/* ==========================================================================
   Amélioration STL — feuille de style de l'atelier
   Mobile d'abord : les grilles multi-colonnes vivent dans les media queries.
   ========================================================================== */

:root {
    --bg: #0e1116;
    --bg-soft: #121821;
    --surface: #161d26;
    --surface-2: #1c2530;
    --surface-3: #232e3a;
    --line: #26313d;
    --line-soft: #1f2833;
    --text: #e9eef4;
    --text-dim: #9aabbd;
    --text-faint: #748699;
    --accent: #d9974f;
    --accent-strong: #eba961;
    --accent-dim: rgba(217, 151, 79, .14);
    --ok: #4bbfa6;
    --ok-dim: rgba(75, 191, 166, .14);
    --warn: #e0a458;
    --warn-dim: rgba(224, 164, 88, .14);
    --danger: #e0685f;
    --danger-dim: rgba(224, 104, 95, .14);
    --info: #5aa6e0;
    --radius: 14px;
    --radius-sm: 10px;
    --radius-lg: 22px;
    --shadow: 0 18px 40px -24px rgba(0, 0, 0, .85);
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
    --tabbar-h: 64px;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background:
        radial-gradient(1200px 600px at 12% -10%, rgba(217, 151, 79, .10), transparent 60%),
        radial-gradient(900px 500px at 100% 0%, rgba(90, 166, 224, .07), transparent 55%),
        var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.55;
    min-height: 100vh;
    padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + 12px);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { margin: 0 0 .5rem; line-height: 1.2; font-weight: 650; letter-spacing: -.01em; }
p { margin: 0 0 .8rem; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-strong); }
code, kbd, .mono { font-family: var(--mono); }

.shell { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 18px; }
.muted { color: var(--text-dim); font-size: .93rem; }

/* ---------- Barre supérieure ---------- */

.topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    padding-top: env(safe-area-inset-top, 0px);
    background: rgba(14, 17, 22, .88);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line-soft);
}

.topbar__inner {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 62px;
    flex-wrap: wrap;
    padding-top: 8px;
    padding-bottom: 8px;
}

.brand { display: flex; align-items: center; gap: 11px; color: var(--text); }
.brand__mark {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(150deg, rgba(217, 151, 79, .22), rgba(217, 151, 79, .05));
    border: 1px solid rgba(217, 151, 79, .35);
    color: var(--accent);
    flex: none;
}
.brand__text { display: flex; flex-direction: column; }
.brand__text strong { font-size: 1rem; letter-spacing: -.01em; }
.brand__text small { color: var(--text-faint); font-size: .74rem; letter-spacing: .04em; text-transform: uppercase; }

.topnav { display: none; gap: 4px; margin-left: auto; }
.topnav__link {
    appearance: none;
    background: none;
    border: 0;
    color: var(--text-dim);
    font: inherit;
    font-size: .93rem;
    padding: 9px 12px;
    border-radius: 10px;
    cursor: pointer;
}
.topnav__link:hover { background: var(--surface-2); color: var(--text); }
.topnav__link.is-active { color: var(--text); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); }

.btn--install { display: inline-flex; margin-left: auto; }

@media (max-width: 559px) {
    .btn--install { font-size: .8rem; padding: 8px 11px; min-height: 40px; gap: 6px; }
}

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

.btn {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 12px 18px;
    min-height: 46px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
    background: var(--surface-2);
    color: var(--text);
    font: inherit;
    font-weight: 560;
    cursor: pointer;
    transition: transform .12s ease, background .18s ease, border-color .18s ease, color .18s ease;
    text-align: center;
}
.btn:hover { background: var(--surface-3); border-color: #33414f; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn--primary {
    background: linear-gradient(160deg, var(--accent-strong), var(--accent));
    border-color: rgba(255, 255, 255, .12);
    color: #241705;
    font-weight: 640;
    box-shadow: 0 12px 26px -16px rgba(217, 151, 79, .9);
}
.btn--primary:hover { background: linear-gradient(160deg, #f5b873, var(--accent-strong)); }
.btn--ghost { background: transparent; }
.btn--ghost:hover { background: var(--surface-2); }
.btn--xl { padding: 17px 26px; min-height: 58px; font-size: 1.05rem; border-radius: 14px; width: 100%; }
.btn--danger { background: var(--danger-dim); border-color: rgba(224, 104, 95, .4); color: #ffbdb8; }
.btn--small { padding: 7px 12px; min-height: 36px; font-size: .85rem; }

/* ---------- Structure des vues ---------- */

.main { padding-top: 26px; }
.view { display: none; }
.view.is-active { display: block; animation: fade .3s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.view__head { margin-bottom: 18px; }
.view__title { font-size: 1.6rem; }
.view__text { color: var(--text-dim); max-width: 68ch; }

.hero { margin-bottom: 22px; }
.hero__eyebrow {
    display: inline-block;
    font-size: .76rem;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--accent);
    background: var(--accent-dim);
    border: 1px solid rgba(217, 151, 79, .3);
    padding: 5px 11px;
    border-radius: 999px;
    margin-bottom: 14px;
}
.hero__title { font-size: clamp(1.6rem, 6.4vw, 2.6rem); }
.hero__text { color: var(--text-dim); max-width: 62ch; }

/* ---------- Zone de dépôt ---------- */

.dropzone {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-align: center;
    padding: 30px 18px;
    border: 1.5px dashed #38475a;
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, rgba(28, 37, 48, .75), rgba(22, 29, 38, .6));
    cursor: pointer;
    transition: border-color .2s ease, background .2s ease, transform .2s ease;
    outline: none;
}
.dropzone:hover, .dropzone:focus-visible { border-color: var(--accent); background: linear-gradient(180deg, rgba(217, 151, 79, .10), rgba(22, 29, 38, .7)); }
.dropzone.is-dragover { border-color: var(--accent-strong); background: var(--accent-dim); transform: scale(1.005); }
.dropzone__icon { color: var(--accent); }
.dropzone__title { font-size: 1.25rem; font-weight: 640; }
.dropzone__hint { color: var(--text-dim); font-size: .9rem; }
.dropzone__privacy { color: var(--text-faint); font-size: .8rem; max-width: 48ch; }
.dropzone .btn { width: 100%; max-width: 330px; }

/* ---------- Niveaux de lissage ---------- */

.levels { margin-top: 20px; }
.levels__label { display: block; font-size: .82rem; letter-spacing: .1em; text-transform: uppercase; color: var(--text-faint); margin-bottom: 8px; }
.levels__note { color: var(--text-dim); font-size: .88rem; margin: 8px 0 0; }

.segmented { display: flex; gap: 6px; background: var(--surface); border: 1px solid var(--line); padding: 5px; border-radius: 12px; }
.segmented__item {
    flex: 1;
    appearance: none;
    border: 0;
    background: transparent;
    color: var(--text-dim);
    font: inherit;
    font-size: .93rem;
    padding: 10px 8px;
    min-height: 44px;
    border-radius: 9px;
    cursor: pointer;
}
.segmented__item:hover { background: var(--surface-2); color: var(--text); }
.segmented__item.is-active { background: var(--surface-3); color: var(--text); box-shadow: inset 0 0 0 1px rgba(217, 151, 79, .45); }
.segmented--small { padding: 4px; }
.segmented--small .segmented__item { font-size: .84rem; padding: 7px 10px; min-height: 38px; flex: none; }

/* ---------- Parcours en étapes ---------- */

.flow {
    list-style: none;
    display: flex;
    gap: 8px;
    padding: 12px 4px;
    margin: 0 0 18px;
    overflow-x: auto;
    scrollbar-width: thin;
    border-top: 1px solid var(--line-soft);
    border-bottom: 1px solid var(--line-soft);
}
.flow__step {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    color: var(--text-faint);
    font-size: .85rem;
    padding: 6px 10px;
    border-radius: 999px;
}
.flow__num {
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--surface-2);
    border: 1px solid var(--line);
    font-size: .74rem;
    font-weight: 600;
    flex: none;
}
.flow__step.is-current { color: var(--text); background: var(--accent-dim); }
.flow__step.is-current .flow__num { background: var(--accent); color: #241705; border-color: transparent; }
.flow__step.is-done { color: var(--ok); }
.flow__step.is-done .flow__num { background: var(--ok-dim); border-color: rgba(75, 191, 166, .45); color: var(--ok); }

/* ---------- Panneaux ---------- */

.panel {
    background: linear-gradient(180deg, rgba(28, 37, 48, .6), rgba(22, 29, 38, .55));
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
}
.panel__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.panel__title { font-size: 1.02rem; margin: 0; }
.panel__subtitle { font-size: .95rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: .08em; }
.panel--cta { text-align: left; }
.panel--viewer { padding-bottom: 12px; }
.panel--file { display: flex; flex-direction: column; }

.grid { display: grid; gap: 16px; grid-template-columns: 1fr; margin-bottom: 0; }
.grid--2, .grid--3 { grid-template-columns: 1fr; }
.panel--auth { max-width: 520px; }

/* ---------- Statistiques ---------- */

.statlist { margin: 0; display: grid; gap: 2px; }
.statlist > div {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 14px;
    padding: 9px 0;
    border-bottom: 1px dashed var(--line-soft);
}
.statlist > div:last-child { border-bottom: 0; }
.statlist dt { color: var(--text-dim); font-size: .88rem; }
.statlist dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.statlist dd small { color: var(--text-faint); font-weight: 400; }

.statcard {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 14px 16px;
}
.statcard__value { font-size: 1.5rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.statcard__label { color: var(--text-dim); font-size: .84rem; }

.score { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.score__ring {
    display: grid;
    place-items: center;
    width: 92px;
    height: 92px;
    border-radius: 50%;
    background: conic-gradient(var(--accent) calc(var(--score, 0) * 1%), var(--surface-3) 0);
    position: relative;
    flex: none;
}
.score__ring::before {
    content: '';
    position: absolute;
    inset: 7px;
    border-radius: 50%;
    background: var(--surface);
}
.score__ring span, .score__ring small { position: relative; z-index: 1; }
.score__ring span { font-size: 1.5rem; font-weight: 680; line-height: 1; }
.score__ring small { font-size: .72rem; color: var(--text-faint); }
.score__label { margin: 0; color: var(--text-dim); font-size: .9rem; }

/* ---------- Listes de défauts, corrections, contrôles ---------- */

.defects, .fixes, .checks, .howto { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.defects li, .fixes li, .checks li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    background: var(--surface);
    border: 1px solid var(--line-soft);
    font-size: .92rem;
}
.defects li { border-left: 3px solid var(--warn); }
.defects li[data-severity="3"] { border-left-color: var(--danger); }
.defects li .tag, .fixes li .tag, .checks li .tag { margin-left: auto; white-space: nowrap; }
.checks li[data-ok="1"] { border-left: 3px solid var(--ok); }
.checks li[data-ok="0"] { border-left: 3px solid var(--danger); }
.checks li .check-detail { color: var(--text-dim); font-size: .84rem; }
.fixes li { border-left: 3px solid var(--info); }
.howto { counter-reset: how; }
.howto li { padding: 10px 0 10px 38px; position: relative; border-bottom: 1px dashed var(--line-soft); }
.howto li:last-child { border-bottom: 0; }
.howto li::before {
    counter-increment: how;
    content: counter(how);
    position: absolute;
    left: 0;
    top: 10px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--accent-dim);
    color: var(--accent);
    font-size: .8rem;
    font-weight: 650;
}

/* ---------- Barre de progression et alertes ---------- */

.progress { position: relative; height: 34px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; overflow: hidden; margin-top: 12px; }
.progress__fill { display: block; height: 100%; width: 0; background: linear-gradient(90deg, rgba(217, 151, 79, .5), var(--accent)); transition: width .3s ease; }
.progress__label { position: absolute; inset: 0; display: grid; place-items: center; font-size: .84rem; color: var(--text); }

.alert { padding: 12px 14px; border-radius: var(--radius-sm); font-size: .92rem; margin: 12px 0 0; }
.alert--warn { background: var(--warn-dim); border: 1px solid rgba(224, 164, 88, .35); color: #ffdcaa; }
.alert--ok { background: var(--ok-dim); border: 1px solid rgba(75, 191, 166, .35); color: #b6f0e2; }
.alert--danger { background: var(--danger-dim); border: 1px solid rgba(224, 104, 95, .35); color: #ffc9c4; }

.verify__banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: var(--radius);
    background: var(--ok-dim);
    border: 1px solid rgba(75, 191, 166, .35);
    color: #d7fff6;
    font-weight: 600;
    margin-bottom: 14px;
}
.verify__banner[data-state="warn"] { background: var(--warn-dim); border-color: rgba(224, 164, 88, .35); color: #ffe6c2; }
.verify__banner[data-state="danger"] { background: var(--danger-dim); border-color: rgba(224, 104, 95, .35); color: #ffd7d3; }
.verify__banner svg { flex: none; }

.export__actions { display: flex; flex-direction: column; gap: 10px; }
.save-hint { color: var(--text-faint); font-size: .84rem; margin: 12px 0 0; }

/* ---------- Visionneuses 3D ---------- */

.viewers { display: grid; grid-template-columns: 1fr; gap: 12px; }
.viewer { margin: 0; position: relative; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: radial-gradient(circle at 50% 40%, #1a232e, #10161d); }
.viewer figcaption { position: absolute; top: 10px; left: 12px; z-index: 2; font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; color: var(--text-faint); }
.viewer canvas { display: block; width: 100%; height: 260px; touch-action: none; }
.viewer__badge { position: absolute; bottom: 10px; right: 12px; z-index: 2; font-size: .78rem; color: var(--text-dim); background: rgba(10, 14, 19, .72); border: 1px solid var(--line); padding: 4px 9px; border-radius: 999px; }
.viewer__help { margin: 10px 0 0; }
.viewers[data-mode="after"] .viewer--before { display: none; }
.viewer--after { border-color: rgba(75, 191, 166, .28); }
.viewers[data-mode="wire"] { grid-template-columns: 1fr; }
.panel--verify { border-color: rgba(75, 191, 166, .25); }
.panel--export { border-color: rgba(217, 151, 79, .3); }
.admin-view { display: block; }
.admin-view[hidden] { display: none !important; }

/* ---------- Tableaux ---------- */

.tablewrap { width: 100%; overflow-x: auto; border: 1px solid var(--line-soft); border-radius: var(--radius-sm); }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; min-width: 640px; }
.table th, .table td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--line-soft); white-space: nowrap; }
.table thead th { color: var(--text-faint); font-weight: 560; font-size: .8rem; text-transform: uppercase; letter-spacing: .07em; }
.table tbody tr:hover { background: var(--surface); }
.table td.name { white-space: normal; min-width: 180px; font-weight: 560; }

.pill { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text-dim); }
.pill--ok { background: var(--ok-dim); border-color: rgba(75, 191, 166, .4); color: #b6f0e2; }
.pill--warn { background: var(--warn-dim); border-color: rgba(224, 164, 88, .4); color: #ffe6c2; }
.pill--danger { background: var(--danger-dim); border-color: rgba(224, 104, 95, .4); color: #ffc9c4; }
.pill--info { background: rgba(90, 166, 224, .14); border-color: rgba(90, 166, 224, .35); color: #cfe7ff; }

/* ---------- Formulaires ---------- */

.form { display: grid; gap: 14px; }
.form label { display: grid; gap: 6px; font-size: .88rem; color: var(--text-dim); }
.form input, .form select, .form textarea {
    font: inherit;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 12px 13px;
    min-height: 46px;
    width: 100%;
}
.form input:focus, .form select:focus, .form textarea:focus { outline: 2px solid rgba(217, 151, 79, .45); outline-offset: 1px; border-color: var(--accent); }
.form__row { display: grid; gap: 14px; grid-template-columns: 1fr; }
.form__hint { color: var(--text-faint); font-size: .82rem; }

/* ---------- FAQ ---------- */

.faq details { background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--radius-sm); padding: 14px 16px; margin-bottom: 10px; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq summary::marker { color: var(--accent); }
.faq p { margin: 10px 0 0; color: var(--text-dim); font-size: .93rem; }

/* ---------- Pied de page ---------- */

.footer { border-top: 1px solid var(--line-soft); margin-top: 30px; padding: 22px 0 calc(12px + env(safe-area-inset-bottom, 0px)); }
.footer__inner { display: flex; flex-direction: column; gap: 8px; color: var(--text-faint); font-size: .85rem; }
.footer__nav { display: flex; flex-wrap: wrap; gap: 14px; }
.footer__nav button { appearance: none; background: none; border: 0; color: var(--text-faint); font: inherit; padding: 0; cursor: pointer; }
.footer__nav button:hover, .footer__nav a:hover { color: var(--accent); }

/* ---------- Barre d'onglets mobile ---------- */

.tabbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
    display: flex;
    justify-content: space-around;
    gap: 2px;
    background: rgba(13, 17, 22, .96);
    backdrop-filter: blur(16px);
    border-top: 1px solid var(--line);
    padding: 5px 4px calc(5px + env(safe-area-inset-bottom, 0px));
}
.tabbar__item {
    appearance: none;
    background: none;
    border: 0;
    color: var(--text-faint);
    font: inherit;
    font-size: .68rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 7px 6px;
    min-width: 64px;
    border-radius: 12px;
    cursor: pointer;
}
.tabbar__item.is-active { color: var(--accent); background: var(--accent-dim); }
.tabbar__item span { letter-spacing: .01em; }

/* ---------- Notifications ---------- */

.toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + 14px); z-index: 60; display: grid; gap: 8px; width: calc(100% - 32px); max-width: 420px; }
.toast {
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    border: 1px solid var(--line);
    color: var(--text);
    font-size: .9rem;
    box-shadow: var(--shadow);
    animation: fade .25s ease;
}
.toast--ok { border-color: rgba(75, 191, 166, .45); }
.toast--warn { border-color: rgba(224, 164, 88, .45); }
.toast--danger { border-color: rgba(224, 104, 95, .45); }

/* ---------- Modale ---------- */

.modal { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; background: rgba(6, 9, 13, .74); backdrop-filter: blur(3px); padding: 18px; }
.modal__box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; max-width: 460px; width: 100%; }
.modal__steps { display: grid; gap: 12px; margin: 14px 0 18px; }
.modal__step { display: flex; gap: 12px; align-items: flex-start; color: var(--text-dim); font-size: .9rem; }
.modal__step svg { color: var(--accent); flex: none; }

/* ---------- Vues admin ---------- */

.admin-body { padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px)); }
.gate { max-width: 420px; margin: 12vh auto; }
.gate__card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.gate__brand { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.gate__hint { color: var(--text-dim); font-size: .88rem; }

.admin-grid { display: grid; gap: 14px; grid-template-columns: 1fr; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.toolbar input, .toolbar select { min-height: 44px; padding: 10px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); color: var(--text); font: inherit; }
.toolbar input { flex: 1 1 180px; }
.chart { position: relative; height: 240px; width: 100%; background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--radius-sm); padding: 12px; }
.chart svg { width: 100%; height: 100%; display: block; overflow: visible; }
.chart__bar { fill: var(--accent); opacity: .85; }
.chart__label { fill: var(--text-faint); font-size: 9px; }
.bars { display: grid; gap: 8px; }
.bars__row { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; align-items: center; font-size: .88rem; }
.bars__track { grid-column: 1 / -1; height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.bars__fill { display: block; height: 100%; background: linear-gradient(90deg, rgba(217, 151, 79, .6), var(--accent)); }
.section-title { font-size: 1.05rem; margin: 22px 0 10px; }
.form--inline { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }

/* ==========================================================================
   Écrans plus larges
   ========================================================================== */

@media (min-width: 560px) {
    .export__actions { flex-direction: row; flex-wrap: wrap; }
    .btn--xl { width: auto; }
    .dropzone .btn { width: auto; }
    .grid--3 { grid-template-columns: repeat(2, 1fr); }
    .form__row--2 { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 768px) {
    body { font-size: 16.5px; }
    .topnav { display: flex; }
    .btn--install { display: inline-flex; }
    .tabbar { display: none; }
    body { padding-bottom: 12px; }
    .grid--2 { grid-template-columns: 1fr 1fr; }
    .grid--3 { grid-template-columns: repeat(3, 1fr); }
    .viewers { grid-template-columns: 1fr 1fr; }
    .viewer canvas { height: 340px; }
    .viewers[data-mode="after"] { grid-template-columns: 1fr; }
    .viewers[data-mode="after"] .viewer canvas { height: 420px; }
    .footer__inner { flex-direction: row; justify-content: space-between; align-items: center; }
    .hero { padding: 10px 0 4px; }
    .admin-grid { grid-template-columns: repeat(2, 1fr); }
    .admin-grid--4 { grid-template-columns: repeat(4, 1fr); }
    .dropzone { padding: 44px 26px; }
    .modal__steps { grid-template-columns: 1fr; }
}

@media (min-width: 1024px) {
    .viewers[data-mode="split"] { grid-template-columns: 1fr 1fr; }
    .grid--2 { gap: 20px; }
    .panel { padding: 22px; }
    .flow { flex-wrap: wrap; }
}

/* ==========================================================================
   Thème de l'administration — identité distincte de l'application visible
   ========================================================================== */

.admin-theme {
    --accent: #4bbfa6;
    --accent-strong: #6ad4ba;
    --accent-dim: rgba(75, 191, 166, .14);
    background:
        radial-gradient(900px 500px at 10% -10%, rgba(75, 191, 166, .10), transparent 60%),
        var(--bg);
}
.admin-theme .btn--primary { color: #04211b; box-shadow: 0 12px 26px -16px rgba(75, 191, 166, .8); }
.admin-theme .btn--primary:hover { background: linear-gradient(160deg, #86e0ca, var(--accent-strong)); }
.admin-theme .brand__mark {
    border-color: rgba(75, 191, 166, .38);
    background: linear-gradient(150deg, rgba(75, 191, 166, .2), rgba(75, 191, 166, .04));
    color: var(--accent);
}
.admin-theme .topnav__link.is-active { box-shadow: inset 0 0 0 1px rgba(75, 191, 166, .35); }
.admin-theme .hero__eyebrow { color: var(--accent); background: var(--accent-dim); border-color: rgba(75, 191, 166, .3); }
.admin-theme .form input:focus, .admin-theme .form select:focus { outline-color: rgba(75, 191, 166, .45); }

@media (min-width: 768px) {
    .admin-body { padding-bottom: 24px; }
    .admin-theme .tabbar { display: none; }
}
