/* Base de connaissance : accent vert (charte des services) */
:root { --kb: #1f7a54; --kb-soft: #e6f5ee; --kb-ink: #12372b; --kb-warm: #fff6dc; }
.kb-subnav { background: var(--kb-soft); border-bottom: 1px solid #c8e6d6; }
.kb-subnav-inner { display: flex; flex-wrap: wrap; padding-block: .6rem; }
.kb-subnav nav { display: flex; flex-wrap: wrap; gap: .5rem 1.1rem; }
.kb-subnav a { color: var(--kb-ink); font-weight: 600; text-decoration: none; padding: .25rem .5rem; border-radius: 999px; }
.kb-subnav a:hover, .kb-subnav a:focus-visible { background: #fff; outline: 2px solid var(--kb); }
.kb-subnav a.kb-subnav-write { background: var(--kb); color: #fff; }
.kb-count { display: inline-block; min-width: 1.4rem; padding: 0 .35rem; border-radius: 999px; background: #c0392b; color: #fff; font-size: .8rem; text-align: center; }
.kb-flash { background: var(--kb-soft); border-left: 4px solid var(--kb); padding: .6rem 1rem; margin: 1rem 0; }
.kb-alert { background: var(--kb-warm); border-left: 4px solid #d4a017; padding: .6rem 1rem; margin: 1rem 0; }
.kb-errors { background: #ffe9e6; border-left: 4px solid #b43a2f; padding: .4rem 1rem; margin: 1rem 0; }
.kb-page { padding-block: 1.5rem 3rem; }
.kb-narrow { max-width: 46rem; }
.kb-lead { max-width: 52rem; font-size: 1.05rem; }
.kb-small { font-size: .88rem; color: #4f6359; }
.kb-hero { background: linear-gradient(135deg, #e6f5ee, #fff6dc 70%, #f1eafc); text-align: center; padding: 2.5rem 0 1.5rem; }
.kb-hero h1 { color: var(--kb-ink); margin: .25rem 0; }
.kb-emoji { font-size: 3.5rem; margin: 0; line-height: 1; }
.kb-search { display: flex; flex-wrap: wrap; gap: .5rem; max-width: 44rem; margin: 1rem auto .6rem; justify-content: center; }
.kb-search input[type=search] { flex: 1 1 18rem; min-width: 0; font-size: 1.1rem; padding: .7rem 1rem; border: 2px solid var(--kb); border-radius: 999px; }
.kb-chips { display: flex; flex-wrap: wrap; gap: .4rem; justify-content: center; }
.kb-chip { display: inline-block; padding: .15rem .7rem; border-radius: 999px; background: #fff; border: 1px solid #b9dcc9; color: var(--kb-ink); text-decoration: none; font-size: .9rem; }
.kb-chip small { color: #6a8378; }
.kb-chip:hover, .kb-chip:focus-visible { border-color: var(--kb); }
.kb-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); gap: 1rem; padding-block: 1rem; }
.kb-tile { display: flex; flex-direction: column; gap: .25rem; padding: 1.1rem; border-radius: 1.2rem; color: var(--kb-ink); text-decoration: none; transition: transform .15s; }
.kb-tile span { font-size: 2rem; }
.kb-tile:hover, .kb-tile:focus-visible { transform: translateY(-3px); outline: 2px solid var(--kb); }
.kb-tile--fiche { background: #dff3e9; } .kb-tile--article { background: #fff1c9; } .kb-tile--retour { background: #fde0ec; } .kb-tile--cas { background: #e4e9ff; } .kb-tile--quiz { background: #efe5fb; }
.kb-daily { display: grid; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); gap: 1rem; padding-block: 1rem; }
.kb-panel { padding: 1.1rem; border: 1px solid #cfe6db; border-radius: 1.2rem; background: #fff; }
.kb-panel h2 { margin-top: 0; font-size: 1.15rem; }
.kb-panel .kb-card { border: 0; padding: 0; box-shadow: none; height: auto; }
.kb-panel--cas { background: linear-gradient(135deg, #fff, #eef1ff); }
.kb-question { font-weight: 700; font-size: 1.1rem; }
.kb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: 1rem; margin-block: 1rem; }
.kb-card { display: flex; flex-direction: column; padding: 1rem; border: 1px solid #cfe6db; border-top: 6px solid var(--kb); border-radius: 1rem; background: #fff; height: 100%; box-sizing: border-box; }
.kb-card--article { border-top-color: #e0a800; } .kb-card--retour { border-top-color: #d81b7a; } .kb-card--cas { border-top-color: #4a5fd1; }
.kb-card h3 { margin: .2rem 0; font-size: 1.1rem; } .kb-card h3 a { color: inherit; }
.kb-card-type { margin: 0; font-size: .82rem; font-weight: 700; color: #4f6359; text-transform: uppercase; letter-spacing: .02em; }
.kb-card-resume { color: #33473e; flex: 1; }
.kb-card-meta { display: flex; flex-wrap: wrap; gap: .3rem .9rem; margin: .4rem 0 0; font-size: .88rem; color: #4f6359; }
.kb-why { display: grid; grid-template-columns: 2fr 1fr; gap: 1.5rem; padding-block: 1.5rem; align-items: start; }
.kb-benefits li { margin-bottom: .5rem; }
.kb-podium { padding-left: 1.4rem; } .kb-podium li { margin-bottom: .3rem; } .kb-podium span { color: #4f6359; font-size: .9rem; }
.kb-disclaimer { font-size: .88rem; color: #4f6359; }
.kb-disclaimer--box { padding: .7rem 1rem; border-radius: .8rem; background: #fff1e6; border-left: 4px solid #d9822b; color: #5b3a12; }
.kb-empty { padding: 1.5rem; border-radius: 1rem; background: var(--kb-warm); text-align: center; }

/* Recherche */
.kb-filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .6rem 1rem; padding: 1rem; margin-bottom: 1rem; border-radius: 1rem; background: var(--kb-soft); }
.kb-filters label { display: flex; flex-direction: column; font-size: .9rem; gap: .2rem; }
.kb-filters-q { flex: 1 1 14rem; }
.kb-filters input, .kb-filters select { padding: .4rem; border: 1px solid #9ac7b1; border-radius: .4rem; }
.kb-pager { display: flex; gap: 1rem; justify-content: center; margin-top: 1rem; }

/* Contenu */
.kb-article { max-width: 54rem; }
.kb-breadcrumb { font-size: .88rem; } .kb-breadcrumb a { color: #4f6359; }
.kb-type-big { font-size: .95rem; }
.kb-une { color: #b8860b; }
.kb-byline { color: #4f6359; }
.kb-byline a { font-weight: 700; }
.kb-level { display: inline-block; padding: 0 .5rem; border-radius: 999px; background: var(--kb-soft); font-size: .85rem; }
.kb-tags { display: flex; flex-wrap: wrap; gap: .4rem; }
.kb-tags--keys { display: block; color: #4f6359; }
.kb-body { line-height: 1.65; } .kb-body h2 { margin-top: 1.6rem; }
.kb-box { margin: 1.2rem 0; padding: .8rem 1.1rem; border-radius: 1rem; }
.kb-box h2 { margin-top: 0; font-size: 1.15rem; }
.kb-box--symptomes { background: #fff6dc; } .kb-box--conduite { background: #e6f5ee; } .kb-box--prevention { background: #eaf1fb; }
.kb-box--quiz { background: #f2ecfb; border: 2px dashed #b9a3e3; }
.kb-choices { list-style: none; padding: 0; display: grid; gap: .5rem; }
.kb-choices button, .kb-game-choices button { width: 100%; padding: .7rem .9rem; border: 2px solid #b9a3e3; border-radius: .8rem; background: #fff; font: inherit; text-align: left; cursor: pointer; color: inherit; }
.kb-choices button:disabled, .kb-game-choices button:disabled { opacity: 1; cursor: default; }
.kb-choices button.is-good, .kb-game-choices button.is-good { border-color: #1f7a54; background: #dff3e9; }
.kb-choices button.is-bad, .kb-game-choices button.is-bad { border-color: #b43a2f; background: #fde4e1; }
.kb-feedback { font-weight: 700; min-height: 1.4rem; }
.kb-solution summary { cursor: pointer; font-weight: 700; color: #6a2fb5; }
.kb-reactions, .kb-owner { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin: 1.5rem 0; }
.kb-owner form { margin: 0; }
.btn--danger { background: #b43a2f; border-color: #b43a2f; color: #fff; }
.kb-copied { color: var(--kb); font-weight: 700; }
.kb-author-box { display: flex; gap: 1rem; align-items: flex-start; padding: 1rem; border-radius: 1rem; background: var(--kb-soft); margin: 1.5rem 0; }
.kb-author-avatar { font-size: 2.6rem; margin: 0; line-height: 1; }
.kb-author-avatar--big { font-size: 4rem; }
.kb-author-head { display: flex; gap: 1.2rem; align-items: center; }
.kb-badges-inline span { font-size: 1.3rem; margin-right: .2rem; }
.kb-comments { margin-top: 2rem; }
.kb-comment { padding: .6rem .9rem; border-left: 3px solid #cfe6db; margin-bottom: .8rem; background: #fff; border-radius: 0 .6rem .6rem 0; }
.kb-comment--hidden { opacity: .55; }
.kb-comment-head { margin: 0; font-size: .88rem; color: #4f6359; }
.kb-comment-actions { display: flex; gap: .8rem; }
.kb-comment-actions form, .kb-inline { display: inline; margin: 0; }
.kb-link { border: 0; background: none; padding: 0; color: var(--kb); text-decoration: underline; cursor: pointer; font: inherit; font-size: .88rem; }
.kb-comment-form { display: grid; gap: .5rem; margin-top: 1rem; }
.kb-comment-form textarea { width: 100%; padding: .6rem; border: 1px solid #9ac7b1; border-radius: .6rem; font: inherit; box-sizing: border-box; }
.kb-related { margin-top: 2rem; }

/* Éditeur guidé */
.kb-editor { max-width: 60rem; }
.kb-progress { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: .4rem; margin: 1rem 0; }
.kb-progress button { width: 100%; display: flex; flex-direction: column; align-items: center; gap: .1rem; padding: .5rem .2rem; border: 2px solid #cfe6db; border-radius: .9rem; background: #fff; font: inherit; font-size: .85rem; cursor: pointer; color: var(--kb-ink); }
.kb-progress-egg { font-size: 1.5rem; }
.kb-progress li.is-current button { border-color: var(--kb); background: var(--kb-soft); font-weight: 700; }
.kb-progress li.is-done button { border-color: #8cc7a8; }
.kb-step { padding: 1rem 1.2rem; border: 1px solid #cfe6db; border-radius: 1.2rem; background: #fff; margin-bottom: 1rem; }
.kb-step h2 { margin-top: 0; }
.kb-step-nav { display: flex; justify-content: space-between; gap: 1rem; }
.kb-type-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: .8rem; }
.kb-type-card { position: relative; display: flex; flex-direction: column; gap: .3rem; padding: 1rem; border: 2px solid #cfe6db; border-radius: 1rem; cursor: pointer; background: #fff; }
.kb-type-card input { position: absolute; opacity: 0; }
.kb-type-card:has(input:checked) { border-color: var(--kb); background: var(--kb-soft); box-shadow: 0 0 0 3px #b9e2cc; }
.kb-type-card:has(input:focus-visible) { outline: 2px solid var(--kb); }
.kb-type-emoji { font-size: 2.2rem; }
.kb-tip { padding: .6rem .9rem; border-radius: .8rem; background: var(--kb-warm); }
.kb-field { display: flex; flex-direction: column; gap: .25rem; margin: .8rem 0; font-weight: 600; }
.kb-field input[type=text], .kb-field textarea, .kb-field select { padding: .5rem; border: 1px solid #9ac7b1; border-radius: .5rem; font: inherit; font-weight: 400; }
.kb-field small { font-weight: 400; color: #4f6359; }
fieldset.kb-field { border: 1px solid #cfe6db; border-radius: .8rem; padding: .6rem .9rem; }
.kb-especes { display: flex; flex-direction: row; flex-wrap: wrap; gap: .3rem 1rem; }
.kb-especes legend { font-weight: 600; }
.kb-check { display: inline-flex; gap: .3rem; align-items: center; font-weight: 400; }
.kb-counter { font-weight: 400; font-size: .82rem; color: #9a5b00; }
.kb-counter.is-ok { color: var(--kb); }
.kb-counter.is-ok::before { content: "✓ "; }
.kb-choice-row { display: flex; gap: .5rem; align-items: center; margin: .3rem 0; }
.kb-choice-row input[type=text] { flex: 1; padding: .45rem; border: 1px solid #9ac7b1; border-radius: .5rem; font: inherit; }
.kb-quality { display: flex; flex-wrap: wrap; gap: 1.5rem; align-items: center; }
.kb-gauge { --score: 0; width: 7rem; height: 7rem; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--kb) calc(var(--score) * 1%), #e5efe9 0); }
.kb-gauge span { display: grid; place-items: center; width: 5.4rem; height: 5.4rem; border-radius: 50%; background: #fff; font-size: 1.6rem; font-weight: 800; color: var(--kb-ink); }
.kb-gauge span::after { content: "/100"; font-size: .7rem; font-weight: 400; }
.kb-checklist { list-style: none; padding: 0; margin: 0; }
.kb-checklist li { margin: .2rem 0; } .kb-checklist li.is-ok { color: var(--kb); }
.kb-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1rem; }
.kb-avatars { display: flex; flex-wrap: wrap; gap: .4rem; }
.kb-avatar input { position: absolute; opacity: 0; }
.kb-avatar span { display: inline-grid; place-items: center; width: 2.6rem; height: 2.6rem; border-radius: 50%; border: 2px solid #cfe6db; font-size: 1.5rem; cursor: pointer; }
.kb-avatar input:checked + span { border-color: var(--kb); background: var(--kb-soft); }
.kb-avatar input:focus-visible + span { outline: 2px solid var(--kb); }

/* Profil, récompenses, classement */
.kb-profile-card { display: grid; grid-template-columns: minmax(12rem, 16rem) 1fr; gap: 1rem; padding: 1rem; margin: 1rem 0; border: 1px solid #cfe6db; border-radius: 1.2rem; background: #fff; }
.kb-level-box { text-align: center; }
.kb-level-emoji { font-size: 3rem; margin: 0; }
.kb-level-bar { height: .7rem; border-radius: 999px; background: #e5efe9; overflow: hidden; }
.kb-level-bar span { display: block; height: 100%; background: linear-gradient(90deg, #8cc7a8, var(--kb)); }
.kb-stats { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem 1.4rem; margin: 0 0 .6rem; }
.kb-badges { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr)); gap: .5rem; grid-column: 1 / -1; }
.kb-badges li { display: flex; flex-direction: column; align-items: center; text-align: center; padding: .5rem; border-radius: .8rem; background: var(--kb-soft); }
.kb-badges li span { font-size: 1.8rem; }
.kb-badges li small { font-size: .75rem; color: #4f6359; }
.kb-badges li.is-locked { background: #f3f3f3; filter: grayscale(1); opacity: .55; }
.kb-tabs a { display: inline-block; padding: .3rem .9rem; border-radius: 999px; border: 1px solid #cfe6db; text-decoration: none; color: var(--kb-ink); margin-right: .3rem; }
.kb-tabs a.is-active { background: var(--kb); color: #fff; border-color: var(--kb); }
.kb-ranking { list-style: none; padding: 0; max-width: 40rem; }
.kb-ranking li { display: grid; grid-template-columns: 3rem 1fr auto auto; gap: .6rem; align-items: center; padding: .6rem .9rem; border-radius: .9rem; background: #fff; border: 1px solid #cfe6db; margin-bottom: .4rem; }
.kb-ranking li.kb-rank-1 { background: #fff6dc; border-color: #e6c35c; } .kb-ranking li.kb-rank-2 { background: #f4f6f8; } .kb-ranking li.kb-rank-3 { background: #fbefe6; }
.kb-rank { font-size: 1.4rem; text-align: center; font-weight: 800; }
.kb-rank-pts { font-weight: 800; color: var(--kb); }
.kb-rules { margin-top: 2rem; }
.kb-points-list { columns: 2; }
.kb-levels { display: flex; flex-wrap: wrap; gap: .5rem 1.2rem; }
.kb-levels small { color: #4f6359; }
.kb-table-wrap { overflow-x: auto; }
.kb-table { width: 100%; border-collapse: collapse; min-width: 36rem; }
.kb-table th, .kb-table td { padding: .5rem; border-bottom: 1px solid #e1efe7; text-align: left; vertical-align: top; }
.kb-table th { background: var(--kb-soft); }
.kb-status { display: inline-block; padding: .05rem .6rem; border-radius: 999px; font-size: .82rem; font-weight: 700; background: #eee; }
.kb-status--publie { background: #dff3e9; color: #12372b; } .kb-status--soumis { background: #e4e9ff; color: #26307a; }
.kb-status--a_revoir { background: #fff1c9; color: #6b4e00; } .kb-status--refuse { background: #fde4e1; color: #7a1f17; }
.kb-review-note { margin: .3rem 0 0; font-size: .88rem; color: #6b4e00; }
.kb-points-detail { margin: .5rem 0 1rem; }

/* Relecture */
.kb-review-grid { display: grid; grid-template-columns: 1fr 20rem; gap: 1.5rem; align-items: start; }
.kb-review-preview { padding: 1rem; border: 1px solid #cfe6db; border-radius: 1rem; background: #fff; }
.kb-review-side { position: sticky; top: 1rem; padding: 1rem; border-radius: 1rem; background: var(--kb-soft); }
.kb-reported { list-style: none; padding: 0; } .kb-reported li { padding: .6rem; border-bottom: 1px solid #e1efe7; }
.kb-admin { margin-top: 2rem; padding: 1rem; border-radius: 1rem; background: #f6f7f8; }
.kb-history { font-size: .88rem; padding-left: 1rem; }

/* Quiz */
.kb-game { max-width: 50rem; }
.kb-score-bar { display: flex; flex-wrap: wrap; gap: 1rem; padding: .6rem 1rem; border-radius: 999px; background: var(--kb-soft); }
.kb-game-card { margin-top: 1rem; padding: 1.2rem; border-radius: 1.2rem; background: #fff; border: 1px solid #cfe6db; box-shadow: 0 6px 18px rgba(18,55,43,.08); }
.kb-game-end { text-align: center; }
.kb-game-choices { display: grid; gap: .5rem; margin: .8rem 0; }

@media (max-width: 760px) {
  .kb-why, .kb-review-grid, .kb-profile-card { grid-template-columns: 1fr; }
  .kb-progress { grid-template-columns: repeat(5, minmax(3.5rem, 1fr)); overflow-x: auto; }
  .kb-progress button { font-size: .72rem; }
  .kb-points-list { columns: 1; }
  .kb-review-side { position: static; }
}
.kb-step-nav [hidden], .kb-progress[hidden], .kb-step[hidden] { display: none; }

/* Photos (Cloudinary) */
.kb-cover-preview { display: grid; place-items: center; aspect-ratio: 1200 / 630; max-width: 30rem; border: 2px dashed #b9dcc9; border-radius: .9rem; background: #f6faf8; color: #6a8378; overflow: hidden; }
.kb-cover-preview img { width: 100%; height: 100%; object-fit: cover; }
.kb-upload-row { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .8rem; }
.kb-upload-status { font-size: .9rem; font-weight: 600; color: var(--kb); }
.kb-upload-status.is-error { color: #b43a2f; }
.kb-cover-figure { margin: 1rem 0; }
.kb-cover-figure img { width: 100%; height: auto; border-radius: 1rem; display: block; }
.kb-body img, .rich-surface img { max-width: 100%; height: auto; border-radius: .8rem; display: block; margin: 1rem 0; }
.kb-card-photo { display: block; margin: -1rem -1rem .6rem; }
.kb-card-photo img { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-radius: .8rem .8rem 0 0; display: block; }
.kb-card--photo { border-top-width: 0; }
.kb-panel .kb-card-photo { margin: 0 0 .6rem; }
.kb-panel .kb-card-photo img { border-radius: .8rem; }
