/* Module Visites — pédagogie inversée, 10 questions */
.visites-app {
  max-width: 1080px;
  margin: 0 auto;
  padding: 24px 20px 48px;
}

.vis-topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  margin-bottom: 28px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--paper-3, #e3e0d8);
}

.vis-brand {
  font-family: var(--font-d, "Source Serif 4", Georgia, serif);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--ink, #1c1b2e);
  text-decoration: none;
}

.vis-brand span {
  display: block;
  font-family: var(--font-b, "Source Sans 3", sans-serif);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent, #2d6a4f);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-top: 2px;
}

.vis-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  font-size: 14px;
}

.vis-nav a {
  color: var(--ink-2, #3a3856);
  text-decoration: none;
}

.vis-nav a:hover {
  color: var(--accent, #2d6a4f);
}

.vis-hero {
  margin-bottom: 28px;
}

.vis-hero h1 {
  font-family: var(--font-d, "Source Serif 4", Georgia, serif);
  font-size: clamp(1.5rem, 3vw, 2rem);
  margin: 0 0 10px;
  line-height: 1.25;
}

.vis-lead {
  color: var(--ink-2, #3a3856);
  max-width: 62ch;
  margin: 0;
}

.vis-doc-link {
  display: inline-block;
  margin-top: 10px;
  font-size: 14px;
  color: var(--accent, #2d6a4f);
}

.vis-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.vis-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px;
  border: 1px solid var(--paper-3, #e3e0d8);
  border-radius: 12px;
  background: var(--white, #fffcf8);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.vis-card:hover {
  border-color: var(--accent-2, #40916c);
  box-shadow: 0 4px 14px rgba(45, 106, 79, 0.12);
}

.vis-card-num {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent, #2d6a4f);
  letter-spacing: 0.06em;
}

.vis-card h2 {
  font-family: var(--font-d, "Source Serif 4", Georgia, serif);
  font-size: 1.05rem;
  margin: 0;
  line-height: 1.35;
}

.vis-card-meta {
  font-size: 13px;
  color: var(--ink-3, #6b6896);
}

.vis-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.vis-tag {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--accent-soft, #d8f3dc);
  color: var(--accent, #2d6a4f);
}

.vis-progress-bar {
  height: 4px;
  border-radius: 2px;
  background: var(--paper-2, #eeecea);
  margin-top: auto;
  overflow: hidden;
}

.vis-progress-fill {
  height: 100%;
  background: var(--accent, #2d6a4f);
  transition: width 0.2s;
}

/* Détail question */
.vis-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 16px;
  font-size: 14px;
  color: var(--accent, #2d6a4f);
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
}

.vis-detail-head {
  margin-bottom: 24px;
}

.vis-detail-head h1 {
  font-family: var(--font-d, "Source Serif 4", Georgia, serif);
  font-size: clamp(1.35rem, 2.5vw, 1.75rem);
  margin: 0 0 12px;
  line-height: 1.3;
}

.vis-detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  font-size: 14px;
  color: var(--ink-3, #6b6896);
}

.vis-section {
  margin-bottom: 28px;
}

.vis-section h2 {
  font-size: 1.1rem;
  margin: 0 0 12px;
  color: var(--ink, #1c1b2e);
}

.vis-phases {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.vis-phase {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px 16px;
  align-items: start;
  padding: 14px 16px;
  border: 1px solid var(--paper-3, #e3e0d8);
  border-radius: 10px;
  background: var(--white, #fffcf8);
}

.vis-phase.done {
  border-color: var(--accent-soft-2, #b7e4c7);
  background: #f8fdf9;
}

.vis-phase-num {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--accent-soft, #d8f3dc);
  color: var(--accent, #2d6a4f);
  font-size: 13px;
  font-weight: 700;
}

.vis-phase.done .vis-phase-num {
  background: var(--accent, #2d6a4f);
  color: #fff;
}

.vis-phase-body h3 {
  font-size: 15px;
  margin: 0 0 4px;
}

.vis-phase-body p {
  font-size: 14px;
  color: var(--ink-2, #3a3856);
  margin: 0;
}

.vis-phase-duree {
  font-size: 12px;
  color: var(--ink-3, #6b6896);
  white-space: nowrap;
}

.vis-phase-check {
  grid-column: 2 / -1;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  cursor: pointer;
}

.vis-corpus-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.vis-corpus-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  padding: 12px 14px;
  border: 1px solid var(--paper-3, #e3e0d8);
  border-radius: 8px;
  background: var(--white, #fffcf8);
}

.vis-corpus-item strong {
  font-size: 14px;
}

.vis-corpus-meta {
  font-size: 13px;
  color: var(--ink-3, #6b6896);
  flex: 1;
  min-width: 140px;
}

/* Extrait philosophique — lisibilité Terminale */
.vis-extrait {
  width: 100%;
  margin: 10px 0 4px;
  padding: 16px 18px 14px;
  border: none;
  border-left: 3px solid var(--accent-soft-2, #b7e4c7);
  border-radius: 0 10px 10px 0;
  background:
    linear-gradient(165deg, #faf7f1 0%, #f4f0e8 55%, #f7f3ec 100%);
  box-shadow: inset 0 1px 0 rgba(255, 252, 248, 0.8);
}

.vis-extrait-body {
  font-family: var(--font-d, "Source Serif 4", Georgia, "Times New Roman", serif);
  font-size: clamp(0.95rem, 2.2vw, 1.05rem);
  font-style: italic;
  font-weight: 500;
  line-height: 1.78;
  color: var(--ink, #1c1b2e);
  max-width: 62ch;
  text-wrap: pretty;
  hyphens: auto;
  -webkit-hyphens: auto;
}

.vis-extrait-p {
  margin: 0 0 0.95em;
  text-align: justify;
  text-justify: inter-word;
}

.vis-extrait-p:last-child {
  margin-bottom: 0;
}

.vis-extrait-oeuvre {
  display: block;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid color-mix(in srgb, var(--paper-3, #e3e0d8) 70%, transparent);
  font-family: var(--font-b, "Source Sans 3", sans-serif);
  font-size: 0.78rem;
  font-style: normal;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--ink-3, #6b6896);
  max-width: 62ch;
}

@media (max-width: 600px) {
  .vis-extrait {
    padding: 14px 14px 12px;
    border-radius: 0 8px 8px 0;
  }

  .vis-extrait-body {
    font-size: 0.98rem;
    line-height: 1.72;
    max-width: none;
    text-align: left;
  }

  .vis-extrait-p {
    text-align: left;
  }
}

.vis-corpus-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.vis-corpus-links a {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent, #2d6a4f);
  text-decoration: none;
  padding: 4px 10px;
  border: 1px solid var(--accent-soft-2, #b7e4c7);
  border-radius: 6px;
}

.vis-corpus-links a:hover {
  background: var(--accent-soft, #d8f3dc);
}

.vis-frise-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--accent-soft, #d8f3dc);
  color: var(--accent, #2d6a4f);
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
}

.vis-frise-link:hover {
  background: var(--accent-soft-2, #b7e4c7);
}

.vis-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.vis-chip {
  font-size: 13px;
  padding: 6px 12px;
  border-radius: 8px;
  background: var(--paper-2, #eeecea);
  color: var(--ink-2, #3a3856);
}

.vis-empty {
  text-align: center;
  color: var(--ink-3, #6b6896);
  padding: 48px 16px;
}

.vis-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  margin-top: 10px;
}

.vis-teacher-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 12px;
  margin-top: 14px;
}

.vis-nav a.is-active {
  color: var(--accent, #2d6a4f);
  font-weight: 700;
}

/* Phase panels */
.vis-phase.has-panel {
  grid-template-columns: auto 1fr auto;
}

.vis-phase.has-panel .vis-phase-body {
  grid-column: 2 / -1;
}

.vis-redaction-panel,
.vis-eval-panel,
.vis-fiche-panel,
.vis-carte-panel {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--paper-3, #e3e0d8);
}

.vis-panel-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
}

.vis-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Fiche auteurs */
.vis-fiche-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 -4px;
  padding: 0 4px;
}

.vis-fiche-table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
  font-size: 13px;
}

.vis-fiche-table th {
  text-align: left;
  font-weight: 600;
  padding: 6px 8px;
  border-bottom: 1px solid var(--paper-3, #e3e0d8);
  color: var(--ink-2, #3d3a5c);
  white-space: nowrap;
}

.vis-fiche-table td {
  padding: 4px 6px;
  vertical-align: middle;
  border-bottom: 1px solid var(--paper-3, #e3e0d8);
}

.vis-fiche-input,
.vis-carte-select {
  width: 100%;
  box-sizing: border-box;
  font-family: inherit;
  font-size: 13px;
  padding: 6px 8px;
  border: 1px solid var(--paper-3, #e3e0d8);
  border-radius: 6px;
  background: #fff;
}

.vis-fiche-input:focus,
.vis-carte-select:focus {
  outline: 2px solid var(--accent-soft-2, #b7e4c7);
  outline-offset: 1px;
}

.vis-fiche-num {
  max-width: 64px;
  text-align: center;
}

.vis-fiche-actions {
  width: 40px;
  text-align: center;
}

/* Carte notionnelle */
.vis-carte-visual {
  margin-bottom: 12px;
  padding: 12px;
  border-radius: 8px;
  background: var(--accent-soft, #d8f3dc);
  background: color-mix(in srgb, var(--accent-soft, #d8f3dc) 55%, #fff);
}

.vis-carte-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.vis-carte-chip {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--accent-soft-2, #b7e4c7);
  font-size: 13px;
  font-weight: 600;
  color: var(--accent, #2d6a4f);
}

.vis-carte-arrows {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.vis-carte-arrow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  font-size: 13px;
}

.vis-carte-arrow em {
  font-style: normal;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--accent, #2d6a4f);
  color: #fff;
}

.vis-carte-hint,
.vis-carte-empty {
  font-size: 13px;
  color: var(--ink-3, #6b6896);
  margin: 6px 0;
}

.vis-carte-cols {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 14px;
}

.vis-carte-block h4 {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 600;
}

.vis-carte-node-row,
.vis-carte-edge-row {
  display: grid;
  gap: 6px;
  margin-bottom: 8px;
  align-items: center;
}

.vis-carte-node-row {
  grid-template-columns: 1fr auto;
}

.vis-carte-edge-row {
  grid-template-columns: 1fr 1fr 1fr auto;
}

.vis-editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}

.vis-tb-btn {
  font-size: 13px;
  padding: 4px 10px;
  border: 1px solid var(--paper-3, #e3e0d8);
  border-radius: 6px;
  background: var(--white, #fffcf8);
  cursor: pointer;
  font-family: inherit;
}

.vis-tb-btn:hover {
  background: var(--accent-soft, #d8f3dc);
}

.vis-editor-sep {
  width: 1px;
  height: 20px;
  background: var(--paper-3, #e3e0d8);
  margin: 0 4px;
}

.vis-editor {
  min-height: 280px;
  max-height: 520px;
  overflow-y: auto;
  padding: 14px 16px;
  border: 1px solid var(--paper-3, #e3e0d8);
  border-radius: 8px;
  background: #fff;
  font-family: var(--font-d, "Source Serif 4", Georgia, serif);
  font-size: 15px;
  line-height: 1.65;
}

.vis-editor:empty::before {
  content: attr(data-placeholder);
  color: var(--ink-3, #6b6896);
  pointer-events: none;
}

.vis-editor:focus {
  outline: 2px solid var(--accent-soft-2, #b7e4c7);
  outline-offset: 1px;
}

.vis-editor-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 8px;
  font-size: 13px;
  color: var(--ink-3, #6b6896);
}

.vis-save-status.saving {
  color: var(--accent, #2d6a4f);
}

.vis-save-status.error {
  color: #b42318;
}

/* Grille évaluation */
.vis-eval-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 12px 0;
}

.vis-eval-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--paper-3, #e3e0d8);
  border-radius: 8px;
  background: var(--white, #fffcf8);
  font-size: 14px;
}

.vis-eval-select {
  font-family: inherit;
  font-size: 14px;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid var(--paper-3, #e3e0d8);
}

.vis-eval-total {
  font-size: 16px;
  padding: 12px;
  border-radius: 8px;
  background: var(--accent-soft, #d8f3dc);
  color: var(--accent, #2d6a4f);
}

/* Questions par texte */
.vis-corpus-item {
  flex-direction: column;
  align-items: stretch;
}

.vis-corpus-intro {
  margin-bottom: 14px;
  max-width: 68ch;
}

.vis-corpus-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  width: 100%;
}

.vis-corpus-item.optional {
  opacity: 0.88;
}

.vis-texte-questions {
  width: 100%;
  margin: 6px 0 4px;
  font-size: 14px;
}

.vis-texte-questions summary {
  cursor: pointer;
  color: var(--accent, #2d6a4f);
  font-weight: 600;
}

.vis-q-list {
  margin: 8px 0 8px 1.2rem;
  color: var(--ink-2, #3a3856);
}

.vis-note-label {
  display: block;
  font-size: 13px;
  color: var(--ink-3, #6b6896);
}

.vis-note-input {
  width: 100%;
  margin-top: 4px;
  padding: 8px 10px;
  border: 1px solid var(--paper-3, #e3e0d8);
  border-radius: 6px;
  font-family: inherit;
  font-size: 13px;
  resize: vertical;
}

.vis-cours-panel {
  margin-top: 10px;
  padding-top: 4px;
}

.vis-cours-panel .vis-note-label {
  margin-top: 10px;
}

.vis-cours-subhead {
  margin: 14px 0 4px;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-2, #3a3856);
}

.vis-plan-cours {
  margin-top: 16px;
  padding-top: 10px;
  border-top: 1px dashed var(--paper-3, #e3e0d8);
}

.vis-plan-cours summary {
  cursor: pointer;
  color: var(--accent, #2d6a4f);
  font-weight: 600;
  font-size: 14px;
}

/* Suivi professeur */
.vis-teacher-wrap {
  overflow-x: auto;
  margin-bottom: 32px;
}

.vis-teacher-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.vis-teacher-table th,
.vis-teacher-table td {
  padding: 10px 8px;
  border: 1px solid var(--paper-3, #e3e0d8);
  text-align: center;
  vertical-align: middle;
}

.vis-teacher-table th {
  background: var(--paper-2, #eeecea);
  font-weight: 600;
  white-space: nowrap;
}

.vis-teacher-table td:first-child {
  text-align: left;
  min-width: 140px;
}

.vis-td-q.has-work {
  background: #f0fdf4;
  font-weight: 600;
}

.vis-td-q.started {
  background: #fffbeb;
}

/* Portfolio */
.vis-portfolio-toc {
  margin-bottom: 28px;
  padding: 18px 20px;
  border: 1px solid var(--paper-3, #e3e0d8);
  border-radius: 12px;
  background: var(--white, #fffcf8);
}

.vis-portfolio-toc h2 {
  font-size: 1rem;
  margin: 0 0 12px;
}

.vis-portfolio-toc ol {
  margin: 0;
  padding-left: 1.4rem;
  line-height: 1.8;
}

.vis-toc-meta {
  font-size: 12px;
  color: var(--ink-3, #6b6896);
}

.vis-portfolio-chapter {
  margin-bottom: 36px;
  padding-bottom: 28px;
  border-bottom: 2px solid var(--paper-3, #e3e0d8);
}

.vis-portfolio-chapter header h2 {
  font-family: var(--font-d, "Source Serif 4", Georgia, serif);
  font-size: 1.35rem;
  margin: 4px 0 8px;
}

.vis-portfolio-q {
  font-size: 14px;
  color: var(--ink-3, #6b6896);
  font-style: italic;
  margin: 0 0 16px;
}

.vis-portfolio-body {
  font-family: var(--font-d, "Source Serif 4", Georgia, serif);
  line-height: 1.7;
  font-size: 15px;
}

.vis-portfolio-empty {
  color: var(--ink-3, #6b6896);
}

@media (max-width: 720px) {
  .vis-carte-cols {
    grid-template-columns: 1fr;
  }
  .vis-carte-edge-row {
    grid-template-columns: 1fr 1fr;
  }
  .vis-carte-edge-row .vis-tb-btn {
    grid-column: 2;
    justify-self: end;
  }
}

@media (max-width: 600px) {
  .vis-phase {
    grid-template-columns: auto 1fr;
  }
  .vis-phase-duree {
    grid-column: 2;
  }
  .vis-eval-row {
    grid-template-columns: 1fr;
  }
  .vis-teacher-table {
    font-size: 11px;
  }
  .vis-fiche-table {
    min-width: 560px;
  }
}
