:root {
  --ink: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  --paper: #f6f6f6;
  --card: #ffffff;
  --accent: #834bff;
  --accent-dark: #6b3acc;
  --accent-soft: #f1ebff;
  --warn: #b42318;
  --warn-soft: #fdecea;
  --bonus: #4b5563;
  --bonus-soft: #f3f4f6;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(900px 420px at 100% -10%, #e6dbff 0%, transparent 60%),
    var(--paper);
  color: var(--ink);
  font-family: var(--sans);
}

.export-banner,
.top,
.levels,
.toolbar,
.list-tools,
main {
  width: calc(100% - 40px);
  margin-inline: auto;
}

.top {
  display: flex;
  justify-content: space-between;
  gap: 32px;
  padding: 48px 0 20px;
}

.eyebrow {
  margin: 0 0 8px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.72rem;
  font-family: var(--sans);
  color: var(--accent);
}

h1 {
  margin: 0;
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 0.95;
}

.lede {
  max-width: 46ch;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.45;
}

.score {
  flex: 0 0 220px;
  box-shadow: 0 10px 25px -12px #834bff40;
  align-self: end;
  padding: 16px 18px 18px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
}

.score-value {
  margin: 0;
  font-size: 2.4rem;
  letter-spacing: -0.04em;
  line-height: 1;
}

.score-label {
  margin: 6px 0 12px;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.85rem;
}

.bar {
  height: 8px;
  overflow: hidden;
  background: #ece7f8;
  border-radius: 999px;
}

.bar span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--accent);
  border-radius: inherit;
  transition: width 180ms ease;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 8px;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filters button,
.reset {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 0.82rem;
  border-radius: 999px;
  padding: 7px 12px;
  cursor: pointer;
}

.filters button[aria-selected="true"] {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}

.reset:hover,
.filters button:hover {
  border-color: var(--accent);
}

.list-tools {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 0 4px;
}

.platform-label {
  margin: 0 0 8px;
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

.platform-filters button {
  font-size: 0.92rem;
  padding: 8px 14px;
}

.text-button {
  border: 0;
  background: transparent;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 0.85rem;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  padding: 8px 0;
}

main {
  display: grid;
  gap: 18px;
  padding: 12px 0 64px;
}

.group h2 {
  margin: 8px 0 10px;
  font-size: 1.15rem;
  font-weight: 600;
}

.item {
  display: block;
  padding: 14px 16px;
  margin-bottom: 8px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.item-head {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px 14px;
  align-items: center;
}

.disclosure {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.chevron {
  width: 0.45rem;
  height: 0.45rem;
  margin-left: 6px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(-45deg);
  flex: none;
}

.disclosure[aria-expanded="true"] .chevron {
  transform: rotate(45deg);
}

.details {
  margin: 8px 0 0 32px;
}

.item:has(.steps, .sections) {
  padding: 16px 18px 18px;
}

.item.done {
  background: #faf8ff;
  border-color: #ddd0ff;
}

.item.done .title {
  text-decoration: line-through;
  text-decoration-color: #b9a3f5;
}

.item input {
  accent-color: var(--accent);
}

.item-head > input {
  width: 18px;
  height: 18px;
  margin-top: 0;
}

.title {
  cursor: pointer;
}

.check-line {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.check-line input {
  width: 16px;
  height: 16px;
  margin-top: 3px;
  flex: none;
}

.check-line label {
  cursor: pointer;
}

.check-line .section-title,
.check-line .subsection-title,
.check-line .step-title,
.check-line .task {
  margin: 0;
}

.check-line.done .section-title,
.check-line.done .subsection-title,
.check-line.done .step-title,
.check-line.done .task {
  text-decoration: line-through;
  text-decoration-color: #b9a3f5;
}

.bullets li:has(> .check-line) {
  list-style: none;
}

.title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.title {
  font-family: var(--sans);
  font-size: 0.98rem;
  font-weight: 600;
}

.badge {
  font-family: var(--sans);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--warn-soft);
  color: var(--warn);
}

.badge-bloquant {
  background: var(--warn-soft);
  color: var(--warn);
}

.badge-important {
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.badge-bonus {
  background: var(--bonus-soft);
  color: var(--bonus);
}

.count {
  margin-left: auto;
  font-size: 0.78rem;
  color: var(--muted);
  white-space: nowrap;
}

.count:empty {
  display: none;
}

.count:empty + .badge {
  margin-left: auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 18px;
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.brand::before {
  content: "";
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
}

.why {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.4;
}

.kicker {
  font-family: var(--sans);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.kicker::after {
  content: " : ";
  letter-spacing: 0;
  font-weight: 500;
}

.objective {
  margin: 10px 0 0;
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.5;
}

.objective .kicker {
  color: var(--accent);
}

.steps {
  margin: 14px 0 0;
  padding-left: 1.35rem;
  display: grid;
  gap: 14px;
}

.steps > li::marker {
  font-family: var(--sans);
  font-weight: 600;
  color: var(--accent);
}

.step-title {
  margin: 0;
  font-family: var(--sans);
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.35;
}

.bullets {
  margin: 6px 0 0;
  padding-left: 1.2rem;
  list-style: disc;
}

.section > .bullets {
  margin-top: 2px;
}

.bullets li {
  margin: 5px 0;
  color: var(--ink);
  font-size: 0.98rem;
  line-height: 1.5;
}

.bullets li::marker {
  color: #8a8178;
}

.bullets li.intro {
  list-style: none;
  margin-left: -1.2rem;
}

.bullets .bullets {
  margin: 4px 0 2px;
  list-style: circle;
}

.sections {
  display: grid;
  gap: 0;
  margin: 16px 0 0;
}

.section + .section {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.section-title {
  margin: 0 0 8px;
  font-size: 1.08rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.25;
}

.section p {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 0.98rem;
  line-height: 1.5;
}

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

.subsections {
  display: grid;
  gap: 12px;
  margin-top: 10px;
}

.subsection-title {
  margin: 0 0 2px;
  font-family: var(--sans);
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.35;
}

.success {
  margin: 16px 0 0;
  padding: 12px 14px;
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  border-radius: 10px;
  color: var(--ink);
  font-size: 0.98rem;
  line-height: 1.5;
}

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

.step-intro,
.note-label,
.section .lead {
  margin: 8px 0 0;
  color: var(--ink);
  font-size: 0.98rem;
  line-height: 1.5;
}

.note-label,
.example-label {
  font-family: var(--sans);
  font-size: 0.88rem;
  font-weight: 600;
}

.example-label {
  margin: 12px 0 6px;
}

.snippet {
  margin: 8px 0 0;
  padding: 12px 14px;
  overflow: auto;
  background: #f3eee6;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.78rem;
  line-height: 1.45;
  white-space: pre;
}

.file-list {
  display: grid;
  gap: 8px;
  margin: 16px 0 0;
}

.file-block {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbf8f3;
}

.file-toggle {
  padding: 10px 12px;
}

.file-panel {
  padding: 0 12px 12px;
}

.file-note {
  margin: 0;
  color: var(--ink);
  font-size: 0.95rem;
  line-height: 1.45;
}

.file-link {
  display: inline-block;
  margin-top: 6px;
  color: var(--accent);
  font-family: var(--sans);
  font-size: 0.82rem;
}

.file-panel .snippet {
  max-height: 320px;
}

.table-scroll {
  margin-top: 10px;
  overflow-x: auto;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.compare {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
  font-size: 0.95rem;
  line-height: 1.4;
}

.compare th,
.compare td {
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}

.compare th {
  background: #f3eee6;
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.compare tr:last-child td {
  border-bottom: 0;
}

.compare td:first-child {
  font-family: var(--sans);
  font-weight: 600;
  white-space: nowrap;
}

.compare .check-line {
  align-items: center;
}

@media (max-width: 720px) {
  .list-tools {
    flex-direction: column;
    align-items: stretch;
  }
}

.empty {
  color: var(--muted);
}

@media (max-width: 720px) {
  .top {
    flex-direction: column;
    gap: 20px;
    padding-top: 28px;
  }

  .score {
    flex-basis: auto;
    width: 100%;
  }

  .toolbar {
    flex-direction: column;
    align-items: stretch;
  }
}


/* Disposition : liste à gauche, détail à droite */
.layout {
  display: grid;
  grid-template-columns: minmax(280px, 360px) 1fr;
  gap: 20px;
  align-items: start;
}

.nav {
  position: sticky;
  top: 16px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  padding: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
}

.nav h2 {
  margin: 6px 8px 8px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid transparent;
}

.nav-item:hover {
  background: #faf8ff;
}

.nav-item.active {
  background: var(--accent-soft);
  border-color: #d9c9ff;
}

.nav-item input {
  width: 16px;
  height: 16px;
  flex: none;
  accent-color: var(--accent);
}

.nav-button {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.nav-button .title {
  font-size: 0.9rem;
  line-height: 1.3;
}

.nav-meta,
.panel-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-meta .count,
.panel-meta .count {
  margin-left: 0;
}

.nav-item.done .title {
  text-decoration: line-through;
  text-decoration-color: #b9a3f5;
  color: var(--muted);
}

.panel {
  min-width: 0;
  padding: 24px 28px 32px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
}

.panel-head {
  padding-bottom: 14px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--line);
}

.panel-head h2 {
  margin: 0 0 8px;
  font-size: 1.6rem;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.panel-meta {
  margin: 0;
}

.panel .details {
  margin: 0;
}

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

  .nav {
    position: static;
    max-height: 50vh;
  }

  .panel {
    padding: 18px 16px 24px;
  }
}


/* Vue simplifiée */
.simple-block {
  margin-top: 18px;
}

.simple-block h3 {
  margin: 0 0 8px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}

.simple-block .check-line {
  padding: 6px 0;
}

.simple-block .task {
  font-size: 1rem;
  line-height: 1.5;
}

.done-block p {
  margin: 0;
  padding: 12px 14px;
  background: #ecfdf3;
  border: 1px solid #c6f0d6;
  border-radius: 10px;
  color: #065f46;
  line-height: 1.5;
}

.blocked-block h3 {
  color: var(--warn);
}

.advanced {
  margin-top: 24px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.advanced summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--muted);
}

.advanced input[type="checkbox"] {
  display: none;
}

.time {
  font-size: 0.8rem;
  color: var(--muted);
}


/* Vue agent IA */
.agent-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
}

.agent-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.copy-button {
  flex: none;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
}

.copy-button:hover {
  background: var(--accent-dark);
}

.panel-head .copy-button {
  margin-top: 10px;
  background: transparent;
  color: var(--accent-dark);
}

.agent-pre {
  margin: 14px 0 0;
  padding: 18px;
  background: #111827;
  color: #e5e7eb;
  border-radius: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.85rem;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}


/* Mode édition */
.edit-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.copy-button.ghost {
  background: transparent;
  color: var(--accent-dark);
}

.copy-button.ghost:hover {
  background: var(--accent-soft);
}

.edit-field {
  display: grid;
  gap: 6px;
  margin-top: 16px;
}

.edit-field span {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.edit-field textarea,
.edit-field input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font: inherit;
  font-size: 0.95rem;
  line-height: 1.5;
  resize: vertical;
}

.edit-field textarea:focus,
.edit-field input:focus {
  outline: 2px solid var(--accent-soft);
  border-color: var(--accent);
}

.edit-field small {
  color: var(--muted);
}

.edit-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 18px;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  max-width: 360px;
  padding: 12px 16px;
  background: var(--ink);
  color: #fff;
  border-radius: 12px;
  font-size: 0.9rem;
  box-shadow: 0 10px 25px -10px #0006;
  z-index: 10;
}

textarea.agent-pre {
  display: block;
  width: 100%;
  min-height: 300px;
  border: 0;
  resize: none;
  overflow: hidden;
}

textarea.agent-pre:focus {
  outline: 2px solid var(--accent);
}

.agent-status {
  margin: 8px 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.nav-item.sub {
  margin-left: 18px;
  padding-left: 10px;
  border-left: 2px solid #e6dbff;
  border-radius: 0 10px 10px 0;
}

/* Exemples et modèles dans la vue « À faire » */
.example-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.example-head .example-label {
  margin: 0;
  font-weight: 600;
}

.example-block .snippet {
  max-height: 420px;
}

.files-block .file-list {
  margin-top: 8px;
}

.file-tools {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

a.copy-button {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

/* Niveaux du playbook */
.levels {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 4px 0 18px;
}

.levels button {
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 600;
  border-radius: 14px;
  padding: 12px 18px;
  cursor: pointer;
}

.levels button:hover {
  border-color: var(--accent);
}

.levels button[aria-selected="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.lede-help {
  font-size: 0.92rem;
}

@media (max-width: 640px) {
  .levels button {
    flex: 1 1 100%;
    text-align: left;
  }
}

/* Export temporaire de toutes les règles */
.export-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding-top: 20px;
}

.export-banner p {
  margin: 0;
  max-width: 60ch;
  color: var(--muted);
  font-size: 0.9rem;
}

.export-all {
  border: 0;
  background: var(--accent);
  color: #ffffff;
  font: inherit;
  font-size: 1.1rem;
  font-weight: 700;
  padding: 16px 26px;
  border-radius: 14px;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(124, 58, 237, 0.25);
}

.export-all:hover {
  background: var(--accent-dark);
}

.export-all:disabled {
  opacity: 0.7;
  cursor: progress;
}

/* Étapes « question » : Si oui / Si non */
.question .task > label {
  font-weight: 600;
}

.branches {
  margin: 6px 0 2px;
}

.branch {
  margin-top: 4px;
}

.branch-line,
.branch-more {
  margin: 0;
  font-weight: 400;
  line-height: 1.45;
}

.branch-line {
  padding-left: 1.6em;
  text-indent: -1.6em;
}

.branch-more {
  padding-left: 1.6em;
  margin-top: 2px;
}

.branch-mark {
  display: inline-block;
  width: 1.6em;
  text-indent: 0;
  font-weight: 700;
}

.branch-oui .branch-mark {
  color: #15803d;
}

.branch-non .branch-mark {
  color: #c2410c;
}

.branch .branches {
  margin-left: 1.6em;
}

/* Questions à choix : on clique Oui ou Non, seul le chemin choisi s'affiche */
.choices {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.choice {
  border: 1px solid var(--line);
  background: #ffffff;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 7px 16px;
  border-radius: 999px;
  cursor: pointer;
}

.choice-oui {
  color: #15803d;
}

.choice-non {
  color: #c2410c;
}

.choice-oui:hover {
  border-color: #16a34a;
  background: #f0fdf4;
}

.choice-non:hover {
  border-color: #ea580c;
  background: #fff7ed;
}

.choice-change {
  border: 0;
  background: none;
  padding: 0;
  color: var(--muted);
  font: inherit;
  font-size: 0.8rem;
  text-decoration: underline;
  cursor: pointer;
}

/* Étape en cours (comme une recette) */
.simple-block > .check-line.current {
  background: #f5f0ff;
  border-radius: 10px;
  box-shadow: inset 3px 0 0 var(--accent);
  padding-top: 8px;
  padding-bottom: 8px;
  margin-left: -10px;
  padding-left: 10px;
}

.simple-block > .check-line.upcoming {
  opacity: 0.5;
}

.simple-block > .check-line.upcoming:hover {
  opacity: 0.85;
}

/* « C'est réglé quand » / « Si ça bloque » en onglets */
.outcome-tablist {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--line);
}

.outcome-tab {
  border: 0;
  border-bottom: 3px solid transparent;
  background: none;
  margin-bottom: -1px;
  padding: 8px 12px;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  cursor: pointer;
}

.outcome-tab-done[aria-selected="true"] {
  color: #047857;
  border-bottom-color: #10b981;
}

.outcome-tab-blocked[aria-selected="true"] {
  color: var(--warn);
  border-bottom-color: var(--warn);
}

.outcome-panel {
  padding-top: 12px;
}

.outcome-panel.blocked-block .bullets {
  margin: 0;
}

.outcome-tab-details[aria-selected="true"] {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.outcome-tablist {
  flex-wrap: wrap;
}

.details-block > .advanced-panel > :first-child {
  margin-top: 0;
}

.check-line input:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

/* Toute la largeur, en colonnes : Étapes → Sous-étapes → Points → Contenu */
.levels,
#filters {
  display: none;
}

.toolbar {
  justify-content: flex-end;
}

.layout {
  grid-template-columns: minmax(170px, 210px) minmax(200px, 250px) minmax(240px, 320px) minmax(0, 1fr);
  gap: 14px;
}

.col {
  padding: 10px;
}

.col-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  margin-top: 4px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.3;
  text-align: left;
  cursor: pointer;
}

.col-item:hover {
  background: #faf8ff;
}

.col-item.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.col-count {
  flex: none;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
}

.col-item.active .col-count {
  color: rgba(255, 255, 255, 0.85);
}

.col-item.done:not(.active) .col-title {
  color: var(--muted);
}

.col-item.done .col-count::before {
  content: "✔ ";
}

.col-points .nav-item.sub {
  margin-left: 0;
}

@media (max-width: 1280px) {
  .layout {
    grid-template-columns: minmax(170px, 200px) minmax(220px, 280px) minmax(0, 1fr);
  }

  .layout > .col:nth-child(1),
  .layout > .col:nth-child(2) {
    grid-column: 1 / -1;
    position: static;
    max-height: none;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
  }

  .layout > .col:nth-child(1) h2,
  .layout > .col:nth-child(2) h2 {
    width: 100%;
    margin-bottom: 2px;
  }

  .layout > .col:nth-child(1) .col-item,
  .layout > .col:nth-child(2) .col-item {
    width: auto;
    margin-top: 0;
  }

  .layout > .col-points {
    grid-column: 1 / 2;
  }

  .layout > .panel {
    grid-column: 2 / -1;
  }
}

@media (max-width: 860px) {
  .layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .layout > .col-points,
  .layout > .panel {
    grid-column: 1 / -1;
  }
}

/* =====================================================================
   Habillage « application » (inspiré de la référence Dribbble de Jordan)
   Barre du haut · menu à gauche · cartes à droite, sur fond dégradé.
   ===================================================================== */
:root {
  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e7e9ef;
  --pill: #0f172a;
  --soft: #f4f5f8;
}

body {
  background: linear-gradient(135deg, #dcd0ff 0%, #e9e4ff 35%, #d6ecff 100%) fixed;
  font-size: 15px;
}

.app {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 32px);
  margin: 16px;
  background: #ffffff;
  border: 6px solid rgba(255, 255, 255, 0.55);
  border-radius: 28px;
  box-shadow: 0 30px 80px rgba(76, 29, 149, 0.12);
  background-clip: padding-box;
  overflow: clip;
}

/* Barre du haut */
.appbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  padding: 14px 24px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.logo-mark {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: linear-gradient(135deg, #834bff, #5b8cff);
  flex: none;
}

.appbar .brand {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-sub {
  padding-left: 10px;
  border-left: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
  white-space: nowrap;
}

.appbar .levels {
  display: flex !important;
  gap: 6px;
  padding: 0;
  width: auto;
  margin: 0;
}

.appbar .levels button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  padding: 10px 18px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
}

.appbar .levels button:hover {
  color: var(--ink);
  background: var(--soft);
}

.appbar .levels button[aria-selected="true"] {
  background: var(--soft);
  color: var(--ink);
  font-weight: 600;
}

.appbar-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
}

.segmented {
  display: inline-flex;
  padding: 3px;
  background: var(--soft);
  border-radius: 999px;
}

.segmented button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 7px 14px;
  border-radius: 999px;
  cursor: pointer;
}

.segmented button[aria-selected="true"] {
  background: #ffffff;
  color: var(--ink);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12);
}

.appbar .export-all {
  font-size: 0.85rem;
  font-weight: 600;
  padding: 9px 16px;
  border-radius: 10px;
  box-shadow: none;
}

/* Corps : menu à gauche, contenu à droite */
.app-body {
  flex: 1;
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px 16px;
  border-right: 1px solid var(--line);
}

#sidebar-nav .nav {
  position: static;
  max-height: none;
  overflow: visible;
  padding: 0;
  background: none;
  border: 0;
  border-radius: 0;
}

#sidebar-nav .nav h2 {
  margin: 18px 10px 6px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink);
}

#sidebar-nav .nav h2:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

#sidebar-nav .nav-item,
#sidebar-nav .nav-item.sub {
  margin: 2px 0;
  padding: 9px 12px;
  gap: 10px;
  border: 0;
  border-radius: 10px;
}

#sidebar-nav .nav-item:hover {
  background: var(--soft);
}

#sidebar-nav .nav-item.active {
  background: var(--pill);
  color: #ffffff;
}

#sidebar-nav .nav-item input {
  appearance: none;
  width: 16px;
  height: 16px;
  margin: 0;
  border: 1.5px solid #94a3b8;
  border-radius: 50%;
  display: grid;
  place-content: center;
  cursor: pointer;
}

#sidebar-nav .nav-item input:checked {
  background: var(--accent);
  border-color: var(--accent);
}

#sidebar-nav .nav-item input:checked::after {
  content: "";
  width: 6px;
  height: 3px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg) translate(0.5px, -0.5px);
}

#sidebar-nav .nav-item.active input {
  border-color: rgba(255, 255, 255, 0.7);
}

#sidebar-nav .nav-button {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

#sidebar-nav .nav-button .title {
  font-size: 0.9rem;
  font-weight: 500;
}

#sidebar-nav .nav-meta .badge {
  display: none;
}

#sidebar-nav .nav-meta .count {
  font-size: 0.75rem;
  color: var(--muted);
  white-space: nowrap;
}

#sidebar-nav .nav-item.active .count {
  color: rgba(255, 255, 255, 0.7);
}

#sidebar-nav .nav-item.done .title {
  color: var(--muted);
}

#sidebar-nav .nav-item.active.done .title {
  color: rgba(255, 255, 255, 0.75);
}

/* Bloc de progression (comme « Complete your intro ») */
.progress-card {
  margin-top: auto;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fbfaff;
}

.progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.progress-title {
  margin: 0;
  font-weight: 600;
  font-size: 0.9rem;
}

.ring {
  --p: 0;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: conic-gradient(var(--accent) calc(var(--p) * 1%), #e9e4ff 0);
  -webkit-mask: radial-gradient(circle 11px, transparent 98%, #000 100%);
  mask: radial-gradient(circle 11px, transparent 98%, #000 100%);
  flex: none;
}

.ring span {
  display: none;
}

.progress-card .score-value {
  margin: 10px 0 0;
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.progress-card .score-label {
  margin: 2px 0 12px;
  color: var(--muted);
  font-size: 0.85rem;
}

.progress-card .reset {
  width: 100%;
  border: 1px solid var(--line);
  background: #ffffff;
  border-radius: 10px;
  padding: 8px 12px;
  font: inherit;
  font-size: 0.85rem;
  color: var(--muted);
  cursor: pointer;
}

/* Contenu : carte d'en-tête puis carte de contenu */
#list {
  width: auto;
  margin: 0;
  padding: 20px 24px 32px;
  background: #fbfbfd;
}

#list.layout {
  display: block;
}

#list .panel {
  padding: 0;
  background: none;
  border: 0;
  border-radius: 0;
}

#list .panel-head {
  padding: 26px 28px 0;
  margin: 0 0 16px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 18px;
}

#list .panel-head h2 {
  margin: 10px 0 6px;
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.panel-objective {
  margin: 0 0 12px;
  max-width: 90ch;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.55;
}

#list .panel-meta {
  color: var(--muted);
  font-size: 0.9rem;
}

#list .panel-head > .panel-meta {
  margin-bottom: 4px;
}

#list .panel-objective {
  margin-top: 4px;
}

.badge {
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: capitalize;
  padding: 3px 8px;
}

.tabs-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.tabs-row .outcome-tablist {
  border-bottom: 0;
  gap: 28px;
  flex-wrap: wrap;
}

.tabs-row .outcome-tab {
  padding: 12px 2px 14px;
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: var(--muted);
  border-bottom-width: 3px;
}

.tabs-row .outcome-tab[aria-selected="true"] {
  color: var(--ink);
  font-weight: 600;
  border-bottom-color: var(--accent);
}

.platform-select {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.85rem;
}

.platform-select select {
  appearance: none;
  border: 1px solid var(--line);
  background: #ffffff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%230f172a' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center;
  border-radius: 10px;
  padding: 9px 36px 9px 14px;
  font: inherit;
  font-size: 0.9rem;
  color: var(--ink);
  cursor: pointer;
}

#list .details {
  padding: 24px 28px 28px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 18px;
}

#list .details > .outcome-tabs {
  margin-top: 0;
}

#list .outcome-panel {
  padding-top: 0;
}

#list .todo-block > .simple-block:first-child {
  margin-top: 0;
}

#list .simple-block h3 {
  color: var(--muted);
}

/* Le menu et le contenu défilent chacun de leur côté, comme une application */
@media (min-width: 761px) {
  body {
    overflow: hidden;
  }

  .app {
    height: calc(100vh - 32px);
  }

  .app-body {
    min-height: 0;
  }

  .sidebar,
  #list {
    overflow-y: auto;
    min-height: 0;
  }

  .sidebar {
    scrollbar-width: thin;
  }
}

/* Petits écrans */
@media (max-width: 1100px) {
  .appbar {
    grid-template-columns: 1fr;
    justify-items: start;
  }

  .appbar-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .app-body {
    grid-template-columns: 240px minmax(0, 1fr);
  }
}

@media (max-width: 760px) {
  .app {
    margin: 0;
    border: 0;
    border-radius: 0;
  }

  .appbar {
    position: static;
    padding: 12px 16px;
  }

  .appbar .levels {
    flex-wrap: wrap;
  }

  .app-body {
    grid-template-columns: minmax(0, 1fr);
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    max-height: 55vh;
    overflow-y: auto;
  }

  .progress-card {
    margin-top: 0;
  }

  #list {
    padding: 16px;
  }

  #list .panel-head,
  #list .details {
    padding-left: 16px;
    padding-right: 16px;
  }

  .tabs-row .outcome-tablist {
    gap: 16px;
  }
}

/* Logo officiel (même fichier que sitegrow.co) */
.brand-logo {
  display: block;
  height: 30px;
  width: auto;
}

/* Question de confirmation d'accès */
.check-line.confirm > input.locked {
  cursor: not-allowed;
}

.check-line.confirm.refused > .task > label {
  color: #c2410c;
}

/* % de complétion dans les pilules d'étape */
.appbar .levels button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.level-pct {
  padding: 2px 8px;
  border-radius: 999px;
  background: #ece6ff;
  color: var(--accent-dark);
  font-size: 0.75rem;
  font-weight: 700;
}

.level-pct.full {
  background: #dcfce7;
  color: #15803d;
}

/* Sélecteur de mois dans la barre du haut */
.appbar .levels {
  align-items: center;
}

.month-nav {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-right: 8px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
}

.appbar .levels .month-arrow {
  width: 30px;
  height: 30px;
  padding: 0;
  justify-content: center;
  font-size: 1.1rem;
  line-height: 1;
  color: var(--ink);
}

.appbar .levels .month-arrow:disabled {
  color: #cbd5e1;
  cursor: default;
  background: transparent;
}

.month-label {
  min-width: 64px;
  text-align: center;
  font-weight: 700;
  font-size: 0.9rem;
}

@media (max-width: 1100px) {
  .appbar .levels {
    flex-wrap: wrap;
  }
}

/* Bloc de progression : flottant en bas à droite (toujours visible) */
@media (min-width: 761px) {
  .progress-card {
    position: fixed;
    right: 40px;
    bottom: 40px;
    z-index: 6;
    width: 250px;
    margin: 0;
    padding: 14px 16px;
    background: #ffffff;
    box-shadow: 0 18px 40px rgba(76, 29, 149, 0.18);
  }

  .progress-card .score-value {
    margin-top: 6px;
    font-size: 1.6rem;
  }

  .progress-card .score-label {
    margin-bottom: 10px;
  }

  #list {
    padding-bottom: 200px;
  }
}

.segmented button,
.appbar .export-all,
.appbar .levels button {
  white-space: nowrap;
}

.appbar {
  grid-template-columns: auto 1fr auto;
}

.appbar .levels {
  justify-content: center;
}

/* Deux barres sous la barre du haut : les mois, puis les étapes du mois */
.appbar {
  grid-template-columns: 1fr auto;
}

.bars {
  display: grid;
  gap: 8px;
  padding: 12px 24px;
  border-bottom: 1px solid var(--line);
  background: #fcfbff;
}

.bar-row {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.bar-label {
  flex: none;
  width: 56px;
  margin: 0;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.month-bar {
  display: flex;
  gap: 8px;
  min-width: 0;
  overflow-x: auto;
  padding: 2px 2px 4px;
  scrollbar-width: thin;
}

.month-chip {
  flex: none;
  display: grid;
  grid-template-columns: auto auto;
  justify-content: space-between;
  gap: 2px 10px;
  min-width: 104px;
  padding: 8px 12px 9px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.month-chip:hover {
  border-color: #c9b6ff;
}

.month-chip.active {
  background: var(--pill);
  border-color: var(--pill);
  color: #ffffff;
}

.month-name {
  font-size: 0.85rem;
  font-weight: 600;
}

.month-pct {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent);
}

.month-chip.active .month-pct {
  color: #d9c9ff;
}

.month-chip.full .month-pct {
  color: #15803d;
}

.month-track {
  grid-column: 1 / -1;
  height: 4px;
  border-radius: 999px;
  background: #ece6ff;
  overflow: hidden;
}

.month-chip.active .month-track {
  background: rgba(255, 255, 255, 0.2);
}

.month-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.month-chip.full .month-track span {
  background: #16a34a;
}

.step-bar,
.bars .levels {
  display: flex !important;
  flex-wrap: wrap;
  gap: 6px;
  width: auto;
  margin: 0;
  padding: 0;
}

.bars .levels button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--muted);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
}

.bars .levels button:hover {
  color: var(--ink);
  border-color: #c9b6ff;
}

.bars .levels button[aria-selected="true"] {
  background: var(--soft);
  border-color: #c9b6ff;
  color: var(--ink);
  font-weight: 600;
}

@media (max-width: 760px) {
  .bars {
    padding: 10px 16px;
  }

  .bar-row {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }

  .bar-label {
    width: auto;
  }
}

.month-chip {
  flex: 1 1 0;
  min-width: 86px;
  padding: 7px 10px 8px;
}

.month-track {
  height: 5px;
  background: #e2d9fb;
}

.month-name,
.month-pct {
  white-space: nowrap;
}

/* Barres Mois et Étapes dans la colonne de droite, au-dessus du contenu */
.main-col {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

.main-col .bars {
  padding: 16px 24px 12px;
  background: #fbfbfd;
  border-bottom: 1px solid var(--line);
}

.main-col #list {
  flex: 1;
}

@media (min-width: 761px) {
  .main-col #list {
    overflow-y: auto;
    min-height: 0;
  }
}

/* Carrousel des mois */
.month-slider {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex: 1;
}

.month-slider .month-bar {
  flex: 1;
  scroll-behavior: smooth;
  scrollbar-width: none;
}

.month-slider .month-bar::-webkit-scrollbar {
  display: none;
}

.month-slider .month-chip {
  flex: none;
  min-width: 100px;
}

.slide-arrow {
  display: none;
  flex: none;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}

.slide-arrow:hover:not(:disabled) {
  border-color: #c9b6ff;
}

.slide-arrow:disabled {
  color: #cbd5e1;
  cursor: default;
}

.month-slider.overflow .slide-arrow {
  display: inline-grid;
  place-items: center;
}
