/* =========================================================================
   Outils Fourmizz — design system
   ========================================================================= */

:root {
  --brand: #00f0d4;
  --brand-hover: #2cf5de;
  --brand-ink: #00302b;          /* texte posé sur la couleur de marque */
  --accent: #00786a;             /* liens / accents lisibles sur fond clair */
  --bg: #f4f7f7;
  --surface: #ffffff;
  --surface-2: #eef3f2;
  --surface-3: #e3ebea;
  --border: #d9e3e1;
  --border-strong: #b9c9c6;
  --text: #0e1a1c;
  --muted: #56686b;
  --danger: #d63a4f;
  --warn: #b7791f;
  --ok: #138a5c;
  --focus: 0 0 0 3px color-mix(in srgb, var(--brand) 55%, transparent);
  --shadow-sm: 0 1px 2px rgb(14 26 28 / .06);
  --shadow: 0 1px 2px rgb(14 26 28 / .05), 0 8px 24px -8px rgb(14 26 28 / .12);
  --shadow-lg: 0 24px 60px -12px rgb(14 26 28 / .28);
  --radius: 14px;
  --radius-sm: 9px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --topbar-h: 64px;
  --sidebar-w: 264px;

  --c-web: #00a893;       --c-web-bg: #d9faf5;
  --c-design: #7c4dff;    --c-design-bg: #ece5ff;
  --c-juridique: #c27803; --c-juridique-bg: #fdf0d5;
  --c-securite: #e0355a;  --c-securite-bg: #fde3e8;
  --c-marketing: #2f6fed; --c-marketing-bg: #e1ebfe;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --accent: #3ff5de; --bg: #0a1012; --surface: #111a1d; --surface-2: #172226; --surface-3: #1e2c31;
    --border: #22333a; --border-strong: #34494f; --text: #e6efee; --muted: #8fa3a6;
    --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 10px 30px -10px rgb(0 0 0 / .5); --shadow-lg: 0 30px 70px -10px rgb(0 0 0 / .7);
    --c-web-bg: #0d3530; --c-design-bg: #2a2147; --c-juridique-bg: #3a2c0c; --c-securite-bg: #401825; --c-marketing-bg: #16284d;
    --c-web: #3ff5de; --c-design: #b29bff; --c-juridique: #f6b73c; --c-securite: #ff7c96; --c-marketing: #7fa8ff;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --accent: #3ff5de; --bg: #0a1012; --surface: #111a1d; --surface-2: #172226; --surface-3: #1e2c31;
  --border: #22333a; --border-strong: #34494f; --text: #e6efee; --muted: #8fa3a6;
  --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 10px 30px -10px rgb(0 0 0 / .5); --shadow-lg: 0 30px 70px -10px rgb(0 0 0 / .7);
  --c-web-bg: #0d3530; --c-design-bg: #2a2147; --c-juridique-bg: #3a2c0c; --c-securite-bg: #401825; --c-marketing-bg: #16284d;
  --c-web: #3ff5de; --c-design: #b29bff; --c-juridique: #f6b73c; --c-securite: #ff7c96; --c-marketing: #7fa8ff;
  color-scheme: dark;
}

/* --- Base ---------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--topbar-h) + 16px); }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.55 var(--font); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { line-height: 1.15; margin: 0 0 .4em; letter-spacing: -.02em; }
h1 { font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.1rem); font-weight: 800; }
h2 { font-size: 1.25rem; font-weight: 750; }
h3 { font-size: 1rem; font-weight: 700; letter-spacing: -.01em; }
p { margin: 0 0 1em; }
a { color: var(--accent); text-underline-offset: 3px; }
img, svg, canvas { max-width: 100%; }
code, kbd, pre, .mono { font-family: var(--mono); font-size: .9em; }
kbd { display: inline-block; padding: 1px 6px; border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 6px; font-size: 11px; color: var(--muted); background: var(--surface); line-height: 1.5; }
.i { width: 18px; height: 18px; flex: none; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 6px; }
::selection { background: color-mix(in srgb, var(--brand) 45%, transparent); }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--brand); color: var(--brand-ink); padding: 8px 14px; border-radius: 8px; }
.skip:focus { left: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
[hidden] { display: none !important; }

/* --- Topbar ---------------------------------------------------------------- */
.topbar { position: sticky; top: 0; z-index: 40; height: var(--topbar-h); background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px); border-bottom: 1px solid var(--border); }
.topbar__in { height: 100%; display: flex; align-items: center; gap: 14px; padding: 0 20px; max-width: 1480px; margin: 0 auto; }
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--text); font-weight: 800; letter-spacing: -.03em; font-size: 19px; white-space: nowrap; }
.brand__mark { width: 26px; height: 26px; border-radius: 8px; background: var(--brand); position: relative; box-shadow: inset 0 -3px 0 rgb(0 0 0 / .12); }
.brand__mark::before, .brand__mark::after { content: ""; position: absolute; width: 6px; height: 6px; border-radius: 50%; background: var(--brand-ink); top: 9px; }
.brand__mark::before { left: 6px; } .brand__mark::after { right: 6px; }
.brand__sub { font-weight: 500; color: var(--muted); font-size: 15px; letter-spacing: 0; padding: 2px 8px; border: 1px solid var(--border); border-radius: 99px; margin-left: 2px; }
.search-trigger { flex: 1; max-width: 420px; margin-left: auto; display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 10px 0 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--muted); font: inherit; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.search-trigger:hover { border-color: var(--border-strong); }
.search-trigger span { flex: 1; text-align: left; }
.topbar__actions { display: flex; align-items: center; gap: 8px; }
.topbar .topbar__menu { display: none; }
.is-hub .search-trigger { visibility: hidden; }
.is-hub.scrolled .search-trigger { visibility: visible; }

/* --- Buttons --------------------------------------------------------------- */
.btn { --h: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: var(--h); padding: 0 16px; border-radius: 10px; border: 1px solid transparent; font: 600 14px/1 var(--font); text-decoration: none; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, transform .08s, box-shadow .15s; color: var(--text); background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn--primary { background: var(--brand); color: var(--brand-ink); box-shadow: inset 0 -2px 0 rgb(0 0 0 / .12); }
.btn--primary:hover { background: var(--brand-hover); }
.btn--dark { background: var(--text); color: var(--bg); }
.btn--ghost { background: transparent; border-color: var(--border); }
.btn--ghost:hover { background: var(--surface-2); border-color: var(--border-strong); }
.btn--sm { --h: 34px; padding: 0 12px; font-size: 13px; }
.btn--block { width: 100%; }
.btn .i { width: 16px; height: 16px; }
.icon-btn { width: 38px; height: 38px; display: inline-grid; place-items: center; border-radius: 10px; border: 1px solid transparent; background: transparent; color: var(--muted); cursor: pointer; transition: background .15s, color .15s; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn--sm { width: 30px; height: 30px; border-radius: 8px; }
.icon-btn--sm .i { width: 15px; height: 15px; }
.only-dark { display: none; }
:root[data-theme="dark"] .only-dark { display: contents; } :root[data-theme="dark"] .only-light { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .only-dark { display: contents; } :root:not([data-theme="light"]) .only-light { display: none; } }

/* --- Shell (pages outil) ----------------------------------------------------- */
.shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); max-width: 1480px; margin: 0 auto; }
.sidebar { position: sticky; top: var(--topbar-h); height: calc(100dvh - var(--topbar-h)); overflow-y: auto; padding: 20px 14px 40px; border-right: 1px solid var(--border); }
.sidebar__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.sidebar__home { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; color: var(--muted); text-decoration: none; padding: 6px 8px; border-radius: 8px; }
.sidebar__home:hover { color: var(--text); background: var(--surface-2); }
.sidebar__home .i { width: 16px; height: 16px; }
.sidebar__close { display: none; }
.sidebar__cat { margin: 18px 10px 6px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar li a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; color: var(--text); text-decoration: none; font-size: 14px; font-weight: 500; }
.sidebar li a .i { color: var(--muted); }
.sidebar li a:hover { background: var(--surface-2); }
.sidebar li a[aria-current="page"] { background: var(--surface); box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--border); font-weight: 650; }
.sidebar li a[aria-current="page"] .i { color: var(--accent); }
.sidebar li a span { flex: 1; }
.drawer-backdrop { display: none; }

.main { min-width: 0; padding: 32px clamp(16px, 3vw, 44px) 0; }
.main--hub { max-width: 1240px; margin: 0 auto; }

/* --- En-tête d'outil ---------------------------------------------------------- */
.tool-head { margin-bottom: 24px; }
.crumbs { display: flex; gap: 8px; font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.crumbs a { color: var(--muted); text-decoration: none; } .crumbs a:hover { color: var(--text); }
.tool-head__row { display: flex; align-items: flex-start; gap: 16px; }
.tool-head__row > div { flex: 1; min-width: 0; }
.tool-head h1 { margin-bottom: 6px; }
.lead { color: var(--muted); font-size: 16px; max-width: 70ch; margin: 0; }
.local-badge { display: inline-flex; align-items: center; gap: 8px; margin: 16px 0 0; padding: 6px 12px 6px 10px; font-size: 13px; color: var(--muted); background: var(--surface); border: 1px solid var(--border); border-radius: 99px; }
.local-badge .i { width: 16px; height: 16px; color: var(--ok); }
.fav-btn[aria-pressed="true"] { color: var(--c-securite); }
.fav-btn[aria-pressed="true"] .i { fill: currentColor; }

.tile { width: 48px; height: 48px; border-radius: 13px; display: grid; place-items: center; flex: none; }
.tile .i { width: 24px; height: 24px; }
.tile--web { background: var(--c-web-bg); color: var(--c-web); }
.tile--design { background: var(--c-design-bg); color: var(--c-design); }
.tile--juridique { background: var(--c-juridique-bg); color: var(--c-juridique); }
.tile--securite { background: var(--c-securite-bg); color: var(--c-securite); }
.tile--marketing { background: var(--c-marketing-bg); color: var(--c-marketing); }

/* --- Panneaux & grilles --------------------------------------------------------- */
.workspace { display: grid; grid-template-columns: minmax(0, 380px) minmax(0, 1fr); gap: 20px; align-items: start; }
.workspace--wide-left { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.stack { display: grid; gap: 16px; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm); min-width: 0; }
.panel--sticky { position: sticky; top: calc(var(--topbar-h) + 20px); }
.panel__title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 16px; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.panel__title--row { text-transform: none; letter-spacing: -.01em; font-size: 15px; color: var(--text); }
.panel + .panel { margin-top: 0; }
.section-sep { height: 1px; background: var(--border); margin: 18px -20px; border: 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row--end { justify-content: flex-end; }
.row--between { justify-content: space-between; }
.spacer { flex: 1; }

/* --- Formulaires ---------------------------------------------------------------- */
.field { display: grid; align-content: start; gap: 6px; margin-bottom: 14px; min-width: 0; }
.field:last-child { margin-bottom: 0; }
.field > label, .label { font-size: 13px; font-weight: 600; color: var(--text); display: flex; justify-content: space-between; gap: 8px; }
.field > label output, .label output { font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; }
.hint { font-size: 12px; color: var(--muted); margin: 0; }
.input, .select, .textarea { width: 100%; min-width: 0; height: 40px; padding: 0 12px; font: inherit; font-size: 14px; color: var(--text); background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); transition: border-color .15s, box-shadow .15s; }
.textarea { height: auto; min-height: 96px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.select { appearance: none; padding-right: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2356686b' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--muted); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus); }
.input--mono { font-family: var(--mono); font-size: 13px; }
.input-group { display: flex; min-width: 0; }
.input-group .input { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.input-group .btn { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; height: 40px; border: 1px solid var(--border-strong); border-left: 0; }

input[type="range"] { width: 100%; accent-color: var(--accent); height: 22px; }
input[type="color"] { width: 40px; height: 40px; padding: 3px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); cursor: pointer; flex: none; }
input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
input[type="color"]::-webkit-color-swatch { border: 0; border-radius: 6px; }
input[type="color"]::-moz-color-swatch { border: 0; border-radius: 6px; }
.color-field { display: flex; gap: 8px; }
.color-field .input { font-family: var(--mono); font-size: 13px; text-transform: uppercase; }

/* Contrôle segmenté */
.seg { display: flex; padding: 3px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 11px; gap: 2px; flex-wrap: wrap; }
.seg label { flex: 1; position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; cursor: pointer; margin: 0; }
.seg span { display: block; text-align: center; padding: 7px 10px; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--muted); white-space: nowrap; transition: background .15s, color .15s; }
.seg input:checked + span { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm), 0 0 0 1px var(--border); }
.seg input:focus-visible + span { box-shadow: var(--focus); }

/* Interrupteur */
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; cursor: pointer; font-size: 14px; }
.switch input { appearance: none; width: 38px; height: 22px; border-radius: 99px; background: var(--border-strong); position: relative; cursor: pointer; flex: none; transition: background .15s; margin: 0; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgb(0 0 0 / .25); transition: transform .18s; }
.switch input:checked { background: var(--accent); }
.switch input:checked::after { transform: translateX(16px); }
.switch small { display: block; color: var(--muted); font-size: 12px; }

/* Cases à cocher en « chips » */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.chip span { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border: 1px solid var(--border-strong); border-radius: 99px; font-size: 13px; font-weight: 600; color: var(--muted); background: var(--surface); transition: all .15s; }
.chip input:checked + span { background: var(--text); border-color: var(--text); color: var(--bg); }
.chip input:focus-visible + span { box-shadow: var(--focus); }

/* --- Sorties & code ------------------------------------------------------------- */
.output { position: relative; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.output pre, .output textarea { margin: 0; padding: 14px 16px; font: 12.5px/1.6 var(--mono); white-space: pre-wrap; word-break: break-word; max-height: 420px; overflow: auto; color: var(--text); }
.output textarea { width: 100%; border: 0; background: transparent; resize: vertical; min-height: 140px; }
.output__bar { display: flex; align-items: center; gap: 6px; padding: 6px 6px 6px 14px; border-bottom: 1px solid var(--border); font-size: 12px; font-weight: 600; color: var(--muted); }
.output__bar .spacer { flex: 1; }

.big-value { font: 700 clamp(1.4rem, 1rem + 1.5vw, 2rem)/1.2 var(--mono); letter-spacing: -.02em; word-break: break-all; }

.kv { width: 100%; border-collapse: collapse; font-size: 14px; }
.kv th, .kv td { text-align: left; padding: 10px 0; border-bottom: 1px solid var(--border); vertical-align: top; }
.kv tr:last-child th, .kv tr:last-child td { border-bottom: 0; }
.kv th { font-weight: 500; color: var(--muted); width: 42%; padding-right: 16px; }
.kv td { font-weight: 600; word-break: break-word; }
.kv td.mono { font-weight: 500; }

.pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 99px; font: 700 10.5px/1.6 var(--font); text-transform: uppercase; letter-spacing: .05em; font-style: normal; background: var(--surface-3); color: var(--muted); white-space: nowrap; }
.pill--new { background: var(--brand); color: var(--brand-ink); }
.pill--ok { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); }
.pill--ko { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }
.pill--warn { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); }

.notice { display: flex; gap: 10px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); font-size: 13px; color: var(--muted); }
.notice .i { width: 16px; height: 16px; margin-top: 2px; color: var(--c-juridique); }
.notice p { margin: 0; }

/* Onglets */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin: -4px 0 16px; overflow-x: auto; scrollbar-width: none; }
.tabs button { appearance: none; border: 0; background: none; font: 600 14px var(--font); color: var(--muted); padding: 10px 12px; border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer; white-space: nowrap; }
.tabs button[aria-selected="true"] { color: var(--text); border-color: var(--accent); }
.tabs button:hover { color: var(--text); }

/* Zone de dépôt */
.dropzone { display: grid; place-items: center; gap: 8px; text-align: center; padding: 36px 20px; border: 2px dashed var(--border-strong); border-radius: var(--radius); background: var(--surface-2); color: var(--muted); cursor: pointer; transition: border-color .15s, background .15s; }
.dropzone:hover, .dropzone.is-over { border-color: var(--accent); background: color-mix(in srgb, var(--brand) 8%, var(--surface)); }
.dropzone .i { width: 32px; height: 32px; color: var(--accent); }
.dropzone strong { color: var(--text); font-size: 15px; }
.dropzone input { display: none; }

/* Damier (transparence) */
.checker { background-color: #fff; background-image: linear-gradient(45deg, #e8eded 25%, transparent 25%), linear-gradient(-45deg, #e8eded 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #e8eded 75%), linear-gradient(-45deg, transparent 75%, #e8eded 75%); background-size: 16px 16px; background-position: 0 0, 0 8px, 8px -8px, -8px 0; }

/* --- Palette ⌘K ---------------------------------------------------------------- */
.cmdk { padding: 0; border: 0; background: transparent; max-width: 620px; width: calc(100% - 32px); margin: 12vh auto auto; }
.cmdk::backdrop { background: rgb(6 14 16 / .5); backdrop-filter: blur(3px); }
.cmdk__box { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-lg); overflow: hidden; color: var(--text); }
.cmdk__field { display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid var(--border); }
.cmdk__field .i { color: var(--muted); }
.cmdk__field input { flex: 1; height: 56px; border: 0; background: transparent; font: 16px var(--font); color: var(--text); outline: none; }
.cmdk__field input::-webkit-search-cancel-button { display: none; }
.cmdk__list { list-style: none; margin: 0; padding: 8px; max-height: min(420px, 60vh); overflow-y: auto; }
.cmdk__list a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: var(--text); text-decoration: none; }
.cmdk__list a[aria-selected="true"] { background: var(--surface-2); }
.cmdk__list a .tile { width: 34px; height: 34px; border-radius: 9px; }
.cmdk__list a .tile .i { width: 18px; height: 18px; }
.cmdk__list b { display: block; font-size: 14px; font-weight: 650; }
.cmdk__list small { display: block; font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmdk__list div { min-width: 0; flex: 1; }
.cmdk__empty { padding: 28px; text-align: center; color: var(--muted); }

/* --- Toast ---------------------------------------------------------------------- */
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 90; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; display: flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 12px; background: var(--text); color: var(--bg); font-size: 14px; font-weight: 600; box-shadow: var(--shadow-lg); transition: opacity .2s, transform .2s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast .i { width: 16px; height: 16px; color: var(--brand); }

/* --- CTA & pied de page ------------------------------------------------------------ */
.cta { margin: 56px 0 0; padding: clamp(24px, 4vw, 40px); border-radius: 20px; background: #0e1a1c; color: #e6efee; display: flex; gap: 24px; align-items: center; justify-content: space-between; flex-wrap: wrap; position: relative; overflow: hidden; }
.cta::before { content: ""; position: absolute; right: -80px; top: -120px; width: 320px; height: 320px; border-radius: 50%; background: radial-gradient(closest-side, rgb(0 240 212 / .35), transparent); pointer-events: none; }
.cta__txt { max-width: 560px; position: relative; }
.cta__kicker { color: var(--brand); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 8px; }
.cta h2 { font-size: clamp(1.3rem, 1rem + 1vw, 1.7rem); color: #fff; }
.cta p { color: #a9bcbe; margin: 0; }
.cta__actions { display: flex; gap: 10px; flex-wrap: wrap; position: relative; }
.cta .btn--ghost { color: #e6efee; border-color: #34494f; }
.cta .btn--ghost:hover { background: #172226; }
.foot { display: flex; justify-content: space-between; gap: 8px 24px; flex-wrap: wrap; padding: 24px 0 32px; font-size: 13px; color: var(--muted); }
.foot p { margin: 0; }
.foot a { color: var(--muted); }

/* =========================================================================
   Hub
   ========================================================================= */
.hero { padding: clamp(24px, 6vw, 72px) 0 28px; text-align: center; }
.hero__kicker { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px 6px 8px; border-radius: 99px; background: var(--surface); border: 1px solid var(--border); font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 20px; }
.hero__kicker b { background: var(--brand); color: var(--brand-ink); padding: 2px 8px; border-radius: 99px; font-size: 12px; }
.hero h1 { font-size: clamp(2rem, 1.2rem + 3.6vw, 3.6rem); line-height: 1.02; letter-spacing: -.045em; max-width: 16ch; margin: 0 auto 16px; }
.hero h1 mark { background: linear-gradient(transparent 58%, var(--brand) 58%, var(--brand) 92%, transparent 92%); color: inherit; padding: 0 .06em; }
.hero__lead { color: var(--muted); font-size: clamp(15px, 1vw + 11px, 18px); max-width: 58ch; margin: 0 auto 28px; }
.hero-search { position: relative; max-width: 620px; margin: 0 auto; }
.hero-search .i { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 20px; height: 20px; pointer-events: none; }
.hero-search input { width: 100%; height: 58px; padding: 0 64px 0 50px; border-radius: 16px; border: 1px solid var(--border-strong); background: var(--surface); font: 16px var(--font); color: var(--text); box-shadow: var(--shadow); }
.hero-search input:focus { outline: none; border-color: var(--accent); box-shadow: var(--shadow), var(--focus); }
.hero-search kbd { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); }
.hero-trust { display: flex; justify-content: center; gap: 8px 22px; flex-wrap: wrap; margin-top: 20px; font-size: 13px; color: var(--muted); }
.hero-trust span { display: inline-flex; align-items: center; gap: 6px; }
.hero-trust .i { width: 15px; height: 15px; color: var(--ok); }

.filters { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 12px; margin: 18px 0 8px; scrollbar-width: none; justify-content: center; }
.filters button { display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 99px; border: 1px solid var(--border); background: var(--surface); font: 600 14px var(--font); color: var(--muted); cursor: pointer; white-space: nowrap; transition: all .15s; }
.filters button .i { width: 16px; height: 16px; }
.filters button:hover { border-color: var(--border-strong); color: var(--text); }
.filters button[aria-pressed="true"] { background: var(--text); border-color: var(--text); color: var(--bg); }
.filters button em { font-style: normal; font-size: 12px; opacity: .6; }

.hub-section { margin-top: 28px; }
.hub-section > h2 { display: flex; align-items: center; gap: 8px; font-size: 14px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; margin-bottom: 14px; }
.hub-section > h2 .i { width: 16px; height: 16px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 14px; }
.card { position: relative; display: flex; flex-direction: column; gap: 12px; padding: 20px; min-height: 176px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; text-decoration: none; color: var(--text); transition: transform .18s cubic-bezier(.2,.7,.3,1), box-shadow .18s, border-color .18s; }
a.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--border-strong); }
.card__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.card h3 { font-size: 16.5px; margin: 0; }
.card p { font-size: 14px; color: var(--muted); margin: 0; flex: 1; }
.card__go { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 650; color: var(--accent); }
.card__go .i { width: 15px; height: 15px; transition: transform .18s; }
a.card:hover .card__go .i { transform: translateX(3px); }
.card .fav-btn { position: absolute; bottom: 12px; right: 12px; opacity: 0; transition: opacity .15s; }
.card:hover .fav-btn, .card .fav-btn[aria-pressed="true"], .card .fav-btn:focus-visible { opacity: 1; }
.card--soon { background: transparent; border-style: dashed; min-height: 0; }
.card--soon .tile { filter: grayscale(.6); opacity: .7; }
.card--soon h3 { color: var(--muted); }
.cards--soon { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.hub-empty { text-align: center; padding: 48px 20px; color: var(--muted); }

/* =========================================================================
   Responsive
   ========================================================================= */
@media (max-width: 1100px) {
  .workspace, .workspace--wide-left { grid-template-columns: minmax(0, 1fr); }
  .panel--sticky { position: static; }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .topbar .topbar__menu { display: inline-grid; }
  .sidebar { position: fixed; z-index: 60; left: 0; top: 0; height: 100dvh; width: min(320px, 86vw); background: var(--bg); border-right: 1px solid var(--border); transform: translateX(-100%); transition: transform .25s cubic-bezier(.2,.7,.3,1); box-shadow: var(--shadow-lg); }
  .sidebar__close { display: inline-grid; }
  body.drawer-open .sidebar { transform: none; }
  body.drawer-open .drawer-backdrop { display: block; position: fixed; inset: 0; z-index: 55; background: rgb(6 14 16 / .45); }
}
@media (max-width: 640px) {
  :root { --topbar-h: 58px; }
  .topbar__in { padding: 0 12px; gap: 8px; }
  .brand__sub, .topbar__agency, .search-trigger span, .search-trigger kbd { display: none; }
  .search-trigger { flex: 0 0 38px; width: 38px; height: 38px; padding: 0; justify-content: center; margin-left: auto; border-color: transparent; background: transparent; }
  .is-hub .search-trigger { visibility: visible; }
  .main { padding: 20px 16px 0; }
  .panel { padding: 16px; }
  .section-sep { margin: 16px -16px; }
  .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .tool-head__row .tile { display: none; }
  .filters { justify-content: flex-start; margin-left: -16px; margin-right: -16px; padding-left: 16px; padding-right: 16px; }
  .hero-search kbd { display: none; }
  .cards { grid-template-columns: minmax(0, 1fr); }
  .card { min-height: 0; display: grid; grid-template-columns: 40px 1fr; gap: 4px 14px; padding: 16px; }
  .card .card__top { grid-row: 1 / span 3; flex-direction: column; }
  .card .card__top .pill { display: none; }
  .card .tile { width: 40px; height: 40px; border-radius: 11px; }
  .card .tile .i { width: 20px; height: 20px; }
  .card p { font-size: 13.5px; }
  .card__go { display: none; }
  .card .fav-btn { top: 10px; bottom: auto; }
  .card h3 { padding-right: 28px; }
  .card .fav-btn { opacity: 1; }
  .cta { border-radius: 16px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

/* =========================================================================
   Documents générés (mentions, RGPD)
   ========================================================================= */
.legal-out .output textarea { min-height: 460px; }
.legal-out .seg span { display: inline-flex; align-items: center; gap: 6px; }
.legal-out .seg .i { width: 15px; height: 15px; }
.doc { border-bottom: 1px solid var(--border); max-height: 62vh; overflow-y: auto; padding: 4px 16px 4px 2px; font-size: 14px; line-height: 1.65; }
.doc h1 { font-size: 1.35rem; margin: 4px 0 14px; }
.doc h2 { font-size: 1rem; margin: 22px 0 6px; }
.doc p, .doc ul { margin: 0 0 10px; }
.doc ul { padding-left: 20px; }
.doc li { margin-bottom: 4px; }
.doc mark.todo { background: color-mix(in srgb, var(--c-juridique) 22%, transparent); color: inherit; border-radius: 4px; padding: 0 3px; font-weight: 600; }
.form-section { margin: 0 0 6px; padding-top: 4px; }
.form-section + .form-section { border-top: 1px solid var(--border); margin-top: 18px; padding-top: 18px; }
.form-section > h3 { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.form-section > h3 .num { width: 22px; height: 22px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--text); color: var(--bg); font-size: 12px; }
.check-card { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; transition: border-color .15s, background .15s; margin-bottom: 8px; }
.check-card:hover { border-color: var(--border-strong); }
.check-card input { margin-top: 3px; accent-color: var(--accent); width: 16px; height: 16px; flex: none; }
.check-card b { display: block; font-size: 14px; }
.check-card small { color: var(--muted); font-size: 12.5px; }
.check-card:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--brand) 7%, var(--surface)); }
.sub-fields { margin: 4px 0 14px 28px; }

/* Sidebar : pastille « nouveau » compacte */
.sidebar .pill--new { width: 8px; height: 8px; padding: 0; font-size: 0; border-radius: 50%; flex: none; }
.sidebar li a { padding: 7px 10px; }
