/* Kit commun des démonstrations : barre de retour au portfolio, sélecteur de palette,
   panneau « Adapter ce modèle », notifications, comparateur avant/après.
   Ces styles ont leurs propres couleurs pour rester identiques sur les dix modèles. */

:root { --dk-ink: #f4f5f2; --dk-bg: rgba(16, 17, 21, .92); --dk-line: rgba(255, 255, 255, .14); --dk-accent: #5b6cff; }

html.dk-switching, html.dk-switching * { transition: background-color .5s ease, color .5s ease, border-color .5s ease, fill .5s ease, stroke .5s ease !important; }

.dk-bar {
  position: fixed; z-index: 900; left: 50%; transform: translateX(-50%);
  bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  display: flex; align-items: center; gap: 6px; padding: 7px;
  background: var(--dk-bg); color: var(--dk-ink); border: 1px solid var(--dk-line); border-radius: 999px;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 18px 40px -16px rgba(0, 0, 0, .55);
  font: 500 14px/1 "Geist", "Segoe UI", system-ui, sans-serif; max-width: calc(100vw - 24px);
  animation: dk-in .5s cubic-bezier(.2, .8, .2, 1) both .3s;
}
@keyframes dk-in { from { opacity: 0; transform: translate(-50%, 20px); } }
.dk-bar a, .dk-bar button { color: inherit; font: inherit; text-decoration: none; background: none; border: 0; cursor: pointer; }
.dk-back { display: inline-flex; align-items: center; gap: 7px; padding: 10px 15px 10px 11px; border-radius: 999px; white-space: nowrap; background: rgba(255, 255, 255, .13) !important; font-weight: 700 !important; }
.dk-back svg { width: 19px; height: 19px; flex: none; transition: transform .2s; }
.dk-back:hover { background: rgba(255, 255, 255, .22) !important; }
.dk-back:hover svg { transform: translateX(-3px); }
.dk-name { padding: 0 6px; opacity: .7; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 16ch; }
.dk-pal { display: flex; gap: 4px; padding: 0 4px; border-left: 1px solid var(--dk-line); border-right: 1px solid var(--dk-line); }
.dk-pal button { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; position: relative; }
.dk-pal button i { width: 20px; height: 20px; border-radius: 50%; display: block; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25); transition: transform .2s; }
.dk-pal button[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--dk-ink); }
.dk-pal button:hover i { transform: scale(1.12); }
.dk-pal button span { position: absolute; bottom: calc(100% + 10px); left: 50%; transform: translateX(-50%); background: #fff; color: #111; padding: 5px 8px; border-radius: 6px; font-size: 11px; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .15s; }
.dk-pal button:hover span, .dk-pal button:focus-visible span { opacity: 1; }
.dk-cta { padding: 10px 16px; border-radius: 999px; background: var(--dk-ink) !important; color: #111 !important; font-weight: 600 !important; white-space: nowrap; }
.dk-info { display: inline-flex; align-items: center; gap: 6px; padding: 10px 13px; border-radius: 999px; white-space: nowrap; box-shadow: inset 0 0 0 1px var(--dk-line); }
.dk-info:hover, .dk-info[aria-expanded="true"] { background: rgba(255, 255, 255, .1) !important; }
.dk-bar :focus-visible { outline: 2px solid var(--dk-accent); outline-offset: 2px; }
.dk-info i { font: italic 700 13px/18px Georgia, serif; width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid currentColor; display: grid; place-items: center; }
.dk-info em { font-style: normal; }
@media (max-width: 560px) { .dk-name { display: none; } .dk-back b span { display: none; } .dk-cta { padding-inline: 12px; } .dk-info span { display: none; } }
@media (max-width: 420px) { .dk-bar { gap: 4px; padding: 5px; } .dk-cta span { display: none; } .dk-info em { display: none; } .dk-info { padding: 10px; } .dk-back { padding: 10px 12px 10px 9px; } .dk-pal { gap: 2px; padding: 0 2px; } .dk-pal button { width: 28px; height: 28px; } }

.dk-panel {
  position: fixed; z-index: 901; left: 50%; bottom: calc(76px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%);
  width: min(440px, calc(100vw - 24px)); background: #fff; color: #15161a; border-radius: 20px; padding: 22px;
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .45); display: grid; gap: 12px;
  font: 400 15px/1.55 "Geist", "Segoe UI", system-ui, sans-serif;
  animation: dk-pop .3s cubic-bezier(.2, .8, .2, 1) both;
}
@keyframes dk-pop { from { opacity: 0; transform: translate(-50%, 12px) scale(.97); } }
.dk-panel b.t { font-size: 18px; font-weight: 700; letter-spacing: -.01em; }
.dk-panel p { margin: 0; color: #4b4e57; }
.dk-panel ol { margin: 0; padding-left: 20px; display: grid; gap: 4px; color: #4b4e57; }
.dk-panel .row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.dk-panel a { display: inline-flex; padding: 10px 16px; border-radius: 999px; background: #15161a; color: #fff; text-decoration: none; font-weight: 600; }
.dk-fiche { max-height: calc(100vh - 110px); max-height: calc(100dvh - 110px); overflow-y: auto; overscroll-behavior: contain; gap: 8px; }
.dk-fiche .h { font: 600 11px/1.2 "Geist Mono", ui-monospace, monospace; text-transform: uppercase; letter-spacing: .06em; color: #6b6f7a; margin-top: 6px; }
.dk-fiche ul { margin: 0; padding-left: 18px; display: grid; gap: 5px; color: #2f323a; font-size: 14px; line-height: 1.45; }
.dk-fiche ul.fn { list-style: none; padding: 0; }
.dk-fiche ul.fn li { display: flex; gap: 8px; align-items: baseline; }
.dk-fiche ul.fn span { flex: none; font: 600 10.5px "Geist Mono", ui-monospace, monospace; padding: 3px 6px; border-radius: 5px; min-width: 9.8em; text-align: center; }
.dk-fiche li.ok span { background: #d9f2e1; color: #135c2c; }
.dk-fiche li.demo span { background: #fbe8c8; color: #7a4a00; }
.dk-fiche .note { font-size: 13px; color: #6b6f7a; }
.dk-panel button { padding: 10px 16px; border-radius: 999px; background: #eceef2; border: 0; font: inherit; font-weight: 600; cursor: pointer; }

.dk-toast {
  position: fixed; z-index: 950; left: 50%; top: calc(16px + env(safe-area-inset-top, 0px)); transform: translateX(-50%);
  background: #15161a; color: #fff; padding: 12px 18px; border-radius: 12px; max-width: calc(100vw - 32px);
  font: 500 14px/1.4 "Geist", "Segoe UI", system-ui, sans-serif; box-shadow: 0 16px 30px -12px rgba(0, 0, 0, .5);
  animation: dk-toast 3.2s ease both;
}
@keyframes dk-toast { 0% { opacity: 0; transform: translate(-50%, -12px); } 10%, 85% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; transform: translate(-50%, -8px); } }

.dk-note { display: inline-flex; align-items: center; gap: 6px; font-size: .72rem; letter-spacing: .04em; text-transform: uppercase; font-weight: 600; padding: 3px 8px; border-radius: 6px; background: rgba(127, 127, 127, .16); }

/* Comparateur avant / après */
.dk-ba { position: relative; overflow: hidden; user-select: none; touch-action: pan-y; --pos: 50%; }
.dk-ba > .after { position: absolute; inset: 0; clip-path: inset(0 0 0 var(--pos)); }
.dk-ba input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: ew-resize; margin: 0; z-index: 3; }
.dk-ba .dk-handle { position: absolute; top: 0; bottom: 0; left: var(--pos); width: 2px; background: #fff; z-index: 2; pointer-events: none; transform: translateX(-1px); }
.dk-ba .dk-handle::after { content: "⟷"; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 42px; height: 42px; border-radius: 50%; background: #fff; color: #111; display: grid; place-items: center; box-shadow: 0 6px 18px rgba(0, 0, 0, .35); font-size: 18px; }

.dk-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }


@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
html { overflow-x: clip; }
body { padding-bottom: 76px; overflow-x: clip; }

/* Confirmation de formulaire (chaque modèle peut la restyler) */
.dk-success { display: grid; gap: 10px; justify-items: start; padding: 24px; border-radius: 14px; border: 1px solid currentColor; border-color: color-mix(in srgb, currentColor 20%, transparent); }
.dk-success strong { font-size: 1.25rem; }
.dk-success p { margin: 0; }
.dk-success button { font: inherit; padding: 10px 16px; border-radius: 999px; border: 1px solid color-mix(in srgb, currentColor 30%, transparent); background: none; color: inherit; cursor: pointer; }

/* Écrans tactiles : pas d'effets coûteux pendant le défilement, pour qu'il reste fluide */
@media (hover: none), (max-width: 760px) {
  *, *::before, *::after { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }
}
@media (max-width: 360px) { .dk-back b { display: none; } .dk-back { padding: 10px 11px; } }
