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

:root {
  --primary: #1e3a5f;
  --primary-light: #2b5ea7;
  --primary-lighter: #e8f0fe;
  --bg: #f8fafc;
  --surface: #ffffff;
  --text: #1e293b;
  --text-secondary: #64748b;
  --border: #e2e8f0;
  --coach-bg: #f1f5f9;
  --user-bg: #1e3a5f;
  --user-text: #ffffff;
  --accent: #059669;
  --accent-light: #ecfdf5;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ---- Dark mode ---- */
[data-theme="dark"] {
  --primary: #7fb3e0;
  --primary-light: #5a9fd4;
  --primary-lighter: #1a2d42;
  --bg: #0f1419;
  --surface: #1a2332;
  --text: #e2e8f0;
  --text-secondary: #8899aa;
  --border: #2a3a4a;
  --coach-bg: #1e2d3d;
  --user-bg: #2b5ea7;
  --user-text: #ffffff;
  --accent: #34d399;
  --accent-light: #0d2818;
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
}

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

/* ---- App container (fixed pour éviter le scroll mobile) ---- */
.app {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

/* ---- Header ---- */
.app-header {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
  z-index: 10;
}

.hamburger {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px;
  background: none;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
}

.hamburger span {
  width: 20px;
  height: 2px;
  background: var(--primary);
  border-radius: 1px;
  transition: all 0.2s;
}

.header-text {
  flex: 1;
  text-align: center;
}

.header-text .brand {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--primary-light);
  font-weight: 600;
}

.header-text h1 {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
  margin: 1px 0;
}

.header-text p {
  font-size: 12px;
  color: var(--text-secondary);
}

.header-spacer {
  width: 36px;
  flex-shrink: 0;
}

/* ---- Side menu ---- */
.menu-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 200;
}

.menu-overlay.visible {
  display: block;
}

.side-menu {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 280px;
  background: var(--surface);
  z-index: 300;
  transform: translateX(-100%);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
  box-shadow: 4px 0 20px rgba(0, 0, 0, 0.1);
}

.side-menu.open {
  transform: translateX(0);
}

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

.menu-header .brand {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 0.5px;
}

.menu-close {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0 4px;
}

.menu-nav {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.menu-item {
  display: block;
  width: 100%;
  padding: 12px 16px;
  border: none;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  font-family: var(--font);
  text-align: left;
  cursor: pointer;
  transition: background 0.15s;
}

.menu-item:hover {
  background: var(--bg);
}

.menu-item.active {
  background: var(--primary-lighter);
  color: var(--primary);
  font-weight: 600;
}

.menu-item.disabled {
  color: var(--text-secondary);
  opacity: 0.5;
  cursor: default;
  font-weight: 400;
}

.menu-item.disabled:hover {
  background: none;
}

.menu-separator {
  height: 1px;
  background: var(--border);
  margin: 8px 0;
}

.menu-reset {
  color: #dc2626 !important;
  font-weight: 500 !important;
}

.menu-reset:hover {
  background: #fef2f2 !important;
}

.menu-logout {
  color: var(--text-secondary) !important;
  font-weight: 400 !important;
  font-size: 13px !important;
  margin-top: 8px;
}

.menu-logout:hover {
  background: #f1f5f9 !important;
  color: var(--text-primary) !important;
}

.menu-toggle-row {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  cursor: default !important;
}

.menu-toggle-row:hover {
  background: none !important;
}

.toggle-switch {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: 24px;
  cursor: pointer;
  transition: background 0.3s;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: transform 0.3s;
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--primary-light);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(20px);
}

.lang-select {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 13px;
  font-family: var(--font);
  cursor: pointer;
  flex-shrink: 0;
}

.lang-select:focus {
  outline: 2px solid var(--primary-light);
  outline-offset: 1px;
}

.menu-soon-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-secondary);
  font-weight: 600;
  padding: 4px 16px 0;
}

/* ---- Progress bar ---- */
.progress-bar {
  height: 3px;
  background: var(--border);
  flex-shrink: 0;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-light), var(--accent));
  width: 20%;
  transition: width 0.5s ease;
  border-radius: 0 2px 2px 0;
}

/* ---- Views ---- */
.view {
  display: none;
  flex: 1;
  flex-direction: column;
  overflow: hidden;
}

.view.active {
  display: flex;
}

/* ---- Phases navigation ---- */
.phases {
  display: flex;
  gap: 6px;
  padding: 12px 16px;
  overflow-x: auto;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.phases::-webkit-scrollbar {
  display: none;
}

.phase-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 2px solid var(--border);
  border-radius: 24px;
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  font-family: var(--font);
}

.phase-btn:hover {
  border-color: var(--primary-light);
  color: var(--primary-light);
}

.phase-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.phase-btn .phase-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  background: var(--border);
  color: var(--text-secondary);
  flex-shrink: 0;
}

.phase-btn.active .phase-num {
  background: rgba(255, 255, 255, 0.25);
  color: white;
}

.phase-btn.visited {
  border-color: var(--primary-light);
  color: var(--primary);
}

.phase-btn.visited .phase-num {
  background: var(--primary-lighter);
  color: var(--primary);
}

/* Synthesis button */
.synth-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 2px solid var(--accent);
  border-radius: 24px;
  background: var(--surface);
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  font-family: var(--font);
}

.synth-btn:hover {
  background: var(--accent);
  color: white;
}

/* ---- Phase info + info button ---- */
.phase-info {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  font-size: 13px;
  color: var(--text-secondary);
  text-align: center;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.info-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: 2px solid var(--primary-light);
  border-radius: 50%;
  background: none;
  color: var(--primary-light);
  font-size: 12px;
  font-weight: 700;
  font-style: italic;
  font-family: Georgia, serif;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s;
}

.info-btn:hover {
  background: var(--primary-light);
  color: white;
}

/* ---- Chat area ---- */
.chat {
  flex: 1;
  overflow-y: auto;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.message {
  display: flex;
  max-width: 85%;
  animation: fadeIn 0.3s ease;
}

.message-user {
  align-self: flex-end;
}

.message-coach {
  align-self: flex-start;
}

.bubble {
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 14px;
  line-height: 1.55;
  word-wrap: break-word;
}

.message-user .bubble {
  background: var(--user-bg);
  color: var(--user-text);
  border-bottom-right-radius: 4px;
}

.message-coach .bubble {
  background: var(--coach-bg);
  color: var(--text);
  border-bottom-left-radius: 4px;
}

/* ---- Retry button ---- */
.retry-bubble {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.retry-btn {
  padding: 6px 14px;
  border: 1.5px solid var(--primary-light);
  border-radius: 16px;
  background: none;
  color: var(--primary-light);
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.retry-btn:hover {
  background: var(--primary-light);
  color: white;
}

/* ---- Suggestion chips ---- */
.suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 4px 0;
  animation: fadeIn 0.3s ease;
}

.suggestion-chip {
  padding: 8px 14px;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 13px;
  font-family: var(--font);
  cursor: pointer;
  transition: all 0.2s;
  line-height: 1.3;
}

.suggestion-chip:hover {
  border-color: var(--primary-light);
  color: var(--primary);
  background: var(--primary-lighter);
}

.suggestion-chip:active {
  transform: scale(0.97);
}

.suggestion-chip.maitrise-chip {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: white;
  border-color: var(--primary);
  font-weight: 500;
}

.suggestion-chip.maitrise-chip:hover {
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
  color: white;
  border-color: var(--primary-light);
}

/* ---- Markdown in chat ---- */
.bubble ul.chat-list {
  list-style: none;
  padding: 4px 0;
  margin: 4px 0;
}

.bubble ul.chat-list li {
  padding: 2px 0 2px 16px;
  position: relative;
  line-height: 1.5;
}

.bubble ul.chat-list li::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 10px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--text-secondary);
}

.message-user .bubble ul.chat-list li::before {
  background: rgba(255, 255, 255, 0.6);
}

.bubble strong {
  font-weight: 700;
}

.bubble em {
  font-style: italic;
}

/* ---- Message timestamps ---- */
.msg-time {
  font-size: 10px;
  color: var(--text-secondary);
  opacity: 0.5;
  align-self: flex-end;
  padding: 0 4px;
  flex-shrink: 0;
  transition: opacity 0.2s;
}

.message:hover .msg-time {
  opacity: 1;
}

/* ---- System messages ---- */
.message-system {
  align-self: center;
  padding: 6px 16px;
  font-size: 12px;
  color: var(--text-secondary);
  background: var(--bg);
  border-radius: 20px;
  font-weight: 600;
  text-align: center;
  letter-spacing: 0.3px;
}

/* ---- Action button in chat ---- */
.message-action {
  align-self: center;
  padding: 8px 0;
  animation: fadeIn 0.3s ease;
}

.action-btn {
  padding: 10px 24px;
  border: 2px solid var(--accent);
  border-radius: 24px;
  background: var(--accent-light);
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: all 0.2s;
}

.action-btn:hover {
  background: var(--accent);
  color: white;
}

/* ---- Typing indicator ---- */
.typing .bubble {
  display: flex;
  gap: 5px;
  padding: 14px 20px;
}

.typing-dot {
  width: 8px;
  height: 8px;
  background: var(--text-secondary);
  border-radius: 50%;
  animation: typingBounce 1.4s ease-in-out infinite;
}

.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.3; }
  30% { transform: translateY(-8px); opacity: 1; }
}

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

/* ---- Input area ---- */
.input-bar {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
}

.input-bar textarea {
  flex: 1;
  padding: 10px 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: var(--font);
  line-height: 1.4;
  resize: none;
  outline: none;
  max-height: 120px;
  transition: border-color 0.2s;
}

.input-bar textarea:focus {
  border-color: var(--primary-light);
}

.input-bar textarea::placeholder {
  color: var(--text-secondary);
}

#mic-btn, #send-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s, transform 0.1s;
}

#send-btn {
  background: var(--primary);
  color: white;
}

#send-btn:hover {
  background: var(--primary-light);
}

#send-btn:active {
  transform: scale(0.95);
}

#send-btn:disabled {
  background: var(--border);
  cursor: not-allowed;
}

#mic-btn {
  background: var(--coach-bg);
  color: var(--text-secondary);
}

#mic-btn:hover {
  background: var(--border);
  color: var(--primary);
}

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

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

/* ---- Toolbox ---- */
.toolbox {
  flex: 1;
  overflow-y: auto;
  padding: 20px 16px;
}

.toolbox-intro {
  text-align: center;
  padding: 0 8px 20px;
}

.toolbox-intro h2 {
  font-size: 18px;
  color: var(--primary);
  margin-bottom: 8px;
}

.toolbox-intro p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ---- Category navigation cards ---- */
.toolbox-categories {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.toolbox-category-card {
  padding: 20px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
  transition: all 0.25s ease;
}

.toolbox-category-card:hover {
  border-color: var(--primary-light);
  background: var(--primary-lighter);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.toolbox-category-card:active {
  transform: translateY(0);
}

.toolbox-category-card h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 4px;
}

.toolbox-category-card p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.category-count {
  display: inline-block;
  margin-top: 10px;
  font-size: 11px;
  font-weight: 600;
  color: var(--primary-light);
  background: var(--primary-lighter);
  padding: 3px 10px;
  border-radius: 12px;
}

.toolbox-back {
  display: inline-flex;
  align-items: center;
  padding: 8px 0;
  margin-bottom: 8px;
  border: none;
  background: none;
  color: var(--primary-light);
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: color 0.2s;
}

.toolbox-back:hover {
  color: var(--primary);
}

.toolbox-cat-header {
  margin-bottom: 16px;
}

.toolbox-cat-header h3 {
  font-size: 17px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 2px;
}

.toolbox-cat-header p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.toolbox-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ---- Toolbox form list (level 2) ---- */
.toolbox-form-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toolbox-form-card {
  display: flex;
  align-items: center;
  padding: 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  cursor: pointer;
  transition: all 0.2s;
}

.toolbox-form-card:hover {
  border-color: var(--primary-light);
  background: var(--primary-lighter);
}

.toolbox-form-card:active {
  transform: scale(0.99);
}

.form-card-text {
  flex: 1;
  min-width: 0;
}

.toolbox-form-card h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}

.toolbox-form-card p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.form-arrow {
  font-size: 24px;
  color: var(--text-secondary);
  margin-left: 12px;
  flex-shrink: 0;
  font-weight: 300;
}

/* ---- Toolbox detail view (level 3) ---- */
.detail-header h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 12px;
}

.detail-description {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.detail-section {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  overflow: hidden;
}

.detail-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  cursor: pointer;
  background: var(--surface);
  transition: background 0.15s;
}

.detail-section-header:hover {
  background: var(--bg);
}

.detail-section-header h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.detail-toggle {
  font-size: 18px;
  color: var(--text-secondary);
  font-weight: 300;
  transition: transform 0.2s;
}

.detail-section.open .detail-toggle {
  transform: rotate(45deg);
}

.detail-section-body {
  display: none;
  padding: 0 16px 16px;
}

.detail-section.open .detail-section-body {
  display: block;
}

.detail-list {
  list-style: none;
  padding: 0;
}

.detail-list li {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text);
  padding: 3px 0 3px 18px;
  position: relative;
}

.detail-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.detail-advantages li::before {
  background: var(--accent);
}

.detail-limits li::before {
  background: #f59e0b;
}

.detail-nuances,
.detail-legal {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
}

.detail-howto {
  padding-left: 20px;
}

.detail-howto li {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text);
  padding: 3px 0;
}

.detail-example {
  padding: 12px;
  background: var(--primary-lighter);
  border-radius: 8px;
  border-left: 3px solid var(--primary-light);
  margin-bottom: 8px;
}

.detail-example:last-child {
  margin-bottom: 0;
}

.detail-example-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 4px;
}

.detail-example p {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text);
}

/* ---- Obstacle cards (inside detail section) ---- */
.obstacle-card {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  overflow: hidden;
  transition: border-color 0.2s;
}

.obstacle-card.open {
  border-color: var(--primary-light);
}

.obstacle-card:last-child {
  margin-bottom: 0;
}

.obstacle-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  cursor: pointer;
  background: var(--surface);
  transition: background 0.15s;
  gap: 10px;
}

.obstacle-header:hover {
  background: var(--bg);
}

.obstacle-doubt {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  font-style: italic;
  line-height: 1.4;
}

.obstacle-doubt::before {
  content: '"';
  color: var(--primary-light);
  font-size: 18px;
  font-weight: 700;
  margin-right: 2px;
}

.obstacle-doubt::after {
  content: '"';
  color: var(--primary-light);
  font-size: 18px;
  font-weight: 700;
  margin-left: 2px;
}

.obstacle-toggle {
  font-size: 18px;
  color: var(--text-secondary);
  font-weight: 300;
  flex-shrink: 0;
  transition: transform 0.2s;
}

.obstacle-card.open .obstacle-toggle {
  transform: rotate(45deg);
}

.obstacle-body {
  display: none;
  padding: 0 14px 14px;
}

.obstacle-card.open .obstacle-body {
  display: block;
}

.obstacle-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.obstacle-response {
  font-size: 13px;
  line-height: 1.65;
  color: var(--text);
}

.detail-related {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.detail-related-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.detail-related-btn {
  padding: 6px 12px;
  border: 1.5px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  color: var(--primary-light);
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: all 0.2s;
}

.detail-related-btn:hover {
  border-color: var(--primary-light);
  background: var(--primary-lighter);
}

.toolbox-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: border-color 0.2s;
}

.toolbox-card.open {
  border-color: var(--primary-light);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  cursor: pointer;
  background: var(--surface);
  transition: background 0.15s;
}

.card-header:hover {
  background: var(--bg);
}

.card-header h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.card-toggle {
  font-size: 18px;
  color: var(--text-secondary);
  font-weight: 300;
  transition: transform 0.2s;
}

.toolbox-card.open .card-toggle {
  transform: rotate(45deg);
}

.card-body {
  display: none;
  padding: 0 16px 16px;
}

.toolbox-card.open .card-body {
  display: block;
}

.card-description {
  font-size: 14px;
  color: var(--text);
  line-height: 1.5;
  margin-bottom: 12px;
}

.card-section {
  margin-bottom: 10px;
}

.card-section:last-child {
  margin-bottom: 0;
}

.card-section-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-secondary);
  font-weight: 600;
  margin-bottom: 4px;
}

.card-section ul {
  list-style: none;
  padding: 0;
}

.card-section li {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text);
  padding: 2px 0 2px 16px;
  position: relative;
}

.card-section li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 9px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.card-advantages li::before {
  background: var(--accent);
}

.card-limits li::before {
  background: #f59e0b;
}

.card-example {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text);
  padding: 10px 12px;
  background: var(--primary-lighter);
  border-radius: 8px;
  border-left: 3px solid var(--primary-light);
}

/* ---- Info modal ---- */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.visible {
  display: flex;
}

.modal {
  background: var(--surface);
  border-radius: var(--radius);
  max-width: 420px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  animation: fadeIn 0.2s ease;
}

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

.modal-header h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary);
}

.modal-close {
  background: none;
  border: none;
  font-size: 22px;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0 4px;
}

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

.modal-field {
  margin-bottom: 14px;
}

.modal-field:last-child {
  margin-bottom: 0;
}

.modal-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-secondary);
  font-weight: 600;
  margin-bottom: 4px;
}

.modal-value {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
}

/* ---- Access Gate Modal ---- */
.access-modal {
  display: none;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(8px);
}

.access-modal.active {
  display: flex;
}

.modal.access-gate {
  max-width: 380px;
  padding: 0;
  overflow: hidden;
  text-align: center;
}

.access-header {
  padding: 28px 24px 20px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: white;
}

.access-logo {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 8px;
}

.access-badge {
  display: inline-block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  padding: 4px 12px;
  background: rgba(255,255,255,0.2);
  border-radius: 20px;
}

.access-body {
  padding: 24px;
}

.access-text {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

#access-email,
#login-email,
#login-password,
#register-email,
#forgot-email {
  width: 100%;
  padding: 16px 18px;
  font-size: 15px;
  border: 2px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  margin-bottom: 14px;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0,0,0,0.04);
}

#access-email:focus,
#login-email:focus,
#login-password:focus,
#register-email:focus,
#forgot-email:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(30, 58, 95, 0.1);
}

#access-email::placeholder,
#login-email::placeholder,
#login-password::placeholder,
#register-email::placeholder,
#forgot-email::placeholder {
  color: var(--text-secondary);
  opacity: 0.7;
}

.access-btn {
  width: 100%;
  padding: 14px;
  font-size: 15px;
  font-weight: 600;
  color: white;
  background: var(--primary);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.2s;
}

.access-btn:hover {
  background: var(--primary-light);
}

.access-status {
  margin-top: 16px;
  font-size: 13px;
  min-height: 20px;
}

.access-status.success {
  color: var(--accent);
}

.access-status.pending {
  color: #f59e0b;
}

.access-status.error {
  color: #ef4444;
}

.access-privacy {
  margin-top: 20px;
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.access-copyright {
  margin-top: 24px;
  font-size: 10px;
  color: var(--text-secondary);
  opacity: 0.6;
}

.access-forgot {
  margin-top: 12px;
  margin-bottom: 0;
  font-size: 13px;
  text-align: right;
}

.access-forgot a {
  color: var(--text-secondary);
  text-decoration: none;
}

.access-forgot a:hover {
  text-decoration: underline;
  color: var(--primary);
}

.access-lang {
  margin-top: 16px;
  text-align: center;
}

.access-lang .lang-select {
  padding: 8px 12px;
  font-size: 13px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

.access-switch {
  margin-top: 16px;
  font-size: 13px;
  color: var(--text-secondary);
}

.access-switch a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}

.access-switch a:hover {
  text-decoration: underline;
}

/* ---- Mode Choice Modal ---- */
.mode-choice-modal {
  display: none;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
}

.mode-choice-modal.active {
  display: flex;
}

.modal.mode-choice {
  max-width: 400px;
  padding: 0;
  overflow: hidden;
}

.mode-choice-header {
  text-align: center;
  padding: 16px 20px 12px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: white;
}

.mode-choice-header h2 {
  font-size: 18px;
  font-weight: 700;
}

.mode-choice-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
}

.mode-option {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  padding: 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
  transition: all 0.2s ease;
}

.mode-option:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.mode-option.express {
  border-color: #fcd34d;
  background: linear-gradient(135deg, #fffbeb 0%, var(--surface) 100%);
}

.mode-option.express:hover {
  border-color: #f59e0b;
}

.mode-option.maitrise {
  border-color: #6ee7b7;
  background: linear-gradient(135deg, #ecfdf5 0%, var(--surface) 100%);
}

.mode-option.maitrise:hover {
  border-color: var(--accent);
}

.mode-label {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}

.mode-desc {
  font-size: 13px;
  line-height: 1.4;
  color: var(--text-secondary);
}

/* Dark mode adjustments */
[data-theme="dark"] .mode-option.express {
  background: linear-gradient(135deg, #2a2314 0%, var(--surface) 100%);
}

[data-theme="dark"] .mode-option.maitrise {
  background: linear-gradient(135deg, #0d2818 0%, var(--surface) 100%);
}

/* Mobile */
@media (max-width: 600px) {
  .modal.mode-choice {
    max-width: calc(100% - 32px);
    margin: 16px;
  }
}

/* ---- Mobile ---- */
@media (max-width: 600px) {
  .header-text h1 {
    font-size: 16px;
  }

  .phases {
    padding: 10px 12px;
  }

  .phase-btn {
    padding: 6px 10px;
    font-size: 12px;
  }

  .synth-btn {
    padding: 6px 10px;
    font-size: 12px;
  }

  .phase-btn .phase-num {
    width: 18px;
    height: 18px;
    font-size: 10px;
  }

  .message {
    max-width: 90%;
  }
}

/* ---- Toolkit Banner ---- */
.toolkit-banner {
  display: none;
  flex-shrink: 0;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  overflow: hidden;
}

.toolkit-banner.visible {
  display: block;
}

.toolkit-collapsed {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  cursor: pointer;
  transition: background 0.15s;
}

.toolkit-collapsed:hover {
  background: var(--bg);
}

.toolkit-banner.expanded .toolkit-collapsed {
  display: none;
}

.toolkit-collapsed-icon {
  font-size: 16px;
}

.toolkit-collapsed-text {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  flex: 1;
}

.toolkit-collapsed-arrow {
  font-size: 14px;
  color: var(--text-secondary);
}

.toolkit-expanded {
  display: none;
  max-height: 300px;
  overflow-y: auto;
  animation: fadeIn 0.3s ease;
}

.toolkit-banner.expanded .toolkit-expanded {
  display: block;
}

.toolkit-exp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  border-bottom: 1px solid var(--border);
  background: var(--primary-lighter);
}

.toolkit-close {
  background: none;
  border: none;
  font-size: 16px;
  color: var(--primary);
  cursor: pointer;
  padding: 2px 6px;
}

.toolkit-tool {
  border-bottom: 1px solid var(--border);
}

.toolkit-tool:last-child {
  border-bottom: none;
}

.toolkit-tool-header {
  display: flex;
  align-items: center;
  padding: 10px 16px;
  cursor: pointer;
  transition: background 0.15s;
  gap: 10px;
}

.toolkit-tool-header:hover {
  background: var(--bg);
}

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

.toolkit-tool-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.toolkit-tool-oneliner {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.3;
}

.toolkit-tool-toggle {
  font-size: 16px;
  color: var(--text-secondary);
  font-weight: 300;
  flex-shrink: 0;
  transition: transform 0.2s;
}

.toolkit-tool.open .toolkit-tool-toggle {
  transform: rotate(45deg);
}

.toolkit-tool-body {
  display: none;
  padding: 0 16px 12px;
}

.toolkit-tool.open .toolkit-tool-body {
  display: block;
}

.toolkit-neuroscience {
  font-size: 12px;
  line-height: 1.55;
  color: var(--text);
  padding: 10px 12px;
  background: var(--accent-light);
  border-left: 3px solid var(--accent);
  border-radius: 0 6px 6px 0;
  margin-bottom: 10px;
  font-style: italic;
}

.toolkit-steps {
  padding-left: 20px;
  margin: 0;
}

.toolkit-steps li {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text);
  padding: 2px 0;
}

/* ---- Nuggets "Le saviez-vous?" ---- */
.message-nugget {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  background: var(--primary-lighter);
  border-left: 3px solid var(--primary-light);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  animation: fadeIn 0.4s ease;
  align-self: stretch;
}

.nugget-icon {
  font-size: 18px;
  flex-shrink: 0;
  line-height: 1;
}

.nugget-text {
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--text);
  font-style: italic;
}

/* ---- Impact / Évolution ---- */
.impact-card {
  align-self: stretch;
  padding: 16px;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  animation: fadeIn 0.3s ease;
}

.impact-card-compact {
  padding: 10px 14px;
  border-color: var(--accent);
  background: var(--accent-light);
}

.impact-card-result {
  border-color: var(--primary-light);
}

.impact-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 4px;
}

.impact-subtitle {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 14px;
}

.impact-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text);
  line-height: 1.4;
}

.impact-summary-icon {
  font-size: 16px;
  flex-shrink: 0;
}

.impact-slider-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
}

.impact-label-group {
  width: 140px;
  flex-shrink: 0;
}

.impact-label-group label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  display: block;
}

.impact-label-desc {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.3;
  display: block;
  margin-top: 2px;
}

.impact-slider-row > label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  width: 90px;
  flex-shrink: 0;
}

.impact-range {
  flex: 1;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--border);
  border-radius: 3px;
  outline: none;
}

.impact-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  border: 2px solid var(--surface);
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

.impact-range::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  border: 2px solid var(--surface);
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

.impact-value {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary);
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}

.impact-untouched {
  opacity: 0.35;
}

.impact-submit {
  display: block;
  width: 100%;
  margin-top: 12px;
  padding: 10px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: white;
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: background 0.2s, opacity 0.2s;
}

.impact-submit:hover:not(:disabled) {
  background: var(--primary-light);
}

.impact-submit-disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.impact-freetext-row {
  margin-top: 10px;
}

.impact-freetext-row label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.impact-freetext {
  width: 100%;
  padding: 8px 12px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: var(--font);
  resize: none;
  outline: none;
  background: var(--surface);
  color: var(--text);
  transition: border-color 0.2s;
}

.impact-freetext:focus {
  border-color: var(--primary-light);
}

.impact-comparison {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.impact-comparison-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.impact-comparison-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  width: 80px;
  flex-shrink: 0;
}

.impact-comparison-bars {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.impact-bar {
  height: 18px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  padding: 0 8px;
  min-width: 40px;
  transition: width 0.6s ease;
}

.impact-bar span {
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
}

.impact-bar-before {
  background: var(--border);
  color: var(--text-secondary);
}

.impact-bar-after {
  background: var(--primary-light);
  color: white;
}

.impact-delta {
  font-size: 14px;
  font-weight: 700;
  width: 32px;
  text-align: center;
  flex-shrink: 0;
}

.impact-delta-positive {
  color: var(--accent);
}

.impact-delta-negative {
  color: #dc2626;
}

.impact-delta-neutral {
  color: var(--text-secondary);
}

.impact-takeaway {
  margin-top: 12px;
  padding: 10px 12px;
  background: var(--primary-lighter);
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text);
}

/* ---- Vue Mon Parcours ---- */
.parcours-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px 16px;
}

.parcours-main-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 20px;
}

.parcours-section {
  margin-bottom: 24px;
}

.parcours-section-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--primary-lighter);
}

.parcours-phase-group {
  margin-bottom: 16px;
}

.parcours-phase-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--primary-light);
  margin-bottom: 6px;
}

.parcours-stat {
  font-size: 13px;
  color: var(--text);
  padding: 4px 0;
}

/* ---- Vue Neuro Délibération ---- */
.neuro-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px 16px;
}

.neuro-intro {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 20px;
}

.parcours-hint {
  font-size: 12px;
  color: var(--text-secondary);
  font-style: italic;
  margin-top: 8px;
}

.parcours-summary-card {
  padding: 12px 14px;
  background: var(--bg);
  border-left: 3px solid var(--primary-light);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin-bottom: 10px;
}

.parcours-summary-phase {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--primary-light);
  margin-bottom: 4px;
}

.parcours-summary-text {
  font-size: 13px;
  line-height: 1.55;
  color: var(--text);
}

/* ---- Safe area (iPhone notch) ---- */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .input-bar {
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
  }
}

/* ---- Walkthrough Tutorial (in-page) ---- */
.walkthrough-overlay {
  position: fixed;
  inset: 0;
  z-index: 9998;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.walkthrough-overlay.visible {
  opacity: 1;
  pointer-events: auto;
  background: rgba(0, 0, 0, 0.6);
}

.walkthrough-highlight {
  position: relative;
  z-index: 9999 !important;
  box-shadow: 0 0 0 4px var(--accent), 0 0 20px rgba(5, 150, 105, 0.4);
  border-radius: 8px;
  animation: pulse-highlight 2s infinite;
}

@keyframes pulse-highlight {
  0%, 100% { box-shadow: 0 0 0 4px var(--accent), 0 0 20px rgba(5, 150, 105, 0.4); }
  50% { box-shadow: 0 0 0 6px var(--accent), 0 0 30px rgba(5, 150, 105, 0.6); }
}

.walkthrough-tooltip {
  position: fixed;
  z-index: 10000;
  background: var(--surface);
  border-radius: 12px;
  padding: 20px;
  max-width: 320px;
  width: calc(100vw - 40px);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.walkthrough-tooltip.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.walkthrough-arrow {
  position: absolute;
  width: 16px;
  height: 16px;
  background: var(--surface);
  transform: rotate(45deg);
}

.walkthrough-arrow.arrow-top {
  top: -8px;
  left: 50%;
  margin-left: -8px;
}

.walkthrough-arrow.arrow-bottom {
  bottom: -8px;
  left: 50%;
  margin-left: -8px;
}

.walkthrough-arrow.arrow-left {
  left: -8px;
  top: 50%;
  margin-top: -8px;
}

.walkthrough-arrow.arrow-right {
  right: -8px;
  top: 50%;
  margin-top: -8px;
}

.walkthrough-content {
  text-align: center;
}

.walkthrough-icon {
  font-size: 40px;
  margin-bottom: 12px;
}

.walkthrough-icon:has(.congruence-visual) {
  font-size: inherit;
  margin-bottom: 8px;
}

.walkthrough-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
}

.walkthrough-text {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.55;
  margin: 0;
}

.walkthrough-nav {
  display: flex;
  justify-content: center;
  margin-top: 16px;
}

.walkthrough-dots {
  display: flex;
  gap: 8px;
}

.walkthrough-dots .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
  cursor: pointer;
  transition: all 0.3s;
}

.walkthrough-dots .dot:hover {
  background: var(--text-secondary);
}

.walkthrough-dots .dot.active {
  background: var(--primary);
  width: 24px;
  border-radius: 4px;
}

.walkthrough-buttons {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.walkthrough-buttons-right {
  display: flex;
  gap: 8px;
}

.walkthrough-prev {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}

.walkthrough-prev:hover {
  border-color: var(--text-secondary);
  color: var(--text);
}

.walkthrough-prev:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.walkthrough-skip {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  padding: 8px 12px;
  transition: color 0.2s;
}

.walkthrough-skip:hover {
  color: var(--text);
}

.walkthrough-next {
  background: var(--primary);
  color: white;
  border: none;
  padding: 10px 24px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}

.walkthrough-next:hover {
  background: var(--primary-light);
  transform: translateY(-1px);
}

.walkthrough-next.finish {
  background: var(--accent);
}

.walkthrough-next.finish:hover {
  background: #047857;
}

/* Dark mode adjustments */
[data-theme="dark"] .walkthrough-tooltip {
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .walkthrough-highlight {
  box-shadow: 0 0 0 4px var(--accent), 0 0 20px rgba(52, 211, 153, 0.4);
}

/* Congruence Circle Visual */
.congruence-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 1rem 0;
  position: relative;
}

/* ===== MOI - Cercle principal ===== */
.congruence-circle-container {
  position: relative;
  width: 130px;
  height: 130px;
  flex-shrink: 0;
}

/* Conteneur statique */
.congruence-circle-inner {
  position: absolute;
  inset: 15px;
}

/* Cercle en 3 arcs (SVG) */
.congruence-arcs {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.congruence-arcs .arc-bg {
  fill: none;
  stroke: var(--primary-lighter);
  stroke-width: 6;
  opacity: 0.3;
}

.congruence-arcs .arc-main {
  fill: none;
  stroke: url(#congruence-gradient);
  stroke-width: 4;
  stroke-linecap: round;
  /* 3 arcs avec 3 gaps - gaps centrés à 0°, 120°, 240° */
  stroke-dasharray: 70 24;
  stroke-dashoffset: 82;
  filter: drop-shadow(0 0 6px rgba(43, 94, 167, 0.5));
}

.congruence-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 7px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 0.8px;
  text-align: center;
  line-height: 1.3;
  text-transform: uppercase;
  z-index: 10;
}

/* Éléments (émote + label) positionnés SUR le cercle */
.congruence-elements {
  position: absolute;
  inset: 0;
}

.congruence-elements .c-elem {
  position: absolute;
  top: 50%;
  left: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.congruence-elements .c-elem .emoji {
  font-size: 16px;
  line-height: 1;
}

.congruence-elements .c-elem .txt {
  font-size: 7px;
  font-weight: 600;
  color: var(--primary);
  white-space: nowrap;
}

.congruence-elements .c-elem .sub {
  font-size: 5px;
  color: var(--text-muted);
  white-space: nowrap;
}

/* Positions fixes sur le cercle : 0°, 120°, 240° */
.congruence-elements .c-expr {
  transform: translate(-50%, -50%) translateY(-40px);
}

.congruence-elements .c-cons {
  transform: translate(-50%, -50%) rotate(120deg) translateY(-45px) rotate(-120deg) translateY(10px);
}

.congruence-elements .c-expe {
  transform: translate(-50%, -50%) rotate(240deg) translateY(-45px) rotate(-240deg) translateY(10px);
}

/* Flèches de connexion entre éléments */
.connection-arrows {
  position: absolute;
  inset: 10px;
  pointer-events: none;
}

.connection-arrows svg {
  width: 100%;
  height: 100%;
}

.connection-arrows path {
  fill: none;
  stroke: var(--primary-light);
  stroke-width: 1.5;
  stroke-dasharray: 4 2;
  opacity: 0.6;
}

/* ===== FLÈCHE LUMINEUSE ===== */
.flux-container {
  width: 60px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  flex-shrink: 0;
  margin-left: -15px; /* Chevauche le cercle pour partir du centre */
  z-index: 5;
}

.flux-beam {
  position: absolute;
  height: 4px;
  width: calc(100% - 12px);
  left: 0;
  background: linear-gradient(90deg,
    var(--accent) 0%,
    var(--accent) 100%);
  border-radius: 4px 0 0 4px;
  box-shadow:
    0 0 10px var(--accent),
    0 0 20px var(--accent),
    0 0 30px rgba(5, 150, 105, 0.5);
  animation: fluxPulse 2s ease-in-out infinite;
}

/* Tête de flèche */
.flux-arrow-head {
  position: absolute;
  right: 0;
  width: 0;
  height: 0;
  border-top: 10px solid transparent;
  border-bottom: 10px solid transparent;
  border-left: 14px solid var(--accent);
  filter: drop-shadow(0 0 8px var(--accent)) drop-shadow(0 0 15px var(--accent));
  animation: arrowPulse 2s ease-in-out infinite;
}

@keyframes arrowPulse {
  0%, 100% { opacity: 0.85; transform: scale(0.95); }
  50% { opacity: 1; transform: scale(1.05); }
}

.flux-beam::before,
.flux-beam::after {
  content: '';
  position: absolute;
  height: 2px;
  width: 60%;
  background: linear-gradient(90deg,
    var(--accent),
    transparent);
  border-radius: 2px;
  left: 0;
}

.flux-beam::before {
  top: -6px;
  animation: fluxWave 2s ease-in-out infinite 0.3s;
}

.flux-beam::after {
  bottom: -6px;
  animation: fluxWave 2s ease-in-out infinite 0.6s;
}

.flux-particles {
  position: absolute;
  width: 100%;
  height: 100%;
}

.flux-particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 6px var(--accent);
  animation: particleFlow 1.5s ease-in-out infinite;
}

.flux-particle:nth-child(1) { top: 50%; left: 0; animation-delay: 0s; }
.flux-particle:nth-child(2) { top: 25%; left: 5%; animation-delay: 0.3s; }
.flux-particle:nth-child(3) { top: 75%; left: 5%; animation-delay: 0.6s; }
.flux-particle:nth-child(4) { top: 50%; left: 15%; animation-delay: 0.9s; }

@keyframes fluxPulse {
  0%, 100% { opacity: 0.8; transform: scaleX(0.95); }
  50% { opacity: 1; transform: scaleX(1.05); }
}

@keyframes fluxWave {
  0%, 100% { opacity: 0.3; transform: scaleX(0.8); }
  50% { opacity: 0.7; transform: scaleX(1); }
}

@keyframes particleFlow {
  0% { transform: translateX(0) scale(1); opacity: 1; }
  100% { transform: translateX(50px) scale(0.5); opacity: 0; }
}

/* ===== SOCIÉTÉ - Grand cercle ===== */
.societe-container {
  position: relative;
  width: 100px;
  height: 100px;
  flex-shrink: 0;
}

.societe-boundary {
  position: absolute;
  inset: 0;
  border: 3px solid var(--accent);
  border-radius: 50%;
  box-shadow:
    0 0 15px rgba(5, 150, 105, 0.3),
    inset 0 0 20px rgba(5, 150, 105, 0.1);
}

.societe-label {
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent) 0%, #34d399 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  white-space: nowrap;
}

/* Mini cercles de congruence flottants */
.mini-congruence-container {
  position: absolute;
  inset: 8px;
  overflow: hidden;
  border-radius: 50%;
}

.mini-congruence {
  position: absolute;
  width: 22px;
  height: 22px;
  animation: floatAround 8s ease-in-out infinite;
}

.mini-congruence-inner {
  width: 100%;
  height: 100%;
  position: relative;
  animation: spinMini 6s linear infinite;
}

.mini-congruence-ring {
  position: absolute;
  inset: 3px;
  border: 1.5px solid var(--primary-light);
  border-radius: 50%;
  opacity: 0.7;
}

.mini-congruence-icons {
  position: absolute;
  inset: 0;
  font-size: 6px;
  line-height: 1;
}

.mini-congruence-icons span {
  position: absolute;
}

.mini-congruence-icons .mini-expr {
  top: -2px;
  left: 50%;
  animation: spinMiniReverseCenter 6s linear infinite;
}

.mini-congruence-icons .mini-cons {
  bottom: 1px;
  right: -1px;
  animation: spinMiniReverse 6s linear infinite;
}

.mini-congruence-icons .mini-expe {
  bottom: 1px;
  left: -1px;
  animation: spinMiniReverse 6s linear infinite;
}

@keyframes spinMiniReverse {
  from { transform: rotate(0deg); }
  to { transform: rotate(-360deg); }
}

@keyframes spinMiniReverseCenter {
  from { transform: translateX(-50%) rotate(0deg); }
  to { transform: translateX(-50%) rotate(-360deg); }
}

/* Positions et animations des mini-cercles */
.mini-congruence:nth-child(1) { top: 10%; left: 20%; animation-delay: 0s; }
.mini-congruence:nth-child(2) { top: 15%; right: 15%; animation-delay: -2s; }
.mini-congruence:nth-child(3) { top: 45%; left: 10%; animation-delay: -4s; }
.mini-congruence:nth-child(4) { top: 40%; right: 10%; animation-delay: -1s; }
.mini-congruence:nth-child(5) { bottom: 20%; left: 25%; animation-delay: -3s; }
.mini-congruence:nth-child(6) { bottom: 15%; right: 20%; animation-delay: -5s; }
.mini-congruence:nth-child(7) { top: 30%; left: 35%; animation-delay: -6s; }

@keyframes floatAround {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(5px, -5px); }
  50% { transform: translate(-3px, 5px); }
  75% { transform: translate(4px, 3px); }
}

@keyframes spinMini {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Collision : cercles dorés quand ils se touchent */
.mini-congruence.colliding .mini-congruence-ring {
  border-color: #fbbf24;
  box-shadow: 0 0 8px #fbbf24, 0 0 12px rgba(251, 191, 36, 0.5);
  opacity: 1;
}

.mini-congruence.colliding .mini-congruence-icons span {
  filter: drop-shadow(0 0 4px #fbbf24);
}
