/* Carrousels — feuille de style des composants. Se charge après tokens.css. Préfixe : cr- */

/* ---------- Socle ---------- */
.cr-root, .cr-root *, .cr-root *::before, .cr-root *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--font-sans); font-size: 15px; line-height: 22px; -webkit-font-smoothing: antialiased; }
.cr-root { font-family: var(--font-sans); color: var(--ink); font-size: 15px; line-height: 22px; font-feature-settings: "ss01" 0; }
.cr-root :where(h1,h2,h3,h4,p,ul,ol,figure) { margin: 0; }
.cr-root :where(button,input,select,textarea) { font: inherit; color: inherit; }
.cr-num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: 13px; line-height: 18px; font-weight: 500; letter-spacing: -0.1px; }
.cr-muted { color: var(--ink-muted); }
.cr-faint { color: var(--ink-faint); }
.cr-sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.cr-root :focus-visible, .cr-focusable:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.cr-h-display { font-family: var(--font-display); font-size: 32px; line-height: 36px; font-weight: 750; letter-spacing: -0.8px; font-variation-settings: "opsz" 48; }
.cr-h-title { font-family: var(--font-display); font-size: 20px; line-height: 26px; font-weight: 700; letter-spacing: -0.3px; }
.cr-h-sub { font-size: 16px; line-height: 22px; font-weight: 600; }
.cr-label { font-size: 13px; line-height: 18px; font-weight: 600; }
.cr-small { font-size: 13px; line-height: 18px; }
.cr-stack { display: flex; flex-direction: column; gap: var(--space-4); }
.cr-row { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.cr-spacer { flex: 1; }
.cr-icon { flex: none; display: inline-block; vertical-align: middle; }
@keyframes cr-spin { to { transform: rotate(360deg); } }
@keyframes cr-shimmer { 0% { background-position: -400px 0; } 100% { background-position: 400px 0; } }
@keyframes cr-pulse { 0%,100% { opacity: 1; } 50% { opacity: .45; } }
@keyframes cr-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.cr-spin { animation: cr-spin 0.9s linear infinite; }
@media (prefers-reduced-motion: reduce) { .cr-root *, .cr-root *::before, .cr-root *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; } }

/* ---------- Surligné (le motif de la marque) ---------- */
.cr-hl { background: linear-gradient(transparent 12%, var(--accent) 12%, var(--accent) 92%, transparent 92%); color: var(--on-accent); padding: 0 .14em; margin: 0 -.04em; -webkit-box-decoration-break: clone; box-decoration-break: clone; border-radius: 2px; }

/* ---------- Bouton ---------- */
.cr-btn { --h: var(--size-control); position: relative; display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); min-height: var(--h); padding: 0 var(--space-4); border-radius: var(--radius-sm); border: 1px solid transparent; font-size: 15px; line-height: 20px; font-weight: 600; cursor: pointer; white-space: nowrap; text-decoration: none; transition: background-color .16s ease-out, border-color .16s ease-out, transform .08s ease-out, box-shadow .16s; user-select: none; }
.cr-btn:active:not(:disabled) { transform: translateY(1px); }
.cr-btn:disabled, .cr-btn[aria-disabled="true"] { cursor: not-allowed; opacity: .45; }
.cr-btn-sm { --h: 32px; padding: 0 var(--space-3); font-size: 13px; gap: 6px; }
.cr-btn-lg { --h: 52px; padding: 0 var(--space-5); font-size: 16px; border-radius: 10px; }
.cr-btn-block { display: flex; width: 100%; }
.cr-btn-primary { background: var(--primary); color: var(--on-primary); }
.cr-btn-primary:hover:not(:disabled) { box-shadow: 0 0 0 3px var(--accent); }
.cr-btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.cr-btn-secondary:hover:not(:disabled) { background: var(--surface-sunken); }
.cr-btn-quiet { background: transparent; color: var(--ink); }
.cr-btn-quiet:hover:not(:disabled) { background: var(--surface-sunken); }
.cr-btn-danger { background: var(--danger); color: var(--on-danger); }
.cr-btn-danger:hover:not(:disabled) { filter: brightness(1.08); }
.cr-btn-danger-quiet { background: transparent; color: var(--erreur-ink); border-color: transparent; }
.cr-btn-danger-quiet:hover:not(:disabled) { background: var(--erreur-bg); }
.cr-btn-icon { padding: 0; width: var(--h); }
.cr-btn-cost { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: 12px; font-weight: 500; opacity: .78; padding-left: var(--space-2); margin-left: 2px; border-left: 1px solid currentColor; line-height: 14px; }
.cr-btn-loading { pointer-events: none; }
.cr-btn-primary.cr-btn-loading { background: var(--surface-sunken); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-strong); }
.cr-btn[aria-pressed="true"].cr-btn-toggle { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.cr-btn-armed { animation: cr-in .16s ease-out; }
@media (pointer: coarse) { .cr-btn { min-height: max(var(--h), var(--size-hit)); } .cr-btn-icon { width: max(var(--h), var(--size-hit)); } }

/* ---------- Badge ---------- */
.cr-badge { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: var(--radius-xs); font-size: 12px; line-height: 16px; font-weight: 600; white-space: nowrap; background: var(--surface-sunken); color: var(--ink-muted); }
.cr-badge-accent { background: var(--accent); color: var(--on-accent); }
.cr-badge-ink { background: var(--ink); color: var(--paper); }
.cr-badge-outline { background: transparent; box-shadow: inset 0 0 0 1px var(--line-strong); color: var(--ink-muted); }
.cr-badge-refus { background: var(--refus-bg); color: var(--refus-ink); }
.cr-badge-erreur { background: var(--erreur-bg); color: var(--erreur-ink); }
.cr-badge-progress { background: var(--surface-sunken); color: var(--ink); }

/* ---------- Champs ---------- */
.cr-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.cr-field-label { display: flex; align-items: baseline; gap: var(--space-2); font-size: 13px; line-height: 18px; font-weight: 600; color: var(--ink); }
.cr-field-label .cr-opt { font-weight: 400; color: var(--ink-faint); }
.cr-input { display: flex; align-items: center; gap: var(--space-2); min-height: var(--size-control); padding: 0 12px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); transition: border-color .16s, box-shadow .16s; }
.cr-input:hover { border-color: var(--ink-muted); }
.cr-input:focus-within { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.cr-input > input, .cr-input > textarea, .cr-input > select { flex: 1; min-width: 0; border: 0; background: transparent; outline: none; padding: 9px 0; font-size: 15px; line-height: 22px; color: var(--ink); }
.cr-input > textarea { resize: vertical; padding: 10px 0; min-height: 88px; }
.cr-input-mono > textarea, .cr-input-mono > input { font-family: var(--font-mono); font-size: 13px; line-height: 20px; }
.cr-input ::placeholder { color: var(--ink-faint); opacity: 1; }
.cr-input .cr-icon { color: var(--ink-muted); }
.cr-input-lg { min-height: 52px; border-radius: 10px; }
.cr-input-lg > input { font-size: 17px; }
.cr-input-invalid { border-color: var(--erreur-line); }
.cr-input-invalid:focus-within { border-color: var(--erreur-line); box-shadow: 0 0 0 1px var(--erreur-line); }
.cr-input-disabled { background: var(--surface-sunken); opacity: .7; }
.cr-field-foot { display: flex; gap: var(--space-3); font-size: 13px; line-height: 18px; color: var(--ink-muted); }
.cr-field-foot > :first-child { flex: 1; }
.cr-field-error { display: flex; gap: 6px; align-items: flex-start; color: var(--erreur-ink); }
.cr-field-error .cr-icon { margin-top: 1px; }
.cr-counter { font-family: var(--font-mono); font-size: 12px; color: var(--ink-faint); white-space: nowrap; }
.cr-counter-over { color: var(--erreur-ink); font-weight: 600; }
.cr-select { position: relative; }
.cr-select > select { appearance: none; -webkit-appearance: none; padding-right: 28px; cursor: pointer; }
.cr-select > .cr-icon { position: absolute; right: 12px; pointer-events: none; }
@media (pointer: coarse) { .cr-input { min-height: var(--size-hit); } .cr-input > input, .cr-input > textarea, .cr-input > select { font-size: 16px; } }

/* Case à cocher */
.cr-check { display: inline-flex; align-items: flex-start; gap: 10px; cursor: pointer; font-size: 15px; line-height: 22px; min-height: 24px; }
.cr-check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.cr-check-box { flex: none; width: 20px; height: 20px; margin-top: 1px; border-radius: var(--radius-xs); border: 1.5px solid var(--line-strong); background: var(--surface); display: grid; place-items: center; color: transparent; transition: background .12s, border-color .12s; }
.cr-check:hover .cr-check-box { border-color: var(--ink-muted); }
.cr-check input:checked + .cr-check-box { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.cr-check input:focus-visible + .cr-check-box { outline: 2px solid var(--focus); outline-offset: 2px; }
.cr-check-hint { display: block; font-size: 13px; line-height: 18px; color: var(--ink-muted); }

/* Segmenté */
.cr-seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--surface-sunken); border-radius: 10px; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.cr-seg button { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border: 0; border-radius: 7px; background: transparent; color: var(--ink-muted); font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.cr-seg button:hover { color: var(--ink); }
.cr-seg button[aria-pressed="true"], .cr-seg button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-raised); }
.cr-seg .cr-seg-count { font-family: var(--font-mono); font-weight: 500; font-size: 12px; color: var(--ink-faint); }
@media (pointer: coarse) { .cr-seg button { height: 38px; } }

/* Étiquette cliquable */
.cr-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 12px; border-radius: var(--radius-pill); border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font-size: 13px; line-height: 18px; font-weight: 500; cursor: pointer; white-space: nowrap; transition: background .12s, border-color .12s; }
.cr-chip:hover { background: var(--surface-sunken); }
.cr-chip[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.cr-chip-meta { color: var(--ink-faint); font-weight: 400; }
.cr-chip[aria-pressed="true"] .cr-chip-meta { color: var(--on-accent); }
.cr-chip-remove { display: grid; place-items: center; width: 20px; height: 20px; margin-right: -6px; border-radius: 50%; border: 0; background: transparent; color: inherit; cursor: pointer; }
.cr-chip-remove:hover { background: var(--line); }
.cr-chip-static { cursor: default; }
@media (pointer: coarse) { .cr-chip { min-height: 40px; } }

/* Note enregistrée sans bouton */
.cr-note { position: relative; }
.cr-note textarea { width: 100%; min-height: 64px; resize: vertical; padding: 10px 12px 24px; border-radius: var(--radius-sm); border: 1px dashed var(--line-strong); background: var(--surface); font-size: 14px; line-height: 20px; color: var(--ink); }
.cr-note textarea:hover { border-style: solid; }
.cr-note textarea:focus { outline: none; border: 1px solid var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.cr-note-status { position: absolute; right: 10px; bottom: 8px; display: inline-flex; align-items: center; gap: 4px; font-size: 12px; line-height: 14px; color: var(--ink-faint); pointer-events: none; }
.cr-note-status-saved { color: var(--ink-muted); }
.cr-note-status-error { color: var(--erreur-ink); }

/* Dépôt de fichiers */
.cr-drop { display: flex; flex-direction: column; gap: var(--space-3); }
.cr-drop-zone { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-2); min-height: 148px; padding: var(--space-5); border: 1.5px dashed var(--line-strong); border-radius: var(--radius-md); background: var(--surface-sunken); text-align: center; cursor: pointer; transition: background .16s, border-color .16s; }
.cr-drop-zone:hover { border-color: var(--ink-muted); }
.cr-drop-zone.cr-drop-over { border-style: solid; border-color: var(--ink); background: var(--accent); color: var(--on-accent); }
.cr-drop-zone.cr-drop-over .cr-muted { color: var(--on-accent); }
.cr-drop-zone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.cr-drop-zone:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }
.cr-drop-ic { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); color: var(--ink); box-shadow: var(--shadow-raised); }
.cr-drop-files { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: var(--space-2); }
.cr-drop-file { position: relative; aspect-ratio: 9/16; border-radius: var(--radius-xs); overflow: hidden; background: var(--stage); }
.cr-drop-file img { width: 100%; height: 100%; object-fit: contain; display: block; }
.cr-drop-file-n { position: absolute; left: 4px; top: 4px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--ink); color: var(--paper); font: 500 11px/20px var(--font-mono); text-align: center; }
.cr-drop-file-x { position: absolute; right: 4px; top: 4px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: var(--surface); color: var(--ink); display: grid; place-items: center; cursor: pointer; box-shadow: var(--shadow-raised); }
.cr-drop-file-warn { position: absolute; left: 0; right: 0; bottom: 0; padding: 3px 5px; background: var(--refus-bg); color: var(--refus-ink); font-size: 11px; line-height: 13px; font-weight: 600; }
.cr-drop-file-bad { outline: 2px solid var(--erreur-line); outline-offset: -2px; }
.cr-drop-file-bad .cr-drop-file-warn { background: var(--erreur-bg); color: var(--erreur-ink); }

/* ---------- Images ---------- */
.cr-slide { position: relative; display: block; flex: none; aspect-ratio: 9/16; border-radius: var(--radius-sm); overflow: hidden; background: var(--stage); }
.cr-slide-45 { aspect-ratio: 4/5; }
.cr-slide img { display: block; width: 100%; height: 100%; object-fit: contain; }
.cr-slide-sm { border-radius: var(--radius-xs); }
.cr-skel { background: linear-gradient(90deg, var(--surface-sunken) 0, var(--line) 120px, var(--surface-sunken) 240px) var(--surface-sunken); background-size: 800px 100%; animation: cr-shimmer 1.6s linear infinite; }
.cr-slide-n { position: absolute; left: 6px; top: 6px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: rgba(0,0,0,.62); color: #fff; font: 500 11px/22px var(--font-mono); text-align: center; }
.cr-pick { position: relative; display: block; width: 100%; padding: 0; border: 0; background: none; text-align: left; cursor: pointer; color: inherit; border-radius: var(--radius-md); }
.cr-pick-check { position: absolute; z-index: 2; display: none; align-items: center; gap: 4px; height: 24px; padding: 0 8px 0 6px; border-radius: 12px; background: var(--accent); color: var(--on-accent); font-size: 12px; font-weight: 700; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.cr-pick[aria-pressed="true"] .cr-pick-check { display: inline-flex; }

/* Carte persona */
.cr-persona { width: 132px; }
.cr-persona .cr-persona-img { position: relative; display: block; aspect-ratio: 9/16; border-radius: var(--radius-md); overflow: hidden; background: var(--stage); transition: box-shadow .16s, transform .16s; }
.cr-persona .cr-persona-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cr-persona:hover .cr-persona-img { box-shadow: 0 0 0 2px var(--line-strong); }
.cr-persona[aria-pressed="true"] .cr-persona-img { box-shadow: 0 0 0 3px var(--select); }
.cr-persona .cr-pick-check { left: 6px; top: 6px; }
.cr-persona-name { display: block; margin-top: 8px; font-size: 15px; line-height: 20px; font-weight: 600; }
.cr-persona-sub { display: block; font-size: 12px; line-height: 16px; color: var(--ink-faint); }
.cr-persona-sm { width: 72px; }
.cr-persona-sm .cr-persona-img { border-radius: 10px; }
.cr-persona-sm .cr-persona-name { margin-top: 6px; font-size: 13px; line-height: 16px; text-align: center; }
.cr-persona-sm .cr-persona-sub { display: none; }
.cr-persona-sm .cr-pick-check { padding: 0; width: 22px; height: 22px; justify-content: center; left: 4px; top: 4px; }
.cr-persona-sm .cr-pick-check span { display: none; }
.cr-persona-new { width: 100%; display: grid; place-items: center; aspect-ratio: 9/16; border-radius: 10px; border: 1.5px dashed var(--line-strong); color: var(--ink-muted); background: transparent; }

/* Carte format */
.cr-format { padding: var(--space-2); border-radius: var(--radius-md); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); transition: box-shadow .16s; }
.cr-format:hover { box-shadow: inset 0 0 0 1px var(--line-strong), var(--shadow-raised); }
.cr-format[aria-pressed="true"] { box-shadow: inset 0 0 0 3px var(--select); }
.cr-format-planche { position: relative; display: block; border-radius: var(--radius-sm); overflow: hidden; background: var(--stage); aspect-ratio: 5.3/1.9; }
.cr-format-planche img { width: 100%; height: 100%; object-fit: contain; display: block; }
.cr-format .cr-pick-check { right: 14px; top: 14px; }
.cr-format-body { display: flex; align-items: flex-start; gap: var(--space-2); padding: 10px 6px 4px; }
.cr-format-name { font-size: 15px; line-height: 20px; font-weight: 600; }
.cr-format-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 3px; font-size: 12px; line-height: 16px; color: var(--ink-faint); }
.cr-fam { display: inline-flex; align-items: center; gap: 5px; }
.cr-fam-dot { width: 12px; height: 12px; border-radius: 3px; flex: none; }
.cr-fam-surligne { background: linear-gradient(transparent 30%, var(--accent) 30%, var(--accent) 80%, transparent 80%), var(--ink-muted); }
.cr-fam-photo { background: var(--ink-muted); }
.cr-fam-sans { background: transparent; box-shadow: inset 0 0 0 1.5px var(--ink-muted); }

/* Carte carrousel (historique) */
.cr-ccard { display: flex; flex-direction: column; gap: 10px; text-decoration: none; color: inherit; }
.cr-ccard-cover { position: relative; display: block; border-radius: var(--radius-md); overflow: hidden; background: var(--stage); aspect-ratio: 9/16; transition: box-shadow .16s, transform .16s; }
.cr-ccard-cover img { width: 100%; height: 100%; object-fit: contain; display: block; }
.cr-ccard:hover .cr-ccard-cover { box-shadow: 0 0 0 2px var(--line-strong); }
.cr-ccard[aria-current="true"] .cr-ccard-cover { box-shadow: 0 0 0 3px var(--select); }
.cr-ccard-badges { position: absolute; left: 8px; bottom: 8px; display: flex; gap: 4px; }
.cr-ccard-count { position: absolute; right: 8px; top: 8px; display: inline-flex; gap: 4px; align-items: center; height: 22px; padding: 0 7px; border-radius: 11px; background: rgba(0,0,0,.6); color: #fff; font: 500 11px/22px var(--font-mono); }
.cr-ccard-subject { font-size: 15px; line-height: 20px; font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cr-ccard-meta { font-size: 12px; line-height: 16px; color: var(--ink-faint); margin-top: 2px; }
.cr-ccard-wait { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 12px; text-align: center; color: var(--ink); font-size: 13px; line-height: 18px; }

/* Carte carrousel d'un compte */
.cr-post { display: grid; grid-template-columns: 112px 1fr; gap: var(--space-3); padding: var(--space-3); border-radius: var(--radius-md); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.cr-post-cover { position: relative; border-radius: var(--radius-sm); overflow: hidden; background: var(--stage); aspect-ratio: 9/16; align-self: start; }
.cr-post-cover img { width: 100%; height: 100%; object-fit: contain; display: block; }
.cr-post-rank { position: absolute; left: 6px; top: 6px; height: 22px; min-width: 22px; padding: 0 6px; border-radius: 11px; background: var(--ink); color: var(--paper); font: 500 11px/22px var(--font-mono); text-align: center; }
.cr-post-body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.cr-post-views { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.cr-post-views .cr-big { font-family: var(--font-mono); font-size: 26px; line-height: 30px; font-weight: 500; letter-spacing: -0.5px; }
.cr-post-line { font-size: 12px; line-height: 16px; color: var(--ink-faint); font-family: var(--font-mono); }
.cr-post-text { font-size: 13px; line-height: 18px; color: var(--ink-muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cr-post-actions { margin-top: auto; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding-top: 4px; }
.cr-link { color: var(--link); text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; display: inline-flex; align-items: center; gap: 4px; font-size: 13px; line-height: 18px; font-weight: 500; }
.cr-link:hover { text-decoration-thickness: 2px; }

/* Vignette photo */
.cr-photo { position: relative; border-radius: var(--radius-sm); overflow: hidden; background: var(--stage); aspect-ratio: 9/16; }
.cr-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cr-photo-x { position: absolute; right: 6px; top: 6px; width: 32px; height: 32px; border-radius: 50%; border: 0; background: var(--surface); color: var(--ink); display: grid; place-items: center; cursor: pointer; box-shadow: var(--shadow-raised); opacity: 0; transition: opacity .12s; }
.cr-photo:hover .cr-photo-x, .cr-photo-x:focus-visible, .cr-photo-x[aria-pressed="true"] { opacity: 1; }
@media (hover: none) { .cr-photo-x { opacity: 1; } }
.cr-photo-x[aria-pressed="true"] { width: auto; padding: 0 10px; border-radius: 16px; background: var(--danger); color: var(--on-danger); font-size: 12px; font-weight: 700; gap: 4px; display: inline-flex; align-items: center; }
.cr-photo-x:disabled { cursor: not-allowed; opacity: 0 !important; }
.cr-photo-tag { position: absolute; left: 6px; bottom: 6px; }
.cr-photo-uses { position: absolute; right: 6px; bottom: 6px; height: 20px; padding: 0 6px; border-radius: 10px; background: rgba(0,0,0,.6); color: #fff; font: 500 11px/20px var(--font-mono); }

/* Visionneuse */
.cr-viewer { position: relative; display: flex; flex-direction: column; gap: var(--space-3); }
.cr-viewer-stage { position: relative; border-radius: var(--radius-lg); background: var(--stage); padding: var(--space-5) 0; }
.cr-viewer-track { display: flex; gap: var(--space-3); overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding: 0 var(--space-5); padding: 0 var(--space-5); scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.cr-viewer-track::after { content: ""; flex: 0 0 1px; }
.cr-viewer-track .cr-slide { scroll-snap-align: start; box-shadow: var(--shadow-slide); cursor: zoom-in; }
.cr-viewer-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--surface); color: var(--ink); display: grid; place-items: center; cursor: pointer; box-shadow: var(--shadow-overlay); z-index: 2; }
.cr-viewer-nav:disabled { opacity: 0; pointer-events: none; }
.cr-viewer-prev { left: -10px; } .cr-viewer-next { right: -10px; }
.cr-viewer-bar { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.cr-viewer-dots { display: flex; gap: 4px; }
.cr-viewer-dots button { width: 20px; height: 6px; padding: 0; border: 0; border-radius: 3px; background: var(--line-strong); cursor: pointer; }
.cr-viewer-dots button[aria-current="true"] { background: var(--ink); width: 28px; }
@media (max-width: 640px) { .cr-viewer-nav { display: none; } .cr-viewer-stage { border-radius: var(--radius-md); padding: var(--space-4) 0; } .cr-viewer-track { padding: 0 var(--space-4); scroll-padding: 0 var(--space-4); } }

/* ---------- Retours ---------- */
.cr-msg { display: grid; grid-template-columns: 24px 1fr; column-gap: 10px; row-gap: 2px; padding: 12px 14px; border-radius: var(--radius-md); background: var(--surface-sunken); color: var(--ink); font-size: 14px; line-height: 20px; animation: cr-in .2s ease-out; align-self: start; }
.cr-msg > .cr-icon { margin-top: 1px; }
.cr-msg-title { font-weight: 650; font-size: 15px; line-height: 22px; }
.cr-msg-title .cr-msg-kicker { display: inline-block; margin-right: 6px; font-size: 11px; line-height: 16px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; vertical-align: 1px; }
.cr-msg-body { grid-column: 2; }
.cr-msg-actions { grid-column: 2; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.cr-msg-ok { background: var(--ok-bg); color: var(--on-accent); }
.cr-msg-refus { background: var(--refus-bg); color: var(--refus-ink); box-shadow: inset 0 0 0 1px var(--refus-line); }
.cr-msg-refus > .cr-icon { color: var(--refus-line); }
.cr-msg-erreur { background: var(--erreur-bg); color: var(--erreur-ink); box-shadow: inset 0 0 0 1.5px var(--erreur-line); }
.cr-msg-erreur > .cr-icon { color: var(--erreur-line); }
.cr-msg-avert { background: var(--avert-bg); color: var(--ink); }
.cr-msg-avert > .cr-icon { color: var(--ink-muted); }
.cr-msg-progress { background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.cr-msg-compact { padding: 8px 12px; font-size: 13px; line-height: 18px; grid-template-columns: 18px 1fr; column-gap: 8px; }
.cr-msg-compact .cr-msg-title { font-size: 13px; line-height: 18px; }
.cr-msg-refus .cr-btn-secondary, .cr-msg-erreur .cr-btn-secondary { background: transparent; border-color: currentColor; color: inherit; }
.cr-msg-ok .cr-btn-secondary { background: transparent; border-color: var(--on-accent); color: var(--on-accent); }

/* Attente */
.cr-task { display: flex; flex-direction: column; gap: var(--space-3); padding: var(--space-4); border-radius: var(--radius-md); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.cr-task-head { display: flex; align-items: center; gap: var(--space-3); }
.cr-task-title { font-weight: 650; font-size: 15px; line-height: 20px; flex: 1; min-width: 0; }
.cr-task-clock { font-family: var(--font-mono); font-size: 22px; line-height: 26px; font-weight: 500; letter-spacing: -0.3px; font-variant-numeric: tabular-nums; }
.cr-task-track { position: relative; height: 8px; border-radius: 4px; background: var(--surface-sunken); overflow: hidden; }
.cr-task-band { position: absolute; top: 0; bottom: 0; background: repeating-linear-gradient(-45deg, var(--line) 0 4px, transparent 4px 8px); }
.cr-task-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 4px; background: var(--progress); transition: width .6s linear; }
.cr-task-fill-late { background: repeating-linear-gradient(-45deg, var(--progress) 0 6px, var(--ink-muted) 6px 12px); background-size: 17px 17px; animation: cr-shimmer 3s linear infinite; }
.cr-task-scale { display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 11px; line-height: 14px; color: var(--ink-faint); margin-top: -4px; }
.cr-steps { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 2px; }
.cr-step { display: grid; grid-template-columns: 22px 1fr auto; gap: 8px; align-items: center; min-height: 28px; font-size: 14px; line-height: 20px; color: var(--ink-faint); }
.cr-step-dot { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; }
.cr-step-todo .cr-step-dot::before { content: ""; width: 8px; height: 8px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--line-strong); }
.cr-step-done { color: var(--ink-muted); }
.cr-step-done .cr-step-dot { background: var(--ink); color: var(--paper); }
.cr-step-now { color: var(--ink); font-weight: 600; }
.cr-step-now .cr-step-dot { background: var(--accent); color: var(--on-accent); }
.cr-step-fail .cr-step-dot { background: var(--refus-bg); color: var(--refus-ink); }
.cr-step-err .cr-step-dot { background: var(--erreur-bg); color: var(--erreur-ink); }
.cr-step-time { font-family: var(--font-mono); font-size: 12px; color: var(--ink-faint); font-weight: 400; }
.cr-task-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; line-height: 18px; color: var(--ink-muted); }
.cr-task-note { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: var(--radius-pill); background: var(--surface-sunken); color: var(--ink); font-size: 12px; font-weight: 600; }
.cr-task-note-off { background: var(--refus-bg); color: var(--refus-ink); animation: cr-pulse 1.6s ease-in-out infinite; }

/* Lot */
.cr-batch { list-style: none; padding: 0; margin: 0; border-radius: var(--radius-md); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; }
.cr-batch-row { display: grid; grid-template-columns: 44px 1fr auto; gap: var(--space-3); align-items: center; padding: 10px var(--space-3); border-top: 1px solid var(--line); }
.cr-batch-row:first-child { border-top: 0; }
.cr-batch-cover { width: 44px; aspect-ratio: 9/16; border-radius: var(--radius-xs); overflow: hidden; background: var(--surface-sunken); display: grid; place-items: center; color: var(--ink-faint); }
.cr-batch-cover img { width: 100%; height: 100%; object-fit: contain; display: block; }
.cr-batch-subject { font-weight: 600; font-size: 14px; line-height: 20px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cr-batch-step { font-size: 13px; line-height: 18px; color: var(--ink-muted); display: flex; gap: 6px; align-items: center; }
.cr-batch-sum { display: flex; align-items: center; gap: var(--space-3); padding: 10px var(--space-3); background: var(--surface-sunken); font-size: 13px; line-height: 18px; }
.cr-batch-bar { display: flex; gap: 3px; flex: 1; max-width: 220px; }
.cr-batch-bar span { flex: 1; height: 6px; border-radius: 3px; background: var(--line); }
.cr-batch-bar .cr-b-ok { background: var(--ink); }
.cr-batch-bar .cr-b-run { background: var(--accent); }
.cr-batch-bar .cr-b-refus { background: var(--refus-line); }
.cr-batch-bar .cr-b-err { background: var(--erreur-line); }

/* Vide */
.cr-empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: var(--space-2); padding: var(--space-7) var(--space-5); border-radius: var(--radius-lg); border: 1.5px dashed var(--line); }
.cr-empty-ic { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: var(--accent); color: var(--on-accent); margin-bottom: var(--space-2); transform: rotate(-4deg); }
.cr-empty-title { font-family: var(--font-display); font-size: 20px; line-height: 26px; font-weight: 700; letter-spacing: -0.3px; }
.cr-empty-text { max-width: 420px; color: var(--ink-muted); font-size: 14px; line-height: 20px; }
.cr-empty-actions { margin-top: var(--space-3); display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }

/* Bandeau */
.cr-banner { display: flex; align-items: center; gap: var(--space-3); padding: 10px var(--space-5); font-size: 14px; line-height: 20px; background: var(--erreur-bg); color: var(--erreur-ink); border-bottom: 1.5px solid var(--erreur-line); }
.cr-banner > .cr-icon { color: var(--erreur-line); }
.cr-banner-refus { background: var(--refus-bg); color: var(--refus-ink); border-bottom-color: var(--refus-line); }
.cr-banner-refus > .cr-icon { color: var(--refus-line); }
.cr-banner-info { background: var(--surface-sunken); color: var(--ink); border-bottom-color: var(--line); }
.cr-banner-info > .cr-icon { color: var(--ink-muted); }
.cr-banner-text { flex: 1; }
.cr-banner-text b { font-weight: 650; }

/* Notification */
.cr-toast { display: grid; grid-template-columns: 40px 1fr auto; gap: var(--space-3); align-items: center; width: 380px; max-width: calc(100vw - 32px); padding: 10px 10px 10px 10px; border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-overlay), inset 0 0 0 1px var(--line); animation: cr-in .22s ease-out; }
.cr-toast-thumb { width: 40px; aspect-ratio: 9/16; border-radius: var(--radius-xs); overflow: hidden; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; }
.cr-toast-thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }
.cr-toast-refus .cr-toast-thumb { background: var(--refus-bg); color: var(--refus-ink); }
.cr-toast-erreur .cr-toast-thumb { background: var(--erreur-bg); color: var(--erreur-ink); }
.cr-toast-title { font-weight: 650; font-size: 14px; line-height: 20px; }
.cr-toast-text { font-size: 13px; line-height: 18px; color: var(--ink-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Navigation ---------- */
.cr-shell { display: grid; grid-template-columns: var(--size-sidebar) minmax(0, 1fr); min-height: 100vh; background: var(--paper); }
.cr-side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: var(--space-4); padding: var(--space-4) var(--space-3); background: var(--surface-sunken); border-right: 1px solid var(--line); overflow-y: auto; }
.cr-brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 0; text-decoration: none; color: var(--ink); }
.cr-brand-word { font-family: var(--font-display); font-weight: 800; font-size: 21px; line-height: 24px; letter-spacing: -0.6px; }
.cr-brand-mark { display: inline-grid; grid-template-columns: repeat(3, 6px); gap: 2px; align-items: end; height: 22px; }
.cr-brand-mark i { display: block; width: 6px; border-radius: 1.5px; background: var(--ink); }
.cr-brand-mark i:nth-child(1) { height: 13px; opacity: .35; } .cr-brand-mark i:nth-child(2) { height: 22px; background: var(--ink); } .cr-brand-mark i:nth-child(3) { height: 13px; opacity: .35; }
.cr-brand-mark i:nth-child(2) { box-shadow: inset 0 -9px 0 var(--accent); }
.cr-nav { display: flex; flex-direction: column; gap: 2px; }
.cr-nav-group { margin-top: var(--space-3); padding: 0 10px 4px; font-size: 11px; line-height: 16px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: var(--ink-faint); }
.cr-nav-item { display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 10px; border-radius: var(--radius-sm); color: var(--ink-muted); text-decoration: none; font-size: 14px; line-height: 20px; font-weight: 550; border: 0; background: none; width: 100%; cursor: pointer; text-align: left; }
.cr-nav-item:hover { background: var(--line); color: var(--ink); }
.cr-nav-item[aria-current="page"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-raised), inset 0 0 0 1px var(--line); font-weight: 650; }
.cr-nav-item[aria-current="page"] .cr-icon { color: var(--ink); }
.cr-nav-item .cr-nav-count { margin-left: auto; font-family: var(--font-mono); font-size: 11px; color: var(--ink-faint); font-weight: 500; }
.cr-nav-create { margin: 4px 0 2px; }
.cr-side-foot { margin-top: auto; display: flex; flex-direction: column; gap: var(--space-3); padding-top: var(--space-3); border-top: 1px solid var(--line); }
.cr-user { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: var(--radius-sm); border: 0; background: none; width: 100%; text-align: left; cursor: pointer; color: var(--ink); }
.cr-user:hover { background: var(--line); }
.cr-avatar { flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--ink); color: var(--paper); display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.cr-avatar-sm { width: 22px; height: 22px; font-size: 10px; }
.cr-user-name { font-size: 14px; line-height: 18px; font-weight: 600; }
.cr-user-role { font-size: 12px; line-height: 16px; color: var(--ink-faint); }
.cr-main { min-width: 0; display: flex; flex-direction: column; }
.cr-page { width: 100%; max-width: var(--size-content); margin: 0 auto; padding: var(--space-6) var(--space-6) var(--space-8); display: flex; flex-direction: column; gap: var(--space-5); }
.cr-page-wide { max-width: none; }
.cr-page-head { display: flex; align-items: flex-end; gap: var(--space-4); flex-wrap: wrap; }
.cr-page-head > div:first-child { flex: 1; min-width: 240px; }
.cr-page-lede { margin-top: 6px; color: var(--ink-muted); font-size: 15px; line-height: 22px; max-width: 640px; }
.cr-crumb { display: flex; align-items: center; gap: 6px; font-size: 13px; line-height: 18px; color: var(--ink-faint); margin-bottom: 6px; }
.cr-crumb a { color: var(--ink-muted); text-decoration: none; } .cr-crumb a:hover { text-decoration: underline; }
.cr-topbar { display: none; }
.cr-bottomnav { display: none; }

/* Panneau générique */
.cr-panel { background: var(--surface); border-radius: var(--radius-lg); box-shadow: inset 0 0 0 1px var(--line); padding: var(--space-5); }
.cr-panel-tight { padding: var(--space-4); }
.cr-panel-head { display: flex; align-items: center; gap: var(--space-3); margin-bottom: var(--space-4); }
.cr-panel-head > :first-child { flex: 1; }
.cr-divider { height: 1px; background: var(--line); border: 0; margin: 0; }

/* Téléphone */
@media (max-width: 1023px) {
  .cr-shell { grid-template-columns: minmax(0, 1fr); }
  .cr-side { display: none; }
  .cr-topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: var(--space-2); height: 56px; padding: 0 var(--space-2) 0 var(--space-4); background: color-mix(in srgb, var(--paper) 92%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
  .cr-topbar-title { flex: 1; min-width: 0; font-family: var(--font-display); font-weight: 750; font-size: 18px; line-height: 22px; letter-spacing: -0.3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .cr-bottomnav { position: fixed; z-index: 10; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(5, 1fr); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line); }
  .cr-page { padding: var(--space-4) var(--space-4) 104px; gap: var(--space-4); }
  .cr-page-head .cr-h-display { display: none; }
  .cr-page-lede { margin-top: 0; font-size: 14px; line-height: 20px; }
  .cr-panel { padding: var(--space-4); border-radius: var(--radius-md); }
}
.cr-bn-item { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 52px; border: 0; background: none; color: var(--ink-faint); font-size: 11px; line-height: 14px; font-weight: 600; text-decoration: none; cursor: pointer; border-radius: 10px; position: relative; }
.cr-bn-item[aria-current="page"] { color: var(--ink); }
.cr-bn-item[aria-current="page"] .cr-bn-ic { background: var(--accent); color: var(--on-accent); }
.cr-bn-ic { width: 52px; height: 30px; border-radius: 15px; display: grid; place-items: center; }
.cr-bn-create .cr-bn-ic { background: var(--primary); color: var(--on-primary); }
.cr-bn-badge { position: absolute; top: 2px; right: calc(50% - 26px); min-width: 16px; height: 16px; border-radius: 8px; background: var(--ink); color: var(--paper); font: 600 10px/16px var(--font-mono); padding: 0 4px; }

/* Indicateur de tâches */
.cr-tray { position: relative; }
.cr-tray-btn { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 38px; padding: 0 10px; border-radius: var(--radius-sm); border: 0; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); color: var(--ink); font-size: 13px; font-weight: 600; cursor: pointer; text-align: left; }
.cr-tray-btn:hover { box-shadow: inset 0 0 0 1px var(--line-strong); }
.cr-tray-btn-pill { width: auto; border-radius: var(--radius-pill); height: 36px; }
.cr-tray-btn .cr-tray-done { margin-left: auto; display: inline-flex; align-items: center; gap: 3px; height: 20px; padding: 0 7px; border-radius: 10px; background: var(--accent); color: var(--on-accent); font-size: 11px; font-weight: 700; }
.cr-tray-idle { color: var(--ink-faint); font-weight: 500; }
.cr-tray-panel { width: 340px; max-width: calc(100vw - 24px); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-overlay), inset 0 0 0 1px var(--line); overflow: hidden; animation: cr-in .16s ease-out; }
.cr-tray-float { position: absolute; z-index: 20; left: 0; bottom: calc(100% + 8px); }
.cr-tray-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line); font-weight: 650; font-size: 14px; }
.cr-tray-list { list-style: none; margin: 0; padding: 4px 0; max-height: 360px; overflow-y: auto; }
.cr-tray-item { display: grid; grid-template-columns: 30px 1fr auto; gap: 10px; align-items: center; padding: 8px 14px; }
.cr-tray-item + .cr-tray-item { border-top: 1px solid var(--line); }
.cr-tray-kind { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--surface-sunken); color: var(--ink); }
.cr-tray-item-ok .cr-tray-kind { background: var(--accent); color: var(--on-accent); }
.cr-tray-item-refus .cr-tray-kind { background: var(--refus-bg); color: var(--refus-ink); }
.cr-tray-item-erreur .cr-tray-kind { background: var(--erreur-bg); color: var(--erreur-ink); }
.cr-tray-label { font-size: 13px; line-height: 18px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cr-tray-step { font-size: 12px; line-height: 16px; color: var(--ink-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cr-tray-foot { padding: 10px 14px; border-top: 1px solid var(--line); font-size: 12px; line-height: 16px; color: var(--ink-faint); }

/* Budget */
.cr-budget { display: flex; flex-direction: column; gap: 6px; padding: 10px; border-radius: var(--radius-sm); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.cr-budget-top { display: flex; align-items: baseline; gap: 6px; font-size: 12px; line-height: 16px; color: var(--ink-muted); }
.cr-budget-top b { font-family: var(--font-mono); font-weight: 500; font-size: 13px; color: var(--ink); }
.cr-budget-top .cr-spacer + span { font-family: var(--font-mono); }
.cr-budget-bar { height: 6px; border-radius: 3px; background: var(--surface-sunken); overflow: hidden; }
.cr-budget-bar span { display: block; height: 100%; border-radius: 3px; background: var(--ink); }
.cr-budget-warn .cr-budget-bar span { background: var(--refus-line); }
.cr-budget-full { background: var(--erreur-bg); box-shadow: inset 0 0 0 1.5px var(--erreur-line); }
.cr-budget-full .cr-budget-top, .cr-budget-full .cr-budget-top b { color: var(--erreur-ink); }
.cr-budget-full .cr-budget-bar { background: var(--surface); }
.cr-budget-full .cr-budget-bar span { background: var(--erreur-line); }
.cr-budget-note { font-size: 12px; line-height: 16px; color: var(--ink-faint); }
.cr-budget-full .cr-budget-note { color: var(--erreur-ink); }
.cr-budget-inline { flex-direction: row; align-items: center; gap: 10px; padding: 0 12px; height: 36px; border-radius: var(--radius-pill); }
.cr-budget-inline .cr-budget-bar { width: 64px; }

/* ---------- Données ---------- */
.cr-stats { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-5); }
.cr-stat { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cr-stat-label { font-size: 12px; line-height: 16px; color: var(--ink-faint); }
.cr-stat-value { font-family: var(--font-mono); font-size: 15px; line-height: 20px; font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cr-stats-lg .cr-stat-value { font-size: 26px; line-height: 30px; letter-spacing: -0.5px; }
.cr-stat-hint { font-size: 12px; line-height: 16px; color: var(--ink-muted); }
.cr-stats-inline { gap: 4px 0; font-size: 13px; line-height: 18px; color: var(--ink-muted); }
.cr-stats-inline .cr-stat { flex-direction: row; gap: 4px; align-items: baseline; }
.cr-stats-inline .cr-stat + .cr-stat::before { content: "·"; margin: 0 8px; color: var(--ink-faint); }
.cr-stats-inline .cr-stat-label { font-size: 13px; order: 2; color: var(--ink-muted); }
.cr-stats-inline .cr-stat-value { font-size: 13px; line-height: 18px; color: var(--ink); }

.cr-table-wrap { border-radius: var(--radius-md); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); overflow-x: auto; }
.cr-table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 20px; }
.cr-table th { position: sticky; top: 0; background: var(--surface); text-align: left; padding: 0; font-size: 12px; line-height: 16px; font-weight: 600; color: var(--ink-muted); border-bottom: 1px solid var(--line-strong); white-space: nowrap; }
.cr-table th > span, .cr-table th > button { display: flex; align-items: center; gap: 4px; padding: 10px 12px; width: 100%; border: 0; background: none; font: inherit; color: inherit; text-align: inherit; }
.cr-table th > button { cursor: pointer; }
.cr-table th > button:hover { color: var(--ink); }
.cr-table th[aria-sort="ascending"] > button, .cr-table th[aria-sort="descending"] > button { color: var(--ink); }
.cr-table th.cr-num-col > span, .cr-table th.cr-num-col > button { justify-content: flex-end; }
.cr-table td { padding: 12px; border-top: 1px solid var(--line); vertical-align: top; }
.cr-table tr:first-child td { border-top: 0; }
.cr-table tbody tr:hover td { background: color-mix(in srgb, var(--surface-sunken) 55%, var(--surface)); }
.cr-table td.cr-num-col { text-align: right; font-family: var(--font-mono); font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cr-table .cr-cell-strong { font-weight: 600; }
.cr-table .cr-sort-ic { opacity: .5; } .cr-table th[aria-sort] .cr-sort-ic { opacity: 1; }
@media (max-width: 720px) {
  .cr-table-cards .cr-table, .cr-table-cards .cr-table tbody, .cr-table-cards .cr-table tr, .cr-table-cards .cr-table td { display: block; width: 100%; }
  .cr-table-cards .cr-table thead { display: none; }
  .cr-table-cards .cr-table tr { padding: 12px var(--space-4); border-top: 1px solid var(--line); display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; }
  .cr-table-cards .cr-table tr:first-child { border-top: 0; }
  .cr-table-cards .cr-table td { padding: 0; border: 0; text-align: left !important; }
  .cr-table-cards .cr-table td[data-label]::before { content: attr(data-label); display: block; font-family: var(--font-sans); font-size: 11px; line-height: 14px; color: var(--ink-faint); }
  .cr-table-cards .cr-table td.cr-cell-wide { grid-column: 1 / -1; }
}

.cr-versions { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.cr-version { display: grid; grid-template-columns: 12px 1fr auto; gap: 10px; align-items: center; padding: 8px 0; position: relative; }
.cr-version::before { content: ""; position: absolute; left: 5px; top: 0; bottom: 0; width: 2px; background: var(--line); }
.cr-version:first-child::before { top: 50%; } .cr-version:last-child::before { bottom: 50%; }
.cr-version-dot { position: relative; z-index: 1; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); box-shadow: inset 0 0 0 2px var(--line-strong); }
.cr-version-current .cr-version-dot { background: var(--accent); box-shadow: inset 0 0 0 2px var(--ink); }
.cr-version-label { font-size: 13px; line-height: 18px; font-weight: 600; }
.cr-version-meta { font-size: 12px; line-height: 16px; color: var(--ink-faint); }

.cr-disc { border-radius: var(--radius-md); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.cr-disc + .cr-disc { margin-top: var(--space-2); }
.cr-disc-head { display: flex; align-items: center; gap: var(--space-3); width: 100%; min-height: 56px; padding: 10px var(--space-4); border: 0; background: none; text-align: left; cursor: pointer; color: var(--ink); border-radius: var(--radius-md); }
.cr-disc-head:hover { background: color-mix(in srgb, var(--surface-sunken) 50%, transparent); }
.cr-disc-head > .cr-icon:first-child { transition: transform .16s; color: var(--ink-muted); }
.cr-disc[data-open="true"] .cr-disc-head > .cr-icon:first-child { transform: rotate(90deg); }
.cr-disc-title { flex: 1; min-width: 0; font-weight: 600; font-size: 15px; line-height: 20px; }
.cr-disc-off .cr-disc-title { text-decoration: line-through; text-decoration-thickness: 1.5px; color: var(--ink-faint); }
.cr-disc-meta { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.cr-disc-body { padding: 4px var(--space-4) var(--space-4) calc(var(--space-4) + 30px); }
@media (max-width: 640px) { .cr-disc-body { padding-left: var(--space-4); } }

.cr-copy { border-radius: var(--radius-md); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; }
.cr-copy-head { display: flex; align-items: center; gap: var(--space-2); padding: 8px 8px 8px 14px; border-bottom: 1px solid var(--line); }
.cr-copy-head .cr-label { flex: 1; }
.cr-copy-text { padding: 12px 14px; white-space: pre-wrap; word-break: break-word; font-size: 14px; line-height: 21px; }
.cr-copy-long .cr-copy-text { font-family: var(--font-mono); font-size: 12px; line-height: 19px; max-height: 320px; overflow-y: auto; background: var(--surface-sunken); color: var(--ink); }
.cr-copy-tags { color: var(--ink-muted); }

/* ---------- Mises en page d'écran (exemples) ---------- */
.cr-studio { display: grid; grid-template-columns: 392px minmax(0, 1fr); gap: var(--space-5); align-items: start; }
.cr-recipe { position: sticky; top: var(--space-5); display: flex; flex-direction: column; gap: var(--space-5); padding: var(--space-5); border-radius: var(--radius-lg); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.cr-recipe-step { display: flex; flex-direction: column; gap: 10px; }
.cr-recipe-step-head { display: flex; align-items: center; gap: 8px; }
.cr-recipe-step-head .cr-label { flex: 1; }
.cr-recipe-n { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font: 500 11px/1 var(--font-mono); background: var(--ink); color: var(--paper); }
.cr-recipe-pick { color: var(--ink-muted); font-size: 13px; }
.cr-strip { display: flex; gap: 8px; overflow-x: auto; padding: 4px 4px 6px; margin: -4px -4px -6px; scrollbar-width: none; }
.cr-stage { position: relative; min-height: 640px; border-radius: var(--radius-lg); background: var(--stage); padding: var(--space-5); display: flex; flex-direction: column; gap: var(--space-4); }
.cr-stage-row { display: flex; gap: var(--space-3); justify-content: center; align-items: flex-start; min-width: 0; }
.cr-stage-row > .cr-slide { box-shadow: var(--shadow-slide); }
.cr-stage-caption { text-align: center; font-size: 13px; line-height: 18px; color: var(--ink-muted); }
.cr-stage-plate { background: var(--surface); border-radius: var(--radius-md); padding: var(--space-4); box-shadow: var(--shadow-raised); }
.cr-grid { display: grid; gap: var(--space-4); grid-template-columns: repeat(auto-fill, minmax(var(--min, 168px), 1fr)); }
.cr-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: var(--space-5); align-items: start; }
.cr-toolbar { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
@media (max-width: 1023px) { .cr-studio, .cr-split { grid-template-columns: minmax(0, 1fr); } .cr-recipe { position: static; padding: var(--space-4); border-radius: var(--radius-md); } .cr-stage { min-height: 0; padding: var(--space-4); border-radius: var(--radius-md); } }

/* Tiroir */
.cr-scrim { position: fixed; inset: 0; z-index: 30; background: var(--scrim); }
.cr-drawer { position: fixed; z-index: 31; top: 0; right: 0; bottom: 0; width: min(960px, 100vw); display: flex; flex-direction: column; background: var(--paper); border-radius: var(--radius-lg) 0 0 var(--radius-lg); box-shadow: var(--shadow-overlay); animation: cr-in .2s ease-out; }
.cr-drawer-head { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-4) var(--space-5); border-bottom: 1px solid var(--line); }
.cr-drawer-head > :first-child { flex: 1; }
.cr-drawer-tools { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; padding: var(--space-3) var(--space-5); border-bottom: 1px solid var(--line); }
.cr-drawer-body { flex: 1; overflow-y: auto; padding: var(--space-5); }
.cr-drawer-foot { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-5); border-top: 1px solid var(--line); background: var(--surface); }
@media (max-width: 640px) { .cr-drawer { top: 24px; width: 100vw; border-radius: var(--radius-lg) var(--radius-lg) 0 0; } .cr-drawer-head, .cr-drawer-tools, .cr-drawer-body, .cr-drawer-foot { padding-left: var(--space-4); padding-right: var(--space-4); } }

/* Éditeur de retouche */
.cr-editor { display: grid; grid-template-rows: auto minmax(0, 1fr); height: 100vh; background: var(--paper); }
.cr-editor-bar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: var(--space-3); padding: 10px var(--space-5); background: var(--surface); border-bottom: 1px solid var(--line); }
.cr-editor-bar-title { flex: 1; min-width: 0; }
.cr-editor-body { display: grid; grid-template-columns: 112px minmax(0, 1fr) 420px; min-height: 0; }
.cr-editor-strip { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: var(--space-4) var(--space-3); border-right: 1px solid var(--line); overflow-y: auto; background: var(--surface-sunken); }
.cr-editor-thumb { position: relative; display: block; width: 72px; flex: none; padding: 0; border: 0; background: none; cursor: pointer; border-radius: var(--radius-sm); text-align: left; color: inherit; }
.cr-editor-thumb .cr-slide { width: 100%; box-shadow: 0 0 0 1px var(--line); transition: box-shadow .16s; }
.cr-editor-thumb[aria-current="true"] .cr-slide { box-shadow: 0 0 0 3px var(--select); }
.cr-editor-thumb-flags { position: absolute; right: 4px; top: 4px; display: flex; flex-direction: column; gap: 3px; align-items: flex-end; }
.cr-editor-thumb-off .cr-slide { opacity: .35; }
.cr-editor-thumb-off::after { content: "retirée"; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) rotate(-8deg); padding: 1px 6px; border-radius: 4px; background: var(--ink); color: var(--paper); font-size: 11px; font-weight: 700; }
.cr-editor-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px var(--ink); }
.cr-editor-canvas { display: flex; flex-direction: column; align-items: center; gap: var(--space-3); padding: var(--space-5); background: var(--stage); min-width: 0; overflow-y: auto; }
.cr-editor-canvas .cr-slide { box-shadow: var(--shadow-slide); }
.cr-editor-pair { display: flex; gap: var(--space-4); align-items: flex-start; justify-content: center; width: 100%; }
.cr-editor-pair figure { display: flex; flex-direction: column; gap: 8px; align-items: center; flex: 1 1 0; max-width: 330px; min-width: 0; margin: 0; }
.cr-editor-pair figure .cr-slide { width: 100%; }
.cr-editor-pair figcaption { font-size: 12px; line-height: 16px; font-weight: 600; color: var(--ink-muted); display: flex; gap: 6px; align-items: center; }
.cr-editor-panel { display: flex; flex-direction: column; gap: var(--space-4); padding: var(--space-5); border-left: 1px solid var(--line); background: var(--surface); overflow-y: auto; }
.cr-editor-block { display: grid; grid-template-columns: 1fr; gap: 4px; }
@media (max-width: 1023px) { .cr-editor-body { grid-template-columns: minmax(0, 1fr); } .cr-editor-strip { flex-direction: row; border-right: 0; border-bottom: 1px solid var(--line); overflow-x: auto; } .cr-editor-thumb { width: 64px; flex: none; } .cr-editor-panel { border-left: 0; } }

/* Connexion */
.cr-login { display: grid; grid-template-columns: 1.1fr 1fr; min-height: 100vh; background: var(--paper); }
.cr-login-art { position: relative; overflow: hidden; background: var(--stage); display: flex; flex-direction: column; justify-content: space-between; padding: var(--space-6); }
.cr-login-fan { position: absolute; left: 50%; top: 52%; width: 0; height: 0; }
.cr-login-fan .cr-slide { position: absolute; width: 190px; left: -95px; top: -169px; box-shadow: var(--shadow-slide); transform-origin: 50% 120%; }
.cr-login-form { display: flex; flex-direction: column; justify-content: center; gap: var(--space-5); width: 100%; max-width: 380px; margin: 0 auto; padding: var(--space-6) var(--space-4); }
.cr-display-xl { font-family: var(--font-display); font-size: 56px; line-height: 56px; font-weight: 800; letter-spacing: -1.5px; }
@media (max-width: 860px) { .cr-login { grid-template-columns: 1fr; } .cr-login-art { min-height: 300px; } }

/* Téléphone : bouton de création collé au pouce */
@media (max-width: 1023px) {
  .cr-recipe-cta { position: sticky; bottom: 72px; z-index: 4; margin: 0 calc(-1 * var(--space-4)) calc(-1 * var(--space-4)); padding: var(--space-3) var(--space-4); background: var(--surface); border-top: 1px solid var(--line); border-radius: 0 0 var(--radius-md) var(--radius-md); }
}

/* ===================== Études ===================== */
.cr-root q { quotes: "« " " »" "“" "”"; }
.cr-format-no { font-family: var(--font-mono); font-size: 12px; font-weight: 500; color: var(--ink-faint); }

/* Verdict : cinq tons */
.cr-verdict { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: var(--radius-xs); font-size: 12px; line-height: 16px; font-weight: 650; white-space: nowrap; }
.cr-verdict-dessus { background: var(--accent); color: var(--on-accent); }
.cr-verdict-dans { background: var(--surface-sunken); color: var(--ink); }
.cr-verdict-dessous { background: transparent; color: var(--ink-muted); box-shadow: inset 0 0 0 1.5px var(--line-strong); }
.cr-verdict-piste { background: transparent; color: var(--ink-muted); border: 1.5px dashed var(--line-strong); }
.cr-verdict-nonclasse { background: transparent; color: var(--ink-faint); border: 1.5px dotted var(--line-strong); }

/* Fiabilité */
.cr-rel { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; line-height: 16px; color: var(--ink-muted); white-space: nowrap; }
.cr-rel-bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 14px; }
.cr-rel-bars i { display: block; width: 4px; border-radius: 1px; background: var(--line); }
.cr-rel-bars i:nth-child(1) { height: 6px; } .cr-rel-bars i:nth-child(2) { height: 10px; } .cr-rel-bars i:nth-child(3) { height: 14px; }
.cr-rel-bars i.on { background: var(--ink); }

/* Écart à la moyenne */
.cr-gap { --fill: var(--ink-muted); display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.cr-gap-good { --fill: var(--ink); }
.cr-gap-bad { --fill: var(--ink-faint); }
.cr-gap-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.cr-gap-label { flex: 1; min-width: 160px; font-size: 13px; line-height: 18px; color: var(--ink-muted); }
.cr-gap-value { font-size: 22px; line-height: 26px; font-weight: 500; letter-spacing: -0.4px; }
.cr-gap-delta { font-size: 12px; line-height: 16px; font-weight: 650; padding: 2px 7px; border-radius: var(--radius-xs); background: var(--surface-sunken); color: var(--ink-muted); white-space: nowrap; }
.cr-gap-good .cr-gap-delta { background: var(--accent); color: var(--on-accent); }
.cr-gap-bad .cr-gap-delta { background: transparent; box-shadow: inset 0 0 0 1px var(--line-strong); }
.cr-gap-track { position: relative; height: 10px; border-radius: 5px; background: var(--surface-sunken); margin-top: 14px; }
.cr-gap-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 5px; background: var(--fill); }
.cr-gap-fragile .cr-gap-fill { background: repeating-linear-gradient(-45deg, var(--fill) 0 4px, transparent 4px 7px); box-shadow: inset 0 0 0 1.5px var(--fill); }
.cr-gap-avg { position: absolute; top: -5px; bottom: -5px; width: 2px; margin-left: -1px; background: var(--ink); border-radius: 1px; }
.cr-gap-avg > span { position: absolute; bottom: calc(100% + 2px); left: 50%; transform: translateX(-50%); font-family: var(--font-mono); font-size: 11px; line-height: 12px; color: var(--ink-muted); white-space: nowrap; }
.cr-gap-compact { flex-direction: row; align-items: center; gap: 8px; }
.cr-gap-compact .cr-gap-track { width: 96px; height: 6px; margin-top: 0; flex: none; }
.cr-gap-compact .cr-gap-avg { top: -3px; bottom: -3px; }
.cr-gap-mini { font-size: 12px; color: var(--ink); width: 34px; text-align: right; }
.cr-pctcell { --fill: var(--ink-muted); display: inline-flex; align-items: center; gap: 8px; justify-content: flex-end; }
.cr-pctcell-track { position: relative; width: 56px; height: 5px; border-radius: 3px; background: var(--surface-sunken); }
.cr-pctcell-track span { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 3px; background: var(--fill); }
.cr-pctcell-track i { position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; background: var(--ink); }
.cr-pctcell.cr-gap-good { --fill: var(--ink); } .cr-pctcell.cr-gap-good .cr-num { font-weight: 650; }
.cr-pctcell.cr-gap-bad { --fill: var(--ink-faint); }

/* Tableaux : case vide, ligne mise en avant, ligne de moyenne, ligne éteinte */
.cr-cell-empty { color: var(--ink-faint); font-family: var(--font-mono); }
.cr-table tr.cr-row-ref td { background: color-mix(in srgb, var(--accent) 22%, var(--surface)); }
.cr-table tr.cr-row-ref td:first-child { box-shadow: inset 4px 0 0 var(--accent); }
.cr-table tr.cr-row-avg td { background: var(--surface-sunken); font-weight: 600; border-top: 1px solid var(--line-strong); }
.cr-table tr.cr-row-off td { color: var(--ink-faint); }
.cr-table tr.cr-row-off td .cr-link { color: var(--ink-muted); }

/* À retenir / Comment lire */
.cr-keys { border-radius: var(--radius-lg); background: var(--ink); color: var(--paper); padding: var(--space-5); }
.cr-keys-head { display: flex; align-items: center; gap: 10px; margin-bottom: var(--space-4); }
.cr-keys-head h2 { margin: 0; font-family: var(--font-display); font-size: 20px; line-height: 26px; font-weight: 700; letter-spacing: -0.3px; }
.cr-keys ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px 28px; }
.cr-keys li { display: grid; grid-template-columns: 28px 1fr; gap: 10px; font-size: 15px; line-height: 22px; }
.cr-keys-n { width: 26px; height: 26px; border-radius: 6px; display: grid; place-items: center; background: var(--accent); color: var(--on-accent); font: 500 13px/1 var(--font-mono); }
.cr-keys b, .cr-keys strong { font-weight: 700; }
.cr-method { border-radius: var(--radius-lg); background: var(--surface-sunken); box-shadow: inset 0 0 0 1px var(--line); }
.cr-method-head { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 52px; padding: 0 var(--space-5); border: 0; background: none; color: var(--ink); cursor: pointer; text-align: left; border-radius: var(--radius-lg); }
.cr-method-title { flex: 1; font-weight: 650; font-size: 15px; }
.cr-method-date { font-family: var(--font-mono); font-size: 12px; padding: 3px 8px; border-radius: var(--radius-xs); background: var(--surface); color: var(--ink-muted); box-shadow: inset 0 0 0 1px var(--line); white-space: nowrap; }
.cr-method-chev { transition: transform .16s; color: var(--ink-muted); }
.cr-method[data-open="true"] .cr-method-chev { transform: rotate(180deg); }
.cr-method-body { padding: 0 var(--space-5) var(--space-5) calc(var(--space-5) + 28px); display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px 28px; font-size: 14px; line-height: 21px; color: var(--ink-muted); }
.cr-method-body p { margin: 0; }
.cr-method-body b { color: var(--ink); font-weight: 650; }

/* Recette */
.cr-recipe-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; counter-reset: s; }
.cr-recipe-steps li { display: grid; grid-template-columns: 26px 1fr; gap: 12px; font-size: 14px; line-height: 21px; }
.cr-recipe-steps-n { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: var(--paper); font: 500 12px/1 var(--font-mono); }

/* Planche d'exemple */
.cr-ex { margin: 0; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.cr-ex-scroll { overflow-x: auto; border-radius: var(--radius-md); background: var(--stage); padding: 10px; scrollbar-width: thin; }
.cr-ex-img { display: block; height: 220px; width: auto; max-width: none; border-radius: var(--radius-xs); }
div.cr-ex-img { width: 610px; }
.cr-ex-ko .cr-ex-scroll { background: transparent; box-shadow: inset 0 0 0 1.5px var(--line-strong); }
.cr-ex figcaption { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.cr-ex-tag { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: var(--radius-xs); font-size: 12px; font-weight: 700; }
.cr-ex-tag-ok { background: var(--accent); color: var(--on-accent); }
.cr-ex-tag-ko { box-shadow: inset 0 0 0 1.5px var(--line-strong); color: var(--ink-muted); }
.cr-ex-hook { font-size: 15px; line-height: 21px; font-weight: 600; }
.cr-ex-meta { font-size: 12px; line-height: 16px; color: var(--ink-faint); display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.cr-ex-meta .cr-link { font-size: 12px; }
.cr-ex-note { font-size: 12px; line-height: 16px; color: var(--ink-muted); }

/* Formule à trous */
.cr-formula { display: flex; align-items: flex-start; gap: 8px; }
.cr-formula code { flex: 1; min-width: 0; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-sunken); font-family: var(--font-mono); font-size: 13px; line-height: 24px; color: var(--ink); word-break: break-word; }
.cr-hole { display: inline; padding: 1px 6px; margin: 0 1px; border-radius: 4px; border: 1px dashed var(--line-strong); background: var(--surface); color: var(--ink-muted); font-family: var(--font-sans); font-size: 13px; font-style: italic; -webkit-box-decoration-break: clone; box-decoration-break: clone; }

/* Accroches réelles */
.cr-hooks { list-style: none; margin: 0; padding: 0; border-radius: var(--radius-md); box-shadow: inset 0 0 0 1px var(--line); }
.cr-hooks li { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 10px 12px; }
.cr-hooks li + li { border-top: 1px solid var(--line); }
.cr-hooks-ic { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; }
.cr-hooks-ok .cr-hooks-ic { background: var(--accent); color: var(--on-accent); }
.cr-hooks-ko .cr-hooks-ic { box-shadow: inset 0 0 0 1.5px var(--line-strong); color: var(--ink-muted); }
.cr-hooks q { font-size: 14px; line-height: 20px; }
.cr-hooks-ko q { color: var(--ink-muted); }
.cr-hooks-meta { display: inline-flex; gap: 10px; align-items: baseline; font-size: 12px; color: var(--ink-faint); white-space: nowrap; }
.cr-hooks-meta .cr-link { font-size: 12px; }
.cr-hooks-ko li { grid-template-columns: 22px minmax(0, 1fr) auto; }

/* Fiche de catégorie */
.cr-cat { border-radius: var(--radius-lg); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); scroll-margin-top: 24px; }
.cr-cat + .cr-cat { margin-top: 10px; }
.cr-cat-rel2 { box-shadow: none; border: 1.5px dashed var(--line-strong); }
.cr-cat-rel1 { box-shadow: none; border: 1.5px dotted var(--line-strong); background: transparent; }
.cr-cat-head { display: grid; grid-template-columns: 56px minmax(0, 1fr) 210px 170px 20px; gap: 16px; align-items: center; width: 100%; padding: 14px 20px 14px 16px; border: 0; background: none; color: var(--ink); text-align: left; cursor: pointer; border-radius: var(--radius-lg); }
.cr-cat-head:hover { background: color-mix(in srgb, var(--surface-sunken) 45%, transparent); }
.cr-cat-rank { font-family: var(--font-display); font-weight: 800; font-size: 30px; line-height: 32px; letter-spacing: -1px; text-align: center; color: var(--ink); }
.cr-cat-rank small { font-size: 13px; font-weight: 700; letter-spacing: 0; margin-right: 1px; vertical-align: 10px; color: var(--ink-muted); }
.cr-cat-unranked .cr-cat-rank { color: var(--ink-faint); }
.cr-cat-title { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-width: 0; }
.cr-cat-name { font-size: 17px; line-height: 22px; font-weight: 650; }
.cr-cat-mini { display: flex; flex-direction: column; gap: 6px; }
.cr-cat-mini-row { display: grid; grid-template-columns: 62px auto; align-items: center; font-size: 11px; color: var(--ink-faint); }
.cr-cat[data-open="true"] .cr-cat-mini { visibility: hidden; }
.cr-cat-chev { color: var(--ink-muted); transition: transform .16s; }
.cr-cat[data-open="true"] .cr-cat-chev { transform: rotate(180deg); }
.cr-cat-body { display: flex; flex-direction: column; gap: 20px; padding: 0 24px 24px 88px; animation: cr-in .18s ease-out; }
.cr-cat-summary { font-size: 15px; line-height: 23px; color: var(--ink-muted); max-width: 760px; margin: 0; }
.cr-cat-gaps { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 40px; padding: 16px 20px 20px; border-radius: var(--radius-md); background: color-mix(in srgb, var(--surface-sunken) 55%, var(--surface)); }
.cr-cat-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 24px; margin: 0; }
.cr-cat-stats dt { font-size: 12px; line-height: 16px; color: var(--ink-faint); order: 2; }
.cr-cat-stats div { display: flex; flex-direction: column-reverse; gap: 2px; }
.cr-cat-stats dd { margin: 0; font-size: 20px; line-height: 24px; font-weight: 500; letter-spacing: -0.3px; }
.cr-cat-warn { display: flex; gap: 8px; align-items: flex-start; margin: 0; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--avert-bg); font-size: 13px; line-height: 19px; color: var(--ink); }
.cr-cat-sec { display: flex; flex-direction: column; gap: 12px; padding-top: 18px; border-top: 1px solid var(--line); }
.cr-cat-sec h4 { margin: 0; font-size: 13px; line-height: 18px; font-weight: 700; }
.cr-cat-examples { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 20px; }
.cr-cat-action { display: flex; gap: 8px; flex-wrap: wrap; padding-top: 18px; border-top: 1px solid var(--line); }

/* Sommaire */
.cr-toc { position: sticky; top: var(--space-5); max-height: calc(100vh - 48px); overflow-y: auto; display: flex; flex-direction: column; gap: 14px; padding: 4px 4px 16px; font-size: 13px; line-height: 18px; scrollbar-width: thin; }
.cr-toc-title { font-size: 11px; line-height: 16px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: var(--ink-faint); padding: 0 8px; }
.cr-toc a { color: inherit; text-decoration: none; border-radius: 6px; }
.cr-toc-part { display: flex; align-items: center; gap: 8px; padding: 6px 8px; font-weight: 650; color: var(--ink); }
.cr-toc-part .cr-num { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: var(--paper); font-size: 11px; }
.cr-toc-count { margin-left: auto; font-family: var(--font-mono); font-size: 11px; font-weight: 500; color: var(--ink-faint); }
.cr-toc ul { list-style: none; margin: 2px 0 0; padding: 0 0 0 10px; display: flex; flex-direction: column; gap: 1px; border-left: 1px solid var(--line); margin-left: 16px; }
.cr-toc li a { display: grid; grid-template-columns: 20px minmax(0, 1fr) 10px; gap: 6px; align-items: center; padding: 4px 8px; color: var(--ink-muted); }
.cr-toc a:hover { background: var(--surface-sunken); color: var(--ink); }
.cr-toc a[aria-current="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-raised), inset 0 0 0 1px var(--line); font-weight: 600; }
.cr-toc-rank { font-family: var(--font-mono); font-size: 11px; color: var(--ink-faint); }
.cr-toc-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cr-toc-unranked { opacity: .75; }
.cr-toc-dot { width: 10px; height: 10px; border-radius: 50%; }
.cr-toc-dot-dessus { background: var(--accent); box-shadow: inset 0 0 0 1.5px var(--ink); }
.cr-toc-dot-dans { background: var(--ink-faint); }
.cr-toc-dot-dessous { box-shadow: inset 0 0 0 1.5px var(--ink-faint); }
.cr-toc-dot-piste { border: 1.5px dashed var(--ink-faint); }
.cr-toc-dot-nonclasse { border: 1.5px dotted var(--line-strong); }

/* Mise en page d'une étude */
.cr-etude { display: grid; grid-template-columns: 232px minmax(0, 1fr); gap: var(--space-6); align-items: start; }
.cr-etude-part { scroll-margin-top: 24px; display: flex; flex-direction: column; gap: 14px; }
.cr-etude-part + .cr-etude-part { margin-top: var(--space-7); }
.cr-etude-part-head { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.cr-etude-part-head > div { flex: 1; min-width: 240px; }
.cr-etude-part-kicker { font-family: var(--font-mono); font-size: 12px; color: var(--ink-faint); }
.cr-etude-legend { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; font-size: 12px; line-height: 16px; color: var(--ink-muted); }
.cr-etude-legend .cr-gap-compact .cr-gap-track { width: 64px; }
.cr-etude-sub { font-size: 12px; line-height: 16px; color: var(--ink-faint); margin-top: 2px; }

@media (max-width: 1023px) {
  .cr-etude { grid-template-columns: minmax(0, 1fr); gap: var(--space-4); }
  .cr-toc { position: sticky; top: 56px; z-index: 5; max-height: none; flex-direction: row; overflow-x: auto; gap: 6px; padding: 8px var(--space-4); margin: 0 calc(-1 * var(--space-4)); background: color-mix(in srgb, var(--paper) 94%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); scrollbar-width: none; }
  .cr-toc-title, .cr-toc ul { display: none; }
  .cr-toc-sec { flex: none; }
  .cr-toc-part { border-radius: var(--radius-pill); box-shadow: inset 0 0 0 1px var(--line-strong); background: var(--surface); padding: 6px 12px 6px 6px; white-space: nowrap; }
  .cr-cat-head { grid-template-columns: 40px minmax(0, 1fr) 18px; gap: 10px; padding: 12px 14px 12px 10px; }
  .cr-cat-rank { font-size: 24px; }
  .cr-cat-mini, .cr-cat-head > .cr-rel { grid-column: 2 / 4; }
  .cr-cat[data-open="true"] .cr-cat-mini { display: none; }
  .cr-cat-body { padding: 0 14px 16px; }
  .cr-cat-gaps { grid-template-columns: 1fr; padding: 14px; }
  .cr-cat-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cr-cat-examples { grid-template-columns: minmax(0, 1fr); }
  .cr-ex-img { height: 180px; }
  .cr-hooks li { grid-template-columns: 22px minmax(0, 1fr); }
  .cr-hooks li > .cr-hooks-meta, .cr-hooks li > .cr-btn { grid-column: 2; justify-self: start; }
  .cr-keys { padding: var(--space-4); border-radius: var(--radius-md); }
  .cr-keys ol { grid-template-columns: 1fr; }
  .cr-method-body { padding: 0 var(--space-4) var(--space-4); }
  .cr-method-head { padding: 0 var(--space-4); }
  .cr-formula { flex-direction: column; }
  .cr-formula .cr-btn { align-self: flex-end; }
}
.cr-page > *, .cr-etude > *, .cr-studio > *, .cr-split > * { min-width: 0; }
.cr-table-wrap, .cr-cell-empty { position: relative; }
.cr-table-dense td { padding: 10px 8px; } .cr-table-dense th > span, .cr-table-dense th > button { padding: 10px 8px; }
.cr-table-dense td:first-child, .cr-table-dense th:first-child > * { padding-left: 14px; }
