/* Style dédié au portail Verifier, indépendant de style.css. */

:root {
    --brand-orange: #f08327;
    --brand-orange-600: #d96f18;
    --brand-blue: #00057b;
    --brand-blue-2: #1b2fb8;

    --bg: #f4f5fb;
    --surface: #ffffff;
    --surface-2: #f8f9fe;
    --text: #161a33;
    --muted: #6a7096;
    --border: #e6e8f4;
    --primary: #16208f;
    --primary-ink: #ffffff;
    --shadow: 0 10px 30px rgba(20, 24, 66, 0.08);
    --shadow-sm: 0 2px 8px rgba(20, 24, 66, 0.06);
    --radius: 16px;
    --radius-sm: 10px;

    --ok: #16a34a;
    --warn: #d19a00;
    --err: #dc2626;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0b0d1c;
        --surface: #15182c;
        --surface-2: #1b1f37;
        --text: #eef0fb;
        --muted: #9aa0c4;
        --border: #2a2f4d;
        --primary: #6f7bff;
        --primary-ink: #0b0d1c;
        --shadow: 0 12px 34px rgba(0, 0, 0, 0.4);
        --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.3);
    }
}
:root[data-theme="dark"] {
    --bg: #0b0d1c;
    --surface: #15182c;
    --surface-2: #1b1f37;
    --text: #eef0fb;
    --muted: #9aa0c4;
    --border: #2a2f4d;
    --primary: #6f7bff;
    --primary-ink: #0b0d1c;
    --shadow: 0 12px 34px rgba(0, 0, 0, 0.4);
    --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.3);
}
:root[data-theme="light"] {
    --bg: #f4f5fb;
    --surface: #ffffff;
    --text: #161a33;
    --muted: #6a7096;
    --border: #e6e8f4;
    --primary: #16208f;
    --primary-ink: #ffffff;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}
body.modal-open, body.drawer-open { overflow: hidden; }
.d-none { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.muted { color: var(--muted); font-size: 0.9rem; }
a { color: var(--primary); }

/* Header */
.app-header {
    background: linear-gradient(120deg, var(--brand-blue) 0%, #241a7a 55%, var(--brand-orange) 160%);
    color: #fff;
    padding: 18px 0 22px;
    box-shadow: var(--shadow);
    position: relative;
    z-index: 5;
}
.header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 22px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand img { height: 30px; width: auto; }
.brand-titles { display: flex; flex-direction: column; line-height: 1.1; }
.brand-title { font-weight: 700; font-size: 1.15rem; letter-spacing: 0.2px; }
.brand-sub { font-size: 0.78rem; opacity: 0.82; }

.header-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.header-actions .link-quiet {
    color: #fff; opacity: 0.85; text-decoration: none; font-size: 0.85rem;
    padding: 6px 8px; border-radius: 8px;
}
.header-actions .link-quiet:hover { opacity: 1; background: rgba(255, 255, 255, 0.12); }

.ghost-white {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #fff;
    border-radius: 10px;
    padding: 8px 12px;
    font-size: 0.85rem;
    cursor: pointer;
    display: inline-flex; align-items: center; gap: 8px;
    transition: background 0.2s ease, transform 0.15s ease;
}
.ghost-white:hover { background: rgba(255, 255, 255, 0.22); }
.ghost-white:active { transform: scale(0.97); }
.lang-btn { font-weight: 700; letter-spacing: 0.4px; }

/* Sélecteur de version */
.version-toggle {
    display: inline-flex;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 999px;
    padding: 4px;
    gap: 4px;
    margin: 16px auto 0;
    max-width: 1120px;
}
.version-toggle-wrap { max-width: 1120px; margin: 0 auto; padding: 0 22px; }
.version-toggle button {
    border: 0;
    background: transparent;
    color: rgba(255, 255, 255, 0.85);
    padding: 9px 18px;
    border-radius: 999px;
    cursor: pointer;
    font-size: 0.86rem;
    display: flex; flex-direction: column; align-items: flex-start;
    transition: background 0.2s ease, color 0.2s ease;
}
.version-toggle button .vt-title { font-weight: 700; }
.version-toggle button .vt-sub { font-size: 0.72rem; opacity: 0.8; }
.version-toggle button.active {
    background: #fff;
    color: var(--brand-blue);
}
.version-toggle button.active .vt-sub { color: var(--brand-orange-600); opacity: 1; }

/* Restrictions */
.restrictions {
    max-width: 1120px;
    margin: 12px auto 0;
    padding: 0 22px;
}
.restrictions-link {
    background: transparent; border: 0; color: rgba(255,255,255,0.9);
    font-size: 0.82rem; cursor: pointer; padding: 4px 0;
    display: inline-flex; align-items: center; gap: 6px;
}
.restrictions-link:hover { text-decoration: underline; }
.restrictions-panel {
    display: none;
    margin-top: 10px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 12px;
    padding: 12px 14px;
}
.restrictions-panel.open { display: block; }
.restrictions-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px; text-align: center;
}
.restrictions-grid .rk { font-size: 0.72rem; opacity: 0.85; display: block; margin-bottom: 4px; }
.restrictions-grid .rv {
    display: inline-block; background: rgba(255,255,255,0.18);
    padding: 4px 10px; border-radius: 999px; font-weight: 600; font-size: 0.8rem;
}

/* Layout */
.container {
    max-width: 1120px;
    margin: 0 auto;
    padding: 26px 22px 60px;
}
.section-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 22px;
    margin-bottom: 22px;
}
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 6px; flex-wrap: wrap; }
.section-title { font-size: 1.2rem; font-weight: 700; margin: 0; }
.section-desc { color: var(--muted); font-size: 0.9rem; margin: 0 0 16px; }

/* Boutons */
.btn {
    border: 0; border-radius: 10px; cursor: pointer;
    font-size: 0.9rem; font-weight: 600;
    padding: 10px 16px;
    display: inline-flex; align-items: center; gap: 8px;
    transition: transform 0.12s ease, box-shadow 0.2s ease, background 0.2s ease, opacity 0.2s ease;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--primary); color: var(--primary-ink); }
.btn-primary:hover { box-shadow: 0 8px 18px rgba(22, 32, 143, 0.28); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; box-shadow: none; }
.btn-accent { background: var(--brand-orange); color: #fff; }
.btn-accent:hover { background: var(--brand-orange-600); }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger-soft { background: rgba(220, 38, 38, 0.1); color: var(--err); }
.btn-danger-soft:hover { background: rgba(220, 38, 38, 0.18); }
.btn-lg { padding: 14px 22px; font-size: 1rem; }
.btn-sm { padding: 8px 14px; font-size: 0.85rem; text-decoration: none; }
.btn-xs { padding: 4px 10px; font-size: 0.78rem; }
.btn-block { width: 100%; justify-content: center; }
.icon-btn {
    background: transparent; border: 0; color: var(--muted); cursor: pointer;
    width: 34px; height: 34px; border-radius: 8px; font-size: 1rem;
    display: inline-flex; align-items: center; justify-content: center;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }

/* Catalogue docs */
.doc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 14px;
}
.doc-card {
    text-align: left;
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px 14px 12px 40px;
    cursor: pointer;
    position: relative;
    display: flex; flex-direction: column; gap: 10px;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.12s ease;
    color: inherit;
}
.doc-card:hover { border-color: var(--brand-blue-2); box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.doc-card.selected { border-color: var(--brand-orange); background: linear-gradient(180deg, rgba(240,131,39,0.06), transparent); }
/* Repère du document ouvert dans l'éditeur, même sans attribut validé. */
.doc-card.editing {
    border-color: var(--brand-blue-2);
    box-shadow: 0 0 0 3px rgba(27, 47, 184, 0.18);
}
.doc-card.editing::after {
    content: "";
    position: absolute; left: -1.5px; top: 10px; bottom: 10px; width: 4px;
    border-radius: 0 4px 4px 0; background: var(--brand-blue-2);
}
.doc-check {
    position: absolute; left: 12px; top: 15px;
    width: 20px; height: 20px; border-radius: 6px;
    border: 1.5px solid var(--border);
    display: inline-flex; align-items: center; justify-content: center;
    color: transparent; font-size: 0.7rem;
    transition: all 0.18s ease;
}
.doc-card.selected .doc-check { background: var(--brand-orange); border-color: var(--brand-orange); color: #fff; }
.doc-card-main { display: flex; flex-direction: column; }
.doc-name { font-weight: 700; font-size: 1rem; }
.doc-type { color: var(--muted); font-size: 0.76rem; font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; word-break: break-all; }
.doc-card-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fmt-badge {
    font-size: 0.7rem; font-weight: 700; padding: 3px 9px; border-radius: 999px;
    text-transform: none; letter-spacing: 0.2px;
}
.fmt-mdoc { background: rgba(22, 32, 143, 0.12); color: var(--brand-blue-2); }
.fmt-sdjwt { background: rgba(220, 38, 38, 0.12); color: var(--err); }
.fmt-unknown { background: rgba(209, 154, 0, 0.15); color: var(--warn); }
.attr-count { font-size: 0.72rem; color: var(--brand-orange-600); font-weight: 600; }

/* Éditeur d'attributs */
.editor-panel {
    margin-top: 16px;
    border: 1.5px solid var(--brand-blue-2);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    overflow: hidden;
}
.editor-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 16px; border-bottom: 1px solid var(--border);
    background: var(--surface);
}
.editor-title { display: flex; flex-direction: column; gap: 4px; }
.editor-sub { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.attr-tree { padding: 12px 16px; max-height: 420px; overflow-y: auto; }
.attr-group { margin-bottom: 10px; border-left: 2px solid var(--border); padding-left: 10px; }
.attr-group-head { padding: 4px 0; }
.ns-label { font-weight: 600; font-family: ui-monospace, Menlo, monospace; font-size: 0.82rem; }
.attr-items {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 4px 14px; padding: 6px 0 8px 6px;
}
.attr-item { display: flex; align-items: center; gap: 8px; font-size: 0.88rem; cursor: pointer; padding: 3px 0; }
.attr-item span { word-break: break-word; }
.chk-inline { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 0.88rem; }
input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--brand-orange); cursor: pointer; }
.editor-actions {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 12px 16px; border-top: 1px solid var(--border); background: var(--surface); flex-wrap: wrap;
}
.editor-actions-left { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.editor-actions-right { display: flex; align-items: center; gap: 8px; }

/* Générer */
.generate-bar { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.generate-hint { color: var(--muted); font-size: 0.88rem; }

/* Tiroir des réglages */
.drawer-overlay {
    position: fixed; inset: 0; background: rgba(10, 12, 28, 0.45);
    opacity: 0; pointer-events: none; transition: opacity 0.25s ease; z-index: 40;
}
.drawer-overlay.open { opacity: 1; pointer-events: auto; }
.drawer {
    position: fixed; top: 0; right: 0; height: 100vh; width: 440px; max-width: 92vw;
    background: var(--surface); box-shadow: -12px 0 40px rgba(0,0,0,0.2);
    transform: translateX(100%); transition: transform 0.28s cubic-bezier(0.3,0.7,0.3,1);
    z-index: 41; display: flex; flex-direction: column;
}
.drawer.open { transform: translateX(0); }
.drawer-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 18px 20px; border-bottom: 1px solid var(--border);
}
.drawer-head h2 { font-size: 1.05rem; margin: 0; }
.drawer-body { padding: 8px 16px 24px; overflow-y: auto; }

.acc { border: 1px solid var(--border); border-radius: 12px; margin: 12px 0; overflow: hidden; }
.acc-head {
    width: 100%; text-align: left; background: var(--surface-2); border: 0;
    padding: 13px 15px; cursor: pointer; font-weight: 600; font-size: 0.94rem;
    display: flex; align-items: center; gap: 10px; color: var(--text);
}
.acc-head .acc-chevron { margin-left: auto; transition: transform 0.2s ease; color: var(--muted); }
.acc.open .acc-head .acc-chevron { transform: rotate(180deg); }
.acc-head i.grp-icon { color: var(--brand-blue-2); width: 18px; text-align: center; }
.acc-body { padding: 14px 15px; }
.acc:not(.open) .acc-body { display: none; }

.field { margin-bottom: 12px; }
.field label.field-label { display: block; font-size: 0.82rem; color: var(--muted); margin-bottom: 5px; }
.input, select.input, textarea.input {
    width: 100%; padding: 9px 11px; border: 1px solid var(--border);
    border-radius: 9px; background: var(--surface); color: var(--text); font-size: 0.88rem;
    font-family: inherit;
}
textarea.input { resize: vertical; min-height: 90px; font-family: ui-monospace, Menlo, monospace; font-size: 0.8rem; }
.row-inline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.pill-group { display: flex; gap: 8px; flex-wrap: wrap; }
.radio-pill {
    display: inline-flex; align-items: center; gap: 7px;
    border: 1px solid var(--border); border-radius: 999px; padding: 7px 13px;
    cursor: pointer; font-size: 0.84rem;
}
.radio-pill.active { border-color: var(--brand-orange); background: rgba(240,131,39,0.08); }
.radio-pill input { accent-color: var(--brand-orange); }

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
    border: 1px solid var(--border); background: var(--surface); color: var(--text);
    border-radius: 999px; padding: 6px 12px; cursor: pointer; font-size: 0.82rem;
    display: inline-flex; align-items: center; gap: 7px; position: relative;
}
.chip.active { background: var(--brand-blue); border-color: var(--brand-blue); color: #fff; }
.chip-order {
    background: var(--brand-orange); color: #fff; border-radius: 999px;
    min-width: 18px; height: 18px; font-size: 0.68rem; font-weight: 700;
    display: inline-flex; align-items: center; justify-content: center;
}
.note {
    font-size: 0.8rem; color: var(--muted); background: var(--surface-2);
    border-radius: 8px; padding: 8px 10px; margin-top: 8px;
    border: 1px dashed var(--border);
}
.wm-example { display: none; white-space: pre; overflow: auto; max-height: 220px;
    background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px;
    padding: 10px; margin-top: 8px; font-family: ui-monospace, Menlo, monospace; font-size: 0.76rem; }
.wm-example.open { display: block; }

/* Checks */
.checks-actions { display: flex; gap: 8px; margin-bottom: 12px; }
.check-group { margin-bottom: 12px; }
.check-group-title { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.4px; color: var(--muted); margin-bottom: 6px; }
.check-items { display: flex; flex-direction: column; gap: 4px; }
.switch-row { display: flex; align-items: center; gap: 10px; cursor: pointer; padding: 3px 0; font-size: 0.84rem; }
.switch { position: relative; width: 34px; height: 20px; flex: none; }
.switch-input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch::before {
    content: ""; position: absolute; inset: 0; background: var(--border); border-radius: 999px; transition: background 0.2s ease;
}
.switch::after {
    content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px;
    background: #fff; border-radius: 50%; transition: transform 0.2s ease; box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
.switch:has(.switch-input:checked)::before { background: var(--ok); }
.switch:has(.switch-input:checked)::after { transform: translateX(14px); }
.switch-label { word-break: break-word; }

/* Modales */
.modal {
    position: fixed; inset: 0; z-index: 60;
    display: none; align-items: center; justify-content: center; padding: 20px;
    background: rgba(10, 12, 28, 0.55);
}
.modal.open { display: flex; }
.modal-card {
    background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
    width: 100%; max-width: 560px; max-height: 88vh; display: flex; flex-direction: column; overflow: hidden;
}
.modal-card.modal-lg { max-width: 820px; }
.modal-head {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.modal-head h3 { margin: 0; font-size: 1.05rem; }
.modal-body { padding: 20px; overflow-y: auto; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }

/* Partage */
.share-body { text-align: center; }
.qr-frame {
    display: inline-flex; align-items: center; justify-content: center;
    background: #fff; padding: 10px; border-radius: 12px; box-shadow: var(--shadow-sm);
    min-height: 100px; margin-bottom: 4px;
}
/* Pas de largeur forcée : une mise à l'échelle non entière rendrait les modules
   du QR flous. Seuls les très petits écrans sont contraints. */
.qr-frame canvas { display: block; max-width: 100%; height: auto; border-radius: 4px; }
.share-link-hint { margin: 10px 0 8px; font-size: 0.82rem; color: var(--muted); }
.share-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.share-meta { margin-top: 16px; font-size: 0.78rem; color: var(--muted); text-align: left; }
.share-meta code { word-break: break-all; }
.countdown-badge {
    display: inline-flex; align-items: center; gap: 8px;
    background: rgba(22,32,143,0.1); color: var(--primary);
    padding: 6px 12px; border-radius: 999px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.cert-pem {
    white-space: pre-wrap; word-break: break-all; font-family: ui-monospace, Menlo, monospace;
    font-size: 0.74rem; background: var(--surface-2); border: 1px solid var(--border);
    border-radius: 8px; padding: 12px; margin: 0;
}

/* Rapport */
.report-summary { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.report-pill { padding: 6px 12px; border-radius: 999px; font-size: 0.8rem; font-weight: 700; }
.pill-success { background: rgba(22,163,74,0.12); color: var(--ok); }
.pill-warning { background: rgba(209,154,0,0.15); color: var(--warn); }
.pill-failed { background: rgba(220,38,38,0.12); color: var(--err); }
.pill-blocking { background: rgba(120,20,20,0.15); color: #7a1414; }
.report-table-wrap { overflow-x: auto; }
.report-table { width: 100%; border-collapse: collapse; font-size: 0.84rem; }
.report-table th, .report-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.report-table th { color: var(--muted); font-weight: 600; }
.report-table td:first-child { font-family: ui-monospace, Menlo, monospace; font-size: 0.78rem; word-break: break-word; }
.report-table tr.sev-warning { background: rgba(209,154,0,0.08); }
.report-table tr.sev-failed { background: rgba(220,38,38,0.07); }
.report-table tr.sev-blocking { background: rgba(120,20,20,0.1); }
.report-sev { font-weight: 600; }
#report-details-body {
    white-space: pre-wrap; word-break: break-word; font-family: ui-monospace, Menlo, monospace;
    font-size: 0.78rem; background: var(--surface-2); border: 1px solid var(--border);
    border-radius: 8px; padding: 12px; margin: 0; max-height: 60vh; overflow: auto;
}

/* Résultats */
.results-error .section-title { color: var(--err); }
.result-doc { margin-bottom: 20px; }
.result-doc-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.result-card {
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    background: var(--surface-2); padding: 14px; margin-bottom: 10px;
}
.result-card-idx { font-size: 0.78rem; color: var(--muted); margin-bottom: 8px; }
.claim-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px 18px; }
.claim-row { display: flex; flex-direction: column; gap: 2px; padding: 6px 0; border-bottom: 1px dashed var(--border); }
.claim-row-img { grid-column: 1 / -1; flex-direction: row; align-items: center; gap: 14px; }
.claim-name { font-size: 0.74rem; color: var(--muted); font-family: ui-monospace, Menlo, monospace; word-break: break-all; }
.claim-value { font-weight: 600; }
.claim-img { max-height: 150px; max-width: 120px; border-radius: 8px; border: 1px solid var(--border); }
.claim-json { white-space: pre-wrap; font-family: ui-monospace, Menlo, monospace; font-size: 0.76rem; background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 8px; margin: 4px 0 0; overflow: auto; max-height: 200px; }
.claim-long { max-height: 110px; overflow: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 8px; font-size: 0.82rem; }
.bool-badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 0.78rem; font-weight: 700; width: fit-content; }
.bool-true { background: rgba(22,163,74,0.14); color: var(--ok); }
.bool-false { background: rgba(220,38,38,0.12); color: var(--err); }
.result-error-box { display: flex; gap: 12px; align-items: flex-start; color: var(--err); }
.result-error-box i { font-size: 1.4rem; margin-top: 2px; }

/* Toasts */
#toasts {
    position: fixed; top: 18px; left: 50%; transform: translateX(-50%);
    z-index: 90; display: flex; flex-direction: column; gap: 8px; align-items: center;
    pointer-events: none; width: min(92vw, 460px);
}
.toast {
    background: var(--surface); color: var(--text); border: 1px solid var(--border);
    border-left: 4px solid var(--muted);
    border-radius: 10px; padding: 11px 16px; box-shadow: var(--shadow);
    font-size: 0.88rem; opacity: 0; transform: translateY(-8px);
    transition: opacity 0.25s ease, transform 0.25s ease; width: 100%;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast-success { border-left-color: var(--ok); }
.toast-error { border-left-color: var(--err); }
.toast-warning { border-left-color: var(--warn); }
.toast-info { border-left-color: var(--brand-blue-2); }

/* Footer */
.app-footer { text-align: center; color: var(--muted); font-size: 0.8rem; padding: 0 20px 30px; }
.app-footer #mode-info { margin-top: 6px; }

/* Responsive */
@media (max-width: 640px) {
    .brand-title { font-size: 1rem; }
    .version-toggle { flex-direction: column; border-radius: 16px; }
    .version-toggle button { border-radius: 12px; }
    .drawer { width: 100vw; }
    .section-card { padding: 16px; }
    .editor-actions { flex-direction: column; align-items: stretch; }
    .editor-actions-right { justify-content: stretch; }
    .editor-actions-right .btn { flex: 1; justify-content: center; }
}
