/* --- CHARTE GRAPHIQUE ET STYLES - SANCTUAIRE ONIRIQUE --- */
:root {
  --bg-dark: #0f0f1a;
  --card-bg: #181828;
  --card-border: #2d2d44;
  --accent-blue: #3b82f6;
  --accent-cyan: #38bdf8;
  --accent-green: #4ade80;
  --accent-rose: #f43f5e;
  --accent-amber: #fbbf24;
  --accent-purple: #8b5cf6;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }

:where(button, a, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 3px solid #7dd3fc;
  outline-offset: 3px;
}

:where(button, summary, input, select, textarea) { touch-action: manipulation; }
button:disabled, input:disabled, select:disabled, textarea:disabled { cursor: not-allowed; }

body {
  background-color: #080811;
  color: var(--text-main);
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 20px;
  overflow-x: hidden;
}

/* Simulation du châssis du Smartphone */
.phone-frame {
  width: 100%;
  max-width: 440px;
  height: 900px;
  background-color: var(--bg-dark);
  border-radius: 40px;
  border: 12px solid #1f1f33;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

/* En-tête mobile */
.header {
  padding: 20px 20px 12px 20px;
  text-align: center;
  background: linear-gradient(180deg, #181828 0%, var(--bg-dark) 100%);
  border-bottom: 1px solid var(--card-border);
}
.header h1 { font-size: 1.25rem; color: var(--text-main); font-weight: 700; letter-spacing: 0.5px; }
.header p { font-size: 0.75rem; color: var(--accent-cyan); margin-top: 4px; font-style: italic; }
.local-only-status {
  display: inline-block;
  margin-top: 7px;
  padding: 3px 8px;
  border: 1px solid rgba(56, 189, 248, .45);
  border-radius: 999px;
  color: #bae6fd;
  font-size: .62rem;
  line-height: 1.2;
}
.profile-switcher {
  margin-top: 10px;
  max-width: 100%;
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.34);
  color: var(--accent-cyan);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.72rem;
  cursor: pointer;
}

.profile-modal-overlay {
  position: fixed;
  z-index: 10000;
  inset: 0;
  background: rgba(4, 4, 12, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.profile-modal-card {
  width: min(100%, 420px);
  max-height: min(92vh, 680px);
  overflow-y: auto;
  background: linear-gradient(145deg, #1c1c30, #10101e);
  border: 1px solid rgba(56, 189, 248, 0.36);
  border-radius: 22px;
  padding: 24px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.58);
}
.profile-icon { color: var(--accent-cyan); font-size: 2.2rem; text-align: center; margin-bottom: 8px; }
.profile-modal-card h2 { font-size: 1.15rem; text-align: center; }
.profile-intro, .profile-privacy-note { color: var(--text-muted); font-size: 0.8rem; line-height: 1.5; text-align: center; margin: 10px 0 16px; }
.profile-privacy-note { font-size: 0.68rem; margin: 16px 0 0; }
.profile-list { display: grid; gap: 8px; margin-bottom: 16px; }
.profile-choice {
  width: 100%; text-align: left; cursor: pointer; color: var(--text-main); background: #10101d;
  border: 1px solid var(--card-border); border-radius: 10px; padding: 11px 12px;
}
.profile-choice:hover, .profile-choice:focus { border-color: var(--accent-cyan); background: rgba(56, 189, 248, 0.1); }
.profile-choice small { display: block; color: var(--text-muted); margin-top: 3px; font-size: 0.7rem; }
.profile-create-form { border-top: 1px solid var(--card-border); padding-top: 16px; }
.profile-create-form label { display: block; font-size: 0.78rem; color: var(--text-muted); margin-bottom: 7px; }
.profile-create-row { display: flex; gap: 8px; }
.profile-create-row input { min-width: 0; }
.btn-profile-primary { border: none; border-radius: 7px; background: var(--accent-blue); color: white; padding: 0 13px; cursor: pointer; font-weight: 600; }
.profile-error { color: #fda4af; font-size: 0.72rem; margin-top: 8px; }
.advanced-panel {
  margin-top: 12px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.34);
}
.advanced-panel > summary {
  padding: 10px 12px;
  color: #cbd5e1;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  list-style-position: inside;
}
.advanced-panel[open] > summary { border-bottom: 1px solid rgba(148, 163, 184, 0.2); }
.advanced-panel > p { padding: 10px 12px 0; color: var(--text-muted); font-size: 0.7rem; line-height: 1.4; }
.profile-advanced-tools { margin-top: 14px; }
.profile-test-profile-list { margin: 4px 0 12px; }
.profile-test-profile-container { display: grid; gap: 8px; padding: 10px; }
.method-fixture-tools {
  margin: 12px 0; padding: 10px; border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 10px; background: rgba(14, 116, 144, 0.08);
}
.method-fixture-tools > strong { color: #38bdf8; font-size: 0.8rem; }
.method-fixture-tools > p { margin: 5px 0 9px; color: var(--text-muted); font-size: 0.68rem; line-height: 1.35; }
.method-fixture-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.method-fixture-actions button {
  border: 1px solid rgba(56, 189, 248, 0.4); border-radius: 7px; padding: 7px;
  background: rgba(14, 116, 144, 0.18); color: #bae6fd; font-size: 0.67rem; font-weight: 700; cursor: pointer;
}
.method-fixture-actions button:disabled { opacity: 0.55; cursor: wait; }
.method-fixture-status { margin-top: 7px; color: #7dd3fc; font-size: 0.67rem; line-height: 1.35; }
.method-coverage-panel { margin-top: 8px; max-height: 220px; overflow-y: auto; display: grid; gap: 6px; }
.method-coverage-row { padding: 7px; border: 1px solid rgba(148, 163, 184, 0.25); border-radius: 7px; background: rgba(15, 23, 42, 0.55); }
.method-coverage-row strong { display: block; color: #e2e8f0; font-size: 0.7rem; }
.method-coverage-row small { display: block; margin-top: 3px; color: var(--text-muted); font-size: 0.63rem; line-height: 1.35; }
.method-coverage-row.ready { border-color: rgba(52, 211, 153, 0.4); }
.method-coverage-row.blocked { border-color: rgba(251, 191, 36, 0.4); }

/* Zone de contenu défilante */
.content-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  scroll-padding-bottom: max(20px, env(safe-area-inset-bottom));
  padding: 16px;
}

.public-welcome-screen {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 14px;
  padding: 28px 14px 36px;
  text-align: center;
}
.public-welcome-screen[hidden] { display: none !important; }
.public-welcome-mark {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  color: #ddd6fe;
  background: linear-gradient(145deg, rgba(59, 130, 246, .24), rgba(139, 92, 246, .2));
  border: 1px solid rgba(167, 139, 250, .5);
  font-size: 2rem;
}
.public-welcome-screen h2 { font-size: clamp(1.75rem, 8vw, 2.3rem); letter-spacing: .02em; }
.public-promise {
  max-width: 350px;
  color: #dbeafe;
  font-size: 1rem;
  line-height: 1.55;
}
.public-welcome-actions { width: min(100%, 340px); display: grid; gap: 10px; margin-top: 8px; }
.public-primary-action,
.public-secondary-action,
.public-back-action {
  width: 100%;
  min-height: 48px;
  border-radius: 10px;
  padding: 12px 16px;
  color: white;
  font-size: .9rem;
  font-weight: 750;
  cursor: pointer;
}
.public-primary-action { border: 0; background: linear-gradient(135deg, #2563eb, #7c3aed); }
.public-secondary-action,
.public-back-action { border: 1px solid rgba(148, 163, 184, .4); background: rgba(15, 23, 42, .72); }
.public-privacy-line { max-width: 350px; color: var(--text-muted); font-size: .74rem; line-height: 1.5; margin-top: 10px; }
body[data-public-entry="welcome"] .journal-nav-bar,
body[data-public-entry="welcome"] #formViewSection,
body[data-public-entry="welcome"] #journalViewSection,
body[data-public-entry="welcome"] #dayJournalViewSection,
body[data-public-entry="welcome"] #worldViewSection { display: none !important; }

/* Carte de Saisie / Dépôt de Rêve */
.card {
  background-color: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
}
.card-title { font-size: 0.95rem; font-weight: 600; color: var(--text-main); margin-bottom: 12px; display: flex; align-items: center; justify-content: space-between; }
.card-title h2 { font: inherit; color: inherit; }

textarea {
  width: 100%;
  height: 100px;
  background-color: #0f0f1a;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  padding: 10px;
  color: var(--text-main);
  font-size: 0.85rem;
  resize: none;
  outline: none;
}
textarea:focus { border-color: var(--accent-blue); }
.public-dream-input { min-height: 260px; height: 42dvh; max-height: 460px; resize: vertical; font-size: 1rem; line-height: 1.55; }
.public-review-action { min-height: 48px; margin-top: 14px !important; background: linear-gradient(135deg, #2563eb, #7c3aed) !important; }
.public-back-action { margin-top: 8px; }
.public-review-card { max-height: calc(100% - 24px); overflow-y: auto; overscroll-behavior: contain; }
.public-review-explanation { margin-bottom: 12px; color: var(--text-muted); font-size: .8rem; line-height: 1.5; }
.public-review-label { display: block; margin-bottom: 6px; color: #a7f3d0; font-size: .75rem; font-weight: 700; }
.public-review-text { min-height: 230px; height: 38dvh; max-height: 400px; resize: vertical; font-size: .94rem; line-height: 1.55; }
.public-review-text[readonly] { opacity: .85; cursor: default; }
.public-review-edit-status { margin-top: 7px; color: var(--text-muted); font-size: .7rem; line-height: 1.4; }
body.public-normal-flow #sourceFragmentsSection { display: none !important; }

.input-row { display: flex; gap: 8px; margin-top: 10px; }
select, input {
  flex: 1;
  background-color: #0f0f1a;
  border: 1px solid var(--card-border);
  border-radius: 6px;
  padding: 8px;
  color: var(--text-main);
  font-size: 0.75rem;
  color-scheme: dark;
}

.btn-main {
  width: 100%;
  background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-purple) 100%);
  color: white;
  border: none;
  padding: 12px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  margin-top: 12px;
  transition: opacity 0.2s;
}
.btn-main:hover { opacity: 0.9; }
.btn-main:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  filter: grayscale(40%);
}

.record-actions { display: flex; flex-direction: column; gap: 8px; margin: 14px 0 12px; }
.record-primary-action { margin-top: 0; background: linear-gradient(135deg, #f97316 0%, #ea580c 100%); }
.record-stop-action { width: 100%; }
.record-stop-action:disabled { opacity: 0.45; cursor: not-allowed; }
.capture-status-message {
  min-height: 22px;
  margin: 8px 0;
  color: var(--text-muted);
  font-size: 0.8rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.capture-action-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
  margin-top: 14px;
}
.capture-action-row > button { min-height: 44px; margin-top: 0; }
.dictation-language-label {
  display: block;
  margin: 10px 0 5px;
  color: var(--text-muted);
  font-size: 0.75rem;
}
.dictation-language-select { width: 100%; min-height: 44px; margin-bottom: 10px; }
.dictation-retry-button { width: 100%; min-height: 44px; margin-top: 9px; color: #bae6fd; background: rgba(14, 116, 144, 0.2); }

@media (max-width: 520px) {
  #panelAudioImport,
  #panelVoiceRecording,
  #panelVoiceDictation { min-width: 0; max-width: 100%; overflow-x: hidden; }
  .capture-action-row,
  .dictation-action-row { display: grid; grid-template-columns: 1fr; gap: 8px; }
  .capture-action-row > button,
  .record-actions button,
  #recordPausedActions button { width: 100%; min-height: 48px; }
  #dictationTextarea { min-height: 170px !important; }
  .audio-filebox { min-width: 0; flex-wrap: wrap; }
  .audio-filebox > div:nth-child(2) { min-width: 0; }
  .audio-filebox audio { max-width: 100%; }
}

/* Mode Selection */
.mode-selector {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
}
.mode-btn {
  flex: 1;
  padding: 6px;
  font-size: 0.7rem;
  background-color: #0f0f1a;
  border: 1px solid var(--card-border);
  color: var(--text-muted);
  border-radius: 6px;
  cursor: pointer;
  text-align: center;
}
.mode-btn.active { background-color: var(--accent-blue); color: white; border-color: var(--accent-blue); }

/* Window Log Terminal (Progression en Temps Réel) */
.terminal-box {
  background-color: #0a0a12;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 16px;
}
.terminal-header { font-size: 0.75rem; font-weight: 700; color: var(--accent-cyan); margin-bottom: 8px; display: flex; justify-content: space-between; }
.terminal-logs {
  max-height: 120px;
  overflow-y: auto;
  font-family: monospace;
  font-size: 0.7rem;
  line-height: 1.4;
}
.log-line { margin-bottom: 4px; display: flex; }
.log-time { color: var(--text-muted); margin-right: 6px; }
.log-step { font-weight: bold; margin-right: 6px; }
.log-info { color: var(--accent-cyan); }
.log-success { color: var(--accent-green); }
.log-warning { color: var(--accent-amber); }

/* Post-Analysis Navigation Triptyque */
.tab-bar {
  display: flex;
  background-color: #0f0f1a;
  padding: 3px;
  border-radius: 8px;
  margin-bottom: 12px;
}
.tab-item {
  flex: 1;
  padding: 8px 4px;
  font-size: 0.68rem;
  font-weight: 600;
  text-align: center;
  color: var(--text-muted);
  border-radius: 6px;
  cursor: pointer;
}
.tab-item.active { background-color: var(--accent-blue); color: white; }

/* Contenu des Vues Post-Analyse */
.result-content { display: none; }
.result-content.active { display: block; }

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.65rem;
  font-weight: 700;
  background-color: rgba(244, 63, 94, 0.2);
  color: var(--accent-rose);
  margin-bottom: 8px;
}
.sub-title { font-size: 0.8rem; font-weight: 600; color: var(--accent-cyan); margin: 10px 0 4px 0; }
.body-text { font-size: 0.8rem; color: #cbd5e1; line-height: 1.4; }
.bullet-list { font-size: 0.78rem; color: var(--accent-cyan); margin-left: 12px; margin-top: 4px; line-height: 1.5; }

/* Prompt Code Box */
.prompt-box {
  background-color: #080811;
  border: 1px dashed var(--accent-purple);
  padding: 8px;
  border-radius: 6px;
  font-family: monospace;
  font-size: 0.7rem;
  color: var(--accent-green);
  margin-top: 6px;
  word-break: break-all;
}

/* Générateur Visuel Canvas */
.canvas-preview {
  width: 100%;
  height: 160px;
  background-color: #0a0a14;
  border-radius: 8px;
  margin-top: 12px;
  display: flex;
  justify-content: center;
  align-items: center;
  border: 1px solid var(--card-border);
  position: relative;
  overflow: hidden;
}
.canvas-preview canvas { width: 100%; height: 100%; }

/* Lexique et Copilote Search */
.search-box {
  width: 100%;
  padding: 8px;
  background-color: #0f0f1a;
  border: 1px solid var(--card-border);
  border-radius: 6px;
  color: white;
  font-size: 0.75rem;
  margin-bottom: 10px;
}
.lexicon-item {
  padding: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.lexicon-term { font-size: 0.8rem; font-weight: bold; color: var(--accent-amber); }
.lexicon-def { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }

/* --- COMPOSANTS DU JOURNAL (VUE LECTURE SEULE) --- */
.journal-nav-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.advanced-mode-menu { flex: 1 1 100%; }
.advanced-mode-menu > summary {
  padding: 7px 9px;
  border: 1px solid var(--card-border);
  border-radius: 7px;
  color: var(--text-muted);
  font-size: 0.7rem;
  text-align: center;
  cursor: pointer;
}
.advanced-mode-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-top: 7px; }
.advanced-mode-actions .mode-btn { width: 100%; }

.journal-item-card {
  background-color: #0f0f1a;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 10px;
}

.journal-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.journal-item-date {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent-cyan);
}

.journal-tag {
  font-size: 0.65rem;
  background-color: rgba(56, 189, 248, 0.15);
  color: var(--accent-cyan);
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
}

.badge-fav {
  font-size: 0.65rem;
  background-color: rgba(251, 191, 36, 0.2);
  color: var(--accent-amber);
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 700;
  margin-right: 4px;
}

.journal-item-meta {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.journal-item-snippet {
  font-size: 0.78rem;
  color: var(--text-main);
  line-height: 1.4;
  margin-bottom: 10px;
  font-style: italic;
  word-break: break-word;
}

.btn-read-dream {
  background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-purple) 100%);
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
}
.btn-read-dream:hover { opacity: 0.9; }
.journal-primary-actions,
.journal-secondary-actions,
.journal-advanced-action-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin-top: 8px;
}
.journal-primary-actions .btn-read-dream { min-height: 40px; }
.journal-secondary-actions .btn-main { margin-top: 0; }
.journal-advanced-actions { margin-top: 10px; }
.journal-advanced-action-grid { padding: 0 10px 10px; }
.journal-advanced-action-grid .journal-item-meta { grid-column: 1 / -1; margin: 0; }
.journal-backup-panel { margin-top: 12px; }

.journal-detail-text {
  font-size: 0.82rem;
  color: var(--text-main);
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 12px 0;
  padding: 10px;
  background-color: #0f0f1a;
  border-radius: 6px;
  border-left: 3px solid var(--accent-blue);
}

.journal-detail-notes {
  margin-top: 10px;
  padding: 8px;
  background-color: rgba(251, 191, 36, 0.08);
  border-left: 3px solid var(--accent-amber);
  border-radius: 4px;
  font-size: 0.75rem;
  color: #fef08a;
}

/* --- ÉDITION & MODALE DE CONFIRMATION SÉCURISÉE --- */
.edit-label {
  display: block;
  font-size: 0.7rem;
  color: var(--text-muted);
  margin: 10px 0 3px 0;
  font-weight: 600;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(8, 8, 17, 0.85);
  backdrop-filter: blur(4px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 100;
  padding: 20px;
  overflow: hidden;
}

.modal-card {
  background-color: var(--card-bg);
  border: 1px solid var(--accent-rose);
  border-radius: 14px;
  padding: 18px;
  width: 100%;
  max-width: 360px;
  max-height: calc(100dvh - 32px);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.7);
}

body.public-modal-open .content-scroll { overflow: hidden; }

.modal-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--accent-rose);
  margin-bottom: 8px;
}

.modal-body-text {
  font-size: 0.78rem;
  color: var(--text-main);
  line-height: 1.45;
  margin-bottom: 16px;
}

.modal-actions {
  display: flex;
  gap: 8px;
}

.btn-modal {
  flex: 1;
  padding: 10px 8px;
  border-radius: 6px;
  border: none;
  font-weight: 600;
  font-size: 0.75rem;
  cursor: pointer;
  transition: opacity 0.2s;
}
.btn-modal:hover { opacity: 0.9; }

.canonical-branch-card {
  width: 100%;
  appearance: none;
  text-align: left;
  font: inherit;
}

.interpretation-branch-card,
.dreamstudio-branch-card,
.symbolic-corpus-branch-card,
.dreamatlas-branch-card {
  border-radius: 12px;
  padding: 12px;
  color: inherit;
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}
.interpretation-branch-card { border: 1px solid rgba(16, 185, 129, 0.42); background: rgba(16, 185, 129, 0.08); }
.dreamstudio-branch-card { border: 1px solid rgba(139, 92, 246, 0.42); background: rgba(139, 92, 246, 0.08); }
.symbolic-corpus-branch-card { border: 1px solid rgba(245, 158, 11, 0.46); background: rgba(120, 53, 15, 0.12); }
.dreamatlas-branch-card { border: 1px solid rgba(56, 189, 248, 0.42); background: rgba(56, 189, 248, 0.08); }

.interpretation-branch-card:hover,
.interpretation-branch-card:focus-visible,
.dreamstudio-branch-card:hover,
.dreamstudio-branch-card:focus-visible,
.symbolic-corpus-branch-card:hover,
.symbolic-corpus-branch-card:focus-visible,
.dreamatlas-branch-card:hover,
.dreamatlas-branch-card:focus-visible {
  border-color: rgba(52, 211, 153, 0.9);
  transform: translateY(-1px);
  outline: none;
}
.interpretation-branch-card:hover,
.interpretation-branch-card:focus-visible { background: rgba(16, 185, 129, 0.14); }
.dreamstudio-branch-card:hover,
.dreamstudio-branch-card:focus-visible { border-color: rgba(192, 132, 252, 0.9); background: rgba(139, 92, 246, 0.14); }
.symbolic-corpus-branch-card:hover,
.symbolic-corpus-branch-card:focus-visible { border-color: rgba(251, 191, 36, 0.92); background: rgba(120, 53, 15, 0.2); }
.dreamatlas-branch-card:hover,
.dreamatlas-branch-card:focus-visible { border-color: rgba(56, 189, 248, 0.9); background: rgba(56, 189, 248, 0.14); }

.interpretation-workspace-card {
  max-width: 500px;
  max-height: calc(100% - 24px);
  overflow-y: auto;
  border-color: rgba(52, 211, 153, 0.75);
}

.dreamer-deepening-card {
  display: flex;
  flex-direction: column;
  width: min(520px, calc(100vw - 24px));
  max-width: 520px;
  max-height: calc(100dvh - 24px);
  overflow: hidden;
  border-color: rgba(96, 165, 250, 0.72);
}

.dreamer-deepening-header {
  display: flex;
  flex: 0 0 auto;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.dreamer-deepening-header .modal-title { color: #bfdbfe; }

.dreamer-deepening-badge {
  flex: 0 0 auto;
  border: 1px solid rgba(96, 165, 250, 0.45);
  border-radius: 999px;
  padding: 4px 8px;
  background: rgba(37, 99, 235, 0.14);
  color: #bfdbfe;
  font-size: 0.62rem;
  font-weight: 800;
}

.dreamer-deepening-intro {
  flex: 0 0 auto;
  margin: 0 0 10px;
  border: 1px solid rgba(96, 165, 250, 0.28);
  border-radius: 9px;
  padding: 10px;
  background: rgba(30, 64, 175, 0.1);
  color: #dbeafe;
  font-size: 0.76rem;
  line-height: 1.5;
}

.dreamer-deepening-scroll {
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 3px;
}

.dreamer-deepening-section {
  margin-bottom: 10px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 10px;
  padding: 12px;
  background: rgba(15, 23, 42, 0.52);
}

.dreamer-deepening-section h2 {
  margin: 0;
  color: #d1fae5;
  font-size: 0.92rem;
  line-height: 1.35;
}

.dreamer-deepening-section p {
  margin: 5px 0 9px;
  color: var(--text-muted);
  font-size: 0.72rem;
  line-height: 1.45;
}

.dreamer-deepening-section label {
  display: block;
  margin: 8px 0 5px;
  color: var(--text-main);
  font-size: 0.74rem;
}

.dreamer-deepening-section textarea,
.dreamer-deepening-section input[type="text"] {
  box-sizing: border-box;
  width: 100%;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  background: rgba(8, 8, 17, 0.8);
  color: var(--text-main);
  padding: 9px;
  font: inherit;
  font-size: 0.78rem;
  line-height: 1.45;
}

.dreamer-deepening-section textarea { min-height: 76px; resize: vertical; }
.dreamer-deepening-section textarea:focus,
.dreamer-deepening-section input[type="text"]:focus { border-color: #60a5fa; outline: none; }

.dreamer-deepening-inline-button,
.dreamer-advanced-button {
  width: 100%;
  margin-top: 9px;
  border: 1px solid rgba(96, 165, 250, 0.45);
  border-radius: 8px;
  padding: 9px;
  background: rgba(37, 99, 235, 0.14);
  color: #bfdbfe;
  font-weight: 700;
  cursor: pointer;
}

.dreamer-deepening-primary-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  flex: 0 0 auto;
  gap: 8px;
}

.dreamer-deepening-primary-actions .btn-modal { margin-bottom: 0; }
.dreamer-advanced-button { flex: 0 0 auto; margin: 10px 0 6px; background: rgba(15, 23, 42, 0.72); }

@media (max-width: 560px) {
  .dreamer-deepening-card { width: calc(100vw - 16px); max-height: calc(100dvh - 16px); padding: 14px; }
  .dreamer-deepening-header { flex-direction: column; }
  .dreamer-deepening-primary-actions { grid-template-columns: 1fr; }
  .dreamer-deepening-section { padding: 11px; }
}

.interpretation-workspace-header,
.interpretation-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.interpretation-workspace-header {
  margin-bottom: 12px;
}

.interpretation-workspace-subtitle,
.interpretation-source-meta,
.interpretation-help {
  color: var(--text-muted);
  font-size: 0.7rem;
  line-height: 1.4;
}

.interpretation-state-badge {
  flex-shrink: 0;
  padding: 3px 7px;
  border-radius: 999px;
  border: 1px solid rgba(52, 211, 153, 0.4);
  background: rgba(16, 185, 129, 0.13);
  color: #6ee7b7;
  font-size: 0.62rem;
  font-weight: 700;
}

.interpretation-source-snapshot,
.interpretation-context-section,
.interpretation-router-lock {
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(15, 23, 42, 0.5);
  border-radius: 10px;
  padding: 11px;
  margin-bottom: 10px;
}

.interpretation-section-heading strong,
.interpretation-context-section label,
.interpretation-router-lock strong {
  color: var(--text-main);
  font-size: 0.76rem;
}

.interpretation-source-meta {
  margin-top: 6px;
}

.interpretation-source-text {
  margin-top: 8px;
  max-height: 100px;
  overflow-y: auto;
  white-space: pre-wrap;
  color: #e2e8f0;
  font-size: 0.76rem;
  line-height: 1.45;
}

.interpretation-section-label {
  margin-bottom: 5px;
  color: #34d399;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.interpretation-context-section label {
  display: block;
  margin-bottom: 6px;
}

.interpretation-context-section textarea {
  box-sizing: border-box;
  width: 100%;
  resize: vertical;
  min-height: 76px;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  background: rgba(8, 8, 17, 0.8);
  color: var(--text-main);
  padding: 9px;
  font: inherit;
  font-size: 0.78rem;
  line-height: 1.45;
}

.interpretation-context-section textarea:focus {
  border-color: #34d399;
  outline: none;
}

.interpretation-context-section input[type="text"] {
  box-sizing: border-box;
  width: 100%;
  margin-bottom: 8px;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  background: rgba(8, 8, 17, 0.8);
  color: var(--text-main);
  padding: 9px;
  font: inherit;
  font-size: 0.78rem;
}

.interpretation-context-section input[type="text"]:focus {
  border-color: #34d399;
  outline: none;
}

.association-save-button {
  width: 100%;
  margin-top: 9px;
  border: 1px solid rgba(52, 211, 153, 0.45);
  border-radius: 8px;
  padding: 9px;
  background: rgba(16, 185, 129, 0.16);
  color: #a7f3d0;
  font-weight: 700;
  cursor: pointer;
}

.gestalt-consent {
  display: flex !important;
  gap: 7px;
  align-items: flex-start;
  margin-bottom: 9px !important;
  color: #cbd5e1 !important;
  font-size: 0.72rem !important;
  line-height: 1.4;
}

.gestalt-consent input {
  margin-top: 2px;
  accent-color: #34d399;
}

.association-entry-list {
  display: grid;
  gap: 7px;
  margin-top: 10px;
}

.association-entry-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: start;
  border: 1px solid rgba(52, 211, 153, 0.28);
  border-radius: 8px;
  padding: 8px;
  background: rgba(16, 185, 129, 0.06);
  color: var(--text-main);
  font-size: 0.74rem;
  white-space: pre-wrap;
}

.association-entry-card.withdrawn {
  border-color: rgba(148, 163, 184, 0.25);
  opacity: 0.66;
}

.association-entry-card small {
  display: block;
  margin-top: 4px;
  color: var(--text-muted);
}

.association-withdraw-button {
  border: 1px solid rgba(251, 113, 133, 0.45);
  border-radius: 6px;
  padding: 4px 6px;
  background: transparent;
  color: #fda4af;
  font-size: 0.68rem;
  cursor: pointer;
}

.interpretation-help {
  margin-top: 5px;
}

.interpretation-save-button {
  width: 100%;
  margin-bottom: 10px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
}

.interpretation-continue-button {
  width: 100%;
  margin-bottom: 10px;
  border: 1px solid rgba(56, 189, 248, 0.45);
  background: rgba(14, 165, 233, 0.14);
  color: #7dd3fc;
}

.interpretation-continue-button:disabled,
.interpretation-save-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.interpretation-save-status {
  min-height: 18px;
  margin: 2px 0 6px;
  color: #6ee7b7;
  font-size: 0.7rem;
}

.interpretation-router-lock {
  display: flex;
  flex-direction: column;
  gap: 3px;
  border-color: rgba(245, 158, 11, 0.3);
}

.interpretation-router-lock strong {
  color: #fbbf24;
}

.interpretation-router-lock span {
  color: var(--text-muted);
  font-size: 0.7rem;
  line-height: 1.4;
}

.interpretation-workspace-actions {
  margin-top: 4px;
}

.memory-echo-scope-notice {
  margin-bottom: 10px;
  border: 1px solid rgba(56, 189, 248, 0.28);
  border-radius: 9px;
  background: rgba(14, 165, 233, 0.08);
  padding: 9px;
  color: #bae6fd;
  font-size: 0.7rem;
  line-height: 1.45;
}

.memory-echo-candidate-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
  max-height: 390px;
  overflow-y: auto;
  margin-bottom: 9px;
}

.memory-echo-candidate {
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.6);
  padding: 10px;
}

.memory-echo-candidate-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #e2e8f0;
  font-size: 0.74rem;
  font-weight: 700;
}

.memory-echo-candidate-excerpt {
  margin: 7px 0;
  color: var(--text-main);
  font-size: 0.75rem;
  line-height: 1.45;
}

.memory-echo-candidate-provenance {
  color: var(--text-muted);
  font-size: 0.65rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.memory-echo-decisions {
  display: flex;
  gap: 7px;
  margin-top: 9px;
}

.echo-decision-button {
  flex: 1;
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 7px;
  background: rgba(30, 41, 59, 0.75);
  color: var(--text-main);
  padding: 7px;
  font-size: 0.7rem;
  cursor: pointer;
}

.echo-decision-button.accepted {
  border-color: rgba(16, 185, 129, 0.85);
  background: rgba(16, 185, 129, 0.18);
  color: #6ee7b7;
}

.echo-decision-button.rejected {
  border-color: rgba(251, 113, 133, 0.75);
  background: rgba(244, 63, 94, 0.14);
  color: #fda4af;
}

.memory-echo-empty {
  border: 1px dashed rgba(148, 163, 184, 0.35);
  border-radius: 10px;
  padding: 18px 10px;
  color: var(--text-muted);
  font-size: 0.74rem;
  line-height: 1.45;
  text-align: center;
}

.memory-echo-review-result {
  min-height: 20px;
  margin-bottom: 8px;
  color: #6ee7b7;
  font-size: 0.7rem;
  line-height: 1.45;
}

.day-note-input-grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr 0.85fr;
  gap: 8px;
  margin-top: 4px;
}

.day-note-input-grid > div,
.day-note-input-grid input,
.day-note-input-grid select {
  min-width: 0;
  width: 100%;
}

.day-note-save-button {
  margin-top: 12px;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.day-note-card {
  margin-bottom: 9px;
  border: 1px solid rgba(245, 158, 11, 0.26);
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.66);
  padding: 11px;
}

.day-note-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #fbbf24;
  font-size: 0.72rem;
  font-weight: 700;
}

.day-note-card-text {
  margin: 8px 0;
  color: var(--text-main);
  font-size: 0.77rem;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.day-note-card-meta {
  color: var(--text-muted);
  font-size: 0.66rem;
  line-height: 1.4;
}

.day-note-card-actions {
  display: flex;
  gap: 7px;
  margin-top: 9px;
}

.day-note-link-button {
  flex: 1;
  border: 1px solid rgba(56, 189, 248, 0.4);
  border-radius: 7px;
  background: rgba(14, 165, 233, 0.13);
  color: #7dd3fc;
  padding: 7px;
  font-size: 0.7rem;
  font-weight: 700;
  cursor: pointer;
}

.day-note-delete-button {
  width: 31px;
  border: 1px solid rgba(244, 63, 94, 0.35);
  border-radius: 7px;
  background: rgba(244, 63, 94, 0.1);
  color: #fda4af;
  cursor: pointer;
}

.capture-intent-panel {
  margin-bottom: 13px;
  border: 1px solid rgba(56, 189, 248, 0.34);
  border-radius: 11px;
  background: rgba(14, 116, 144, 0.08);
  padding: 11px;
}

.capture-intent-title {
  margin-bottom: 8px;
  color: #bae6fd;
  font-size: 0.78rem;
  font-weight: 800;
}

.capture-intent-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.capture-intent-button,
.existing-dream-picker button {
  border: 1px solid rgba(148, 163, 184, 0.32);
  border-radius: 8px;
  padding: 8px;
  color: white;
  font-size: 0.71rem;
  font-weight: 700;
  cursor: pointer;
}

.capture-intent-button.new { background: rgba(16, 185, 129, 0.22); border-color: rgba(16, 185, 129, 0.55); }
.capture-intent-button.existing { background: rgba(59, 130, 246, 0.2); border-color: rgba(59, 130, 246, 0.55); }
.capture-intent-button.active { box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.18); }

.existing-dream-picker {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 7px;
  align-items: end;
  margin-top: 9px;
}

.existing-dream-picker label {
  grid-column: 1 / -1;
  color: var(--text-muted);
  font-size: 0.68rem;
}

.existing-dream-picker select { min-width: 0; width: 100%; }
.existing-dream-picker button { background: #2563eb; }

.capture-intent-status {
  margin-top: 8px;
  color: #7dd3fc;
  font-size: 0.69rem;
  line-height: 1.4;
}

.primary-text-capture {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid rgba(139, 92, 246, 0.62);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.18), rgba(37, 99, 235, 0.12));
}
.primary-text-capture strong,
.primary-text-capture span,
.primary-text-capture small { display: block; }
.primary-text-capture strong { color: #ede9fe; font-size: 1rem; }
.primary-text-capture span { margin-top: 5px; color: #ddd6fe; font-size: 0.78rem; line-height: 1.45; }
.primary-text-capture small { margin-top: 5px; color: #a5b4fc; font-size: 0.7rem; line-height: 1.4; }
.alternative-capture-modes { margin-top: 12px; }
.alternative-capture-modes .capture-cards-grid { padding: 0 10px 10px; }
.optional-reading-paths { margin-bottom: 12px; }
.optional-reading-paths .express-secondary-entry-grid { margin: 10px; }
.confirmed-source-notice {
  margin-top: 7px;
  padding: 9px;
  border: 1px solid rgba(16, 185, 129, 0.38);
  border-radius: 8px;
  color: #a7f3d0;
  background: rgba(6, 95, 70, 0.14);
  font-size: 0.72rem;
  line-height: 1.4;
}
#editRawText[readonly] { opacity: 0.82; cursor: default; }
.edit-advanced-settings { margin-top: 10px; }

.fragment-reclassify-button {
  padding: 1px 5px;
  border: 1px solid rgba(251, 191, 36, 0.52);
  border-radius: 4px;
  background: rgba(245, 158, 11, 0.14);
  color: #fbbf24;
  cursor: pointer;
  font: inherit;
  line-height: 1.3;
}

.source-fragment-header { display: flex; align-items: center; gap: 5px; min-width: 0; }
.source-fragment-title { flex: 1; min-width: 0; }
.source-fragment-select-label { display: inline-flex; align-items: center; cursor: pointer; margin-left: 2px; }
.source-fragment-item .fragment-advanced-control,
.dream-revision-advanced { display: none !important; }
#sourceFragmentsSection.fragment-advanced-open .fragment-advanced-control { display: inline-flex !important; }
#sourceFragmentsSection.fragment-advanced-open .dream-revision-advanced { display: inline-block !important; }
.source-fragment-advanced { margin-top: 10px; }
.source-fragment-advanced .btn-main { width: calc(100% - 20px); margin: 8px 10px 10px !important; }
.capture-advanced-settings { margin-top: 14px; }
.capture-advanced-settings .mode-selector { padding: 0 10px 10px; }
.technical-progress-panel { margin: 0 0 16px; }
.technical-progress-panel .terminal-box { margin: 0; border: 0; border-radius: 0 0 8px 8px; }
.sovereign-advanced-branches { margin-bottom: 14px; }
.sovereign-advanced-branches > div { margin: 10px 10px 14px !important; }
.sovereign-advanced-branches > .interpretation-save-status { margin: 0 10px 10px !important; }

@media (max-width: 520px) {
  .day-note-input-grid {
    grid-template-columns: 1fr;
  }
  .capture-intent-actions {
    grid-template-columns: 1fr;
  }
  html, body { width: 100%; min-width: 0; overflow-x: hidden; }
  body { display: block; min-height: 100dvh; padding: 0; }
  .phone-frame { width: 100%; max-width: none; height: 100dvh; min-height: 100dvh; border: 0; border-radius: 0; box-shadow: none; }
  .header { padding: 14px 12px 10px; }
  .content-scroll { min-width: 0; padding: 12px; overflow-x: hidden; }
  .card { min-width: 0; padding: 12px; }
  .advanced-mode-actions,
  .journal-primary-actions,
  .journal-secondary-actions,
  .journal-advanced-action-grid { grid-template-columns: 1fr; }
  .card-title { flex-wrap: wrap; gap: 6px; }
  .source-fragment-item { min-width: 0; }
  .source-fragment-header { flex-wrap: wrap; align-items: center; gap: 6px; }
  .source-fragment-title { flex: 1 1 145px; min-width: 0; overflow-wrap: anywhere; }
  .source-fragment-header .fragment-reclassify-button,
  .source-fragment-header .fragment-transcription-language,
  .source-fragment-header .fragment-transcribe-button,
  .source-fragment-header .fragment-listen-button { flex: 0 1 auto; max-width: 100%; }
  .fragment-transcription-language { max-width: 84px !important; }
  .input-row > div { min-width: min(100%, 110px) !important; }
  button, input, select, textarea { max-width: 100%; }
  .public-welcome-screen { min-height: calc(100dvh - 116px); padding: 22px 8px 30px; }
  .public-dream-input { min-height: 240px; height: 44dvh; }
  .public-review-card { max-height: calc(100dvh - 16px); padding: 14px; }
  .public-review-text { min-height: 210px; height: 36dvh; }
  .public-review-action { scroll-margin-bottom: 16px; }
}

@media (max-width: 360px) {
  .header { padding: 10px 10px 8px; }
  .header p, .local-only-status { margin-top: 3px; }
  .content-scroll { padding: 10px; }
  .public-welcome-screen { gap: 11px; padding-inline: 4px; }
  .public-welcome-actions { width: 100%; }
  .public-dream-input { min-height: 220px; }
  .modal-actions { flex-direction: column-reverse; }
  .btn-modal { min-height: 46px; }
}

.btn-cancel {
  background-color: var(--card-border);
  color: var(--text-main);
}

.btn-confirm-delete {
  background: linear-gradient(135deg, var(--accent-rose) 0%, #e11d48 100%);
  color: white;
}

.toast-notification {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background-color: #181828;
  border: 1px solid var(--accent-green);
  color: var(--accent-green);
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 600;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.6);
  z-index: 200;
  text-align: center;
  max-width: 90%;
  pointer-events: none;
}

/* --- TENDANCE DESCRIPTIVE (ROMAN NUIT) --- */
.analytics-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.analytics-title-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent-cyan);
  background-color: rgba(56, 189, 248, 0.12);
  padding: 4px 10px;
  border-radius: 6px;
  border-left: 3px solid var(--accent-cyan);
  margin-bottom: 8px;
}

.analytics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}

.analytics-stat-card {
  background-color: #0f0f1a;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  padding: 10px;
  text-align: center;
}

.analytics-stat-value {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent-purple);
}

.analytics-stat-label {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.analytics-list-card {
  background-color: #0f0f1a;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 10px;
}

.analytics-word-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 0.78rem;
}
.analytics-word-item:last-child {
  border-bottom: none;
}

.analytics-word-text {
  font-weight: 600;
  color: var(--text-main);
}

.analytics-word-meta {
  font-size: 0.7rem;
  color: var(--accent-cyan);
}

.analytics-disclaimer-note {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-style: italic;
  background-color: #080811;
  padding: 8px 10px;
  border-radius: 6px;
  border-left: 3px solid var(--card-border);
  margin-top: 8px;
  line-height: 1.4;
}

/* --- EXPORTATION ET IMPORTATION SÉCURISÉES --- */
.privacy-warning-box {
  background-color: rgba(251, 191, 36, 0.08);
  border: 1px solid var(--accent-amber);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 0.74rem;
  color: #fef08a;
  line-height: 1.45;
  margin-top: 10px;
}

.import-report-card {
  background-color: #0f0f1a;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  padding: 12px;
  margin-top: 10px;
}

.import-report-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.76rem;
  padding: 5px 0;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.06);
}
.import-report-row:last-child {
  border-bottom: none;
}

.import-count-badge {
  font-weight: 700;
  font-size: 0.8rem;
  padding: 2px 8px;
  border-radius: 4px;
}
.import-count-valid { color: var(--accent-green); background-color: rgba(16, 185, 129, 0.12); }
.import-count-duplicate { color: var(--accent-amber); background-color: rgba(251, 191, 36, 0.12); }
.import-count-rejected { color: var(--accent-rose); background-color: rgba(244, 63, 94, 0.12); }

/* Bouton Toggle Masquer/Afficher Phrase Secrète */
.btn-toggle-pass {
  background: var(--card-border);
  color: var(--text-muted);
  border: 1px solid var(--card-border);
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 0.75rem;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}
.btn-toggle-pass:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
}

/* Styles modale de phrase secrète d'exportation / importation chiffrée */
.passphrase-field-group {
  margin-bottom: 10px;
}
.passphrase-label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.passphrase-input-row {
  display: flex;
  gap: 6px;
  align-items: center;
}
.passphrase-warning-box {
  font-size: 0.75rem;
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.1);
  padding: 8px 10px;
  border-radius: 6px;
  border-left: 3px solid #fbbf24;
  margin-bottom: 14px;
}
.validation-msg {
  font-size: 0.75rem;
  color: #f87171;
  min-height: 18px;
  margin-bottom: 10px;
}

/* ==========================================================================
   SO-VOICE MODULE STYLES (CAPTURE, ENREGISTREMENT, DICTÉE & AUDIO)
   ========================================================================== */

/* Grille des 4 portes d'entrée */
.capture-cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 18px;
}
@media (max-width: 650px) {
  .capture-cards-grid {
    grid-template-columns: 1fr;
  }
}

.capture-card {
  position: relative;
  background: var(--bg-card, #0f172a);
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
  border-radius: 16px;
  padding: 20px;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  display: flex;
  flex-direction: column;
}
.capture-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.3);
  border-color: rgba(215, 180, 119, 0.55);
}
.capture-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 22px;
  margin-bottom: 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.capture-card h3 {
  margin: 0 0 8px 0;
  font-size: 1.1rem;
  font-family: Georgia, serif;
  color: var(--text-color, #e2e8f0);
}
.capture-card p {
  margin: 0 0 16px 0;
  color: var(--text-muted, #94a3b8);
  font-size: 0.85rem;
  line-height: 1.5;
  flex: 1;
}
.capture-card-btn {
  border: 0;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 0.82rem;
  font-weight: 500;
  color: white;
  cursor: pointer;
  align-self: flex-start;
}
.capture-card-btn.blue { background: #3b82f6; }
.capture-card-btn.orange { background: #f97316; }
.capture-card-btn.typed { background: #8b5cf6; }
.capture-card-btn.green { background: #10b981; }

/* Zone de glisser-déposer (Drop Zone) */
.audio-dropzone {
  border: 2px dashed rgba(255, 255, 255, 0.25);
  border-radius: 18px;
  padding: 40px 20px;
  text-align: center;
  background: rgba(255, 255, 255, 0.02);
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.audio-dropzone.dragover, .audio-dropzone:hover {
  border-color: #3b82f6;
  background: rgba(59, 130, 246, 0.08);
}
.audio-dropzone-icon {
  font-size: 48px;
  margin-bottom: 12px;
}
.audio-filebox {
  margin-top: 18px;
  background: #091322;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 18px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

/* Onde audio & timer d'enregistrement */
.record-wrap {
  text-align: center;
}
.record-timer {
  font-size: 42px;
  font-family: monospace, monospace;
  font-variant-numeric: tabular-nums;
  margin: 12px 0;
  color: #f59e0b;
}
.audio-wave {
  height: 90px;
  border-radius: 14px;
  margin: 18px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  background: #08101d;
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0 20px;
  overflow: hidden;
}
.audio-bar {
  width: 4px;
  border-radius: 4px;
  background: linear-gradient(180deg, #a855f7, #6366f1);
  height: 18px;
  opacity: 0.4;
}
.recording .audio-bar {
  animation: audioPulse 1.1s ease-in-out infinite;
}
.audio-bar:nth-child(3n) { animation-delay: 0.2s; }
.audio-bar:nth-child(4n) { animation-delay: 0.4s; }
.audio-bar:nth-child(5n) { animation-delay: 0.6s; }

@keyframes audioPulse {
  0%, 100% { height: 16px; opacity: 0.3; }
  50% { height: 68px; opacity: 1; }
}

.record-btn-round {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: #1e293b;
  color: white;
  font-size: 24px;
  cursor: pointer;
  margin: 0 8px;
  transition: transform 0.15s ease, background 0.15s ease;
}
.record-btn-round:hover {
  transform: scale(1.05);
}
.record-btn-round.stop {
  background: #991b1b;
  border-color: #f87171;
}

/* Zone de dictée vocale */
.dictation-header {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-bottom: 16px;
}
.dictation-mic-pill {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: radial-gradient(circle, #10b981, #047857);
  font-size: 36px;
  flex-shrink: 0;
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.15);
}
.dictation-mic-pill.active {
  animation: micPulse 1.5s infinite;
}

@keyframes micPulse {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
  70% { box-shadow: 0 0 0 16px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* Badges & Révision */
.transcription-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.simulated-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.7rem;
  background: rgba(147, 51, 234, 0.15);
  color: #c084fc;
  border: 1px solid rgba(147, 51, 234, 0.3);
}

/* Badges de Statut Rêve Brut (RAW-01 à RAW-09) */
.status-badge-draft {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 600;
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.status-badge-confirmed {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 600;
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-badge-legacy {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 600;
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.addition-item {
  border-left: 2px solid #f59e0b;
  padding: 6px 0 6px 10px;
  margin-bottom: 8px;
  background: rgba(245, 158, 11, 0.04);
  border-radius: 0 6px 6px 0;
}
.addition-time {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-bottom: 2px;
}
.addition-text {
  font-size: 0.8rem;
  color: var(--text-color);
  line-height: 1.4;
}

/* MERGE-BATCH-04.2 — SO-WORLD / WORLD-LINK */
.world-profile-badge,
.world-count-badge {
  font-size: 0.7rem;
  color: #5eead4;
}

.world-scope-notice {
  margin-bottom: 0;
  padding: 10px 12px;
  border-left: 3px solid #14b8a6;
  background: rgba(20, 184, 166, 0.07);
  border-radius: 0 8px 8px 0;
}

.world-form-card,
.world-map-card {
  margin-top: 12px;
}

.world-form-grid,
.world-link-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 10px;
}

.world-link-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.world-save-button,
.world-link-save-button {
  margin-top: 12px;
  background: linear-gradient(135deg, #0f766e 0%, #14b8a6 100%);
}

.world-entity-list,
.world-link-list {
  display: grid;
  gap: 9px;
}

.world-entity-card,
.world-link-card {
  border: 1px solid rgba(45, 212, 191, 0.28);
  border-radius: 11px;
  background: rgba(15, 118, 110, 0.08);
  padding: 11px;
}

.world-entity-card.revoked,
.world-link-card.revoked {
  opacity: 0.62;
  border-color: rgba(148, 163, 184, 0.25);
}

.world-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.world-card-title {
  color: #ccfbf1;
  font-weight: 700;
}

.world-card-meta,
.world-card-provenance,
.world-card-description {
  color: var(--text-muted);
  font-size: 0.74rem;
  line-height: 1.45;
  margin-top: 5px;
}

.world-card-description {
  color: var(--text-main);
}

.world-card-excerpt {
  margin-top: 7px;
  color: #bae6fd;
  font-size: 0.75rem;
  line-height: 1.45;
}

.world-card-actions {
  display: flex;
  gap: 7px;
  margin-top: 9px;
  flex-wrap: wrap;
}

.world-card-actions button {
  padding: 5px 8px;
  border-radius: 6px;
  border: 1px solid rgba(94, 234, 212, 0.35);
  background: rgba(15, 118, 110, 0.18);
  color: #99f6e4;
  cursor: pointer;
  font-size: 0.72rem;
}

.world-card-actions button.world-revoke-button {
  border-color: rgba(248, 113, 113, 0.35);
  background: rgba(127, 29, 29, 0.18);
  color: #fca5a5;
}

.world-status-badge {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 2px 7px;
  font-size: 0.65rem;
  background: rgba(20, 184, 166, 0.15);
  color: #5eead4;
}

.world-status-badge.stale {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
}

.world-status-badge.revoked {
  background: rgba(148, 163, 184, 0.13);
  color: #cbd5e1;
}

@media (max-width: 640px) {
  .world-form-grid,
  .world-link-grid {
    grid-template-columns: 1fr;
  }
}

/* MERGE-BATCH-05 — routeur des contrats méthodologiques */
.interpretation-router-lock.active {
  border-color: rgba(139, 92, 246, 0.45);
  background: rgba(109, 40, 217, 0.09);
}

.interpretation-router-open-button {
  margin-top: 10px;
  width: 100%;
  background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
  color: white;
}

.interpretation-router-card {
  width: min(920px, calc(100vw - 28px));
  max-width: 920px;
  max-height: 92vh;
  overflow-y: auto;
}

.router-scope-notice {
  border-color: rgba(167, 139, 250, 0.35);
  background: rgba(109, 40, 217, 0.08);
}

.router-choice-panel {
  display: grid;
  gap: 7px;
  margin: 12px 0;
  padding: 11px;
  border: 1px solid rgba(167, 139, 250, 0.25);
  border-radius: 10px;
  background: rgba(76, 29, 149, 0.08);
}

.router-choice-panel label,
.method-gate-check {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  color: var(--text-muted);
  font-size: 0.76rem;
  line-height: 1.4;
}

.router-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.7fr);
  gap: 9px;
  margin: 11px 0;
}

.interpretation-method-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 10px 0 14px;
}

.interpretation-method-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border: 1px solid rgba(167, 139, 250, 0.24);
  border-radius: 11px;
  background: rgba(76, 29, 149, 0.07);
}

.interpretation-method-card.selected {
  border-color: rgba(52, 211, 153, 0.55);
  background: rgba(16, 185, 129, 0.07);
}

.interpretation-method-card.blocked {
  opacity: 0.72;
  border-color: rgba(248, 113, 113, 0.28);
}

.method-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.method-card-title {
  color: #ede9fe;
  font-weight: 700;
  font-size: 0.84rem;
}

.method-card-provenance,
.method-card-reason,
.method-card-contract {
  color: var(--text-muted);
  font-size: 0.72rem;
  line-height: 1.45;
}

.method-card-status {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 2px 6px;
  font-size: 0.62rem;
  color: #c4b5fd;
  background: rgba(124, 58, 237, 0.2);
}

.method-card-status.blocked { color: #fca5a5; background: rgba(127, 29, 29, 0.22); }
.method-card-status.recommended { color: #6ee7b7; background: rgba(6, 95, 70, 0.24); }
.method-card-status.historical_only { color: #fcd34d; background: rgba(120, 53, 15, 0.22); }

.method-contract-details {
  border-top: 1px solid rgba(167, 139, 250, 0.16);
  padding-top: 7px;
}

.method-contract-details summary {
  cursor: pointer;
  color: #c4b5fd;
  font-size: 0.73rem;
}

.method-contract-details ul {
  margin: 7px 0 0 18px;
  padding: 0;
  color: var(--text-muted);
  font-size: 0.7rem;
}

.method-select-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  margin-top: auto;
}

.method-select-check {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #d1fae5;
  font-size: 0.76rem;
}

@media (max-width: 700px) {
  .interpretation-method-list,
  .router-toolbar {
    grid-template-columns: 1fr;
  }
}

.batch06-card { width: min(980px, 96vw); max-height: 92vh; overflow-y: auto; }
.batch06-section { margin-top: 14px; padding: 14px; border: 1px solid rgba(192,132,252,.25); border-radius: 12px; background: rgba(88,28,135,.06); }
.batch06-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; margin-top: 10px; }
.batch06-grid > div { padding: 10px; border: 1px solid rgba(148,163,184,.18); border-radius: 9px; }
.batch06-list { display: grid; gap: 7px; margin-top: 8px; }
.batch06-list-item { padding: 8px; border-radius: 7px; background: rgba(15,23,42,.65); color: var(--text-muted); font-size: .75rem; line-height: 1.45; }
.batch06-narrative { margin: 12px 0; padding: 12px; border-left: 3px solid #c084fc; background: rgba(126,34,206,.08); color: #e9d5ff; font-size: .8rem; line-height: 1.6; }
.batch06-choice-row { display: grid; grid-template-columns: repeat(auto-fit,minmax(130px,1fr)); gap: 8px; margin: 10px 0; }
.batch06-choice-row button,.batch06-symbol-card button { padding: 9px; border: 1px solid rgba(148,163,184,.3); border-radius: 8px; background: rgba(15,23,42,.7); color: var(--text-muted); cursor: pointer; }
.batch06-choice-row button.selected { border-color: #34d399; color: #d1fae5; background: rgba(5,150,105,.12); }
.batch06-symbol-list { display: grid; gap: 8px; margin: 10px 0; }
.batch06-symbol-card { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 9px; padding: 10px; border: 1px solid rgba(56,189,248,.24); border-radius: 9px; }
.batch06-symbol-card.protected { border-color: rgba(251,191,36,.28); }
.batch06-symbol-card small { color: var(--text-muted); }
#globalProfileModalOverlay label { display: grid; gap: 5px; margin-top: 10px; color: var(--text-muted); font-size: .78rem; }
#globalProfileModalOverlay input[type="text"],#globalProfileModalOverlay select { width: 100%; padding: 9px; border-radius: 8px; border: 1px solid rgba(148,163,184,.3); background: #0b1020; color: var(--text); }
@media (max-width:700px){.batch06-grid{grid-template-columns:1fr}.batch06-symbol-card{grid-template-columns:auto 1fr}.batch06-symbol-card button{grid-column:1/-1}}

/* MERGE-BATCH-10.2 — page finale d'interprétation */
.interpretation-final-open-button {
  width: 100%;
  margin-top: 12px;
  color: #fff;
  background: linear-gradient(135deg, #7c3aed 0%, #2563eb 55%, #0891b2 100%);
}
.interpretation-result-card {
  width: min(760px, calc(100vw - 24px));
  max-height: calc(100vh - 30px);
  overflow-y: auto;
  border-color: rgba(167, 139, 250, 0.62);
  box-shadow: 0 24px 80px rgba(8, 5, 30, 0.72);
}
.interpretation-result-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(167, 139, 250, 0.28);
}
.interpretation-result-header .modal-title { color: #c4b5fd; }
.interpretation-result-archive-notice {
  margin: 14px 0;
  padding: 10px 12px;
  border: 1px solid rgba(245, 158, 11, 0.48);
  border-radius: 10px;
  color: #fcd34d;
  background: rgba(120, 53, 15, 0.16);
  line-height: 1.45;
}
.interpretation-result-version-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0;
}
.interpretation-result-version-nav button {
  padding: 7px 11px;
  border: 1px solid rgba(148, 163, 184, 0.32);
  border-radius: 999px;
  color: var(--text-muted);
  background: rgba(15, 23, 42, 0.72);
  cursor: pointer;
}
.interpretation-result-version-nav button.selected {
  color: #fff;
  border-color: rgba(139, 92, 246, 0.85);
  background: rgba(109, 40, 217, 0.42);
}
.interpretation-result-section {
  margin-top: 14px;
  padding: 16px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.55);
}
.interpretation-result-section h3,
.interpretation-result-section summary {
  margin: 0 0 10px;
  color: #e2e8f0;
  font-size: 1rem;
  font-weight: 700;
}
.interpretation-result-section summary { cursor: pointer; }
.interpretation-result-dream-text {
  margin-top: 12px;
  padding: 12px;
  border-radius: 10px;
  color: #dbeafe;
  background: rgba(2, 6, 23, 0.7);
  white-space: pre-wrap;
  line-height: 1.55;
}
.interpretation-result-methods {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}
.interpretation-result-method-card {
  padding: 14px;
  border: 1px solid rgba(45, 212, 191, 0.34);
  border-radius: 12px;
  background: rgba(6, 78, 59, 0.14);
}
.interpretation-result-method-card h4 { margin: 0 0 10px; color: #5eead4; }
.interpretation-result-method-card h5 { margin: 12px 0 5px; color: #cbd5e1; font-size: 0.86rem; }
.interpretation-result-method-card ul,
.interpretation-result-evidence ul {
  margin: 0;
  padding-left: 20px;
  color: #cbd5e1;
  line-height: 1.5;
}
.interpretation-result-hypothesis { color: #ddd6fe; }
.interpretation-result-limit {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed rgba(148, 163, 184, 0.28);
  color: #94a3b8;
  font-size: 0.84rem;
}
.interpretation-result-synthesis { color: #dbeafe; line-height: 1.58; }
.interpretation-result-synthesis-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.interpretation-result-synthesis-grid > div {
  padding: 10px;
  border-radius: 10px;
  color: #cbd5e1;
  background: rgba(2, 6, 23, 0.45);
}
.interpretation-result-review textarea { width: 100%; margin: 12px 0; }
.interpretation-result-reviewed-summary {
  margin-bottom: 12px;
  padding: 10px;
  border: 1px solid rgba(16, 185, 129, 0.34);
  border-radius: 10px;
  color: #a7f3d0;
  background: rgba(6, 95, 70, 0.16);
}
@media (max-width: 620px) {
  .interpretation-result-header { flex-direction: column; }
  .interpretation-result-synthesis-grid { grid-template-columns: 1fr; }
}

/* MERGE-BATCH-11.1 — coquille SO-SYMBOLIC-CORPUS */
.symbolic-corpus-shell-card {
  width: min(560px, calc(100vw - 24px));
  max-height: calc(100vh - 30px);
  overflow-y: auto;
  border-color: rgba(245, 158, 11, 0.58);
}
.symbolic-corpus-shell-badge {
  color: #fcd34d;
  border-color: rgba(245, 158, 11, 0.4);
  background: rgba(120, 53, 15, 0.18);
}
.symbolic-corpus-shell-status {
  display: grid;
  gap: 5px;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid rgba(52, 211, 153, 0.3);
  border-radius: 11px;
  color: #a7f3d0;
  background: rgba(6, 78, 59, 0.13);
}
.symbolic-corpus-shell-status span { color: var(--text-muted); font-size: 0.76rem; }
.symbolic-corpus-shell-section {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: 11px;
  background: rgba(120, 53, 15, 0.08);
}
.symbolic-corpus-shell-section h3 { margin: 0 0 8px; color: #fde68a; font-size: 0.92rem; }
.symbolic-corpus-shell-section ol { margin: 0; padding-left: 20px; color: var(--text-muted); font-size: 0.78rem; line-height: 1.55; }
.symbolic-corpus-shell-lock {
  margin-top: 14px;
  padding: 11px;
  border: 1px solid rgba(248, 113, 113, 0.32);
  border-radius: 10px;
  color: #fca5a5;
  background: rgba(127, 29, 29, 0.12);
  font-size: 0.76rem;
  line-height: 1.45;
}
.symbolic-corpus-path { border-color: rgba(52, 211, 153, 0.34); }
.symbolic-corpus-path h3 { color: #a7f3d0; }
.symbolic-corpus-path-progress { display: grid; gap: 8px; }
.symbolic-corpus-path-steps { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.symbolic-corpus-path-step {
  min-width: 0;
  padding: 8px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 8px;
  color: var(--text-muted);
  background: rgba(15, 23, 42, 0.5);
  font-size: 0.7rem;
  line-height: 1.35;
}
.symbolic-corpus-path-step strong { display: block; color: #cbd5e1; font-size: 0.72rem; }
.symbolic-corpus-path-step.complete { border-color: rgba(52, 211, 153, 0.38); background: rgba(6, 78, 59, 0.13); color: #a7f3d0; }
.symbolic-corpus-path-step.current { border-color: rgba(56, 189, 248, 0.5); background: rgba(8, 47, 73, 0.2); color: #bae6fd; }
.symbolic-corpus-path-step.stale { border-color: rgba(248, 113, 113, 0.5); background: rgba(127, 29, 29, 0.13); color: #fecaca; }
.symbolic-corpus-path-next {
  padding: 9px;
  border-left: 3px solid rgba(56, 189, 248, 0.7);
  color: #e0f2fe;
  background: rgba(8, 47, 73, 0.18);
  font-size: 0.75rem;
  line-height: 1.45;
}

.symbolic-corpus-help,
.symbolic-documentary-locked p {
  margin: 0 0 10px;
  color: var(--text-muted);
  font-size: 0.78rem;
  line-height: 1.45;
}
.symbolic-candidate-list { display: grid; gap: 9px; }
.symbolic-candidate-empty {
  padding: 12px;
  border: 1px dashed rgba(245, 158, 11, 0.35);
  border-radius: 9px;
  color: var(--text-muted);
  font-size: 0.78rem;
}
.symbolic-candidate-card {
  padding: 11px;
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.66);
}
.symbolic-candidate-card.state-accepted,
.symbolic-candidate-card.state-manual_added { border-color: rgba(52, 211, 153, 0.42); }
.symbolic-candidate-card.state-ignored { opacity: 0.72; border-color: rgba(148, 163, 184, 0.28); }
.symbolic-candidate-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 9px; }
.symbolic-candidate-header strong { color: #fde68a; overflow-wrap: anywhere; }
.symbolic-candidate-state {
  flex: 0 1 auto;
  color: #cbd5e1;
  font-size: 0.67rem;
  text-align: right;
}
.symbolic-candidate-provenance { margin-top: 5px; color: var(--text-muted); font-size: 0.7rem; }
.symbolic-candidate-card details { margin-top: 7px; color: #bae6fd; font-size: 0.72rem; }
.symbolic-candidate-card summary { cursor: pointer; }
.symbolic-candidate-card blockquote { margin: 6px 0 0; padding-left: 9px; border-left: 2px solid rgba(56, 189, 248, 0.4); color: var(--text-muted); }
.symbolic-candidate-controls { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 9px; }
.symbolic-candidate-controls select { flex: 1 1 210px; min-height: 38px; }
.symbolic-action-button {
  min-height: 38px;
  padding: 7px 10px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 7px;
  color: var(--text-main);
  background: rgba(30, 41, 59, 0.72);
  cursor: pointer;
}
.symbolic-action-button.accept,
.symbolic-action-button.first-look { border-color: rgba(52, 211, 153, 0.46); color: #a7f3d0; }
.symbolic-action-button.ignore { color: #cbd5e1; }
.symbolic-action-button:focus-visible,
.symbolic-candidate-controls select:focus-visible,
.symbolic-manual-add input:focus-visible,
.symbolic-manual-add select:focus-visible { outline: 3px solid rgba(56, 189, 248, 0.72); outline-offset: 2px; }
.symbolic-manual-add { margin-top: 13px; }
.symbolic-manual-add > label { display: block; margin-bottom: 6px; color: #fde68a; font-size: 0.78rem; }
.symbolic-manual-add-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(120px, 0.7fr) auto; gap: 7px; }
.symbolic-manual-add-row input,
.symbolic-manual-add-row select { min-width: 0; }
.symbolic-compact-button { width: auto; min-height: 40px; }
.symbolic-first-look-label { margin-bottom: 9px; color: #fde68a; font-weight: 700; }
.symbolic-first-look-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 9px; }
.symbolic-first-look-history { margin-top: 9px; color: #a7f3d0; font-size: 0.74rem; line-height: 1.4; }
.symbolic-documentary-locked { border-color: rgba(248, 113, 113, 0.3); }
.symbolic-documentary-locked h3 { color: #fca5a5; }
.symbolic-documentary-source-bridge { border-color: rgba(56, 189, 248, 0.34); }
.symbolic-documentary-source-bridge h3 { color: #7dd3fc; }
.symbolic-source-match-action { margin-top: 10px; }
.symbolic-source-match-action:disabled { opacity: 0.5; cursor: not-allowed; }
.symbolic-source-match-action:focus-visible { outline: 3px solid rgba(56, 189, 248, 0.72); outline-offset: 2px; }
.symbolic-source-match-status {
  margin-top: 9px;
  color: #bae6fd;
  font-size: 0.75rem;
  line-height: 1.45;
}
.symbolic-source-match-list { display: grid; gap: 9px; margin-top: 10px; }
.symbolic-source-match-card {
  padding: 11px;
  border: 1px solid rgba(56, 189, 248, 0.34);
  border-radius: 10px;
  background: rgba(8, 47, 73, 0.22);
}
.symbolic-source-match-card strong { display: block; color: #e0f2fe; }
.symbolic-source-match-meta { margin-top: 5px; color: #bae6fd; font-size: 0.72rem; line-height: 1.45; overflow-wrap: anywhere; }
.symbolic-source-selection-control {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 9px;
  padding-top: 9px;
  border-top: 1px solid rgba(56, 189, 248, 0.22);
  color: #e0f2fe;
  font-size: 0.74rem;
  line-height: 1.4;
  cursor: pointer;
}
.symbolic-source-selection-control input { width: 18px; height: 18px; flex: 0 0 auto; accent-color: #0ea5e9; }
.symbolic-source-selection-control input:focus-visible { outline: 3px solid rgba(56, 189, 248, 0.72); outline-offset: 2px; }
.symbolic-source-selection-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 11px; }
.symbolic-source-selection-actions[hidden] { display: none; }
.symbolic-source-selection-history {
  margin-top: 10px;
  color: #a7f3d0;
  font-size: 0.74rem;
  line-height: 1.45;
}
.symbolic-source-content-withheld {
  margin-top: 11px;
  padding: 9px;
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 8px;
  color: #fde68a;
  background: rgba(120, 53, 15, 0.12);
  font-size: 0.72rem;
  line-height: 1.45;
}
.symbolic-entry-qualification { border-color: rgba(167, 139, 250, 0.36); }
.symbolic-entry-qualification h3 { color: #c4b5fd; }
.symbolic-entry-qualification-action { margin-top: 2px; background: linear-gradient(135deg, #5b21b6 0%, #7c3aed 100%); }
.symbolic-entry-qualification-action:disabled { opacity: 0.5; cursor: not-allowed; }
.symbolic-entry-qualification-action:focus-visible { outline: 3px solid rgba(196, 181, 253, 0.72); outline-offset: 2px; }
.symbolic-entry-qualification-results { display: grid; gap: 9px; margin-top: 10px; }
.symbolic-entry-qualification-card {
  padding: 11px;
  border: 1px solid rgba(248, 113, 113, 0.36);
  border-radius: 10px;
  background: rgba(127, 29, 29, 0.1);
}
.symbolic-entry-qualification-card.qualified { border-color: rgba(52, 211, 153, 0.42); background: rgba(6, 78, 59, 0.12); }
.symbolic-entry-qualification-card strong { display: block; color: #ede9fe; overflow-wrap: anywhere; }
.symbolic-entry-qualification-state { margin-top: 5px; color: #fca5a5; font-size: 0.72rem; font-weight: 700; }
.symbolic-entry-qualification-card.qualified .symbolic-entry-qualification-state { color: #6ee7b7; }
.symbolic-entry-qualification-card ul { margin: 7px 0 0; padding-left: 19px; color: #fecaca; font-size: 0.72rem; line-height: 1.45; }
.symbolic-documentary-synthesis { border-color: rgba(52, 211, 153, 0.38); }
.symbolic-documentary-synthesis h3 { color: #a7f3d0; }
.symbolic-synthesis-action { margin-top: 2px; background: linear-gradient(135deg, #047857 0%, #059669 100%); }
.symbolic-synthesis-action:disabled { opacity: 0.5; cursor: not-allowed; }
.symbolic-synthesis-review-actions { margin-top: 11px; }
.symbolic-synthesis-review-actions[hidden] { display: none; }
.symbolic-synthesis-review-actions > label { display: block; margin-bottom: 6px; color: #a7f3d0; font-size: 0.76rem; }
.symbolic-synthesis-review-actions textarea { width: 100%; }
.symbolic-synthesis-witness { margin-top: 7px; padding: 9px; border-left: 3px solid rgba(52, 211, 153, 0.52); color: #d1fae5; background: rgba(6, 78, 59, 0.1); font-size: 0.75rem; line-height: 1.45; }
.symbolic-remediation { border-color: rgba(251, 191, 36, 0.38); }
.symbolic-remediation h3 { color: #fcd34d; }
.symbolic-remediation-action { margin-top: 2px; background: linear-gradient(135deg, #92400e 0%, #d97706 100%); }
.symbolic-remediation-action:disabled { opacity: 0.5; cursor: not-allowed; }
.symbolic-remediation-action:focus-visible { outline: 3px solid rgba(252, 211, 77, 0.72); outline-offset: 2px; }
.symbolic-remediation-results { display: grid; gap: 9px; margin-top: 10px; }
.symbolic-remediation-card {
  padding: 11px;
  border: 1px solid rgba(251, 191, 36, 0.35);
  border-radius: 10px;
  background: rgba(120, 53, 15, 0.11);
}
.symbolic-remediation-card.state-ready_for_review { border-color: rgba(52, 211, 153, 0.42); background: rgba(6, 78, 59, 0.12); }
.symbolic-remediation-card.state-rejected { border-color: rgba(248, 113, 113, 0.42); background: rgba(127, 29, 29, 0.12); }
.symbolic-remediation-card strong { display: block; color: #fef3c7; overflow-wrap: anywhere; }
.symbolic-remediation-state { margin-top: 5px; color: #fcd34d; font-size: 0.72rem; font-weight: 700; }
.symbolic-remediation-tracks { margin-top: 7px; color: #fde68a; font-size: 0.72rem; line-height: 1.45; }
.symbolic-remediation-card ul { margin: 7px 0 0; padding-left: 19px; color: #fed7aa; font-size: 0.72rem; line-height: 1.45; }
.symbolic-remediation-boundary { margin-top: 8px; padding-top: 7px; border-top: 1px solid rgba(251, 191, 36, 0.24); color: #fca5a5; font-size: 0.7rem; }

/* INTERPRETATION_EXPRESS_V1 */
.express-entry-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
  padding: 13px;
  border: 1px solid rgba(52, 211, 153, 0.58);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(6, 78, 59, 0.28), rgba(12, 74, 110, 0.22));
}
.express-entry-card strong { display: block; color: #d1fae5; font-size: 0.9rem; }
.express-entry-card span { display: block; margin-top: 4px; color: #a7f3d0; font-size: 0.72rem; line-height: 1.4; }
.express-entry-card button,
.express-run-button {
  padding: 10px 13px;
  border: 1px solid rgba(110, 231, 183, 0.62);
  border-radius: 9px;
  background: linear-gradient(135deg, #059669, #0284c7);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}
.express-entry-card button:focus-visible,
.express-run-button:focus-visible { outline: 3px solid rgba(110, 231, 183, 0.72); outline-offset: 2px; }
.express-entry-card button:disabled,
.express-run-button:disabled { opacity: 0.58; cursor: wait; }
.quick-reading-entry-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 13px;
  align-items: center;
  margin-bottom: 14px;
  padding: 16px;
  border: 1px solid rgba(96, 165, 250, 0.78);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.34), rgba(124, 58, 237, 0.28), rgba(5, 150, 105, 0.2));
  box-shadow: 0 10px 30px rgba(30, 64, 175, 0.18);
}
.quick-reading-entry-card strong { display: block; color: #fff; font-size: 1rem; }
.quick-reading-entry-card span { display: block; margin-top: 5px; color: #dbeafe; font-size: 0.75rem; line-height: 1.45; }
.quick-reading-entry-card button {
  min-width: 128px;
  padding: 12px 15px;
  border: 1px solid rgba(191, 219, 254, 0.8);
  border-radius: 10px;
  color: #fff;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  font-weight: 850;
  cursor: pointer;
}
.express-secondary-entry-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.express-secondary-entry-grid .express-entry-card { grid-template-columns: 1fr; margin-bottom: 0; }
.express-secondary-entry-grid .express-entry-card button { width: 100%; }
.quick-reading-journal-button,
.quick-reading-detail-button {
  border: 1px solid rgba(147, 197, 253, 0.72) !important;
  color: #eff6ff !important;
  background: linear-gradient(135deg, #2563eb, #7c3aed) !important;
  font-weight: 800;
}
.quick-reading-detail-button { margin: 0 0 8px !important; }
.dictionaries-express-entry-card {
  border-color: rgba(251, 191, 36, 0.58);
  background: linear-gradient(135deg, rgba(120, 53, 15, 0.25), rgba(76, 29, 149, 0.18));
}
.dictionaries-express-entry-card strong { color: #fef3c7; }
.dictionaries-express-entry-card span { color: #fde68a; }
.dictionaries-express-entry-card button {
  border-color: rgba(252, 211, 77, 0.65);
  background: linear-gradient(135deg, #d97706, #7c3aed);
}
#dictionariesExpressModalOverlay,
#dictionariesDreamerDeepeningModalOverlay {
  align-items: center;
  overflow: hidden;
  overscroll-behavior: contain;
}
.dictionaries-express-card {
  width: min(650px, 100%);
  max-width: 650px;
  max-height: calc(100% - 40px);
  max-height: min(calc(100dvh - 40px), calc(100% - 40px));
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.dictionaries-express-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable;
  padding-right: 4px;
}
.dictionaries-express-badge { color: #fde68a; border-color: rgba(251, 191, 36, 0.5); background: rgba(120, 53, 15, 0.24); }
.dictionaries-express-status,
.dictionaries-express-first-look,
.dictionaries-express-rights-gate,
.dictionaries-express-empty {
  margin: 10px 0;
  padding: 11px 12px;
  border: 1px solid rgba(251, 191, 36, 0.35);
  border-radius: 10px;
  background: rgba(120, 53, 15, 0.12);
  color: #fde68a;
  font-size: 0.78rem;
  line-height: 1.5;
}
.dictionaries-express-status:empty { display: none; }
.dictionaries-express-first-look h3,
.dictionaries-express-rights-gate h3,
.dictionaries-express-motifs-title { margin: 0 0 7px; color: #fef3c7; font-size: 0.9rem; }
.dictionaries-express-first-look p,
.dictionaries-express-rights-gate p { margin: 0; color: #e2e8f0; }
.dictionaries-express-rights-gate label,
.dictionaries-dreamer-first-look label { display: block; margin: 10px 0 5px; color: #fde68a; font-size: 0.74rem; font-weight: 700; }
.dictionaries-express-rights-gate select,
.dictionaries-dreamer-first-look select,
.dictionaries-dreamer-first-look textarea { width: 100%; }
.dictionaries-express-rights-gate button,
.dictionaries-dreamer-first-look button {
  width: 100%;
  margin-top: 10px;
  padding: 10px;
  border: 1px solid rgba(252, 211, 77, 0.58);
  border-radius: 8px;
  background: linear-gradient(135deg, #d97706, #7c3aed);
  color: #fff;
  font-weight: 750;
  cursor: pointer;
}
#dictionariesExpressJurisdictionFeedback,
#dictionariesDreamerFirstLookFeedback { margin-top: 8px; color: #fde68a; font-size: 0.72rem; line-height: 1.4; }
.dictionaries-express-gate-actions { display: grid; grid-template-columns: 1.2fr 1fr; gap: 9px; margin-top: 11px; }
.dictionaries-express-gate-actions button {
  padding: 10px;
  border: 1px solid rgba(252, 211, 77, 0.55);
  border-radius: 8px;
  background: rgba(120, 53, 15, 0.28);
  color: #fef3c7;
  font-weight: 750;
  cursor: pointer;
}
.dictionaries-express-gate-actions button:first-child { background: linear-gradient(135deg, #d97706, #7c3aed); color: #fff; }
.dictionaries-express-results { display: grid; gap: 11px; }
.dictionaries-express-symbols { color: #fde68a; font-size: 0.78rem; line-height: 1.5; }
.dictionaries-express-motif {
  padding: 12px;
  border: 1px solid rgba(251, 191, 36, 0.36);
  border-radius: 11px;
  background: rgba(30, 41, 59, 0.58);
}
.dictionaries-express-motif h3 { margin: 0 0 9px; color: #fcd34d; font-size: 0.95rem; text-transform: uppercase; }
.dictionaries-express-witness { padding: 9px 0; border-top: 1px solid rgba(148, 163, 184, 0.22); }
.dictionaries-express-witness:first-of-type { border-top: 0; padding-top: 0; }
.dictionaries-express-witness strong { display: block; margin-bottom: 4px; color: #bae6fd; }
.dictionaries-express-witness p { margin: 0; color: #e2e8f0; font-size: 0.78rem; line-height: 1.52; }
.dictionaries-express-witness .dictionaries-express-review-note { margin-top: 7px; color: #fde68a; font-size: 0.69rem; }
.dictionaries-express-provenance { margin-top: 7px; color: #94a3b8; font-size: 0.7rem; }
.dictionaries-express-provenance summary { color: #7dd3fc; cursor: pointer; }
.dictionaries-express-provenance p { margin-top: 6px; color: #94a3b8; font-size: 0.7rem; overflow-wrap: anywhere; }
.dictionaries-express-comparison { margin: 8px 0 0; padding-top: 8px; border-top: 1px solid rgba(251, 191, 36, 0.23); color: #cbd5e1; font-size: 0.73rem; line-height: 1.48; }
.dictionaries-express-boundary { color: #a7f3d0; font-size: 0.75rem; line-height: 1.48; }
.dictionaries-express-actions { flex: 0 0 auto; flex-wrap: wrap; margin-top: 13px; }
.dictionaries-express-actions .btn-modal { flex: 1 1 150px; }
.dictionaries-dreamer-deepening-card { width: min(680px, 100%); max-width: 680px; }
.dictionaries-dreamer-section {
  margin-top: 11px;
  padding: 12px;
  border: 1px solid rgba(251, 191, 36, 0.3);
  border-radius: 10px;
  background: rgba(30, 41, 59, 0.44);
}
.dictionaries-dreamer-section h3 { margin: 0 0 8px; color: #fef3c7; font-size: 0.9rem; }
.dictionaries-dreamer-section > p { margin: 0 0 8px; color: #cbd5e1; font-size: 0.75rem; line-height: 1.45; }
.express-interpretation-card { max-width: 620px; }
.express-state-badge { color: #a7f3d0; border-color: rgba(52, 211, 153, 0.52); background: rgba(6, 78, 59, 0.28); }
.express-safety-note {
  margin: 10px 0;
  padding: 10px;
  border-left: 3px solid #34d399;
  border-radius: 7px;
  background: rgba(6, 78, 59, 0.16);
  color: #d1fae5;
  font-size: 0.76rem;
  line-height: 1.45;
}
.express-run-button { width: 100%; margin: 9px 0 12px; }
.express-interpretation-results { display: grid; gap: 10px; }
.express-reading-overview,
.express-reading-closing {
  padding: 12px;
  border: 1px solid rgba(52, 211, 153, 0.38);
  border-radius: 10px;
  color: #ecfdf5;
  background: rgba(6, 78, 59, 0.14);
  font-size: 0.84rem;
  line-height: 1.55;
}
.express-reading-overview h3 { margin: 0 0 9px; color: #a7f3d0; font-size: 0.92rem; }
.express-reading-overview p { margin: 0 0 9px; }
.express-reading-overview p:last-child { margin-bottom: 0; }
.express-reading-section {
  padding: 11px 12px;
  border: 1px solid rgba(56, 189, 248, 0.28);
  border-radius: 10px;
  background: rgba(8, 47, 73, 0.14);
}
.express-reading-section h3 { margin: 0 0 7px; color: #bae6fd; font-size: 0.83rem; }
.express-reading-section p,
.express-reading-section ul { margin: 0; color: #e2e8f0; font-size: 0.78rem; line-height: 1.5; }
.express-reading-section ul { padding-left: 19px; }
.express-reading-extra { margin-top: 9px; }
.express-reading-extra summary { cursor: pointer; color: #7dd3fc; font-size: 0.76rem; }
.express-reading-extra ul,
.express-reading-extra p { margin-top: 8px; }
.express-reading-trace { color: #94a3b8; font-size: 0.72rem; }
.express-reading-trace summary { cursor: pointer; color: #7dd3fc; }
.express-reading-trace p { line-height: 1.45; }
.express-deepening-actions {
  display: grid;
  grid-template-columns: minmax(120px, 180px) 1fr;
  gap: 10px;
  align-items: center;
  margin-top: 13px;
  padding-top: 12px;
  border-top: 1px solid rgba(148, 163, 184, 0.24);
}
.express-deepening-actions span { color: #94a3b8; font-size: 0.72rem; line-height: 1.4; }
.remote-synthesis-consent-card { max-width: 470px; }
.remote-synthesis-minimum-note {
  margin: 0 0 13px;
  padding: 10px;
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 8px;
  background: rgba(8, 47, 73, 0.18);
  color: #cbd5e1;
  font-size: 0.73rem;
  line-height: 1.48;
}
.remote-synthesis-remember {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 0 0 15px;
  color: #e2e8f0;
  font-size: 0.76rem;
}
.remote-synthesis-remember input { width: auto; }

#quickReadingModalOverlay {
  align-items: center;
  overflow: hidden;
  overscroll-behavior: contain;
}
.quick-reading-card {
  width: min(720px, 100%);
  max-width: 720px;
  max-height: min(calc(100dvh - 32px), calc(100% - 32px));
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-color: rgba(96, 165, 250, 0.72);
  box-shadow: 0 24px 80px rgba(8, 5, 30, 0.75);
}
.quick-reading-header {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(96, 165, 250, 0.3);
}
.quick-reading-header .modal-title { color: #bfdbfe; }
.quick-reading-reread-button {
  flex: 0 0 auto;
  padding: 8px 11px;
  border: 1px solid rgba(147, 197, 253, 0.5);
  border-radius: 9px;
  color: #dbeafe;
  background: rgba(30, 64, 175, 0.18);
  font-weight: 700;
  cursor: pointer;
}
.quick-reading-badge,
.quick-reading-local-badge {
  flex: 0 0 auto;
  padding: 4px 8px;
  border: 1px solid rgba(96, 165, 250, 0.5);
  border-radius: 999px;
  color: #bfdbfe;
  background: rgba(30, 64, 175, 0.23);
  font-size: 0.64rem;
  font-weight: 750;
}
.quick-reading-local-badge { color: #fde68a; border-color: rgba(251, 191, 36, 0.5); background: rgba(120, 53, 15, 0.22); }
.quick-reading-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable;
  padding: 4px 4px 4px 0;
}
.quick-reading-section {
  margin-top: 12px;
  padding: 14px;
  border: 1px solid rgba(52, 211, 153, 0.38);
  border-radius: 13px;
  background: rgba(6, 78, 59, 0.12);
}
.quick-reading-documentary-disclosure,
.quick-reading-optional-deepening {
  width: 100%;
  min-width: 0;
  margin-top: 12px;
  padding: 0;
  border: 1px solid rgba(251, 191, 36, 0.4);
  border-radius: 13px;
  background: rgba(120, 53, 15, 0.1);
  overflow: hidden;
}
.quick-reading-documentary-disclosure > summary,
.quick-reading-optional-deepening > summary {
  padding: 13px 14px;
  color: #fef3c7;
  font-weight: 760;
  cursor: pointer;
}
.quick-reading-documentary-disclosure[open] > summary,
.quick-reading-optional-deepening[open] > summary {
  border-bottom: 1px solid rgba(251, 191, 36, 0.28);
}
.quick-reading-documentary { margin: 0; border: 0; border-radius: 0; background: transparent; }
.quick-reading-optional-deepening {
  padding-bottom: 0;
  border-color: rgba(148, 163, 184, 0.34);
  background: rgba(15, 23, 42, 0.28);
}
.quick-reading-optional-deepening > summary { color: #cbd5e1; }
.quick-reading-optional-deepening > p { margin: 12px 14px 0; color: #94a3b8; font-size: 0.74rem; line-height: 1.45; }
.quick-reading-optional-deepening > .quick-reading-deepen-button { width: calc(100% - 28px); margin: 10px 14px 14px; }
.quick-reading-section-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.quick-reading-section h2 { margin: 0; color: #d1fae5; font-size: 1.02rem; }
.quick-reading-documentary h2 { color: #fef3c7; }
.quick-reading-section-header p { margin: 5px 0 0; color: #cbd5e1; font-size: 0.74rem; line-height: 1.45; }
.quick-reading-status {
  margin: 10px 0;
  color: #bfdbfe;
  font-size: 0.76rem;
  line-height: 1.45;
}
.quick-reading-status:empty { display: none; }
.quick-reading-consent {
  margin: 10px 0;
  padding: 12px;
  border: 1px solid rgba(96, 165, 250, 0.42);
  border-radius: 10px;
  background: rgba(30, 64, 175, 0.14);
  color: #e2e8f0;
  font-size: 0.76rem;
  line-height: 1.45;
}
.quick-reading-consent p { margin: 0 0 10px; }
.quick-reading-consent h3 { margin: 0 0 8px; color: #dbeafe; font-size: 0.94rem; }
.quick-reading-consent label { display: flex; align-items: center; gap: 7px; margin-bottom: 10px; }
.quick-reading-consent input { width: auto; }
.quick-reading-consent-details { margin: 0 0 10px; padding: 8px 10px; }
.quick-reading-consent-details summary { color: #bfdbfe; cursor: pointer; }
.quick-reading-consent-details p { margin: 8px 0 0; color: #cbd5e1; }
.quick-reading-inline-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.quick-reading-inline-actions button,
.quick-reading-deepen-button {
  padding: 10px;
  border: 1px solid rgba(147, 197, 253, 0.55);
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  font-weight: 750;
  cursor: pointer;
}
.quick-reading-inline-actions .quick-reading-secondary-button { color: #cbd5e1; background: rgba(15, 23, 42, 0.68); }
.quick-reading-deepen-button { width: 100%; margin-top: 11px; }
.quick-reading-documentary .quick-reading-deepen-button { border-color: rgba(252, 211, 77, 0.58); background: linear-gradient(135deg, #d97706, #7c3aed); }
.quick-reading-footer { flex: 0 0 auto; margin-top: 12px; }
.quick-reading-footer .btn-modal { width: 100%; }
#quickReadingJurisdictionFeedback { margin-top: 8px; color: #fde68a; font-size: 0.72rem; }

.public-data-controls {
  margin-top: 14px;
  border: 1px solid rgba(56, 189, 248, 0.38);
  border-radius: 14px;
  background: rgba(8, 47, 73, 0.13);
  overflow: hidden;
}
.public-data-controls > summary {
  padding: 14px 16px;
  color: #bae6fd;
  font-weight: 800;
  cursor: pointer;
}
.public-data-controls[open] > summary { border-bottom: 1px solid rgba(56, 189, 248, 0.25); }
.public-data-intro { padding: 13px 14px 0; color: #cbd5e1; font-size: 0.78rem; line-height: 1.5; }
.public-data-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; padding: 13px 14px; }
.public-data-card {
  min-width: 0;
  padding: 13px;
  border: 1px solid rgba(96, 165, 250, 0.32);
  border-radius: 11px;
  background: rgba(15, 23, 42, 0.48);
}
.public-data-card h3 { margin: 0 0 7px; color: #e0f2fe; font-size: 0.95rem; }
.public-data-card p { margin: 0 0 11px; color: #cbd5e1; font-size: 0.75rem; line-height: 1.48; }
.public-data-card button,
.public-local-delete-info button {
  width: 100%;
  min-height: 42px;
  padding: 10px;
  border: 1px solid rgba(125, 211, 252, 0.55);
  border-radius: 8px;
  background: linear-gradient(135deg, #2563eb, #0891b2);
  color: #fff;
  font-weight: 760;
  cursor: pointer;
  white-space: normal;
  overflow-wrap: anywhere;
}
.public-data-actions { display: grid; gap: 8px; }
.public-data-actions button:last-child { background: rgba(30, 41, 59, 0.78); color: #dbeafe; }
.public-data-status { margin-top: 9px; min-height: 1em; color: #a7f3d0; font-size: 0.72rem; line-height: 1.45; overflow-wrap: anywhere; }
.public-data-status.error { color: #fda4af; }
.public-ai-data-info,
.public-local-delete-info,
.public-legacy-data-tools { margin: 0 14px 12px; min-width: 0; }
.public-ai-data-info p,
.public-local-delete-info p,
.public-legacy-data-tools p { color: #cbd5e1; font-size: 0.74rem; line-height: 1.48; }
.public-local-delete-info button { margin-bottom: 12px; background: rgba(127, 29, 29, 0.38); border-color: rgba(251, 113, 133, 0.55); }
.public-legacy-data-actions { display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px !important; }
.public-legacy-data-actions .btn-main { min-width: 0 !important; margin: 0 !important; white-space: normal; overflow-wrap: anywhere; }
.public-restore-preview-card { width: min(470px, 100%); max-width: 470px; min-width: 0; overflow: hidden; }
.public-restore-preview-body { max-height: min(60vh, 500px); overflow-x: hidden; overflow-y: auto; color: #e2e8f0; }
.public-restore-file-name { color: #7dd3fc; font-size: 0.74rem; overflow-wrap: anywhere; word-break: break-word; }
.public-restore-message { color: #a7f3d0; font-size: 0.8rem; line-height: 1.5; }
.public-restore-message.error { color: #fda4af; }
.public-restore-preview-body ul { padding-left: 20px; color: #cbd5e1; font-size: 0.75rem; line-height: 1.55; }
.public-restore-boundary { padding: 9px; border-left: 3px solid #38bdf8; background: rgba(8, 47, 73, 0.18); color: #dbeafe; font-size: 0.73rem; line-height: 1.45; }
.public-restore-actions { flex-wrap: wrap; }
.public-restore-actions .btn-modal { flex: 1 1 150px; min-height: 42px; white-space: normal; }
.public-restore-actions #confirmDreamtheonRestoreButton { background: linear-gradient(135deg, #059669, #0891b2); color: #fff; }
.public-restore-actions #confirmDreamtheonRestoreButton:disabled { opacity: 0.45; cursor: not-allowed; }

.optional-dream-metadata { margin-top: 12px; border: 1px solid rgba(56, 189, 248, 0.24); border-radius: 12px; padding: 0 12px 12px; }
.optional-dream-metadata > summary { padding: 12px 0; color: var(--accent-cyan); cursor: pointer; font-weight: 700; }
.optional-dream-metadata-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.optional-dream-metadata-grid label:not(.unknown-date-choice) { display: block; margin-bottom: 5px; color: var(--text-muted); font-size: 0.76rem; }
.optional-dream-metadata-grid input[type="date"], .optional-dream-metadata-grid select { width: 100%; }
.unknown-date-choice { display: flex; align-items: center; gap: 7px; margin-top: 7px; color: var(--text-muted); font-size: 0.76rem; }
.unknown-date-choice input { width: auto; flex: 0 0 auto; }
.dream-metadata-validation { min-height: 1.1em; margin-top: 5px; color: var(--accent-rose); font-size: 0.72rem; }

.journal-calendar { min-width: 0; display: grid; gap: 12px; }
.journal-calendar-navigation { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; align-items: center; gap: 8px; }
.journal-calendar-navigation h3 { margin: 0; text-align: center; text-transform: capitalize; font-size: 1rem; }
.journal-calendar-navigation button, .journal-unknown-date-button { min-height: 44px; border: 1px solid rgba(56, 189, 248, 0.35); border-radius: 10px; background: rgba(15, 23, 42, 0.72); color: var(--text-main); cursor: pointer; }
.journal-calendar-weekdays, .journal-calendar-grid { min-width: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.journal-calendar-weekdays span { text-align: center; color: var(--text-muted); font-size: 0.68rem; font-weight: 700; }
.journal-calendar-day, .journal-calendar-blank { min-width: 0; min-height: 42px; }
.journal-calendar-day { position: relative; display: grid; place-items: center; border: 1px solid rgba(148, 163, 184, 0.2); border-radius: 8px; background: rgba(15, 23, 42, 0.5); color: var(--text-main); cursor: pointer; }
.journal-calendar-day.today { border-color: rgba(56, 189, 248, 0.65); }
.journal-calendar-day.has-dreams { background: rgba(16, 185, 129, 0.16); border-color: rgba(52, 211, 153, 0.55); }
.journal-calendar-day.selected, .journal-unknown-date-button.selected { outline: 2px solid #38bdf8; outline-offset: 1px; }
.journal-calendar-day.legacy-future-date { border-color: #f59e0b; background: rgba(245, 158, 11, 0.15); }
.journal-calendar-day strong { position: absolute; right: 3px; bottom: 2px; min-width: 15px; padding: 1px 3px; border-radius: 999px; background: #059669; color: white; font-size: 0.58rem; line-height: 1.25; }
.journal-calendar-buckets { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.journal-unknown-date-button { padding: 8px 12px; }
.journal-legacy-date-notice { color: #fbbf24; font-size: 0.74rem; overflow-wrap: anywhere; }
.journal-calendar-selected-list { display: grid; gap: 9px; min-width: 0; }
.journal-calendar-selection-title { color: var(--accent-cyan); font-weight: 700; }
.journal-calendar-dream-card { min-width: 0; padding: 12px; border: 1px solid rgba(56, 189, 248, 0.24); border-radius: 12px; background: rgba(15, 23, 42, 0.56); }
.journal-calendar-dream-card p { margin: 7px 0 10px; overflow-wrap: anywhere; }
.journal-calendar-dream-meta, .journal-calendar-empty { color: var(--text-muted); font-size: 0.76rem; }

.public-normal-flow :where(button, summary) { min-height: 44px; }
.public-normal-flow :where(p, span, div, h1, h2, h3, label, button, summary),
.modal-card,
.public-data-card { overflow-wrap: anywhere; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

@media (max-width: 520px) {
  .symbolic-corpus-path-steps { grid-template-columns: 1fr; }
  .symbolic-manual-add-row { grid-template-columns: 1fr; }
  .symbolic-first-look-actions { grid-template-columns: 1fr; }
  .symbolic-action-button, .symbolic-candidate-controls select { width: 100%; }
  .symbolic-source-selection-actions { grid-template-columns: 1fr; }
  .express-entry-card,
  .express-deepening-actions { grid-template-columns: 1fr; }
  .express-entry-card button { width: 100%; }
  .dictionaries-express-gate-actions { grid-template-columns: 1fr; }
  .quick-reading-entry-card,
  .express-secondary-entry-grid,
  .quick-reading-inline-actions { grid-template-columns: 1fr; }
  .quick-reading-entry-card button { width: 100%; }
  .quick-reading-card { max-height: calc(100dvh - 16px); padding: 14px; }
  .quick-reading-header { flex-direction: column; }
  .quick-reading-reread-button { width: 100%; }
  .quick-reading-section { padding: 12px; }
  .quick-reading-documentary-disclosure > summary,
  .quick-reading-optional-deepening > summary { padding: 12px; }
  .public-data-grid,
  .public-legacy-data-actions { grid-template-columns: 1fr; }
  .public-data-grid { padding: 12px; }
  .public-data-controls > summary { padding: 13px; }
  .public-ai-data-info,
  .public-local-delete-info,
  .public-legacy-data-tools { margin-left: 12px; margin-right: 12px; }
  .public-restore-actions { display: grid; grid-template-columns: 1fr; }
  .public-restore-actions .btn-modal { width: 100%; }
  .optional-dream-metadata-grid { grid-template-columns: 1fr; }
  .journal-calendar-weekdays, .journal-calendar-grid { gap: 2px; }
  .journal-calendar-day, .journal-calendar-blank { min-height: 44px; font-size: 0.74rem; }
  .journal-calendar-navigation { grid-template-columns: 42px minmax(0, 1fr) 42px; }
}
