/* ============================================
   scope-tool — base styles
   Sober, monochrome, info-dense layout for an
   animation tool. No decorative colors beyond
   status (badges + toggles).
   ============================================ */

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: #1a1a1a;
  background: #f6f6f6;
}

/* Default drawer width — overridable at runtime via JS (drag-to-resize). */
:root { --drawer-width: 640px; }

/* Topbar + counter-bar are FIXED full-viewport so the drawer never pushes them.
   Body gets a top-padding equal to --header-bottom (set by App.updateHeaderBottom)
   so .page starts flush against the counter-bar regardless of its wrap state. */
body { padding-top: var(--header-bottom, 95px); }

/* When the méthodologie drawer is open, push only the page content (which is
   in body's normal flow) to the left. Topbar/counter-bar are fixed → unaffected.
   Help drawer (left side) pushes content to the right via padding-left. */
body { transition: padding-right 0.25s cubic-bezier(0.2, 0.9, 0.3, 1),
                  padding-left  0.25s cubic-bezier(0.2, 0.9, 0.3, 1); }
body.drawer-open       { padding-right: var(--drawer-width); }
body.help-drawer-open  { padding-left:  var(--drawer-width); }
body.drawer-resizing { transition: none; }   /* disable transition during drag */
body.drawer-resizing,
body.drawer-resizing * { user-select: none; cursor: col-resize !important; }

a { color: inherit; text-decoration: none; }

/* ----- Topbar ----- */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 0 24px;
  height: 56px;
  background: #1a1a1a;
  color: #fff;
  border-bottom: 1px solid #000;
}

.topbar .brand {
  font-weight: 700;
  letter-spacing: 0.02em;
  font-size: 14px;
  text-transform: uppercase;
}

.topbar .brand small {
  display: block;
  font-size: 11px;
  font-weight: 400;
  opacity: 0.65;
  letter-spacing: 0;
  text-transform: none;
}

.topbar .nav {
  display: flex;
  gap: 4px;
  margin-left: auto;
}

.topbar .nav a {
  padding: 6px 14px;
  border-radius: 4px;
  font-size: 13px;
  color: rgba(255,255,255,0.75);
  transition: background 0.15s, color 0.15s;
}

.topbar .nav a:hover,
.topbar .nav a.active,
.topbar .nav .nav-btn:hover {
  background: rgba(255,255,255,0.08);
  color: #fff;
}

.topbar .nav .nav-btn {
  padding: 6px 14px;
  border-radius: 4px;
  font-size: 13px;
  color: rgba(255,255,255,0.75);
  background: transparent;
  border: none;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.topbar .reset-btn {
  margin-left: 16px;
  padding: 6px 12px;
  font-size: 12px;
  border: 1px solid rgba(255,255,255,0.25);
  background: transparent;
  color: rgba(255,255,255,0.85);
  border-radius: 4px;
  cursor: pointer;
}

.topbar .reset-btn:hover {
  background: rgba(255,255,255,0.08);
  color: #fff;
}

/* Help CTA button in the topbar (dark theme variant) */
.topbar .nav-help {
  margin-left: 4px;
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 4px;
  padding: 6px 12px;
  font-size: 12px;
}

.topbar .nav-help.is-active {
  background: #fff;
  color: #1a1a1a;
  border-color: #fff;
}

/* Inner content of the help drawer body (pre/code/ol etc.) */
.drawer-body.help-drawer-body pre.help-tree {
  background: #f6f6f6;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  padding: 12px 14px;
  font-size: 12px;
  line-height: 1.5;
  overflow-x: auto;
  color: #333;
  margin: 8px 0 12px;
}

.drawer-body.help-drawer-body code {
  background: #f6f6f6;
  border: 1px solid #e0e0e0;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 12px;
}

.drawer-body.help-drawer-body ol {
  margin: 8px 0 12px 20px;
  padding: 0;
  font-size: 13px;
}

.drawer-body.help-drawer-body li {
  margin-bottom: 8px;
  line-height: 1.55;
}

/* ----- Counter bar (fixed under topbar) ----- */
.counter-bar {
  position: fixed;
  top: 56px;
  left: 0;
  right: 0;
  z-index: 90;
  background: #fff;
  border-bottom: 1px solid #e0e0e0;
  padding: 8px 24px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 18px;
  font-size: 13px;
  flex-wrap: wrap;
}

.counter-bar .counter-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding-right: 18px;
  border-right: 1px solid #ececec;
}
.counter-bar .counter-group:last-child { border-right: 0; padding-right: 0; }

.counter-bar .counter-group .lvl {
  color: #444;
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-right: 4px;
}
.counter-bar .counter-group .lvl-total {
  color: #999;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  margin-left: 2px;
}

.counter-bar .count {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 12px;
}

.counter-bar .count .num { font-variant-numeric: tabular-nums; }
.counter-bar .count.mvp    { background: #e6f4ea; color: #1e7a36; }
.counter-bar .count.vnext  { background: #f1f3f5; color: #555; }
.counter-bar .count.out    { background: #fbe9e7; color: #b13a23; }

/* ----- Page layout ----- */
.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px 80px;
}

.page-header {
  margin-bottom: 32px;
}

.page-header h1 {
  margin: 0 0 8px;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.page-header .subtitle {
  margin: 0;
  color: #666;
  font-size: 15px;
}

.page-header .meta {
  margin-top: 12px;
  font-size: 12px;
  color: #888;
}

h2 {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.005em;
  margin: 32px 0 12px;
}

h3 {
  font-size: 15px;
  font-weight: 700;
  margin: 18px 0 8px;
}

p { margin: 0 0 12px; }

ul { margin: 0 0 12px; padding-left: 20px; }
li { margin-bottom: 4px; }

/* ----- Cards ----- */
.card {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  padding: 20px;
  margin-bottom: 16px;
}

.card h2:first-child,
.card h3:first-child { margin-top: 0; }

/* ----- Démarche grid ----- */
.demarche {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 24px 0 32px;
}

.demarche .step {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  padding: 16px;
  position: relative;
}

.demarche .step .num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: #1a1a1a;
  color: #fff;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 8px;
}

.demarche .step h3 {
  margin: 0 0 6px;
  font-size: 14px;
}

.demarche .step p {
  margin: 0 0 8px;
  font-size: 12px;
  color: #666;
}

.demarche .step .step-link {
  background: transparent;
  border: none;
  padding: 0;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  color: #1a1a1a;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.demarche .step .step-link:hover { color: #000; }

/* ----- Epic grid (index page) ----- */
.epics-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 24px;
}

.epic-card {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  padding: 20px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
  text-decoration: none;
  color: inherit;
  display: block;
}

.epic-card:hover {
  border-color: #1a1a1a;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  transform: translateY(-1px);
}

.epic-card .epic-id {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #888;
  text-transform: uppercase;
}

.epic-card h3 {
  margin: 4px 0 10px;
  font-size: 17px;
  line-height: 1.3;
}

.epic-card .epic-actors {
  margin: 0 0 10px;
}

.epic-head .epic-actors {
  margin: 4px 0 12px;
}

.epic-card .desc {
  font-size: 13px;
  color: #555;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.epic-card .epic-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: #666;
  border-top: 1px solid #f0f0f0;
  padding-top: 10px;
}

.epic-card .epic-foot .left {
  display: flex;
  gap: 12px;
}

/* ----- Epic page header ----- */
.epic-head {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  padding: 24px;
  margin-bottom: 20px;
}

.epic-head .epic-id {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #888;
  text-transform: uppercase;
}

.epic-head h1 {
  margin: 4px 0 12px;
  font-size: 24px;
}

.epic-head .epic-toggle-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #f0f0f0;
}

.epic-head .epic-toggle-row .label {
  font-size: 12px;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

/* ----- Feature accordion ----- */
.feature {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  margin-bottom: 12px;
  overflow: hidden;
}

.feature-head {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  cursor: pointer;
  user-select: none;
}

.feature-head:hover {
  background: #fafafa;
}

.feature-head .chevron {
  font-size: 12px;
  color: #888;
  transition: transform 0.15s;
}

.feature.open .feature-head .chevron {
  transform: rotate(90deg);
}

.feature-head .feature-id {
  font-size: 11px;
  font-weight: 700;
  color: #888;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  min-width: 50px;
}

.feature-head .feature-title {
  flex: 1;
  font-weight: 600;
  font-size: 15px;
}

.feature-head .ucs-count {
  font-size: 12px;
  color: #888;
}

/* Clickable UC complexity badge — inherits .complexity-badge style */
.uc-complexity-badge {
  cursor: pointer;
  user-select: none;
  transition: transform 0.1s, box-shadow 0.1s;
}
.uc-complexity-badge:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}
/* Auto-derived (from spec signals): subtle dashed border */
.uc-complexity-badge.is-auto {
  border-style: dashed !important;
  opacity: 0.85;
}
/* Manual override: solid + small bullet appended in JS */
.uc-complexity-badge.is-manual {
  font-weight: 800;
}

/* ----- Complexity picker popover ----- */
.complexity-picker {
  position: absolute;
  z-index: 1200;
  background: #fff;
  border: 1px solid #d8d8d8;
  border-radius: 10px;
  padding: 10px 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
  min-width: 200px;
  font-size: 13px;
}

.complexity-picker-title {
  font-size: 11px;
  font-weight: 600;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.complexity-picker-row {
  display: flex;
  gap: 4px;
  margin-bottom: 8px;
}

.complexity-picker .complexity-pick {
  flex: 1;
  padding: 6px 0;
  border: 1px solid #d8d8d8;
  border-radius: 6px;
  background: #fff;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.1s, border-color 0.1s, color 0.1s;
}

.complexity-picker .complexity-pick:hover {
  border-color: #1a1a1a;
}

.complexity-picker .complexity-pick[data-tshirt="S"]  { color: #1862a8; }
.complexity-picker .complexity-pick[data-tshirt="M"]  { color: #8a6300; }
.complexity-picker .complexity-pick[data-tshirt="L"]  { color: #a03e00; }
.complexity-picker .complexity-pick[data-tshirt="XL"] { color: #9a1010; }

.complexity-picker .complexity-pick[aria-pressed="true"] {
  background: #1a1a1a;
  color: #fff;
  border-color: #1a1a1a;
}

.complexity-picker .complexity-pick-auto {
  width: 100%;
  padding: 6px 10px;
  border: 1px solid #d8d8d8;
  border-radius: 6px;
  background: #fff;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  color: #555;
  cursor: pointer;
}

.complexity-picker .complexity-pick-auto:hover {
  border-color: #1a1a1a;
  color: #1a1a1a;
}

.complexity-picker .complexity-pick-auto[aria-pressed="true"] {
  background: #f1f3f5;
  border-color: #1a1a1a;
  color: #1a1a1a;
}

.feature-body {
  display: none;
  padding: 0 20px 20px;
  border-top: 1px solid #f0f0f0;
}

.feature.open .feature-body { display: block; }

.feature-meta {
  margin: 16px 0;
  font-size: 13px;
  color: #555;
}

.feature-meta .desc { margin-bottom: 8px; }

.feature-meta .why {
  font-style: italic;
  color: #666;
  border-left: 3px solid #e0e0e0;
  padding-left: 10px;
}

/* ----- UC card ----- */
.ucs-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.uc-card {
  border: 1px solid #e8e8e8;
  border-radius: 5px;
  padding: 14px 16px;
  background: #fafafa;
}

.uc-card .uc-head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.uc-card .uc-id {
  font-size: 11px;
  font-weight: 700;
  color: #888;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  min-width: 50px;
}

.uc-card .uc-title {
  flex: 1;
  font-weight: 600;
  font-size: 14px;
  min-width: 280px;
}

.uc-card .uc-meta {
  margin-top: 6px;
  font-size: 12px;
  color: #666;
  line-height: 1.45;
}

.uc-card .uc-meta strong {
  color: #444;
  font-weight: 600;
}

.uc-card .uc-actions {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.uc-card .detail-btn {
  margin-left: auto;
  background: transparent;
  border: 1px solid #ccc;
  padding: 4px 10px;
  font-size: 12px;
  border-radius: 4px;
  cursor: pointer;
  color: #555;
}

.uc-card .detail-btn:hover {
  border-color: #1a1a1a;
  color: #1a1a1a;
}

/* ----- Méthodologie page ----- */
.persona {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  padding: 18px 20px;
  margin-bottom: 12px;
}

.persona h3 {
  margin: 0 0 6px;
  font-size: 15px;
}

.persona .role {
  font-size: 12px;
  color: #888;
  margin-bottom: 10px;
}

.persona .pains {
  font-size: 13px;
  color: #555;
}

.glossaire-list {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 8px 24px;
  font-size: 13px;
}

.glossaire-list dt {
  font-weight: 700;
  color: #1a1a1a;
}

.glossaire-list dd {
  margin: 0;
  color: #555;
}

/* ----- Synthèse page ----- */
.synth-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.synth-summary .stat {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  padding: 18px;
  text-align: center;
}

.synth-summary .stat .num {
  font-size: 32px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.synth-summary .stat .lbl {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #666;
  margin-top: 4px;
}

.synth-summary .stat.mvp   .num { color: #1e7a36; }
.synth-summary .stat.vnext .num { color: #555; }
.synth-summary .stat.out   .num { color: #b13a23; }

.synth-tree {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  padding: 18px 22px;
  margin-bottom: 16px;
}

.synth-tree details {
  margin-bottom: 12px;
}

.synth-tree summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 14px;
  padding: 6px 0;
  list-style: none;
}

.synth-tree summary::-webkit-details-marker { display: none; }

.synth-tree summary::before {
  content: '▸';
  display: inline-block;
  width: 16px;
  color: #888;
  transition: transform 0.15s;
}

.synth-tree details[open] > summary::before {
  transform: rotate(90deg);
}

.synth-tree .feature-row {
  margin-left: 20px;
  padding: 4px 0;
  font-size: 13px;
  border-left: 2px solid #f0f0f0;
  padding-left: 10px;
}

.synth-tree .uc-row {
  margin-left: 30px;
  padding: 3px 0 3px 12px;
  font-size: 12px;
  color: #555;
  border-left: 1px dashed #e0e0e0;
}

.synth-tree .uc-row .uc-id-inline {
  display: inline-block;
  min-width: 50px;
  font-weight: 700;
  color: #888;
  font-size: 11px;
}

.synth-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  flex-wrap: wrap;
}

/* ----- Send synthese card (synthese page) ----- */
.synth-send-card {
  margin-top: 40px;
  padding: 28px 28px 24px;
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 12px;
}

.synth-send-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 22px;
}

.synth-send-head-icon {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #1a1a1a;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
}

.synth-send-head-text { flex: 1; min-width: 0; }

.synth-send-head h2 {
  margin: 0 0 4px;
  font-size: 17px;
  font-weight: 700;
  color: #1a1a1a;
}

.synth-send-sub {
  margin: 0;
  font-size: 13px;
  color: #666;
  line-height: 1.5;
}

.synth-send-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 0;
}

.synth-send-actions {
  display: flex;
  gap: 10px;
  margin-top: 4px;
  flex-wrap: wrap;
}

/* ----- Form fields (reusable) ----- */
.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 12px;
  font-weight: 600;
  color: #444;
  letter-spacing: 0.01em;
}

.form-hint {
  font-weight: 400;
  color: #999;
  font-size: 11px;
  text-transform: lowercase;
}

.form-field input[type="email"],
.form-field input[type="text"],
.form-field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d8d8d8;
  border-radius: 8px;
  background: #fafafa;
  font-family: inherit;
  font-size: 14px;
  color: #1a1a1a;
  line-height: 1.5;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
  resize: vertical;
}

.form-field input::placeholder,
.form-field textarea::placeholder { color: #aaa; }

.form-field input:focus,
.form-field textarea:focus {
  outline: none;
  border-color: #1a1a1a;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(26,26,26,0.08);
}

.form-error {
  margin: 0;
  padding: 10px 12px;
  background: #fee;
  border: 1px solid #fcc;
  border-radius: 8px;
  color: #900;
  font-size: 13px;
}

/* ----- Success state ----- */
.synth-send-success {
  text-align: center;
  padding: 12px 8px 8px;
}

.synth-send-success-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: #e6f4ea;
  color: #1e7a36;
  font-size: 24px;
  font-weight: 700;
}

.synth-send-success-title {
  font-size: 17px;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 6px;
}

.synth-send-success-sub {
  font-size: 13px;
  color: #666;
  line-height: 1.5;
  max-width: 480px;
  margin: 0 auto 16px;
}

.synth-send-mock-note {
  display: inline-block;
  margin: 0 0 14px;
  padding: 4px 10px;
  background: #fff8e6;
  border: 1px solid #f0d28a;
  border-radius: 999px;
  font-size: 11px;
  color: #8a5a00;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 5px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  font-family: inherit;
  transition: background 0.15s, border-color 0.15s;
}

.btn-primary {
  background: #1a1a1a;
  color: #fff;
}

.btn-primary:hover { background: #000; }

.btn-secondary {
  background: #fff;
  border-color: #ccc;
  color: #1a1a1a;
}

.btn-secondary:hover { border-color: #1a1a1a; }

.btn-danger {
  background: #b13a23;
  color: #fff;
}

.btn-danger:hover { background: #8e2c19; }

/* ----- App Modal (Modal.confirm / Modal.alert) ----- */
.app-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 15, 18, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1100;
  opacity: 0;
  transition: opacity 0.15s ease;
  pointer-events: none;
}

.app-modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.app-modal {
  background: #fff;
  border-radius: 12px;
  max-width: 460px;
  width: calc(100% - 32px);
  padding: 24px 28px;
  box-shadow: 0 12px 48px rgba(0,0,0,0.22);
  transform: translateY(8px);
  transition: transform 0.15s ease;
}

.app-modal-backdrop.open .app-modal { transform: translateY(0); }

.app-modal h3 {
  margin: 0 0 12px;
  font-size: 17px;
  font-weight: 700;
  color: #1a1a1a;
}

.app-modal-body {
  font-size: 14px;
  color: #444;
  line-height: 1.5;
  margin-bottom: 22px;
}

.app-modal-body p { margin: 0 0 8px; }
.app-modal-body p:last-child { margin-bottom: 0; }

.app-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.app-modal-actions .btn {
  padding: 8px 16px;
  font-size: 13px;
}

/* ----- Modal ----- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-backdrop.open { display: flex; }

.modal {
  background: #fff;
  border-radius: 8px;
  max-width: 720px;
  width: calc(100% - 40px);
  max-height: calc(100vh - 40px);
  overflow: auto;
  padding: 28px 32px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.18);
}

.modal h2 {
  margin-top: 0;
  font-size: 20px;
}

.modal .modal-close {
  position: sticky;
  top: 0;
  float: right;
  background: transparent;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: #888;
  margin: -8px -8px 0 0;
}

.modal .uc-detail h4 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #888;
  margin: 18px 0 6px;
}

.modal .uc-detail h4:first-of-type { margin-top: 0; }

.modal .uc-detail ol,
.modal .uc-detail ul {
  margin: 0 0 12px;
  font-size: 13px;
}

.modal .uc-detail p {
  font-size: 13px;
  margin: 0 0 8px;
}

/* ----- Back link (synthese, etc.) ----- */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #666;
  margin-bottom: 16px;
}

.back-link:hover { color: #1a1a1a; }

/* ----- Methodologie drawer (inline-right, no backdrop, resizable) -----
   Anchored below the fixed topbar + counter-bar via --header-bottom
   (set by App.updateHeaderBottom() so the drawer butts flush with the
   counter-bar even when it wraps on narrow viewports).
   Width driven by --drawer-width (CSS var, JS-controlled).
   No darkening — page content stays fully readable on the left. */
.drawer-backdrop {
  position: fixed;
  top: var(--header-bottom, 95px);
  right: 0;
  bottom: 0;
  width: var(--drawer-width);
  max-width: 100vw;
  z-index: 80;
  pointer-events: none;
}

.drawer {
  position: relative;
  background: #fff;
  width: 100%;
  height: 100%;
  border-left: 1px solid #d8d8d8;
  box-shadow: -6px 0 18px rgba(0,0,0,0.06);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.25s cubic-bezier(0.2, 0.9, 0.3, 1);
  pointer-events: auto;
}

body.drawer-resizing .drawer { transition: none; }

.drawer-backdrop.open .drawer { transform: translateX(0); }

/* Resize handle on the LEFT edge of the drawer — drag to widen / narrow. */
.drawer-resizer {
  position: absolute;
  top: 0;
  left: -3px;
  width: 8px;
  height: 100%;
  cursor: col-resize;
  z-index: 1;
  background: transparent;
  transition: background 0.15s;
}

.drawer-resizer:hover,
body.drawer-resizing .drawer-resizer {
  background: rgba(26, 26, 26, 0.12);
}

.drawer-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 22px;
  border-bottom: 1px solid #e0e0e0;
  background: #fafafa;
  flex-shrink: 0;
}

.drawer-head h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  flex: 1;
}

.drawer-close {
  background: transparent;
  border: none;
  font-size: 24px;
  line-height: 1;
  color: #666;
  cursor: pointer;
  padding: 4px 10px;
  border-radius: 4px;
}

.drawer-close:hover { background: #f0f0f0; color: #1a1a1a; }

.drawer-body {
  overflow-y: auto;
  padding: 20px 22px 40px;
  flex: 1;
}

.drawer-body section {
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid #f0f0f0;
}

.drawer-body section:last-child { border-bottom: none; }

.drawer-body h3 {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #888;
  margin: 0 0 10px;
  font-weight: 700;
}

.drawer-body h4 {
  font-size: 14px;
  font-weight: 700;
  margin: 12px 0 4px;
}

.drawer-body p { font-size: 13px; }
.drawer-body ul { font-size: 13px; }

.drawer-body .persona { margin-bottom: 14px; }
.drawer-body .persona .role { font-size: 12px; color: #888; margin-bottom: 6px; }
.drawer-body .persona .pains { font-size: 13px; color: #555; }
.drawer-body .persona .pains ul { margin-top: 4px; }

/* ----- Left-side drawer (HelpDrawer) ----- */
.drawer-backdrop.drawer-backdrop-left {
  left: 0;
  right: auto;
  /* Anchor below topbar+counter-bar on scope/synthese (where --header-bottom is
     set by App.updateHeaderBottom). On the home page the var is unset → top 0. */
  top: var(--header-bottom, 0);
}

.drawer.drawer-left {
  border-left: 0;
  border-right: 1px solid #d8d8d8;
  box-shadow: 6px 0 18px rgba(0,0,0,0.06);
  transform: translateX(-100%);
}

.drawer-backdrop.drawer-backdrop-left.open .drawer.drawer-left {
  transform: translateX(0);
}

.drawer-resizer.drawer-resizer-right {
  left: auto;
  right: -3px;
}

/* ----- Floating "Comprendre l'outil" FAB (always visible, bottom-left) ----- */
.help-fab {
  position: fixed;
  left: 20px;
  bottom: 20px;
  z-index: 200;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px 10px 12px;
  border-radius: 999px;
  background: #1a1a1a;
  color: #fff;
  border: 1px solid #1a1a1a;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0,0,0,0.18);
  transition: background 0.15s, transform 0.15s, box-shadow 0.15s;
}

.help-fab:hover {
  background: #000;
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(0,0,0,0.22);
}

.help-fab .help-fab-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
}

.help-fab.is-active {
  background: #fff;
  color: #1a1a1a;
  border-color: #d8d8d8;
}

.help-fab.is-active:hover { background: #f6f6f6; }

@media (max-width: 600px) {
  .help-fab .help-fab-label { display: none; }
  .help-fab { padding: 10px; }
}

/* ----- Responsive ----- */
@media (max-width: 900px) {
  .epics-grid { grid-template-columns: 1fr; }
  .demarche { grid-template-columns: repeat(2, 1fr); }
  .glossaire-list { grid-template-columns: 1fr; gap: 4px 0; }
  .glossaire-list dt { margin-top: 8px; }
}
