/* ClicShot - interface de l'éditeur */

/* Plus Jakarta Sans (SIL OFL 1.1, voir fonts/OFL.txt) - police variable 200–800, hébergée localement. */
@font-face {
    font-family: "Plus Jakarta Sans";
    font-style: normal;
    font-weight: 200 800;
    font-display: swap;
    src: url("../fonts/plus-jakarta-sans-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: "Plus Jakarta Sans";
    font-style: normal;
    font-weight: 200 800;
    font-display: swap;
    src: url("../fonts/plus-jakarta-sans-latin-ext.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Police du code (outil Code) : JetBrains Mono, SIL OFL 1.1 (voir fonts/OFL-JetBrainsMono.txt) */
/* Autres polices du code (Fira Code, Source Code Pro) : téléchargées seulement si elles sont choisies. */
@font-face {
    font-family: "Fira Code";
    font-style: normal;
    font-weight: 300 700;
    font-display: swap;
    src: url("../fonts/fira-code-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: "Fira Code";
    font-style: normal;
    font-weight: 300 700;
    font-display: swap;
    src: url("../fonts/fira-code-latin-ext.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: "Source Code Pro";
    font-style: normal;
    font-weight: 300 800;
    font-display: swap;
    src: url("../fonts/source-code-pro-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: "Source Code Pro";
    font-style: normal;
    font-weight: 300 800;
    font-display: swap;
    src: url("../fonts/source-code-pro-latin-ext.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Polices de titre (Fraunces, Bricolage Grotesque, Caveat) : téléchargées seulement si elles sont choisies. */
@font-face {
    font-family: "Fraunces";
    font-style: normal;
    font-weight: 300 900;
    font-display: swap;
    src: url("../fonts/fraunces-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: "Fraunces";
    font-style: normal;
    font-weight: 300 900;
    font-display: swap;
    src: url("../fonts/fraunces-latin-ext.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: "Bricolage Grotesque";
    font-style: normal;
    font-weight: 300 800;
    font-display: swap;
    src: url("../fonts/bricolage-grotesque-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: "Bricolage Grotesque";
    font-style: normal;
    font-weight: 300 800;
    font-display: swap;
    src: url("../fonts/bricolage-grotesque-latin-ext.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: "Caveat";
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url("../fonts/caveat-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: "Caveat";
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url("../fonts/caveat-latin-ext.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: "JetBrains Mono";
    font-style: normal;
    font-weight: 100 800;
    font-display: swap;
    src: url("../fonts/jetbrains-mono-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: "JetBrains Mono";
    font-style: normal;
    font-weight: 100 800;
    font-display: swap;
    src: url("../fonts/jetbrains-mono-latin-ext.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
    --bg: #f6f5f9;
    --stage: #eeedf3;
    --stage-dot: #d9d7e3;
    --surface: #ffffff;
    --surface-2: #f3f2f7;
    --surface-3: #e8e7ef;
    --border: #e3e2ea;
    --text: #17171f;
    --text-2: #5d5d6e;
    --text-3: #8d8d9d;
    --accent: #6d5efc;
    --accent-2: #5847f0;
    --accent-soft: #eeebff;
    --accent-text: #ffffff;
    /* Dégradé de marque (logo) : violet en haut à gauche → rose en bas à droite */
    --brand-1: #6d5efc;
    --brand-2: #ec5fb0;
    --brand-gradient: linear-gradient(135deg, var(--brand-1), var(--brand-2));
    --brand-gradient-soft: linear-gradient(135deg, color-mix(in srgb, var(--brand-1) 14%, transparent), color-mix(in srgb, var(--brand-2) 14%, transparent));
    --brand-glow: 0 6px 18px color-mix(in srgb, var(--brand-1) 32%, transparent);
    --danger: #e5484d;
    --shadow-sm: 0 1px 2px rgba(20, 20, 40, 0.06);
    --shadow-md: 0 8px 30px rgba(20, 20, 40, 0.10), 0 1px 3px rgba(20, 20, 40, 0.06);
    --radius: 12px;
    --radius-sm: 8px;
    --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --topbar-h: 60px;
    /* Largeur maximale du contenu des pages publiques (landing, pages de contenu). */
    --container: 1400px;
    --sidebar-w: 340px;
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #111116;
        --stage: #0b0b0f;
        --stage-dot: #22222b;
        --surface: #1a1a21;
        --surface-2: #23232c;
        --surface-3: #2d2d38;
        --border: #2c2c36;
        --text: #f1f1f6;
        --text-2: #b0b0c0;
        --text-3: #7c7c8e;
        --accent: #8b7fff;
        --accent-2: #9d93ff;
        --accent-soft: #2a2550;
        --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
        --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.45);
        color-scheme: dark;
    }
}

:root[data-theme="dark"] {
    --bg: #111116;
    --stage: #0b0b0f;
    --stage-dot: #22222b;
    --surface: #1a1a21;
    --surface-2: #23232c;
    --surface-3: #2d2d38;
    --border: #2c2c36;
    --text: #f1f1f6;
    --text-2: #b0b0c0;
    --text-3: #7c7c8e;
    --accent: #8b7fff;
    --accent-2: #9d93ff;
    --accent-soft: #2a2550;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.45);
    color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 14px/1.45 var(--font);
    -webkit-font-smoothing: antialiased;
}

/* L'éditeur occupe tout l'écran ; les autres pages défilent normalement. */
.page-app { overflow: hidden; }

[hidden] { display: none !important; }

button, input, select, textarea { font: inherit; color: inherit; }

button { cursor: pointer; }

button:disabled { cursor: not-allowed; opacity: 0.45; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

kbd {
    display: inline-block;
    min-width: 1.6em;
    padding: 1px 6px;
    border: 1px solid var(--border);
    border-bottom-width: 2px;
    border-radius: 6px;
    background: var(--surface);
    font: 600 11px/1.5 var(--font);
    color: var(--text-2);
    text-align: center;
}

.sprite { display: none; }

.ic {
    width: 18px;
    height: 18px;
    flex: none;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ---------- Boutons ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 36px;
    padding: 0 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    font-weight: 600;
    white-space: nowrap;
    transition: background 0.15s, border-color 0.15s, transform 0.1s;
}

.btn:hover:not(:disabled) { background: var(--surface-2); }
.btn:active:not(:disabled) { transform: translateY(1px); }

.btn-primary {
    border-color: transparent;
    background: var(--brand-gradient);
    /* Sans cela, le dégradé se répète sous la bordure transparente (liseré rose à gauche). */
    background-origin: border-box;
    color: var(--accent-text);
    box-shadow: var(--brand-glow);
}

/* Garde le dégradé au survol : sans cela, `.btn:hover` (plus spécifique) le remplace par un fond clair sous le texte blanc. */
.btn-primary:hover:not(:disabled) {
    background: var(--brand-gradient);
    background-origin: border-box;
    filter: brightness(1.07) saturate(1.05);
}

/* Texte en dégradé de marque */
.text-gradient {
    background: var(--brand-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

::selection { background: color-mix(in srgb, var(--brand-1) 24%, transparent); }

.btn-ghost { background: transparent; box-shadow: none; border-color: transparent; }
.btn-ghost:hover:not(:disabled) { background: var(--surface-3); }

.btn-small { height: 30px; padding: 0 10px; font-size: 13px; }

.btn-icon {
    display: inline-grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--text-2);
}

.btn-icon:hover:not(:disabled) { background: var(--surface-2); color: var(--text); }

/* Bouton RESET de la barre du haut : pastille en dégradé de marque */
.btn-reset { margin-left: 4px; background: var(--brand-gradient); color: var(--accent-text); box-shadow: var(--brand-glow); }
.btn-reset:hover:not(:disabled) { background: var(--brand-gradient); color: var(--accent-text); filter: brightness(1.07) saturate(1.05); }
.btn-reset:active:not(:disabled) { transform: translateY(1px); }

.btn-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 6px;
    border: 0;
    border-radius: 6px;
    background: none;
    color: var(--text-2);
    font-size: 12.5px;
    font-weight: 600;
}

.btn-link .ic { width: 14px; height: 14px; }
.btn-link:hover { color: var(--accent); background: var(--accent-soft); }

/* ---------- Barre du haut ---------- */

.topbar {
    position: relative;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 16px;
    height: var(--topbar-h);
    padding: 0 16px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    font-size: 17px;
    font-weight: 800;
    letter-spacing: -0.02em;
    text-decoration: none;
}

.modes {
    display: flex;
    gap: 2px;
    padding: 3px;
    border-radius: 11px;
    background: var(--surface-2);
}

.mode {
    white-space: nowrap;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 32px;
    padding: 0 12px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--text-2);
    font-weight: 600;
    font-size: 13px;
}

.mode .ic { width: 16px; height: 16px; }
.mode.is-active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.mode.is-active .ic { color: var(--brand-1); }

/* Titre principal de l'outil (H1) : à droite des onglets, discret, sur une seule ligne (« … » s'il manque de place,
   titre complet dans l'infobulle). */
.tool-title {
    flex: 1 1 0;
    min-width: 0;
    max-width: 560px;
    margin: 0;
    overflow: hidden;
    color: var(--text-2);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: -0.005em;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
}

.sep { width: 1px; height: 24px; margin: 0 4px; background: var(--border); }

.lang-switch { display: flex; gap: 2px; }

.lang-switch a {
    display: inline-grid;
    place-items: center;
    padding: 6px;
    border-radius: 6px;
    transition: background 0.15s;
}

.lang-switch a:hover { background: var(--surface-2); }
/* Langue active : liseré aux couleurs de la marque (les deux drapeaux restent en pleine couleur). */
.lang-switch a.is-active .flag { box-shadow: 0 0 0 2px var(--surface), 0 0 0 3.5px var(--accent); }

/* Drapeaux du sélecteur de langue (symboles #flag-fr, #flag-en du sprite) */
.flag { display: block; width: 20px; height: 14px; border-radius: 3px; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1); overflow: hidden; }

.ic-moon { display: none; }
:root[data-theme="dark"] .ic-sun { display: none; }
:root[data-theme="dark"] .ic-moon { display: block; }

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .ic-sun { display: none; }
    :root:not([data-theme="light"]) .ic-moon { display: block; }
}

/* Bouton Exporter + menu : un seul dégradé continu sur les deux parties */
.export { position: relative; display: flex; border-radius: 10px; background: var(--brand-gradient); box-shadow: var(--brand-glow); }
.export:has(.btn-primary:disabled) { opacity: 0.45; }
.export > .btn-primary { background: transparent; box-shadow: none; }
.export > .btn-primary:disabled { opacity: 1; }
.export > .btn-primary:hover:not(:disabled) { background: rgba(255, 255, 255, 0.12); filter: none; }
.export > .btn-primary:first-child { border-top-right-radius: 0; border-bottom-right-radius: 0; }

.btn-caret {
    padding: 0 8px;
    border-left: 1px solid rgba(255, 255, 255, 0.3);
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.popover {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 280px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-md);
}

.hint { margin: 4px 0 0; color: var(--text-3); font-size: 12px; }

/* ---------- Espace de travail ---------- */

.workspace {
    display: grid;
    grid-template-columns: 1fr var(--sidebar-w);
    height: calc(100% - var(--topbar-h));
}

.stage {
    position: relative;
    display: grid;
    place-items: center;
    min-width: 0;
    overflow: hidden;
    background-color: var(--stage);
    background-image: radial-gradient(var(--stage-dot) 1px, transparent 1px);
    background-size: 20px 20px;
}

.canvas-wrap { display: grid; place-items: center; padding: 32px 32px 80px; }

#preview {
    display: block;
    border-radius: 6px;
    box-shadow: 0 12px 40px rgba(20, 20, 40, 0.14);
}

.stage-bar {
    position: absolute;
    bottom: 20px;
    left: 50%;
    display: flex;
    gap: 4px;
    padding: 4px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    box-shadow: var(--shadow-md);
    transform: translateX(-50%);
}

.dropzone { padding: 24px; }

.dropzone-card {
    width: min(460px, 100%);
    padding: 36px 32px 24px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--surface);
    box-shadow: var(--shadow-md);
    text-align: center;
}

.dropzone-art {
    position: relative;
    height: 96px;
    margin: 0 auto 18px;
}

.dropzone-art span {
    position: absolute;
    top: 8px;
    left: 50%;
    width: 120px;
    height: 80px;
    border-radius: 10px;
    border: 3px solid var(--surface);
    box-shadow: var(--shadow-md);
}

.dropzone-art span:nth-child(1) { background: linear-gradient(135deg, #c3b9ff, #f6c3e2); transform: translateX(-110%) rotate(-10deg); }
.dropzone-art span:nth-child(2) { background: linear-gradient(135deg, #1b1740, #3a2a7a); transform: translateX(10%) rotate(9deg); }
.dropzone-art span:nth-child(3) { top: 0; background: var(--brand-gradient); transform: translateX(-50%); z-index: 1; }

.dropzone h2 { margin: 0 0 4px; font-size: 24px; letter-spacing: -0.02em; }
.dropzone p { margin: 0; color: var(--text-2); }

.dropzone-keys {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 20px 0;
}

.dropzone-keys kbd { padding: 6px 12px; font-size: 14px; }
.muted { color: var(--text-3); margin-left: 6px; }

.dropzone-actions { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }

/* Capture d'une page web à partir de son adresse */
.capture-form { margin-top: 22px; }
.dropzone .capture-sep { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; color: var(--text-3); font-size: 12.5px; }
.capture-sep::before, .capture-sep::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.capture-row { display: flex; gap: 8px; }
.capture-format { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 10px; }
.dropzone .capture-format .hint { margin: 0; }
.capture-format .seg { flex: none; }
.capture-format .seg > button { flex: none; height: 26px; padding: 0 12px; overflow: visible; }
.quota-note, .dropzone .quota-note { margin: 10px 0 0; color: var(--danger); font-size: 12.5px; font-weight: 600; }
.capture-row input {
    flex: 1;
    min-width: 0;
    height: 36px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface-2);
    outline: none;
    transition: border-color 0.15s, background 0.15s;
}
.capture-row input:focus { border-color: var(--accent); background: var(--surface); }
.capture-form.is-loading .btn .ic { animation: capture-spin 1s linear infinite; }
@keyframes capture-spin { to { transform: rotate(360deg); } }

.drop-overlay {
    position: absolute;
    inset: 12px;
    z-index: 10;
    display: grid;
    place-items: center;
    border: 2px dashed var(--accent);
    border-radius: 18px;
    background: color-mix(in srgb, var(--accent-soft) 85%, transparent);
    color: var(--accent);
    font-size: 18px;
    font-weight: 700;
    pointer-events: none;
}

.toast {
    position: absolute;
    top: 16px;
    left: 50%;
    z-index: 30;
    padding: 9px 16px;
    border-radius: 10px;
    background: var(--text);
    color: var(--bg);
    font-weight: 600;
    font-size: 13px;
    box-shadow: var(--shadow-md);
    transform: translateX(-50%);
    animation: toast-in 0.2s ease-out;
}

.toast.is-error { background: var(--danger); color: #fff; }

@keyframes toast-in {
    from { opacity: 0; transform: translate(-50%, -6px); }
}

/* ---------- Barre latérale ---------- */

.sidebar {
    min-width: 0;
    overflow-x: hidden;
    overflow-y: auto;
    border-left: 1px solid var(--border);
    background: var(--surface);
    scrollbar-width: thin;
}

.panel {
    display: grid;
    gap: 12px;
    padding: 16px;
    border-bottom: 1px solid var(--border);
}

.panel-head { display: flex; align-items: center; justify-content: space-between; min-height: 24px; }
.panel-head h2 { margin: 0; font-size: 13px; font-weight: 700; letter-spacing: 0.01em; }

.field { display: grid; gap: 6px; min-width: 0; }

.field-label { color: var(--text-2); font-size: 12.5px; font-weight: 500; }

.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
/* Un champ masqué (sans objet pour le réglage en cours) : l'autre prend toute la largeur. */
.field-grid:has(> [hidden]) { grid-template-columns: minmax(0, 1fr); }

.field input[type="text"], .field textarea, .field select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    outline: none;
    transition: border-color 0.15s, background 0.15s;
}

.field textarea { resize: vertical; min-height: 38px; }

.field input[type="text"]:focus, .field textarea:focus, .field select:focus {
    border-color: var(--accent);
    background: var(--surface);
}

.field-range {
    grid-template-columns: 1fr auto;
    gap: 4px 8px;
    align-items: center;
}

.field-range input { grid-column: 1 / -1; }

.field-range output {
    color: var(--text-3);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}

input[type="range"] {
    width: 100%;
    height: 18px;
    margin: 0;
    background: transparent;
    accent-color: var(--accent);
    cursor: pointer;
}

/* Contrôle segmenté */
.seg {
    display: flex;
    gap: 2px;
    padding: 3px;
    border-radius: 10px;
    background: var(--surface-2);
}

.seg > button {
    flex: 1;
    min-width: 0;
    height: 30px;
    padding: 0 6px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--text-2);
    font-size: 12.5px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.seg > button:hover { color: var(--text); }
.seg > button.is-active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

.seg-tabs > button { padding: 0 2px; font-size: 11.5px; }
.seg-icons > button { display: grid; place-items: center; }
.seg-icons .ic { width: 16px; height: 16px; }

/* Nuanciers */
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }

.swatch {
    width: 30px;
    height: 30px;
    padding: 0;
    border: 2px solid var(--surface);
    border-radius: 50%;
    box-shadow: 0 0 0 1px var(--border);
    transition: transform 0.12s, box-shadow 0.12s;
}

.swatch:hover { transform: scale(1.1); }
.swatch.is-active { box-shadow: 0 0 0 2px var(--accent); }
/* Rangée serrée : dix couleurs sur une ligne (couleur des noms, outil Conversation). */
.swatches-compact { gap: 5px; }
.swatches-compact .swatch, .swatches-compact .color-field input[type="color"] { width: 25px; height: 25px; }

.auto-palette { display: grid; gap: 8px; }

.color-row { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; }
.color-row .field-range { flex: 1; min-width: 140px; }

.color-field { display: inline-flex; align-items: center; gap: 8px; color: var(--text-2); font-size: 12.5px; cursor: pointer; }

.color-field input[type="color"] {
    width: 30px;
    height: 30px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: none;
    cursor: pointer;
}

.color-field input[type="color"]::-webkit-color-swatch-wrapper { padding: 3px; }
.color-field input[type="color"]::-webkit-color-swatch { border: 0; border-radius: 5px; }
.color-field input[type="color"]::-moz-color-swatch { border: 0; border-radius: 5px; }

.bg-options { display: grid; gap: 10px; }

/* Presets de styles */
.preset-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
/* Thèmes de code : 2 colonnes, vignettes plus grandes pour lire le code. */
#theme-grid { grid-template-columns: repeat(2, 1fr); }

/* Saisie du code (outil Code) */
.code-input {
    width: 100%;
    min-height: 190px;
    max-height: 420px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    color: var(--text);
    font: 400 12.5px/1.6 "JetBrains Mono", ui-monospace, Consolas, monospace;
    white-space: pre;
    overflow: auto;
    resize: vertical;
    tab-size: 4;
    outline: none;
    transition: border-color 0.15s, background 0.15s;
}
.code-input:focus { border-color: var(--accent); background: var(--surface); }

.preset {
    position: relative;
    display: grid;
    gap: 5px;
    min-width: 0;
    padding: 0;
    border: 0;
    background: none;
    text-align: left;
}

.preset-thumb {
    display: grid;
    place-items: center;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    border-radius: 9px;
    background: var(--surface-2);
    box-shadow: 0 0 0 1px var(--border);
    transition: box-shadow 0.15s, transform 0.15s;
}

/* Vignette en cours de génération */
.preset-thumb:empty {
    background: linear-gradient(100deg, var(--surface-2) 30%, var(--surface-3) 50%, var(--surface-2) 70%) 0 0 / 200% 100%;
    animation: shimmer 1.2s linear infinite;
}

@keyframes shimmer {
    to { background-position: -200% 0; }
}

.preset-canvas { width: 100%; height: 100%; object-fit: cover; }

.preset:hover .preset-thumb { transform: translateY(-2px); }
.preset.is-active .preset-thumb { box-shadow: 0 0 0 2px var(--accent), 0 0 0 5px var(--accent-soft); }

.preset-check {
    position: absolute;
    top: 6px;
    right: 6px;
    display: none;
    place-items: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--brand-gradient);
    box-shadow: 0 2px 6px rgba(20, 20, 40, 0.25);
    color: #fff;
}

.preset-check .ic { width: 12px; height: 12px; stroke-width: 3; }
.preset.is-active .preset-check { display: grid; }

.preset-meta { display: flex; justify-content: space-between; gap: 6px; min-width: 0; }
.preset-name { overflow: hidden; color: var(--text-2); font-size: 12px; font-weight: 600; white-space: nowrap; text-overflow: ellipsis; }
.preset-cat { flex: none; color: var(--text-3); font-size: 11px; }
.preset.is-active .preset-name { color: var(--accent); }

.panel-actions { display: flex; gap: 2px; }

/* Panneaux repliables : le titre est un bouton */
.panel-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    letter-spacing: inherit;
    text-align: left;
    cursor: pointer;
}
.panel-toggle .ic { width: 14px; height: 14px; color: var(--text-3); transition: transform 0.15s; }
.panel-toggle:hover .ic { color: var(--text); }
.panel.is-collapsed .panel-toggle .ic { transform: rotate(-90deg); }
.panel.is-collapsed > :not(.panel-head) { display: none !important; }
.panel.is-collapsed .panel-head > :not(h2) { display: none; }

/* Fenêtres de confirmation et de saisie (dialogs.js) */
.modal {
    width: min(420px, calc(100vw - 32px));
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--surface);
    color: var(--text);
    box-shadow: var(--shadow-md);
}
.modal::backdrop { background: rgba(12, 10, 24, 0.55); backdrop-filter: blur(3px); }
.modal-body { display: grid; gap: 12px; padding: 22px; }
.modal-body h2 { margin: 0; font-size: 17px; line-height: 1.35; letter-spacing: -0.01em; }
.modal-body p { margin: 0; color: var(--text-2); font-size: 14px; line-height: 1.5; }
.modal-input {
    width: 100%;
    height: 40px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface-2);
    color: var(--text);
    font: inherit;
    outline: none;
}
.modal-input:focus { border-color: var(--accent); background: var(--surface); }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }

/* Menu d'export : nom du fichier (préfixe fixe + saisie), partage, export en lot */
.name-field {
    display: flex;
    align-items: center;
    min-width: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
}
.name-field:focus-within { border-color: var(--accent); background: var(--surface); }
.name-prefix { flex: none; padding-left: 10px; color: var(--text-3); font-size: 13px; white-space: nowrap; }
.field .name-field input[type="text"] { flex: 1; min-width: 0; padding-left: 1px; border: 0; background: none; }
.popover .btn-small { justify-content: center; }
.export-batch { border-top: 1px solid var(--border); padding-top: 10px; }
.export-batch summary { color: var(--text-2); font-size: 12.5px; font-weight: 600; cursor: pointer; }
.export-batch[open] summary { margin-bottom: 6px; color: var(--text); }
.export-batch .hint { margin: 0 0 8px; }
.export-batch-grid { display: grid; grid-template-columns: repeat(3, auto); gap: 6px 10px; margin-bottom: 10px; }
.export-batch .btn { width: 100%; }
.popover .check { display: flex; align-items: center; gap: 6px; color: var(--text-2); font-size: 12.5px; cursor: pointer; }
.popover .check input { accent-color: var(--accent); }
.btn-save-style { justify-self: start; }
.btn-save-style .ic { width: 14px; height: 14px; }
.styles-dialog-actions { display: flex; align-items: center; gap: 8px; }
.styles-empty { grid-column: 1 / -1; margin: 0; padding: 36px 16px; color: var(--text-3); text-align: center; }

/* Style personnel dans la galerie : actions au coin de la vignette */
.preset-wrap { position: relative; min-width: 0; }
.preset-wrap .preset { width: 100%; }
.preset-actions { position: absolute; top: 6px; left: 6px; display: flex; gap: 4px; opacity: 0; transition: opacity 0.12s; }
.preset-wrap:hover .preset-actions, .preset-wrap:focus-within .preset-actions { opacity: 1; }
.preset-action {
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: rgba(18, 18, 26, 0.72);
    color: #fff;
}
.preset-action:hover { background: rgba(18, 18, 26, 0.92); }
.preset-action .ic { width: 14px; height: 14px; }
@media (hover: none) { .preset-actions { opacity: 1; } }
.btn-link-accent { color: var(--accent); }

/* Galerie de tous les styles */
.styles-dialog {
    width: min(1180px, calc(100vw - 32px));
    max-height: calc(100vh - 48px);
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--surface);
    color: var(--text);
    box-shadow: 0 30px 80px rgba(10, 10, 30, 0.35);
}

.styles-dialog[open] { display: flex; flex-direction: column; }
.styles-dialog::backdrop { background: rgba(12, 10, 24, 0.55); backdrop-filter: blur(3px); }

.styles-dialog-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 18px 20px 6px;
}

.styles-dialog-head h2 { margin: 0; font-size: 18px; }

.style-filters { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 20px 14px; border-bottom: 1px solid var(--border); }

.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 30px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text-2);
    font-size: 12.5px;
    font-weight: 600;
}

.chip small { color: var(--text-3); font-weight: 600; }
.chip:hover { color: var(--text); background: var(--surface-2); }
.chip.is-active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.chip.is-active small { color: var(--accent); }

.styles-dialog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 16px 14px;
    padding: 18px 20px 22px;
    overflow-y: auto;
}

/* Onglets sur plusieurs lignes : chaque onglet prend la largeur de son libellé (aucun n'est tronqué). */
.seg-grid { display: flex; flex-wrap: wrap; }
.seg-grid > button { flex: 1 1 auto; padding: 0 9px; overflow: visible; }
/* Quatre choix aux libellés longs : deux par ligne. */
.seg-pairs { display: grid; grid-template-columns: 1fr 1fr; }
.swatch-wide { width: 54px; height: 36px; overflow: hidden; border-radius: 9px; }
.swatch-wide canvas { display: block; width: 100%; height: 100%; object-fit: cover; }
.field-grow { flex: 1; }

/* Cadres */
.frame-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.frame-grid > button { display: grid; gap: 4px; justify-items: center; height: auto; padding: 10px 4px 8px; }
.frame-grid-4 { grid-template-columns: repeat(4, 1fr); }
.frame-grid-4 > button { align-content: space-between; padding: 9px 2px 7px; font-size: 11px; }

/* Coloris des appareils : pastilles */
.seg.device-colors { flex-wrap: wrap; gap: 8px; padding: 0; background: none; }
.device-colors > button {
    flex: none;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 2px solid var(--surface);
    border-radius: 50%;
    box-shadow: 0 0 0 1px var(--border);
    transition: transform 0.12s, box-shadow 0.12s;
}
.device-colors > button:hover { transform: scale(1.1); }
.device-colors > button.is-active { box-shadow: 0 0 0 2px var(--accent); }
.seg.device-colors > button.dot-auto { background: linear-gradient(135deg, #e3e4e8 50%, #2f2f34 50%); }
.seg.device-colors > button.dot-gold { background: #e3cba4; }
.seg.device-colors > button.dot-rose { background: #efc1c4; }
.seg.device-colors > button.dot-blue { background: #9fbce0; }
.seg.device-colors > button.dot-green { background: #a9cdb6; }
.seg.device-colors > button.dot-purple { background: #c3b6e6; }
.seg.device-colors > button.dot-red { background: #c8343a; }
.seg.device-colors > button.dot-midnight { background: #262c40; }

/* Outil Publication : réseaux (logo sur pastille claire), avatar, chiffres */
.platform-grid > button { gap: 5px; padding: 9px 4px 7px; }
.platform-logo { width: 22px; height: 22px; padding: 3px; box-sizing: content-box; border-radius: 7px; background: #ffffff; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08); }
.avatar-row { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: var(--radius-sm); background: var(--surface-2); }
.avatar-preview { width: 40px; height: 40px; flex: none; border-radius: 50%; }
.avatar-text { display: grid; flex: 1; min-width: 0; font-size: 13px; }
.avatar-text .hint { margin: 0; }

.logo-thumb {
    display: grid;
    flex: none;
    place-items: center;
    width: 40px;
    height: 40px;
    padding: 4px;
    border: 1px dashed var(--border);
    border-radius: 10px;
    background: var(--surface);
    color: var(--text-3);
}

.logo-thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.logo-thumb img[hidden] { display: none; }
.logo-thumb img:not([hidden]) + .ic { display: none; }
.field-label-row { display: flex; justify-content: space-between; gap: 8px; }
.field-label-row .muted { margin: 0; font-weight: 400; }

/* Outil Notification : icône d'application (carrée) ; outil Conversation : liste des messages */
.avatar-preview-square { border-radius: 9px; }
.msg-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.msg-list:empty { display: none; }

.msg-row {
    display: grid;
    gap: 6px;
    padding: 8px;
    border: 1px solid var(--border);
    border-left: 3px solid var(--text-3);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
}

.msg-row.is-me { border-left-color: var(--accent); }
.msg-head { display: flex; align-items: center; gap: 2px; }

.msg-side {
    height: 24px;
    margin-right: auto;
    padding: 0 10px;
    border: 0;
    border-radius: 999px;
    background: var(--surface-3);
    color: var(--text-2);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.msg-row.is-me .msg-side { background: var(--accent-soft); color: var(--accent); }
.msg-btn { width: 26px; height: 26px; border-radius: 7px; }
.msg-btn .ic { width: 15px; height: 15px; }
.msg-btn:disabled { opacity: 0.35; }

.msg-row textarea {
    width: 100%;
    min-height: 36px;
    padding: 7px 9px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    outline: none;
    resize: vertical;
}

.msg-row textarea:focus { border-color: var(--accent); }

/* Outil Annonce : groupes de champs propres à un type, lignes des nouveautés (étiquette colorée) */
.field-stack { display: grid; gap: 12px; }
.item-row { border-left-color: var(--tag, var(--text-3)); }

.item-tag {
    height: 26px;
    margin-right: auto;
    padding: 0 8px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: color-mix(in srgb, var(--tag, var(--text-3)) 12%, var(--surface));
    color: var(--tag, var(--text-2));
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.item-tag option { color: var(--text); background: var(--surface); }

/* Outil Screenshot : liste des captures (avant / après, montage) */
.shot-list { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.shot-list:empty { display: none; }

.shot-row {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 6px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
}

.shot-thumb { flex: none; width: 50px; height: 36px; margin-right: 8px; border-radius: 6px; background: var(--surface-3); object-fit: cover; }
.shot-name { display: grid; flex: 1; min-width: 0; font-size: 13px; }
.shot-name strong, .shot-name small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shot-name small { color: var(--text-3); font-size: 11.5px; }

/* Outil Témoignage : note en étoiles et couleur de la carte */
.rating-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.rating { display: flex; gap: 2px; }

.star {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: none;
    color: var(--surface-3);
    transition: transform 0.12s, color 0.12s;
}

.star .ic { width: 22px; height: 22px; fill: currentColor; stroke: currentColor; }
.star.is-on { color: #fbb224; }
.star:hover { transform: scale(1.15); }

.chip-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }

.card-chip {
    width: 34px;
    height: 32px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    transition: transform 0.12s, box-shadow 0.12s;
}

.card-chip:hover { transform: translateY(-1px); }
.card-chip.is-active { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent); }
.button-row { display: flex; gap: 6px; flex-wrap: wrap; }
.numbers-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(64px, 1fr)); gap: 6px; }
.number-field {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    color: var(--text-3);
}
.number-field:focus-within { border-color: var(--accent); background: var(--surface); }
.number-field .ic { width: 15px; height: 15px; }
.number-field input { width: 100%; min-width: 0; height: 34px; padding: 0; border: 0; background: none; color: var(--text); outline: none; }

.frame-ico {
    display: block;
    width: 34px;
    height: 24px;
    border: 2px solid currentColor;
    border-radius: 4px;
    opacity: 0.8;
}

.frame-ico-none { border-style: dashed; }
.frame-ico-desktop { border-top-width: 6px; }
.frame-ico-browser { border-top-width: 7px; border-radius: 5px; }
.frame-ico-phone { width: 15px; height: 26px; border-radius: 5px; border-width: 2.5px; }
.frame-ico-tablet { width: 22px; height: 28px; border-radius: 4px; border-width: 3px; }
.frame-ico-windows { border-top-width: 6px; border-radius: 1px; }
.frame-ico-watch { position: relative; width: 17px; height: 18px; margin: 3px 0; border-radius: 6px; border-width: 2.5px; }
.frame-ico-watch::before, .frame-ico-watch::after { content: ''; position: absolute; left: 1.5px; right: 1.5px; height: 4px; background: currentColor; opacity: 0.75; }
.frame-ico-watch::before { top: -6.5px; border-radius: 2px 2px 0 0; }
.frame-ico-watch::after { bottom: -6.5px; border-radius: 0 0 2px 2px; }
.frame-ico-laptop { width: 30px; height: 20px; border-width: 3px 3px 5px; border-radius: 3px 3px 1px 1px; box-shadow: 0 3px 0 -1px currentColor; }

/* Position */
.position-row { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: center; }

.pos-grid { display: grid; grid-template-columns: repeat(3, 26px); gap: 3px; padding: 4px; }
.pos-grid > button { display: grid; place-items: center; width: 26px; height: 26px; padding: 0; }
.pos-grid i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: 0.35; }
.pos-grid > button.is-active i { opacity: 1; background: var(--accent); }

.position-sliders { display: grid; gap: 8px; }

/* Inclinaisons 3D */
.tilt-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }

/* Commandes 3D : grisées quand WebGL est indisponible */
.effect-3d { display: grid; gap: 12px; min-width: 0; margin: 0; padding: 0; border: 0; }
.effect-3d:disabled { opacity: 0.45; filter: grayscale(1); }
.effect-3d:disabled button:disabled { opacity: 1; }

.notice {
    margin: 0;
    padding: 8px 10px;
    border: 1px solid color-mix(in srgb, var(--danger) 35%, transparent);
    border-radius: 8px;
    background: color-mix(in srgb, var(--danger) 8%, transparent);
    color: var(--text-2);
    font-size: 12.5px;
}

.tilt {
    display: grid;
    gap: 6px;
    justify-items: center;
    padding: 12px 4px 8px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface-2);
    color: var(--text-2);
    font-size: 12px;
    font-weight: 600;
}

.tilt:hover { color: var(--text); }
.tilt.is-active { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

.tilt-card {
    width: 44px;
    height: 30px;
    border-radius: 4px;
    background: var(--brand-gradient);
    box-shadow: 0 4px 10px rgba(20, 20, 40, 0.15);
}

.sidebar-foot {
    display: flex;
    justify-content: space-between;
    padding: 14px 16px 20px;
    color: var(--text-3);
    font-size: 11.5px;
}


/* ---------- Éléments communs aux pages ---------- */

.badge {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 999px;
    background: var(--surface-3);
    color: var(--text-3);
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.01em;
    vertical-align: middle;
}

.badge-ok { background: color-mix(in srgb, #12b76a 16%, transparent); color: #0e9f5c; }

.btn { text-decoration: none; color: var(--text); }
.btn-primary { color: var(--accent-text); }
.btn-large { height: 46px; padding: 0 20px; border-radius: 12px; font-size: 15px; }

.eyebrow {
    display: inline-block;
    padding: 4px 12px;
    border: 1px solid color-mix(in srgb, var(--brand-1) 22%, transparent);
    border-radius: 999px;
    background: var(--brand-gradient-soft);
    color: var(--accent);
    font-size: 12.5px;
    font-weight: 700;
}

.lead { color: var(--text-2); font-size: 18px; line-height: 1.55; }

.cta-row { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------- Landing ---------- */

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 24px;
    height: 68px;
    padding: 0 max(16px, calc((100% - var(--container)) / 2));
    border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
    background: color-mix(in srgb, var(--bg) 82%, transparent);
    backdrop-filter: saturate(1.4) blur(12px);
}

.site-nav { display: flex; gap: 4px; }

.site-nav a {
    padding: 6px 10px;
    border-radius: 8px;
    color: var(--text-2);
    font-weight: 600;
    text-decoration: none;
}

.site-nav a:hover { color: var(--text); background: var(--surface-2); }

.site-header-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }

.page-landing main { overflow-x: clip; }

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
    gap: 48px;
    align-items: center;
    max-width: var(--container);
    margin: 0 auto;
    padding: 72px 16px 56px;
}

.hero-text { display: grid; gap: 20px; justify-items: start; }

.hero h1 {
    margin: 0;
    font-size: clamp(34px, 5vw, 58px);
    line-height: 1.05;
    letter-spacing: -0.035em;
}

/* Accroche (H2) sous le titre principal : un peu plus petite, resserrée contre le H1. */
.hero-subtitle { margin: -10px 0 0; font-size: clamp(24px, 3.2vw, 38px); line-height: 1.12; letter-spacing: -0.03em; }
.hero .lead { margin: 0; max-width: 34em; }

.hero-visual { position: relative; }

.hero-visual::before {
    content: "";
    position: absolute;
    inset: 10% 5%;
    z-index: -1;
    border-radius: 50%;
    background:
        radial-gradient(closest-side at 30% 35%, color-mix(in srgb, var(--brand-1) 38%, transparent), transparent),
        radial-gradient(closest-side at 72% 68%, color-mix(in srgb, var(--brand-2) 34%, transparent), transparent);
    filter: blur(40px);
}

#hero-canvas {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 18px;
    box-shadow: 0 30px 80px rgba(20, 20, 50, 0.22);
    transition: opacity 0.35s ease;
}

#hero-canvas.is-fading { opacity: 0; }

.section { max-width: var(--container); margin: 0 auto; padding: 64px 16px; scroll-margin-top: 68px; }

@media (prefers-reduced-motion: no-preference) {
    html:has(.page-landing) { scroll-behavior: smooth; }
}
.section-narrow { max-width: 780px; }

.section-head { display: grid; gap: 8px; margin-bottom: 32px; text-align: center; }
.section-head h2 { margin: 0; font-size: clamp(26px, 3.4vw, 36px); letter-spacing: -0.025em; line-height: 1.15; }
.section-head p { margin: 0; color: var(--text-2); font-size: 16px; }

/* Trois cartes par ligne (grille de six colonnes, deux par carte) ; une dernière ligne incomplète est centrée, qu'elle
   compte une carte ou deux. */
.tool-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 20px; }
.tool-grid > .tool-card { grid-column: span 2; }
.tool-grid > .tool-card:last-child:nth-child(3n + 1) { grid-column: 3 / span 2; }
.tool-grid > .tool-card:nth-last-child(2):nth-child(3n + 1) { grid-column: 2 / span 2; }

.tool-card {
    display: grid;
    align-content: start;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--surface);
    color: var(--text);
    text-decoration: none;
    transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}

.tool-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.tool-card.is-ready { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }

.tool-icon, .feature-icon {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--accent-soft);
    color: var(--accent);
}

.tool-icon .ic, .feature-icon .ic { width: 22px; height: 22px; }

/* Carte d'outil : exemple de rendu, nom, description, lien. */
.tool-shot { display: block; width: 100%; height: auto; aspect-ratio: 1200 / 630; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.tool-body { display: grid; gap: 10px; padding: 20px 22px 22px; }
.tool-name { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 700; }
.tool-name .tool-icon { width: 34px; height: 34px; border-radius: 10px; }
.tool-name .tool-icon .ic { width: 18px; height: 18px; }
.tool-text { color: var(--text-2); }
.tool-cta { display: inline-flex; align-items: center; gap: 6px; color: var(--accent); font-size: 14px; font-weight: 700; }
.tool-cta .ic { width: 16px; height: 16px; transition: transform 0.15s; }
.tool-card:hover .tool-cta .ic { transform: translateX(3px); }

/* Douze fonctionnalités : quatre colonnes sur grand écran, trois, deux puis une. */
.feature-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }

.feature {
    padding: 24px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--surface);
}

.feature h3 { margin: 14px 0 6px; font-size: 17px; }
.feature p { margin: 0; color: var(--text-2); }

/* Styles personnels : texte à gauche, illustration du panneau « Mes styles » à droite (HTML et CSS uniquement). */
.my-styles { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: clamp(32px, 5vw, 72px); align-items: center; }
.my-styles-text { display: grid; gap: 16px; justify-items: start; }
.my-styles-text h2 { margin: 0; font-size: clamp(28px, 3.6vw, 40px); letter-spacing: -0.03em; line-height: 1.1; }
.my-styles-text > p { margin: 0; color: var(--text-2); font-size: 17px; line-height: 1.55; }
.my-styles-text .btn { margin-top: 8px; }

.styles-visual { position: relative; padding: 24px 24px 64px; isolation: isolate; }

.styles-visual::before {
    content: "";
    position: absolute;
    inset: 4% 8% 12%;
    z-index: -1;
    border-radius: 50%;
    background:
        radial-gradient(closest-side at 30% 35%, color-mix(in srgb, var(--brand-1) 34%, transparent), transparent),
        radial-gradient(closest-side at 72% 68%, color-mix(in srgb, var(--brand-2) 30%, transparent), transparent);
    filter: blur(40px);
}

.sv-panel {
    display: grid;
    gap: 14px;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--surface);
    box-shadow: 0 30px 70px rgba(20, 20, 50, 0.16);
}

.sv-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sv-title { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 800; }
.sv-title .ic { width: 18px; height: 18px; color: var(--accent); }
.sv-badge { padding: 3px 10px; border-radius: 999px; background: var(--brand-gradient-soft); color: var(--accent); font-size: 12px; font-weight: 700; }

.sv-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.sv-card { display: grid; gap: 7px; padding: 6px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.sv-card.is-active { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.sv-name { padding: 0 2px 2px; color: var(--text-2); font-size: 12.5px; font-weight: 600; }

/* Miniatures : le fond et la fenêtre de chaque style, dessinés en CSS. */
.sv-thumb { display: grid; place-items: center; overflow: hidden; aspect-ratio: 16 / 10; border-radius: 8px; }
.sv-sorbet { background: linear-gradient(135deg, #ff9eb5, #ffc7a8); }
.sv-ocean { background: linear-gradient(150deg, #8fd3ff, #5b7cfa); }
.sv-minuit { background: radial-gradient(circle at 30% 30%, #5b3df5, #1a1440 72%); }
.sv-menthe { background: linear-gradient(140deg, #a5f0d4, #5fcfa9); }

.sv-window {
    position: relative;
    width: 70%;
    height: 62%;
    border-radius: 6px;
    background: #fff;
    box-shadow: 0 8px 18px rgba(20, 20, 50, 0.25);
}

.sv-window i { position: absolute; top: 9%; width: 5px; height: 5px; border-radius: 50%; background: #ff5f57; }
.sv-window i:nth-child(1) { left: 6%; }
.sv-window i:nth-child(2) { left: 13%; background: #febc2e; }
.sv-window i:nth-child(3) { left: 20%; background: #28c840; }
.sv-window::before, .sv-window::after { content: ""; position: absolute; left: 8%; border-radius: 3px; }
.sv-window::before { top: 34%; right: 34%; height: 9%; background: rgba(20, 20, 40, 0.14); }
.sv-window::after { top: 54%; right: 12%; height: 28%; background: rgba(109, 94, 252, 0.18); }
.sv-ocean .sv-window { transform: perspective(300px) rotateY(-16deg) rotateX(6deg); }
.sv-minuit .sv-window { background: #1b1836; box-shadow: 0 10px 22px rgba(0, 0, 0, 0.45); }
.sv-minuit .sv-window::before { background: rgba(255, 255, 255, 0.2); }
.sv-minuit .sv-window::after { background: rgba(167, 139, 250, 0.35); }
.sv-menthe .sv-window { width: 34%; height: 80%; border-radius: 9px; }
.sv-menthe .sv-window i { display: none; }
.sv-menthe .sv-window::before { top: 18%; right: 20%; left: 20%; }

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

.sv-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 32px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: var(--surface-2);
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
}

.sv-btn .ic { width: 15px; height: 15px; }
.sv-btn-primary { border-color: transparent; background: var(--brand-gradient); color: #fff; }

/* Fichier exporté et équipe : étiquettes posées sur le panneau. */
.sv-file, .sv-team {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid var(--border);
    background: var(--surface);
    box-shadow: var(--shadow-md);
    font-size: 13px;
    font-weight: 700;
}

.sv-file { right: 0; bottom: 18px; padding: 10px 14px 10px 10px; border-radius: 14px; transform: rotate(3deg); }
.sv-file small { display: block; color: var(--text-3); font-size: 11.5px; font-weight: 500; }
.sv-file-icon { display: grid; place-items: center; width: 34px; height: 40px; border-radius: 7px; background: var(--brand-gradient); color: #fff; font: 700 12px ui-monospace, Consolas, monospace; }
.sv-team { left: 0; bottom: 0; padding: 7px 14px 7px 8px; border-radius: 999px; color: var(--text-2); font-weight: 600; transform: rotate(-2deg); }
.sv-avatars { display: flex; }

.sv-avatars i {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    margin-left: -8px;
    border: 2px solid var(--surface);
    border-radius: 50%;
    background: #6d5efc;
    color: #fff;
    font-size: 10px;
    font-style: normal;
    font-weight: 800;
}

.sv-avatars i:first-child { margin-left: 0; }
.sv-avatars i:nth-child(2) { background: #ec5fb0; }
.sv-avatars i:nth-child(3) { background: #0f9f6e; }

/* Frise des étapes : pastilles reliées par des flèches courbes en pointillés, au-dessus puis en dessous. */
.timeline {
    --gap: clamp(40px, 6vw, 96px);
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--gap);
    margin: 0;
    padding: 28px 0 0;
    list-style: none;
}

.timeline-step { position: relative; display: grid; justify-items: center; gap: 8px; text-align: center; }
.timeline-step h3 { margin: 12px 0 0; font-size: 19px; letter-spacing: -0.01em; }
.timeline-step p { max-width: 24em; margin: 0; color: var(--text-2); }

.timeline-badge {
    position: relative;
    display: grid;
    place-items: center;
    width: 76px;
    height: 76px;
    border-radius: 24px;
    background: var(--brand-gradient);
    color: #fff;
    box-shadow: 0 14px 34px color-mix(in srgb, var(--brand-1) 34%, transparent);
    transform: rotate(-4deg);
}

.timeline-step:nth-child(2) .timeline-badge { transform: rotate(4deg); }
.timeline-badge .ic { width: 32px; height: 32px; stroke-width: 1.8; }

.timeline-num {
    position: absolute;
    top: -10px;
    right: -10px;
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border: 3px solid var(--bg);
    border-radius: 50%;
    background: var(--surface);
    color: var(--accent);
    font-size: 13px;
    font-weight: 800;
    box-shadow: var(--shadow-sm);
}

/* Flèche entre deux pastilles : centrée sur l'espace qui les sépare. */
.timeline-arrow {
    position: absolute;
    top: -26px;
    left: calc(100% + var(--gap) / 2);
    width: clamp(96px, calc(100% + var(--gap) - 120px), 200px);
    height: auto;
    overflow: visible;
    color: var(--brand-1);
    transform: translateX(-50%);
    pointer-events: none;
}

.timeline-arrow.is-below { top: 40px; color: var(--brand-2); transform: translateX(-50%) scaleY(-1); }
.timeline-curve, .timeline-head { fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.timeline-curve { stroke-dasharray: 2 9; }

@media (prefers-reduced-motion: no-preference) {
    .timeline-curve { animation: timeline-flow 1.6s linear infinite; }
}

@keyframes timeline-flow { to { stroke-dashoffset: -22; } }

.privacy-band {
    display: flex;
    gap: 20px;
    align-items: center;
    padding: 32px;
    border-radius: 20px;
    background: var(--brand-gradient);
    color: #fff;
    box-shadow: 0 20px 50px color-mix(in srgb, var(--brand-1) 25%, transparent);
}

.privacy-band .ic { width: 44px; height: 44px; flex: none; opacity: 0.95; }
.privacy-band h2 { margin: 0 0 6px; font-size: 22px; }
.privacy-band p { margin: 0; color: rgba(255, 255, 255, 0.88); }

.faq { display: grid; gap: 10px; }

.faq details {
    padding: 16px 20px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
}

.faq summary { font-weight: 700; cursor: pointer; }
.faq details p { margin: 10px 0 0; color: var(--text-2); }

/* Contact : présentation à gauche, formulaire à droite. */
.contact { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: clamp(32px, 5vw, 72px); align-items: start; }
.contact-intro { display: grid; gap: 16px; justify-items: start; padding-top: 8px; }
.contact-intro h2 { margin: 0; font-size: clamp(28px, 3.6vw, 40px); letter-spacing: -0.03em; line-height: 1.1; }
.contact-intro > p { margin: 0; color: var(--text-2); font-size: 17px; line-height: 1.55; }
.contact-points, .check-list { display: grid; gap: 10px; margin: 8px 0 0; padding: 0; list-style: none; }
.contact-points li, .check-list li { display: flex; align-items: center; gap: 10px; color: var(--text-2); }
.contact-points .ic, .check-list .ic { flex: none; width: 22px; height: 22px; padding: 4px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); stroke-width: 2.4; }

.contact-form {
    display: grid;
    gap: 14px;
    padding: clamp(20px, 3vw, 32px);
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--surface);
    box-shadow: var(--shadow-md);
}

.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-row-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-field .required { color: var(--accent); font-weight: 700; text-decoration: none; }
.form-field { display: grid; gap: 6px; }
.form-field > span { color: var(--text-2); font-size: 13px; font-weight: 600; }
.form-field small { color: var(--text-3); font-weight: 500; }

.form-field input, .form-field textarea {
    width: 100%;
    padding: 11px 13px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface-2);
    color: var(--text);
    font: inherit;
    outline: none;
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.form-field textarea { min-height: 130px; resize: vertical; }
.form-field input:focus, .form-field textarea:focus {
    border-color: var(--accent);
    background: var(--surface);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent);
}

/* Champ piège pour les robots : hors de l'écran, jamais rempli par une personne. */
.contact-trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.contact-consent { display: flex; align-items: flex-start; gap: 10px; color: var(--text-2); font-size: 13px; line-height: 1.5; cursor: pointer; }
.contact-consent input { flex: none; width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--accent); cursor: pointer; }
.contact-consent a { color: var(--accent); }
.contact-foot { display: flex; justify-content: flex-end; }
.contact-form .btn .ic { width: 16px; height: 16px; }

.contact-status {
    margin: 0;
    padding: 10px 14px;
    border-radius: 10px;
    background: color-mix(in srgb, #12b76a 14%, var(--surface));
    color: #0e9f5c;
    font-weight: 600;
}

.contact-status.is-error { background: color-mix(in srgb, var(--danger) 12%, var(--surface)); color: var(--danger); }

/* Appel à l'action final : panneau sombre aux lueurs de la marque, exemples de rendus en éventail. */
.cta-panel {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 40px;
    align-items: center;
    overflow: hidden;
    padding: clamp(32px, 5vw, 64px);
    border-radius: 28px;
    background:
        radial-gradient(60% 90% at 0% 0%, color-mix(in srgb, var(--brand-1) 55%, transparent), transparent 70%),
        radial-gradient(55% 80% at 100% 100%, color-mix(in srgb, var(--brand-2) 50%, transparent), transparent 70%),
        #15122b;
    color: #fff;
    box-shadow: 0 30px 80px color-mix(in srgb, var(--brand-1) 22%, transparent);
    isolation: isolate;
}

/* Grille discrète en fond. */
.cta-panel::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background-image: radial-gradient(rgba(255, 255, 255, 0.14) 1px, transparent 1px);
    background-size: 22px 22px;
    mask-image: linear-gradient(90deg, #000, transparent 70%);
}

.cta-copy { display: grid; gap: 18px; justify-items: start; }
.cta-copy h2 { margin: 0; font-size: clamp(30px, 4vw, 48px); letter-spacing: -0.035em; line-height: 1.08; }
.cta-copy > p { max-width: 30em; margin: 0; color: rgba(255, 255, 255, 0.82); font-size: 17px; line-height: 1.55; }
.cta-copy .cta-row { margin-top: 6px; }

.btn-light { border-color: #fff; background: #fff; color: #15122b; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25); }
.btn-light:hover:not(:disabled) { background: #f1efff; }
.btn-outline-light { border-color: rgba(255, 255, 255, 0.45); background: transparent; color: #fff; box-shadow: none; }
.btn-outline-light:hover:not(:disabled) { border-color: #fff; background: rgba(255, 255, 255, 0.1); }

.cta-points { display: grid; grid-template-columns: repeat(2, auto); gap: 10px 28px; margin: 10px 0 0; padding: 0; list-style: none; color: rgba(255, 255, 255, 0.88); font-size: 14px; font-weight: 600; }
.cta-points li { display: flex; align-items: center; gap: 8px; }
.cta-points .ic { flex: none; width: 20px; height: 20px; padding: 3px; border-radius: 50%; background: rgba(255, 255, 255, 0.16); stroke-width: 2.6; }

.cta-visual { position: relative; min-height: 380px; }

.cta-shot {
    position: absolute;
    width: 70%;
    height: auto;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 14px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
    transition: transform 0.35s ease;
}

.cta-shot-1 { top: 0; left: 0; transform: rotate(-7deg); }
.cta-shot-2 { top: 9%; right: 0; transform: rotate(5deg); }
.cta-shot-3 { bottom: 0; left: 15%; transform: rotate(-2deg); }
.cta-panel:hover .cta-shot-1 { transform: rotate(-9deg) translate(-6px, -6px); }
.cta-panel:hover .cta-shot-2 { transform: rotate(7deg) translate(6px, -4px); }
.cta-panel:hover .cta-shot-3 { transform: rotate(-1deg) translateY(6px); }

.site-footer { border-top: 1px solid var(--border); background: var(--surface); }

.site-footer-inner {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 32px;
    max-width: var(--container);
    margin: 0 auto;
    padding: 40px 16px 24px;
}

.site-footer-brand p { margin: 10px 0 0; color: var(--text-2); max-width: 30em; }
.site-footer-brand .site-footer-credit { color: var(--text-3); font-size: 13.5px; }
.site-footer-credit a { color: var(--text-2); font-weight: 600; text-decoration-color: color-mix(in srgb, var(--accent) 50%, transparent); text-underline-offset: 3px; }
.site-footer-credit a:hover { color: var(--accent); }

/* Réseaux sociaux : logos pleins (remplissage, sans contour). */
.site-footer-social { display: flex; gap: 8px; margin-top: 16px; }
.site-footer-social a {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--border));
    border-radius: 11px;
    background: var(--accent-soft);
    color: var(--accent);
    transition: color 0.15s, border-color 0.15s, background 0.15s, transform 0.15s, box-shadow 0.15s;
}
.site-footer-social a:hover { border-color: transparent; background: var(--brand-gradient); color: #fff; box-shadow: var(--brand-glow); transform: translateY(-2px); }
.ic-logo { width: 18px; height: 18px; fill: currentColor; stroke: none; }
.site-footer-links { display: grid; gap: 8px; align-content: start; }
.site-footer-links > a { color: var(--text-2); text-decoration: none; }
.site-footer-links > a:hover { color: var(--accent); }
.site-footer-title { font-weight: 700; }
.site-footer .lang-switch { margin-left: -7px; }

/* Sous-pied de page : version à gauche, pages du pied de page (mentions légales, confidentialité…) à droite. */
.site-footer-bottom {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 24px;
    max-width: var(--container);
    margin: 0 auto;
    padding: 16px 16px 28px;
    border-top: 1px solid var(--border);
    color: var(--text-3);
    font-size: 12.5px;
}

.site-footer-legal { margin: 0; }
.site-footer-pages { display: flex; flex-wrap: wrap; gap: 4px 20px; }
.site-footer-pages a { color: var(--text-2); text-decoration: none; }
.site-footer-pages a:hover { color: var(--accent); }

/* ---------- Pages de contenu (mentions légales, confidentialité…) ---------- */

.content-page { padding-top: 48px; }
.content-page h1 { margin: 0 0 28px; font-size: clamp(30px, 4vw, 42px); letter-spacing: -0.03em; line-height: 1.15; }
.content-body { color: var(--text-2); font-size: 16px; line-height: 1.7; overflow-wrap: break-word; }
.content-body > :first-child { margin-top: 0; }
.content-body h2 { margin: 2em 0 0.6em; color: var(--text); font-size: 22px; letter-spacing: -0.015em; line-height: 1.3; }
.content-body h3 { margin: 1.6em 0 0.5em; color: var(--text); font-size: 18px; }
.content-body h4 { margin: 1.4em 0 0.4em; color: var(--text); font-size: 16px; }
.content-body p, .content-body ul, .content-body ol, .content-body blockquote { margin: 0 0 1em; }
.content-body ul, .content-body ol { padding-left: 1.4em; }
.content-body li { margin: 0.25em 0; }
.content-body strong { color: var(--text); }
.content-body a { color: var(--accent); }
.content-body blockquote { padding: 4px 0 4px 16px; border-left: 3px solid var(--accent); }
.content-body .ql-align-center { text-align: center; }
.content-body .ql-align-right { text-align: right; }
.content-body .ql-align-justify { text-align: justify; }
.content-body .ql-indent-1 { margin-left: 1.5em; }
.content-body .ql-indent-2 { margin-left: 3em; }
.content-body .ql-indent-3 { margin-left: 4.5em; }
.content-body .ql-indent-4 { margin-left: 6em; }
.content-updated { margin: 40px 0 0; color: var(--text-3); font-size: 13px; }

/* ---------- Outils à venir ---------- */

.page-tool { display: flex; flex-direction: column; }

.soon {
    display: grid;
    flex: 1;
    place-items: center;
    padding: 48px 16px;
    background-color: var(--stage);
    background-image: radial-gradient(var(--stage-dot) 1px, transparent 1px);
    background-size: 20px 20px;
}

.soon-card {
    display: grid;
    gap: 14px;
    justify-items: start;
    width: min(560px, 100%);
    padding: 36px;
    border: 1px solid var(--border);
    border-radius: 22px;
    background: var(--surface);
    box-shadow: var(--shadow-md);
}

.soon-icon {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: var(--accent-soft);
    color: var(--accent);
}

.soon-icon .ic { width: 26px; height: 26px; }
.soon-card h1 { margin: 0; font-size: 30px; letter-spacing: -0.025em; }
.soon-card .lead { margin: 0; font-size: 16px; }

.checklist { display: grid; gap: 6px; margin: 0 0 8px; padding: 0; list-style: none; color: var(--text-2); }
.checklist li { position: relative; padding-left: 26px; }

.checklist li::before {
    content: "";
    position: absolute;
    top: 4px;
    left: 0;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: inset 0 0 0 5px var(--accent-soft);
}

/* ---------- Annotations ---------- */

/* Barre Remplacer / Retirer en haut de la zone de travail */
.stage-bar-top { top: 14px; bottom: auto; }

/* Outil Code : génération d'un code d'exemple (panneau sous le bouton du haut) */
.generate-panel {
    position: absolute;
    top: 62px;
    left: 50%;
    z-index: 6;
    display: grid;
    gap: 8px;
    width: min(560px, calc(100% - 32px));
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
    box-shadow: var(--shadow-md);
    transform: translateX(-50%);
}
.generate-panel textarea {
    width: 100%;
    padding: 9px 11px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    color: var(--text);
    font: inherit;
    font-size: 13.5px;
    resize: vertical;
    outline: none;
}
.generate-panel textarea:focus { border-color: var(--accent); background: var(--surface); }
.generate-actions { display: flex; align-items: center; gap: 6px; }
.generate-actions .quota-note { flex: 1; margin: 0; }
.generate-panel.is-loading .btn-primary .ic { animation: capture-spin 1s linear infinite; }

.canvas-wrap { padding: 64px 48px 96px; }

.preview-frame { position: relative; line-height: 0; }

.annot-overlay {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: visible;
    touch-action: none;
}

/* Saisie d'un texte directement sur l'aperçu : posée sur l'annotation, avec sa police et ses couleurs. */
.annot-inline {
    position: absolute;
    z-index: 2;
    margin: 0;
    border: 0;
    outline: 2px solid var(--brand-2);
    outline-offset: 2px;
    overflow: hidden;
    resize: none;
    white-space: pre;
    box-sizing: border-box;
}
.annot-inline[hidden] { display: none; }

.annot-outline {
    fill: none;
    stroke: var(--brand-2);
    stroke-width: 1.5;
    stroke-dasharray: 5 4;
    vector-effect: non-scaling-stroke;
}

.annot-outline-line { stroke-opacity: 0.6; }

.annot-handle {
    fill: #fff;
    stroke: var(--brand-2);
    stroke-width: 2;
    vector-effect: non-scaling-stroke;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

.annot-handle-mid { fill: var(--brand-2); stroke: #fff; }

/* Barre d'outils flottante en bas de la zone de travail */
.annot-toolbar {
    position: absolute;
    bottom: 18px;
    left: 50%;
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--surface);
    box-shadow: var(--shadow-md);
    transform: translateX(-50%);
}

.annot-tool {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 11px;
    background: transparent;
    color: var(--text-2);
}

.annot-tool:hover { background: var(--surface-2); color: var(--text); }
.annot-tool.is-active { background: var(--text); color: var(--bg); }
.annot-tool .ic { width: 20px; height: 20px; }
.annot-sep { width: 1px; height: 24px; margin: 0 4px; background: var(--border); }

/* Mode annotation : la barre latérale n'affiche que les propriétés et la liste */
.sidebar.is-annotating > .panel[data-panel],
.sidebar.is-annotating > .sidebar-foot { display: none; }

.annot-panel .panel-head { margin-bottom: -4px; }
.annot-panel .btn-link .ic { width: 16px; height: 16px; }
.annot-count { font-size: 12px; }

.annot-head { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; }
.annot-head strong { font-size: 16px; }
.annot-head .hint { margin: 2px 0 0; }

.annot-icon {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 11px;
    background: var(--brand-gradient-soft);
    color: var(--brand-2);
}

.annot-icon .ic { width: 20px; height: 20px; }

.annot-props { display: grid; gap: 14px; }
.annot-field textarea {
    width: 100%;
    padding: 9px 11px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    resize: vertical;
    outline: none;
}

.annot-field textarea:focus { border-color: var(--accent); background: var(--surface); }

.annot-colors { display: flex; flex-wrap: wrap; gap: 7px; }

.annot-color {
    width: 28px;
    height: 28px;
    padding: 0;
    border: 2px solid var(--surface);
    border-radius: 50%;
    box-shadow: 0 0 0 1px var(--border), inset 0 -3px 6px rgba(0, 0, 0, 0.15);
    cursor: pointer;
}

.annot-color.is-active { box-shadow: 0 0 0 2px var(--brand-2); }

.annot-color-custom {
    overflow: hidden;
    background: conic-gradient(#ff4d7e, #ffd43b, #2fd08c, #3b82f6, #8b5cf6, #ff4d7e);
}

.annot-color-custom::-webkit-color-swatch-wrapper { padding: 0; }
.annot-color-custom::-webkit-color-swatch { border: 0; border-radius: 50%; opacity: 0; }
.annot-color-custom::-moz-color-swatch { border: 0; opacity: 0; }

/* Sélecteur affichant la couleur choisie (pastille du texte) */
.annot-color-value { overflow: hidden; background: none; }
.annot-color-value::-webkit-color-swatch-wrapper { padding: 0; }
.annot-color-value::-webkit-color-swatch { border: 0; border-radius: 50%; }
.annot-color-value::-moz-color-swatch { border: 0; border-radius: 50%; }

.emoji-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(34px, 1fr)); gap: 4px; }
.emoji {
    display: grid;
    place-items: center;
    height: 34px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 9px;
    background: var(--surface-2);
    font-size: 19px;
    line-height: 1;
    font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
}
.emoji:hover { background: var(--surface-3); }
.emoji.is-active { border-color: var(--brand-2); background: var(--brand-gradient-soft); }
.annot-field input[type="text"] { width: 100%; }

.annot-slider { display: grid; grid-template-columns: 1fr 44px; gap: 10px; align-items: center; }
.annot-slider output { color: var(--text-3); font-size: 12px; text-align: right; font-variant-numeric: tabular-nums; }

.annot-toggle, .toggle-row { display: flex; gap: 10px; align-items: center; color: var(--text-2); font-size: 13px; font-weight: 500; cursor: pointer; }
.annot-toggle > span, .toggle-row > span { flex: 1; }

/* Option de filigrane, tout en bas du panneau ; option « Afficher l'appareil » de l'outil Notification */
.panel-watermark strong, [data-panel="notif-device"] .annot-toggle strong { display: block; color: var(--text); font-size: 13px; font-weight: 700; }
.panel-watermark .hint, [data-panel="notif-device"] .annot-toggle .hint { display: block; margin-top: 2px; font-weight: 400; }

/* Interrupteur */
.switch {
    position: relative;
    width: 38px;
    height: 22px;
    margin: 0;
    border-radius: 999px;
    background: var(--surface-3);
    appearance: none;
    cursor: pointer;
    transition: background 0.15s;
}

.switch::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
    transition: transform 0.15s;
}

.switch:checked { background: var(--brand-gradient); }
.switch:checked::after { transform: translateX(16px); }

.annot-list { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }

.annot-item {
    display: grid;
    grid-template-columns: auto auto 1fr;
    gap: 10px;
    align-items: center;
    padding: 9px 12px;
    border: 1px solid transparent;
    border-radius: 10px;
    color: var(--text-2);
    font-size: 13px;
    cursor: grab;
}

.annot-item:hover { background: var(--surface-2); }
.annot-item.is-active { border-color: var(--brand-2); background: var(--brand-gradient-soft); color: var(--text); }
.annot-item.is-dragging { opacity: 0.4; }
.annot-item.is-over { box-shadow: inset 0 2px 0 var(--brand-2); }
.annot-item .ic { width: 16px; height: 16px; }
.annot-item-name { font-weight: 700; color: var(--text); }
.annot-item-info { overflow: hidden; color: var(--text-3); font-size: 12px; text-align: right; white-space: nowrap; text-overflow: ellipsis; }
.annot-keys { margin: 4px 0 0; text-align: center; }

/* ---------- Page 404 ---------- */

.page-simple { display: grid; place-items: center; min-height: 100%; }
.notfound { display: grid; gap: 12px; justify-items: center; padding: 24px; text-align: center; }
.notfound h1 { margin: 0; font-size: 72px; letter-spacing: -0.04em; }
.notfound p { margin: 0 0 8px; color: var(--text-2); }

/* ---------- Responsive ---------- */

/* Sept outils et le titre de l'outil : sous 2000 px, seul l'onglet ouvert garde son nom (les autres : icône et
   infobulle). Trop étroit pour le titre (moins de 1320 px) : il reste dans la page pour le référencement, sans être affiché. */
@media (max-width: 2000px) {
    .mode:not(.is-active) span { display: none; }
}

@media (max-width: 1320px) {
    .tool-title {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip-path: inset(50%);
        white-space: nowrap;
    }
}

@media (max-width: 1280px) {
    .mode .badge { display: none; }
}

@media (max-width: 1100px) {
    .mode span { display: none; }
    .feature-grid { grid-template-columns: repeat(3, 1fr); }
    .tool-grid { grid-template-columns: repeat(2, 1fr); }
    .tool-grid > .tool-card,
    .tool-grid > .tool-card:last-child:nth-child(3n + 1),
    .tool-grid > .tool-card:nth-last-child(2):nth-child(3n + 1) { grid-column: auto; }
    .tool-grid > .tool-card:last-child:nth-child(2n + 1) { grid-column: 1 / -1; justify-self: center; width: calc(50% - 10px); }
}

@media (max-width: 900px) {
    .hero { grid-template-columns: 1fr; padding-top: 48px; }
    .feature-grid { grid-template-columns: 1fr 1fr; }
    .contact, .cta-panel, .my-styles { grid-template-columns: 1fr; }
    .cta-visual { min-height: 0; aspect-ratio: 4 / 3; }
    .site-nav { display: none; }
    .site-footer-inner { grid-template-columns: 1fr 1fr; }
    .site-footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 820px) {
    .page-app { overflow: auto; }
    .topbar { flex-wrap: wrap; height: auto; padding: 10px 16px; gap: 10px; }
    .modes { order: 3; width: 100%; }
    .tool-title {
        position: static;
        order: 4;
        width: 100%;
        height: auto;
        max-width: none;
        clip-path: none;
        white-space: normal;
        font-size: 12.5px;
        text-align: center;
    }
    .mode { flex: 1; justify-content: center; }
    .mode .badge { display: none; }
    .topbar .lang-switch, .topbar .sep { display: none; }
    .workspace { display: block; height: auto; }
    .stage { min-height: 60vh; height: 60vh; }
    .canvas-wrap { padding: 16px 16px 64px; }
    .sidebar { border-left: 0; border-top: 1px solid var(--border); overflow: visible; }
}

@media (max-width: 820px) {
    .timeline { grid-template-columns: 1fr; gap: 96px; padding-top: 0; }
    .timeline-arrow, .timeline-arrow.is-below {
        /* Flèche tournée d'un quart de tour : sa hauteur visible est sa largeur (72 px), centrée sur sa boîte. */
        top: calc(100% + 30px);
        left: 50%;
        width: 72px;
        transform: translateX(-50%) rotate(90deg) scaleY(-1);
    }
    .timeline-arrow.is-below { transform: translateX(-50%) rotate(90deg); }
}

@media (max-width: 600px) {
    /* Boutons de la barre du haut resserrés pour tenir sur la largeur d'un téléphone. */
    .topbar-actions { gap: 2px; }
    .tool-grid, .feature-grid { grid-template-columns: 1fr; }
    .form-row, .cta-points { grid-template-columns: 1fr; }
    .styles-visual { display: grid; gap: 10px; padding: 12px 0 0; }
    .sv-file, .sv-team { position: static; justify-self: start; transform: none; }
    .tool-grid > .tool-card:last-child:nth-child(2n + 1) { width: auto; }
    .site-header { gap: 8px; }
    .site-header .lang-switch { display: none; }
    .site-header .btn-primary { padding: 0 12px; }
    .privacy-band { flex-direction: column; align-items: flex-start; }
    .soon-card { padding: 24px; }
}

@media (max-width: 480px) {
    .brand span { display: none; }
    #btn-copy span { display: none; }
}

/* ---------- Mode maintenance ---------- */

.page-maintenance {
    display: grid;
    place-items: center;
    min-height: 100%;
    background-color: var(--stage);
    background-image:
        radial-gradient(circle at 15% 20%, color-mix(in srgb, var(--brand-1) 32%, transparent), transparent 45%),
        radial-gradient(circle at 85% 80%, color-mix(in srgb, var(--brand-2) 30%, transparent), transparent 45%);
}

.maintenance { padding: 24px 16px; }

.maintenance-card {
    display: grid;
    gap: 16px;
    justify-items: center;
    width: min(520px, 100%);
    padding: 40px 32px;
    border: 1px solid var(--border);
    border-radius: 24px;
    background: color-mix(in srgb, var(--surface) 88%, transparent);
    box-shadow: var(--shadow-md);
    text-align: center;
    backdrop-filter: blur(10px);
}

.maintenance-card h1 { margin: 0; font-size: clamp(26px, 5vw, 34px); letter-spacing: -0.03em; }
.maintenance-card .lead { margin: 0; font-size: 16px; }

.preview-pill {
    position: fixed;
    bottom: 16px;
    left: 16px;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: calc(100% - 32px);
    padding: 8px 14px;
    border-radius: 999px;
    background: #1b1740;
    color: #fff;
    font-size: 12.5px;
    font-weight: 600;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.preview-pill a { color: #c9c2ff; white-space: nowrap; }
.preview-dot { width: 8px; height: 8px; flex: none; border-radius: 50%; background: #febc2e; }
