/* ResaPropulse — système de design de l'administration */
:root {
  --bg: #f6f7fb; --panel: #ffffff; --panel-2: #f9fafc; --text: #0f172a; --muted: #64748b; --line: #e6e8ef;
  --accent: #4f46e5; --accent-hover: #4338ca; --accent-soft: #eef2ff; --accent-text: #3730a3;
  --ok: #059669; --ok-soft: #ecfdf5; --warn: #b45309; --warn-soft: #fffbeb; --danger: #dc2626; --danger-soft: #fef2f2;
  --radius: 14px; --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 2px 8px rgba(15, 23, 42, .04);
  --shadow-lg: 0 10px 30px rgba(15, 23, 42, .10);
  --sidebar: 264px;
  /* Séries de graphiques : ordre fixe, palette validée (daltonisme, contraste). */
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100; --s5: #e87ba4; --s6: #6250d6; --s7: #008300; --s8: #e34948;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1020; --panel: #121829; --panel-2: #0f1524; --text: #e5e9f2; --muted: #94a0b8; --line: #232c43;
    --accent: #818cf8; --accent-hover: #a5b4fc; --accent-soft: #1e2347; --accent-text: #c7d2fe;
    --ok: #34d399; --ok-soft: #0f2a22; --warn: #fbbf24; --warn-soft: #2a2410; --danger: #f87171; --danger-soft: #2c1414;
    --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #9085e9; --s7: #0ca30c; --s8: #e66767;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3); --shadow-lg: 0 10px 30px rgba(0, 0, 0, .45);
  }
}
[hidden] { display: none !important; }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.55 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { margin: 0 0 .4rem; line-height: 1.25; letter-spacing: -.01em; }
h1 { font-size: 1.6rem; } h2 { font-size: 1.4rem; font-weight: 700; } h3 { font-size: 1.02rem; font-weight: 650; }
p { margin: .35rem 0 .6rem; }
a { color: var(--accent); text-decoration: none; } a:hover { text-decoration: underline; }
.muted { color: var(--muted); } .error { color: var(--danger); min-height: 1.2em; }
.ic { flex: none; vertical-align: -3px; }
code { background: var(--panel-2); border: 1px solid var(--line); border-radius: 6px; padding: 0 .3rem; font-size: .88em; }

/* Formulaires */
input, select, textarea { width: 100%; padding: .6rem .75rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel); color: var(--text); font: inherit; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--accent); }
textarea { min-height: 96px; resize: vertical; }
label { display: block; margin: .65rem 0; font-weight: 550; font-size: .92rem; }
label input, label select, label textarea { margin-top: .3rem; font-weight: 400; font-size: .95rem; }

/* Boutons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; padding: .55rem 1rem; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--panel); color: var(--text); cursor: pointer; font: inherit; font-weight: 550; text-decoration: none !important; transition: background .15s, border-color .15s, transform .05s; }
.btn:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); background: var(--panel-2); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.danger { color: var(--danger); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.small { padding: .35rem .7rem; font-size: .86rem; }
.btn[disabled] { opacity: .55; cursor: wait; }
.btn.active { background: var(--accent-soft); border-color: transparent; color: var(--accent-text); }

/* Écran de connexion */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
.auth-aside { background: radial-gradient(1200px 600px at 0% 0%, #6366f1 0%, #4338ca 45%, #1e1b4b 100%); color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; }
.auth-aside h1 { font-size: 2.1rem; max-width: 18ch; color: #fff; }
.auth-aside .lead { color: #c7d2fe; font-size: 1.05rem; max-width: 42ch; }
.auth-aside ul { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 14px; }
.auth-aside li { display: flex; gap: 12px; align-items: flex-start; color: #e0e7ff; }
.auth-aside li .ic { color: #a5b4fc; margin-top: 2px; }
.auth-aside .fine { color: #a5b4fc; font-size: .85rem; }
.auth-main { display: grid; place-items: center; padding: 24px 16px; }
.auth-card { width: 100%; max-width: 420px; }
.auth-card .brandline { display: flex; align-items: center; gap: .6rem; margin-bottom: 1.4rem; }
.seg { display: inline-flex; background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 4px; gap: 4px; margin-bottom: 1rem; }
.seg button { border: 0; background: transparent; padding: .45rem .9rem; border-radius: 9px; font: inherit; font-weight: 550; color: var(--muted); cursor: pointer; }
.seg button.on { background: var(--panel); color: var(--text); box-shadow: var(--shadow); }
.auth-card form .btn.primary { width: 100%; margin-top: .6rem; padding: .75rem 1rem; }

/* Coquille : menu latéral + contenu */
.shell { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.sidebar { background: var(--panel); border-right: 1px solid var(--line); padding: 18px 14px; display: flex; flex-direction: column; gap: 10px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: .6rem; padding: 4px 8px 10px; font-size: 1rem; }
.logo-mark { width: 30px; height: 30px; border-radius: 9px; background: linear-gradient(135deg, #6366f1, #8b5cf6); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: .95rem; flex: none; }
.logo-mark.brand-svg { background: url(/brand/mark.svg) center / cover no-repeat; }
.brand .names { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.brand .names small { color: var(--muted); font-size: .78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); display: inline-block; flex: none; }
.sidebar nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-label { font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 14px 10px 6px; }
.sidebar nav a { display: flex; align-items: center; gap: .65rem; padding: .5rem .65rem; border-radius: 9px; color: var(--text); text-decoration: none; font-weight: 500; font-size: .94rem; }
.sidebar nav a .ic { color: var(--muted); }
.sidebar nav a:hover { background: var(--panel-2); }
.sidebar nav a.active { background: var(--accent-soft); color: var(--accent-text); }
.sidebar nav a.active .ic { color: var(--accent); }
.sidebar nav a .badge { margin-left: auto; }
.badge { background: var(--accent); color: #fff; border-radius: 999px; padding: 0 .5rem; font-size: .75rem; font-weight: 700; line-height: 1.5; }
.sidebar-foot { border-top: 1px solid var(--line); padding-top: 10px; display: grid; gap: 6px; }
.main { padding: 28px 36px 48px; max-width: 1240px; width: 100%; }
.topbar { display: none; }
.scrim { display: none; }

/* En-tête de page */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 18px; }
.page-head p { margin: .2rem 0 0; }

/* Cartes, grilles */
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.grid-2 { display: grid; gap: 16px; grid-template-columns: 1.15fr 1fr; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); }
.card > h3:first-child, .card .card-head h3 { margin-bottom: .2rem; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: .8rem; margin-bottom: .6rem; }
.section { margin-top: 18px; }
.row { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }

/* Indicateurs */
.kpi { position: relative; }
.kpi .label, .kpi > .muted:first-child { display: flex; align-items: center; gap: .45rem; color: var(--muted); font-size: .88rem; font-weight: 550; }
.kpi .value { font-size: 1.85rem; font-weight: 750; letter-spacing: -.02em; font-variant-numeric: tabular-nums; margin: .25rem 0 .1rem; }
.kpi .delta { font-size: .84rem; font-weight: 600; }
.kpi .delta.up { color: var(--ok); } .kpi .delta.down { color: var(--danger); }
.kpi-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); position: absolute; top: 16px; right: 16px; }

/* Tableaux */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: .6rem .5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: .82rem; text-transform: uppercase; letter-spacing: .03em; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
th.num { white-space: nowrap; }

/* Pastilles de statut */
.pill { display: inline-flex; align-items: center; gap: .3rem; padding: .1rem .6rem; border-radius: 999px; font-size: .78rem; font-weight: 600; background: var(--panel-2); color: var(--muted); border: 1px solid var(--line); white-space: nowrap; }
.pill.low, .pill.success, .pill.applied, .pill.published, .pill.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.pill.medium, .pill.scheduled, .pill.awaiting_phone, .pill.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.pill.high, .pill.failed, .pill.error { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.pill.proposed, .pill.running, .pill.info { background: var(--accent-soft); color: var(--accent-text); border-color: transparent; }
.pill.undone, .pill.rejected, .pill.draft { background: var(--panel-2); color: var(--muted); }
.status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--muted); }
.status-dot.on { background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 20%, transparent); }

/* Actions des agents */
.action { border-left: 4px solid var(--line); }
.action.seo { border-left-color: #10b981; } .action.ads { border-left-color: #f59e0b; } .action.social { border-left-color: #8b5cf6; }
.action.reputation { border-left-color: #eab308; } .action.prospecting { border-left-color: #0ea5e9; } .action.report { border-left-color: #64748b; }
.action pre { white-space: pre-wrap; font: inherit; color: var(--muted); margin: .4rem 0; }

/* Onglets */
.tabs { display: flex; gap: .4rem; margin: 1rem 0; flex-wrap: wrap; }
.tabs button.active, .tabs a.active { background: var(--accent-soft); border-color: transparent; color: var(--accent-text); }

/* Tableau de bord */
.todo { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.todo li a { display: flex; align-items: center; gap: .75rem; padding: .7rem .8rem; border: 1px solid var(--line); border-radius: 12px; color: var(--text); text-decoration: none; background: var(--panel-2); }
.todo li a:hover { border-color: var(--accent); }
.todo .count { margin-left: auto; font-weight: 700; color: var(--accent); }
.todo .ic-wrap { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex: none; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 34px 1fr; gap: .75rem; padding: .65rem 0; border-bottom: 1px solid var(--line); }
.timeline li:last-child { border-bottom: 0; }
.timeline .ic-wrap { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--panel-2); border: 1px solid var(--line); color: var(--accent); }
.timeline .meta { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; font-size: .85rem; color: var(--muted); }
.agent-grid { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.agent-chip { display: flex; align-items: center; gap: .6rem; padding: .55rem .7rem; border: 1px solid var(--line); border-radius: 12px; color: var(--text); text-decoration: none !important; background: var(--panel); }
.agent-chip:hover { border-color: var(--accent); }
.agent-chip .ic { color: var(--accent); }
.agent-chip small { display: block; color: var(--muted); font-size: .78rem; }
.progress { height: 8px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: linear-gradient(90deg, #6366f1, #8b5cf6); border-radius: inherit; }
.steps { list-style: none; padding: 0; margin: .8rem 0 0; display: grid; gap: 6px; }
.steps li { display: flex; gap: .7rem; align-items: flex-start; line-height: 1.4; }
.steps .tick { margin-top: 1px; }
.steps .tick { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; flex: none; }
.steps .tick.done { background: var(--ok); border-color: var(--ok); color: #fff; }

/* Médias, publications */
.media-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.media-grid img, .media-grid video { width: 100%; aspect-ratio: 4/5; object-fit: cover; border-radius: 10px; background: var(--line); }
.variants { display: flex; gap: .3rem; flex-wrap: wrap; margin-top: .5rem; }
.dropzone { display: block; border: 2px dashed var(--line); border-radius: var(--radius); padding: 1.8rem; text-align: center; cursor: pointer; background: var(--panel); transition: border-color .15s, background .15s; }
.dropzone:hover, .dropzone.over { border-color: var(--accent); background: var(--accent-soft); }
.post { display: grid; grid-template-columns: 120px 1fr; gap: 1rem; }
.post img, .post video { width: 120px; height: 150px; object-fit: cover; border-radius: 10px; background: var(--line); }
details > summary { cursor: pointer; font-weight: 550; }
details > summary::marker { color: var(--muted); }

/* Divers */
.toast { position: fixed; bottom: 18px; right: 18px; left: 18px; margin-left: auto; max-width: 420px; background: #0f172a; color: #fff; padding: .85rem 1rem; border-radius: 12px; z-index: 50; box-shadow: var(--shadow-lg); }
.callout { background: var(--accent-soft); color: var(--accent-text); border-radius: 12px; padding: .8rem 1rem; margin: 1rem 0; }
.callout a { color: inherit; text-decoration: underline; }
.callout.warn { background: var(--warn-soft); color: var(--warn); }
.empty { text-align: center; padding: 28px 16px; color: var(--muted); }
.empty .ic { color: var(--accent); margin-bottom: .4rem; }
.chat { display: flex; flex-direction: column; gap: .6rem; }
.bubble { max-width: 80%; padding: .7rem 1rem; border-radius: 14px; white-space: pre-wrap; }
.bubble.user { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 4px; }
.bubble.assistant { align-self: flex-start; background: var(--panel-2); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.spark { display: block; width: 120px; height: 28px; }
.conn-grid { display: grid; gap: 16px; grid-template-columns: 1fr; }

/* Planning */
.plan-bar { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; justify-content: space-between; margin-bottom: 12px; }
.plan-bar .period { font-weight: 700; font-size: 1.05rem; text-transform: capitalize; min-width: 14ch; }
.plan-filters { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: 14px; }
.chip { display: inline-flex; align-items: center; gap: .4rem; padding: .3rem .7rem; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); font-size: .85rem; font-weight: 550; cursor: pointer; user-select: none; }
.chip input { display: none; }
.chip .sw { width: 10px; height: 10px; border-radius: 3px; }
.chip.off { opacity: .45; }
.t-agent { --c: #6366f1; } .t-post { --c: #d946ef; } .t-action { --c: #f59e0b; } .t-prospect { --c: #0ea5e9; }
.chip .sw { background: var(--c); }
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--panel); }
.week .day { border-right: 1px solid var(--line); min-height: 420px; display: flex; flex-direction: column; min-width: 0; }
.week .day:last-child { border-right: 0; }
.day-head { padding: .55rem .6rem; border-bottom: 1px solid var(--line); background: var(--panel-2); font-size: .82rem; color: var(--muted); font-weight: 600; text-transform: capitalize; display: flex; justify-content: space-between; align-items: baseline; }
.day-head b { color: var(--text); font-size: 1.1rem; }
.day.today .day-head { background: var(--accent-soft); color: var(--accent-text); }
.day.today .day-head b { color: var(--accent-text); }
.day-body { padding: .4rem; display: grid; gap: .35rem; align-content: start; min-width: 0; grid-template-columns: minmax(0, 1fr); }
.ev { display: block; min-width: 0; max-width: 100%; overflow: hidden; text-align: left; width: 100%; border: 1px solid var(--line); border-left: 3px solid var(--c); background: var(--panel); border-radius: 8px; padding: .35rem .45rem; font: inherit; font-size: .8rem; color: var(--text); cursor: pointer; text-decoration: none !important; line-height: 1.3; }
.ev:hover { box-shadow: var(--shadow); border-color: var(--c); }
.ev .t { display: flex; gap: .3rem; align-items: center; color: var(--muted); font-size: .74rem; }
.ev .t .ic { color: var(--c); }
.ev .n { font-weight: 600; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.ev .d { color: var(--muted); font-size: .74rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev.planned { border-style: dashed; border-left-style: solid; background: var(--panel-2); }
.ev.compact { padding: .25rem .45rem; }
.ev.compact .n { font-weight: 500; -webkit-line-clamp: 1; color: var(--muted); }
.agenda-day .ev > * { min-width: 0; }
.agenda-day .ev .d { white-space: normal; }
.plan-bar .period { min-width: 0; }
.ev.error, .ev.failed { border-left-color: var(--danger); }
.ev.proposed { background: var(--warn-soft); }
.month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--panel); }
.month .dow { padding: .45rem; text-align: center; font-size: .76rem; font-weight: 700; color: var(--muted); text-transform: uppercase; background: var(--panel-2); border-bottom: 1px solid var(--line); }
.month .cell { min-height: 112px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: .35rem; display: flex; flex-direction: column; gap: .2rem; cursor: pointer; }
.month .cell:nth-child(7n) { border-right: 0; }
.month .cell.out { background: var(--panel-2); color: var(--muted); }
.month .cell.today .num { background: var(--accent); color: #fff; }
.month .num { align-self: flex-start; font-size: .8rem; font-weight: 700; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; }
.month .line { font-size: .74rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; gap: .3rem; align-items: center; }
.month .line i { width: 7px; height: 7px; border-radius: 50%; background: var(--c); flex: none; }
.month .more { font-size: .72rem; color: var(--muted); }
.agenda-day { margin-bottom: 14px; }
.agenda-day h3 { font-size: .95rem; text-transform: capitalize; margin: 0 0 .5rem; display: flex; gap: .5rem; align-items: center; }
.agenda-day .ev { font-size: .9rem; padding: .55rem .7rem; display: grid; grid-template-columns: 58px 1fr auto; gap: .6rem; align-items: center; }
.agenda-day .ev .time { color: var(--muted); font-variant-numeric: tabular-nums; font-size: .85rem; }

/* Mobile */
@media (max-width: 960px) {
  .auth { grid-template-columns: 1fr; }
  .auth-aside { padding: 28px 20px; }
  .auth-aside h1 { font-size: 1.5rem; }
  .auth-aside ul, .auth-aside .fine { display: none; }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .topbar { display: flex; position: sticky; top: 0; z-index: 30; align-items: center; justify-content: space-between; gap: .6rem; padding: 10px 16px; background: var(--panel); border-bottom: 1px solid var(--line); }
  .sidebar { position: fixed; z-index: 40; left: 0; top: 0; bottom: 0; width: min(86vw, 300px); transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--shadow-lg); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(15, 23, 42, .45); z-index: 35; }
  .main { padding: 18px 16px 40px; }
  .post { grid-template-columns: 1fr; }
  .kpi .value { font-size: 1.55rem; }
  .agenda-day .ev { grid-template-columns: 48px 1fr; }
  .agenda-day .ev .pill { display: none; }
}

/* ---------- Tableau de bord analytique ---------- */
.period { margin-bottom: 0; }
.board { transition: opacity .2s; }
.board.loading { opacity: .5; pointer-events: none; }
.tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (min-width: 1500px) { .tiles { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.tiles .kpi .label { padding-right: 40px; }
.tiles .kpi .value { font-size: 1.6rem; }
.kpi .unit { font-size: 1rem; font-weight: 600; }
.kpi .delta.muted { color: var(--muted); font-weight: 550; }
.grid-2.even { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.chart-card { min-width: 0; }
.chart-sub { margin: 0; font-size: .84rem; }
.chart-host { position: relative; min-height: 220px; }
.chart { position: relative; }
.chart svg { display: block; overflow: visible; touch-action: pan-y; }
.chart svg:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 6px; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .axis { stroke: color-mix(in srgb, var(--muted) 45%, var(--line)); stroke-width: 1; }
.chart .tick { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart .line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .line.strong { stroke-width: 3; }
.chart .area { opacity: .1; }
.chart .dot { stroke: var(--panel); stroke-width: 2; }
.chart .dot.hover { pointer-events: none; }
.chart .cross { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; pointer-events: none; }
.chart .col { transition: opacity .12s; }
.chart .col.dim { opacity: .45; }
.chart-tip { position: absolute; top: 4px; z-index: 5; min-width: 150px; max-width: 320px; pointer-events: none; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-lg); padding: .5rem .7rem; font-size: .84rem; }
.chart-tip .tip-title { color: var(--muted); font-size: .78rem; margin-bottom: .2rem; }
.chart-tip .tip-row { display: flex; align-items: center; gap: .45rem; line-height: 1.6; }
.chart-tip .tip-row strong { font-variant-numeric: tabular-nums; }
.chart-tip .tip-row span:last-child { color: var(--muted); }
.chart-tip .tip-key { width: 12px; height: 2px; border-radius: 1px; flex: none; }
.chart-tip .tip-row:not(:has(.tip-key)) { padding-left: calc(12px + .45rem); }
.legend { display: flex; flex-wrap: wrap; gap: .3rem 1rem; margin: .1rem 0 .6rem; font-size: .84rem; color: var(--text); }
.legend span { display: inline-flex; align-items: center; gap: .4rem; }
.legend i.bar { width: 10px; height: 10px; border-radius: 3px; }
.legend i.line { width: 14px; height: 2px; border-radius: 1px; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
th.num { white-space: nowrap; }
.agent-bars { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; }
.agent-bars li { display: grid; grid-template-columns: minmax(120px, 34%) 1fr auto; align-items: center; gap: .7rem; font-size: .9rem; border-radius: 8px; }
.agent-bars li:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.ab-name { display: flex; align-items: center; gap: .45rem; min-width: 0; color: var(--muted); }
.ab-name span { color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ab-track { display: flex; gap: 2px; height: 12px; }
.ab-track span { height: 100%; min-width: 3px; }
.ab-track span:last-child { border-radius: 0 4px 4px 0; }
.ab-val { font-variant-numeric: tabular-nums; min-width: 3.2rem; text-align: right; }
.ad-hero { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: .4rem 0 1rem; }
.ad-hero div { background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .6rem .8rem; display: grid; }
.ad-hero span { font-size: .8rem; }
.ad-hero strong { font-size: 1.25rem; font-variant-numeric: tabular-nums; }
@media (max-width: 960px) { .grid-2.even { grid-template-columns: 1fr; } }
@media (max-width: 560px) {
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .tiles .kpi { padding: 14px; }
  .tiles .kpi .value { font-size: 1.3rem; }
  .tiles .kpi-icon { display: none; }
  .ad-hero { grid-template-columns: 1fr; }
  .agent-bars li { grid-template-columns: 1fr auto; }
  .agent-bars .ab-track { grid-column: 1 / -1; grid-row: 2; }
}

/* ---------- Suivi de positions ---------- */
.subtabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.subtabs button { border: 0; background: none; font: inherit; font-weight: 550; color: var(--muted); padding: .6rem .9rem; border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer; white-space: nowrap; }
.subtabs button:hover { color: var(--text); }
.subtabs button.on { color: var(--text); border-bottom-color: var(--accent); }
.filters { gap: .6rem; flex-wrap: wrap; }
.filters .seg { margin-bottom: 0; }
.rank-table td { vertical-align: middle; }
.rank-table tr.me td { background: color-mix(in srgb, var(--accent-soft) 55%, transparent); }
.rank-table .url { font-size: .8rem; max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vis { display: inline-flex; align-items: center; gap: .6rem; justify-content: flex-end; }
.vis > span:first-child { min-width: 4.6rem; }
.vis-bar { width: 80px; height: 6px; border-radius: 3px; background: var(--panel-2); border: 1px solid var(--line); overflow: hidden; display: inline-block; }
.vis-bar span { display: block; height: 100%; background: var(--s1); border-radius: 0 3px 3px 0; }
.feats { white-space: nowrap; }
.feat { display: inline-flex; align-items: center; gap: .2rem; font-size: .74rem; padding: .05rem .4rem; margin: 1px 2px 1px 0; border-radius: 6px; background: var(--panel-2); border: 1px solid var(--line); color: var(--muted); }
.feat.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.feat.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.rank-add { display: grid; grid-template-columns: 1fr 200px auto; gap: .6rem; align-items: start; }
.rank-add textarea { min-height: 44px; }
.plain-list { list-style: none; margin: 0; padding: 0; }
.plain-list li { display: flex; justify-content: space-between; align-items: center; gap: .6rem; padding: .5rem 0; border-bottom: 1px solid var(--line); }
.cannibal { list-style: none; margin: .6rem 0 0; padding: 0; display: grid; gap: .8rem; }
.cannibal > li { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .7rem .9rem; }
.cannibal ul { margin: .4rem 0 0; padding-left: 1.1rem; font-size: .9rem; }
.stack { display: grid; gap: .9rem; }
fieldset.plain { border: 0; padding: 0; margin: 0; display: flex; gap: 1.2rem; flex-wrap: wrap; }
fieldset.plain legend { font-weight: 600; margin-bottom: .3rem; padding: 0; }
@media (max-width: 760px) { .rank-add { grid-template-columns: 1fr; } .vis-bar { display: none; } }
/* Un tableau large défile dans sa carte au lieu d'élargir la page. */
.main, #view, #rank-body, .grid-2 > * { min-width: 0; }
.kw-table td:first-child { min-width: 210px; }
.kw-table th.comp { white-space: normal; min-width: 64px; max-width: 110px; line-height: 1.25; text-transform: none; letter-spacing: 0; font-size: .78rem; }
.kw-table .feats { max-width: 190px; white-space: normal; }
@media (max-width: 860px) { .page-head p { overflow-wrap: anywhere; } .filters { flex-wrap: wrap; } .filters .seg { overflow-x: auto; max-width: 100%; } }

.feat { white-space: nowrap; }
.row-actions { display: flex; gap: 2px; justify-content: flex-end; }
.comp-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); }
.comp-grid td, .comp-grid th { padding-left: .35rem; padding-right: .35rem; }
.nowrap { white-space: nowrap; }
@media (max-width: 960px) { .comp-grid { grid-template-columns: 1fr; } }
.chart-tip .tip-row strong { white-space: nowrap; }

.sugg { margin-top: 1rem; border-top: 1px solid var(--line); padding-top: 1rem; }
.sugg .seg { margin-bottom: .6rem; flex-wrap: wrap; }
.sugg-list { list-style: none; margin: .4rem 0 0; padding: 0; display: grid; gap: 2px; max-height: 420px; overflow-y: auto; }
.sugg-list label { display: flex; gap: .6rem; align-items: flex-start; font-weight: 400; padding: .45rem .5rem; border-radius: 8px; cursor: pointer; }
.sugg-list label:hover { background: var(--panel-2); }
.sugg-list input { margin-top: .25rem; }

/* ---------- E-mailing ---------- */
.tiles-3 { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.tiles-3 .kpi .value { font-size: 1.45rem; }
.mail-editor { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 16px; align-items: start; }
.plain-fs { border: 0; padding: 0; margin: 0; min-width: 0; }
.section-pair { display: grid; gap: .35rem; }
.mail-preview { position: sticky; top: 16px; }
.mail-preview .seg { margin-bottom: 0; }
.inbox-line { margin: .8rem 0; padding: .6rem .8rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel-2); font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inbox-line span { margin-left: .4rem; }
.pv-frame { border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; background: #f3f4f6; transition: max-width .2s; margin: 0 auto; max-width: 100%; }
.pv-frame.mobile { max-width: 390px; }
.pv-frame iframe { display: block; width: 100%; height: 720px; border: 0; background: #f3f4f6; }
td.num { white-space: nowrap; }
.auto-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; margin-top: 1rem; }
.auto-card { display: grid; gap: .7rem; align-content: start; }
.switch { display: inline-flex; align-items: center; gap: .45rem; font-weight: 600; font-size: .86rem; cursor: pointer; white-space: nowrap; }
.switch input { width: 36px; height: 20px; appearance: none; -webkit-appearance: none; background: var(--line); border-radius: 999px; position: relative; cursor: pointer; transition: background .15s; margin: 0; }
.switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: left .15s; box-shadow: 0 1px 2px rgba(0,0,0,.25); }
.switch input:checked { background: var(--ok); }
.switch input:checked::after { left: 18px; }
@media (max-width: 1100px) { .mail-editor { grid-template-columns: minmax(0, 1fr); } .mail-preview { position: static; } }
@media (max-width: 560px) { .auto-grid { grid-template-columns: 1fr; } .mail-editor .grid { grid-template-columns: 1fr !important; } }

/* ---------- Bibliothèque de campagnes ---------- */
.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; margin-top: .8rem; }
.lib-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: .45rem; border-top: 4px solid var(--c, var(--accent)); min-width: 0; }
.lib-card h3 { margin: .1rem 0 0; font-size: 1.05rem; }
.lib-card.cat-saison { --c: #2a78d6; } .lib-card.cat-cadeaux { --c: #e87ba4; } .lib-card.cat-entreprises { --c: #6250d6; }
.lib-card.cat-fidelite { --c: #1baf7a; } .lib-card.cat-actualite { --c: #eb6834; } .lib-card.cat-mes, .lib-card.cat-custom { --c: var(--muted); }
.lib-top { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; }
.lib-cat { font-size: .74rem; font-weight: 650; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-right: auto; }
.lib-subject { margin: .1rem 0; font-size: .9rem; color: var(--text); font-style: italic; }
.lib-actions { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: auto; padding-top: .4rem; }
.lib-filter { flex-wrap: wrap; margin-bottom: 0; }
.lib-dialog { width: min(760px, calc(100vw - 32px)); max-height: calc(100vh - 48px); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; background: var(--panel); color: var(--text); box-shadow: var(--shadow-lg); }
.lib-dialog::backdrop { background: rgba(15, 23, 42, .45); }
.lib-dialog iframe { display: block; width: 100%; height: min(62vh, 640px); border: 1px solid var(--line); border-radius: var(--radius-sm); background: #f3f4f6; margin-bottom: .8rem; }
.lib-dialog h3 { margin: 0; }

/* ---------- Lecture des chiffres : « En clair », verdicts, lexique ---------- */
.insights h3 { display: flex; align-items: center; gap: .45rem; }
.insights ul { list-style: none; margin: .3rem 0 0; padding: 0; display: grid; gap: .1rem; }
.ins { display: grid; grid-template-columns: 118px minmax(0, 1fr); gap: .8rem; align-items: start; padding: .65rem 0; border-top: 1px solid var(--line); }
.ins:first-child { border-top: 0; }
.ins strong { display: block; font-size: .95rem; }
.ins p { margin: .15rem 0 0; color: var(--muted); font-size: .9rem; }
.ins a { display: inline-block; margin-top: .25rem; font-size: .88rem; font-weight: 600; }
.ins-badge, .verdict { display: inline-flex; align-items: center; gap: .3rem; font-size: .76rem; font-weight: 650; padding: .15rem .55rem; border-radius: 999px; white-space: nowrap; width: max-content; }
.ins.good .ins-badge, .verdict.good { background: var(--ok-soft); color: var(--ok); }
.ins.watch .ins-badge, .verdict.watch { background: var(--warn-soft); color: var(--warn); }
.ins.act .ins-badge, .verdict.act { background: var(--danger-soft); color: var(--danger); }
.ins.info .ins-badge, .verdict.info { background: var(--accent-soft); color: var(--accent-text); }
.verdict { margin-left: .25rem; vertical-align: middle; font-size: .72rem; padding: .05rem .45rem; }
.kpi .verdict { margin-left: 0; margin-right: .2rem; }
.ad-hero .verdict { margin: .2rem 0 0; }
.term { text-decoration: underline dotted color-mix(in srgb, var(--muted) 70%, transparent); text-underline-offset: 3px; cursor: help; border-radius: 3px; }
.term:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.term-pop { position: fixed; z-index: 1000; background: var(--text); color: var(--panel); font-size: .84rem; line-height: 1.45; font-weight: 450; padding: .55rem .75rem; border-radius: 10px; box-shadow: var(--shadow-lg); pointer-events: none; text-transform: none; letter-spacing: 0; }
@media (max-width: 560px) { .ins { grid-template-columns: 1fr; gap: .35rem; } }

.logo-mark.logo-lg { width: 40px; height: 40px; border-radius: 11px; font-size: 1.15rem; }

/* ---------- Établissements : bouton du menu et sélecteur ---------- */
.space-btn { display: flex; align-items: center; gap: .6rem; width: 100%; margin: 4px 0 10px; padding: .5rem .6rem; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); color: var(--text); font: inherit; text-align: left; cursor: pointer; position: relative; }
.space-btn:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); background: var(--panel-2); }
.space-btn:focus-visible, .space-top:focus-visible, .space-row:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.space-btn-text { display: grid; min-width: 0; flex: 1; line-height: 1.25; }
.space-btn-text strong { font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.space-btn-text small { color: var(--muted); font-size: .76rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.space-btn-dot { width: 9px; height: 9px; border-radius: 50%; background: #e0245e; flex: none; }
.space-avatar { --av: var(--accent); flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--av); color: #fff; font-weight: 750; letter-spacing: .02em; width: 44px; height: 44px; box-shadow: inset 0 0 0 2px color-mix(in srgb, #fff 18%, transparent); }
.space-avatar.add { background: var(--panel-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
.space-top { display: inline-flex; align-items: center; gap: .3rem; border: 0; background: none; font: inherit; font-weight: 750; font-size: 1.02rem; color: var(--text); cursor: pointer; max-width: 62vw; padding: .3rem .4rem; border-radius: 8px; }
.space-top span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sheet-scrim { position: fixed; inset: 0; background: rgba(15, 23, 42, .45); z-index: 80; animation: fade .15s ease-out; }
.sheet { position: fixed; z-index: 81; background: var(--bg); border: 1px solid var(--line); box-shadow: var(--shadow-lg); display: flex; flex-direction: column;
  top: 16px; left: calc(var(--sidebar) + 8px); width: 420px; max-height: calc(100vh - 32px); border-radius: 18px; animation: pop .16s ease-out; }
.sheet-handle { display: none; }
.sheet-body { overflow-y: auto; padding: 18px; }
.sheet-title { margin: 0 0 12px; font-size: 1.05rem; }
.space-group { margin: 16px 4px 6px; font-size: .76rem; font-weight: 650; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.space-card { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.space-row { display: flex; align-items: center; gap: .85rem; width: 100%; padding: .8rem 1rem; border: 0; border-top: 1px solid var(--line); background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.space-row:first-child { border-top: 0; }
.space-row:hover { background: var(--panel-2); }
.space-row.loading { opacity: .55; pointer-events: none; }
.space-row-text { display: grid; flex: 1; min-width: 0; line-height: 1.3; }
.space-row-text strong { font-size: 1rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.space-row-text small { color: var(--muted); font-size: .86rem; display: inline-flex; align-items: center; gap: .35rem; }
.red-dot { width: 7px; height: 7px; border-radius: 50%; background: #e0245e; display: inline-block; }
.space-check { width: 26px; height: 26px; border-radius: 50%; background: #0a84ff; color: #fff; display: grid; place-items: center; flex: none; }
.space-add-form { padding: .9rem 1rem 1rem; display: grid; gap: .6rem; }
@keyframes pop { from { opacity: 0; transform: translateY(-6px) scale(.98); } }
@keyframes rise { from { transform: translateY(100%); } }
@keyframes fade { from { opacity: 0; } }
/* Mobile : feuille qui monte du bas, avec sa poignée, comme sur Instagram. */
@media (max-width: 860px) {
  .sheet { top: auto; left: 0; right: 0; bottom: 0; width: auto; max-height: 86vh; border-radius: 22px 22px 0 0; border-bottom: 0; animation: rise .22s ease-out; padding-bottom: env(safe-area-inset-bottom); }
  .sheet-handle { display: block; width: 44px; height: 5px; border-radius: 3px; background: color-mix(in srgb, var(--muted) 45%, transparent); margin: 10px auto 2px; flex: none; }
  .sheet-body { padding: 10px 14px 20px; }
  .sheet-title { text-align: center; font-size: 1rem; }
  body.sheet-open { overflow: hidden; }
}
@media (prefers-reduced-motion: reduce) { .sheet, .sheet-scrim { animation: none; } }
.space-top.has-dot::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #e0245e; margin-left: 2px; }

/* Fonctions ajoutées (attribution, création, suivi des sites, boîtes mail) */
.sidebar .nav-heading { color: var(--muted); margin: .7rem .7rem .15rem; font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; }
.proposal-grid { grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); }
.proposal img { width: 100%; max-height: 215px; object-fit: contain; border-radius: 8px; background: var(--panel-2); }
.proposal textarea { min-height: 125px; }
.report-range select { width: auto; }
.tabs a.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
  .sidebar .nav-heading { width: 100%; }
.approval-caption { white-space: pre-wrap; }
.approval-media { width: 135px; max-height: 180px; object-fit: contain; border-radius: 8px; }
.campaign-kpis { grid-template-columns: repeat(auto-fit, minmax(92px, 1fr)); gap: .65rem; }
#upload-progress { width: min(100%, 420px); accent-color: var(--accent); }
.tracking-source { border: 1px solid var(--line); border-radius: var(--radius); padding: .85rem; }
.tracking-source form { margin-top: .6rem; }
.mail-body { white-space: pre-wrap; overflow-wrap: anywhere; }

/* Mes campagnes : canaux nommés clairement */
.ch-badge { display: inline-flex; align-items: center; gap: .4rem; padding: .25rem .6rem .25rem .3rem; border-radius: 999px; font-size: .85rem; font-weight: 600; background: var(--panel-2); border: 1px solid var(--line); color: var(--text); white-space: nowrap; }
.ch-badge b { display: inline-grid; place-items: center; width: 1.4rem; height: 1.4rem; border-radius: 50%; color: #fff; font-size: .72rem; background: #64748b; }
.ch-facebook b, .ch-social b { background: #1877f2; }
.ch-instagram b { background: linear-gradient(45deg, #f58529, #dd2a7b 55%, #8134af); }
.ch-meta_ads b { background: linear-gradient(135deg, #1877f2, #dd2a7b); }
.ch-google b { background: #1a9e55; }
.ch-google_ads b { background: #e8a100; }
.ch-email b { background: #0b996e; }
.ch-linkedin b { background: #0a66c2; }
.ch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .75rem; margin: .75rem 0; }
.ch-tile { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .8rem; background: var(--panel); min-width: 0; }
.ch-tile.empty { background: var(--panel-2); }
.ch-tile.empty .ch-num { color: var(--muted); }
.ch-num { font-size: 1.35rem; font-weight: 700; margin: .5rem 0 .1rem; }
.ch-hint { font-size: .78rem; color: var(--muted); margin-top: .35rem; }
.clear-line { background: var(--accent-soft); color: var(--accent-text); border-radius: var(--radius-sm); padding: .6rem .8rem; margin: .5rem 0; }
.clear-line.muted { background: var(--panel-2); color: var(--muted); }
.step { display: flex; gap: .8rem; align-items: flex-start; padding: .8rem 0; border-top: 1px solid var(--line); }
.step-n { flex: none; display: grid; place-items: center; width: 1.8rem; height: 1.8rem; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 700; }
.ch-pick { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .5rem; }
.ch-pick label { cursor: pointer; }
.ch-pick input { position: absolute; opacity: 0; pointer-events: none; }
.ch-pick .ch-badge { padding: .45rem .8rem .45rem .45rem; }
.ch-pick input:checked + .ch-badge { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 2px var(--accent); }
.ch-pick input:focus-visible + .ch-badge { outline: 2px solid var(--accent); outline-offset: 2px; }
.link-out { display: flex; gap: .5rem; margin-top: .6rem; }
.link-out input { flex: 1; min-width: 0; font-family: ui-monospace, monospace; font-size: .85rem; }
.ok-text { color: var(--ok); } .warn-text { color: var(--warn); }
.link-out[hidden] { display: none; }
.ch-tile .ch-badge { white-space: normal; max-width: 100%; }
.native-grid { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.native-card.used { border-color: var(--ok); box-shadow: 0 0 0 1px var(--ok); }
.native-steps { padding-left: 1.2rem; margin: .6rem 0; }
.native-steps li { margin: .35rem 0; }
.native-prio { border: 0; padding: 0; margin: .4rem 0 .6rem; display: flex; gap: 1.2rem; flex-wrap: wrap; }
.native-prio legend { font-weight: 600; margin-bottom: .3rem; padding: 0; }
.native-prio label { display: inline-flex; gap: .4rem; align-items: center; }
/* Adresse de l'espace (sous-domaine) */
.addr-input { display: flex; align-items: stretch; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; background: var(--panel); margin-top: .35rem; max-width: 640px; }
.addr-input input { border: 0; border-radius: 0; flex: 1; min-width: 0; font-weight: 600; box-shadow: none; }
.addr-input:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.addr-pre, .addr-suf { display: grid; place-items: center; padding: 0 .7rem; background: var(--panel-2); color: var(--muted); font-size: .9rem; white-space: nowrap; }
.addr-current { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; font-weight: 600; }
@media (max-width: 560px) { .addr-pre { display: none; } .addr-suf { padding: 0 .5rem; font-size: .8rem; } }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.section-tight { margin: .35rem 0; gap: .6rem; align-items: center; }
.addr-sites { border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.addr-site { display: flex; justify-content: space-between; align-items: center; gap: .6rem; padding: .6rem .8rem; flex-wrap: wrap; }
.addr-site + .addr-site { border-top: 1px solid var(--line); }

/* ---------- Mes agents : liste claire + panneau de réglages ---------- */
.ag-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .75rem; margin: .5rem 0 1rem; }
.ag-summary > * { display: flex; align-items: center; gap: .7rem; padding: .85rem 1rem; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-sm); color: var(--text); text-decoration: none; min-width: 0; }
.ag-summary strong { font-size: 1.45rem; line-height: 1; font-variant-numeric: tabular-nums; display: inline-flex; }
.ag-summary span { color: var(--muted); font-size: .9rem; }
.ag-summary a:hover { border-color: var(--accent); }
.ag-summary .hot { border-color: var(--accent); background: var(--accent-soft); }
.ag-summary .hot span { color: var(--accent-text); }
.ag-how { margin-bottom: 1.2rem; }
.ag-how summary { cursor: pointer; }
.ag-steps { list-style: none; padding: 0; margin: .9rem 0 .4rem; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; }
.ag-steps li { display: flex; gap: .7rem; align-items: flex-start; min-width: 0; }
.ag-steps p { margin: .2rem 0 0; color: var(--muted); font-size: .92rem; }
.ag-step-n { flex: none; width: 1.8rem; height: 1.8rem; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: #fff; font-weight: 700; }
.ag-group { margin-top: 1.4rem; }
.ag-group h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 .55rem; }
.ag-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); gap: .7rem; }
.ag-card { display: flex; align-items: flex-start; gap: .85rem; width: 100%; text-align: left; padding: .9rem 1rem; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; color: var(--text); font: inherit; transition: border-color .15s, box-shadow .15s, transform .15s; min-width: 0; }
.ag-card:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.ag-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ag-card.off { background: var(--panel-2); }
.ag-card.off .ag-ico { filter: grayscale(1); opacity: .6; }
.ag-ico { flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.ag-main { flex: 1; min-width: 0; display: grid; gap: .3rem; }
.ag-top { display: flex; align-items: center; justify-content: space-between; gap: .6rem; }
.ag-desc { color: var(--muted); font-size: .9rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ag-meta { display: flex; flex-wrap: wrap; gap: .3rem .9rem; font-size: .8rem; color: var(--muted); }
.ag-mode { font-weight: 600; color: var(--text); }
.ag-pending { font-weight: 600; color: var(--accent-text); background: var(--accent-soft); padding: 0 .45rem; border-radius: 999px; }
.ag-chev { color: var(--muted); align-self: center; }
.pill.muted { background: var(--panel-2); color: var(--muted); }
.ag-scrim { position: fixed; inset: 0; background: rgba(15, 23, 42, .35); opacity: 0; transition: opacity .18s; z-index: 60; }
.ag-scrim.in { opacity: 1; }
.ag-panel { position: fixed; top: 0; right: 0; bottom: 0; width: min(520px, 100vw); background: var(--panel); z-index: 61; display: flex; flex-direction: column; box-shadow: var(--shadow-lg); transform: translateX(100%); transition: transform .2s ease; padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
.ag-panel.in { transform: none; }
.ag-ph { display: flex; align-items: center; gap: .8rem; padding: 1rem 1.2rem; border-bottom: 1px solid var(--line); }
.ag-ph h3 { margin: 0 0 .2rem; }
.ag-ph > div { flex: 1; min-width: 0; }
.ag-body { flex: 1; overflow-y: auto; padding: 1rem 1.2rem; display: grid; gap: 1.1rem; align-content: start; }
.ag-body > p { margin: 0; color: var(--muted); }
.ag-pf { display: flex; gap: .6rem; justify-content: flex-end; padding: .9rem 1.2rem; border-top: 1px solid var(--line); flex-wrap: wrap; }
.ag-field { border: 0; padding: 0; margin: 0; display: grid; gap: .5rem; min-width: 0; }
.ag-field legend, .ag-field > strong { font-weight: 600; margin-bottom: .4rem; padding: 0; }
.ag-modes { display: grid; gap: .5rem; }
.ag-mode-opt { display: flex; gap: .7rem; align-items: flex-start; padding: .7rem .8rem; border: 1px solid var(--line); border-radius: var(--radius-sm); cursor: pointer; margin: 0; }
.ag-mode-opt input { margin-top: .25rem; width: auto; accent-color: var(--accent); }
.ag-mode-opt span { display: grid; gap: .15rem; }
.ag-mode-opt small { color: var(--muted); font-weight: 400; }
.ag-mode-opt em { font-style: normal; font-size: .72rem; color: var(--ok); background: var(--ok-soft); padding: .05rem .4rem; border-radius: 999px; margin-left: .3rem; font-weight: 600; }
.ag-mode-opt:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent); }
.ag-freq { display: flex; flex-wrap: wrap; gap: .4rem; }
.ag-freq label { margin: 0; cursor: pointer; }
.ag-freq input { position: absolute; opacity: 0; pointer-events: none; }
.ag-freq span { display: inline-block; padding: .4rem .75rem; border: 1px solid var(--line); border-radius: 999px; font-size: .88rem; background: var(--panel); }
.ag-freq input:checked + span { background: var(--accent); border-color: var(--accent); color: #fff; }
.ag-freq input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.ag-switch { display: flex; align-items: center; gap: .8rem; padding: .75rem .9rem; border: 1px solid var(--line); border-radius: var(--radius-sm); cursor: pointer; margin: 0; }
.ag-switch input { position: absolute; opacity: 0; pointer-events: none; }
.ag-track { flex: none; width: 42px; height: 24px; border-radius: 999px; background: var(--line); position: relative; transition: background .15s; }
.ag-track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .15s; }
.ag-switch input:checked + .ag-track { background: var(--ok); }
.ag-switch input:checked + .ag-track::after { transform: translateX(18px); }
.ag-switch input:focus-visible + .ag-track { outline: 2px solid var(--accent); outline-offset: 2px; }
.ag-switch span:last-child { display: grid; }
.ag-switch small { color: var(--muted); font-weight: 400; }
.ag-stats { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.ag-stats li { display: flex; justify-content: space-between; gap: 1rem; padding: .5rem .8rem; font-size: .9rem; }
.ag-stats li + li { border-top: 1px solid var(--line); }
.ag-stats span { color: var(--muted); }
.ag-stats .ag-summary-line { color: var(--muted); font-size: .85rem; display: block; }
.ag-adv summary { cursor: pointer; font-weight: 600; }
.ag-adv[open] summary { margin-bottom: .4rem; }
@media (max-width: 640px) {
  .ag-panel { top: auto; left: 0; width: 100vw; max-height: 92vh; border-radius: 18px 18px 0 0; transform: translateY(100%); }
  .ag-panel.in { transform: none; }
}
@media (prefers-reduced-motion: reduce) { .ag-panel, .ag-scrim, .ag-card { transition: none; } }
