@import url('/vendor/font/400.css');
@import url('/vendor/font/700.css');
@import url('/vendor/font/400-italic.css');

:root {
  --paper: #F1F5F4;
  --surface: #FFFFFF;
  --ink: #18282B;
  --muted: #56686B;
  --line: #D4DEDC;
  --line-soft: #E6ECEB;
  --accent: #13856E;
  --accent-strong: #0D6B58;
  --accent-ink: #FFFFFF;
  --accent-wash: #E2F1EC;
  --up: #1E7B45;
  --down: #B3412C;
  --warn-bg: #FFF4DA;
  --warn-ink: #6B4B00;
  --error-bg: #FBE7E3;
  --error-ink: #8A2A18;
  --ok-bg: #E2F1EC;
  --ok-ink: #0D5546;
  --serp-title: #1A0DAB;
  --serp-url: #4D5156;
  --serp-text: #474747;
  --radius-s: 6px;
  --radius-m: 10px;
  --font: 'Atkinson Hyperlegible', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #111A1B;
    --surface: #182325;
    --ink: #E3ECEA;
    --muted: #9AAEAC;
    --line: #2C3B3D;
    --line-soft: #223031;
    --accent: #34A889;
    --accent-strong: #4CC3A2;
    --accent-ink: #08201A;
    --accent-wash: #173A33;
    --up: #5CC48A;
    --down: #F0806A;
    --warn-bg: #3A2F12;
    --warn-ink: #F3D58A;
    --error-bg: #3D1E19;
    --error-ink: #F4B3A6;
    --ok-bg: #173A33;
    --ok-ink: #A9E3D2;
    --serp-title: #99C3FF;
    --serp-url: #BDC1C6;
    --serp-text: #BDC1C6;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 1rem/1.55 var(--font); font-variant-numeric: tabular-nums; }
a { color: var(--accent-strong); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
h1, h2, h3 { line-height: 1.2; margin: 0; font-weight: 700; }
h1 { font-size: 1.75rem; letter-spacing: -0.01em; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 .75rem; }
small, .muted { color: var(--muted); }
code, kbd { font-family: var(--mono); font-size: .88em; background: var(--line-soft); padding: .1em .35em; border-radius: 4px; }
pre { font-family: var(--mono); font-size: .82rem; background: var(--line-soft); padding: .75rem; border-radius: var(--radius-s); overflow: auto; white-space: pre-wrap; max-height: 18rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- Structure : rail des sites + zone principale ---- */
.shell { display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: 100vh; }
.rail { background: var(--surface); border-right: 1px solid var(--line); padding: 1.25rem .75rem; display: flex; flex-direction: column; gap: 1.25rem; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: .6rem; padding: 0 .5rem; color: var(--ink); text-decoration: none; font-weight: 700; font-size: 1.15rem; }
.brand svg { color: var(--accent); flex: none; }
.rail-group { display: flex; flex-direction: column; gap: 2px; }
.rail-heading { font-size: .82rem; color: var(--muted); padding: 0 .6rem .3rem; }
.rail a.rail-link { display: flex; align-items: center; gap: .6rem; padding: .5rem .6rem; border-radius: var(--radius-s); color: var(--ink); text-decoration: none; line-height: 1.25; }
.rail a.rail-link:hover { background: var(--line-soft); }
.rail a.rail-link[aria-current="page"] { background: var(--accent-wash); }
.rail-site small { display: block; font-size: .78rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail-site span { min-width: 0; }
.dot { width: .7rem; height: .7rem; border-radius: 50%; flex: none; box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--line); }
.rail-add { color: var(--accent-strong) !important; font-weight: 700; }
.rail-foot { margin-top: auto; display: flex; flex-direction: column; gap: 2px; }
.rail-foot form { margin: 0; }
.linklike { background: none; border: 0; padding: .5rem .6rem; font: inherit; color: var(--muted); cursor: pointer; text-align: left; width: 100%; border-radius: var(--radius-s); }
.linklike:hover { background: var(--line-soft); color: var(--ink); }

.main { padding: 1.75rem clamp(1rem, 3vw, 2.5rem) 4rem; max-width: 1180px; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.page-head p { margin: .35rem 0 0; color: var(--muted); }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }

/* ---- En-tête de site avec onglets ---- */
.site-head { margin-bottom: 1.5rem; }
.site-title { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.site-title .dot { width: .9rem; height: .9rem; }
.site-title a.domain { color: var(--muted); font-size: .95rem; }
.tabs { display: flex; gap: .25rem; margin-top: 1rem; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs a { padding: .6rem .9rem; color: var(--muted); text-decoration: none; border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); font-weight: 700; }

/* ---- Boutons & formulaires ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; padding: .55rem 1rem; border-radius: var(--radius-s); border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; line-height: 1.2; }
.btn:hover { border-color: var(--muted); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
.btn-danger { color: var(--down); }
.btn-danger:hover { border-color: var(--down); }
.btn-small { padding: .35rem .7rem; font-size: .9rem; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
form.inline { display: inline; margin: 0; }

label { font-weight: 700; display: block; margin-bottom: .3rem; }
.field { margin-bottom: 1.1rem; }
.field .hint { font-size: .88rem; color: var(--muted); margin-top: .3rem; }
input[type=text], input[type=url], input[type=password], input[type=search], input[type=number], select, textarea {
  width: 100%; padding: .55rem .7rem; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--surface); color: var(--ink); font: inherit;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
textarea { min-height: 6rem; resize: vertical; }
textarea.code { font-family: var(--mono); font-size: .85rem; min-height: 16rem; }
input[type=color] { width: 3rem; height: 2.4rem; padding: 2px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--surface); }
.choice { display: flex; gap: .65rem; align-items: flex-start; padding: .8rem .9rem; border: 1px solid var(--line); border-radius: var(--radius-m); background: var(--surface); font-weight: 400; cursor: pointer; margin: 0; }
.choice:has(input:checked) { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.choice input { margin-top: .3rem; accent-color: var(--accent); }
.choice strong { display: block; }
.choices { display: grid; gap: .6rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.check { display: flex; gap: .5rem; align-items: center; font-weight: 400; }
.check input { accent-color: var(--accent); width: 1.05rem; height: 1.05rem; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0 1.25rem; }
fieldset { border: 0; padding: 0; margin: 0 0 1.75rem; min-width: 0; }
legend { font-size: 1.2rem; font-weight: 700; padding: 0; margin-bottom: .9rem; }
details.more { margin: 0 0 1.5rem; border-top: 1px solid var(--line); padding-top: 1rem; }
details.more > summary { cursor: pointer; font-weight: 700; margin-bottom: 1rem; }

/* ---- Messages ---- */
.notice { padding: .8rem 1rem; border-radius: var(--radius-m); margin-bottom: 1.25rem; background: var(--ok-bg); color: var(--ok-ink); border: 1px solid color-mix(in srgb, var(--ok-ink) 18%, transparent); }
.notice.warn { background: var(--warn-bg); color: var(--warn-ink); border-color: color-mix(in srgb, var(--warn-ink) 22%, transparent); }
.notice.error { background: var(--error-bg); color: var(--error-ink); border-color: color-mix(in srgb, var(--error-ink) 22%, transparent); }
.notice p:last-child { margin-bottom: 0; }

/* ---- Panneaux ---- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 1.25rem; margin-bottom: 1.5rem; }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.panel-head p { margin: .25rem 0 0; color: var(--muted); font-size: .92rem; }
.empty { text-align: left; padding: 1.5rem 1.25rem; }
.empty h2 { margin-bottom: .5rem; }
.empty p { color: var(--muted); max-width: 60ch; }

/* ---- Tableaux (registre) ---- */
.table-wrap { overflow-x: auto; margin: 0 -1.25rem; padding: 0 1.25rem; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .65rem .6rem; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
th { font-size: .85rem; color: var(--muted); font-weight: 700; border-bottom-color: var(--line); white-space: nowrap; }
td.num, th.num { text-align: right; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: color-mix(in srgb, var(--line-soft) 55%, transparent); }
td .sub { display: block; font-size: .82rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; max-width: 36rem; white-space: nowrap; }
.cell-site { display: flex; align-items: center; gap: .65rem; }
.cell-site a { font-weight: 700; color: var(--ink); text-decoration: none; }
.cell-site a:hover { text-decoration: underline; }
.spark { display: block; color: var(--accent); }
.trend { font-size: .82rem; font-weight: 700; white-space: nowrap; }
.trend.up { color: var(--up); }
.trend.down { color: var(--down); }
.trend.flat { color: var(--muted); }
.status { display: inline-block; font-size: .8rem; font-weight: 700; padding: .12rem .5rem; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.status.published { color: var(--ok-ink); background: var(--ok-bg); border-color: transparent; }
.kind { font-size: .82rem; color: var(--muted); }
.big-num { font-size: 1.05rem; font-weight: 700; }

/* ---- Chiffres clés d'un site ---- */
.figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0; border: 1px solid var(--line); border-radius: var(--radius-m); background: var(--surface); margin-bottom: 1.5rem; overflow: hidden; }
.figure { padding: 1rem 1.25rem; border-right: 1px solid var(--line-soft); }
.figure:last-child { border-right: 0; }
.figure .label { font-size: .88rem; color: var(--muted); }
.figure .value { font-size: 1.75rem; font-weight: 700; line-height: 1.15; margin: .2rem 0; }
.period { display: flex; gap: .25rem; flex-wrap: wrap; }
.period a { padding: .3rem .65rem; border-radius: 999px; text-decoration: none; color: var(--muted); border: 1px solid var(--line); font-size: .9rem; }
.period a[aria-current="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1rem; }
.chart-box { position: relative; height: 210px; }
.chart-title { font-weight: 700; font-size: .95rem; margin-bottom: .4rem; }
.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 1.5rem; }
.two-col > .panel { margin-bottom: 0; }
.stack { display: flex; flex-direction: column; gap: 1.5rem; }

/* ---- Activité ---- */
.activity { list-style: none; margin: 0; padding: 0; }
.activity li { display: grid; grid-template-columns: 1.1rem 1fr auto; gap: .5rem; padding: .5rem 0; border-bottom: 1px solid var(--line-soft); align-items: start; }
.activity li:last-child { border-bottom: 0; }
.activity .when { color: var(--muted); font-size: .85rem; white-space: nowrap; }
.activity .mark { font-weight: 700; }
.activity .mark.ok { color: var(--up); }
.activity .mark.ko { color: var(--down); }
.activity details summary { cursor: pointer; color: var(--muted); font-size: .85rem; }

/* ---- Éditeur ---- */
.editor-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 1.5rem; align-items: start; }
.editor-main .title-input { font-size: 1.6rem; font-weight: 700; padding: .5rem .7rem; }
.editor-side { position: sticky; top: 1rem; display: flex; flex-direction: column; gap: 1rem; }
.editor-side .panel { margin: 0; }
.counter { font-size: .82rem; color: var(--muted); float: right; font-weight: 400; }
.counter.over { color: var(--down); font-weight: 700; }
.counter.good { color: var(--up); }
.slug-row { display: flex; align-items: stretch; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--surface); overflow: hidden; }
.slug-row span { padding: .55rem 0 .55rem .7rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 55%; font-size: .92rem; align-self: center; }
.slug-row input { border: 0; border-radius: 0; padding-left: .1rem; }
.slug-row:focus-within { outline: 2px solid var(--accent); border-color: var(--accent); }
.slug-row input:focus { outline: none; }

/* L'aperçu Google : l'élément signature de Vigie */
.serp { font-family: Arial, sans-serif; background: var(--surface); padding: .25rem 0; }
.serp-site { display: flex; align-items: center; gap: .55rem; margin-bottom: .3rem; }
.serp-fav { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: .75rem; font-weight: 700; color: #fff; flex: none; }
.serp-name { font-size: .88rem; color: var(--ink); line-height: 1.2; }
.serp-site > div { min-width: 0; }
.serp-url { font-size: .78rem; color: var(--serp-url); line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.serp-title { color: var(--serp-title); font-size: 1.2rem; line-height: 1.3; margin: .1rem 0 .25rem; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; }
.serp-desc { color: var(--serp-text); font-size: .86rem; line-height: 1.55; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; margin: 0; }
.serp-desc.placeholder, .serp-title.placeholder { opacity: .55; font-style: italic; }
.checks { list-style: none; padding: 0; margin: 0; font-size: .92rem; }
.checks li { display: flex; gap: .5rem; padding: .3rem 0; }
.checks li::before { content: '○'; color: var(--muted); font-weight: 700; width: 1rem; flex: none; }
.checks li.ok::before { content: '✓'; color: var(--up); }
.checks li.ko::before { content: '!'; color: var(--down); }
.side-actions { display: flex; flex-direction: column; gap: .5rem; }
.side-actions .btn { width: 100%; }
.job { font-size: .9rem; padding: .6rem .75rem; border-radius: var(--radius-s); background: var(--line-soft); }
.job.ok { background: var(--ok-bg); color: var(--ok-ink); }
.job.ko { background: var(--error-bg); color: var(--error-ink); }

/* EasyMDE aux couleurs de Vigie */
.EasyMDEContainer .CodeMirror { border: 1px solid var(--line); border-radius: 0 0 var(--radius-s) var(--radius-s); background: var(--surface); color: var(--ink); font: 1.02rem/1.65 var(--font); min-height: 420px; }
.EasyMDEContainer .editor-toolbar { border: 1px solid var(--line); border-bottom: 0; border-radius: var(--radius-s) var(--radius-s) 0 0; background: var(--surface); padding: 4px; opacity: 1; display: flex; flex-wrap: wrap; gap: 2px; }
.EasyMDEContainer .editor-toolbar button { width: auto; min-width: 0; height: auto; padding: .3rem .55rem; font: .88rem var(--font); color: var(--ink); border-radius: 4px; border: 1px solid transparent; }
.EasyMDEContainer .editor-toolbar button:hover, .EasyMDEContainer .editor-toolbar button.active { background: var(--line-soft); border-color: var(--line); }
.EasyMDEContainer .editor-toolbar i.separator { border-left-color: var(--line); border-right: 0; margin: 0 4px; }
.EasyMDEContainer .CodeMirror-cursor { border-left-color: var(--ink); }
.EasyMDEContainer .CodeMirror-selected, .EasyMDEContainer .CodeMirror-focused .CodeMirror-selected { background: var(--accent-wash); }
.EasyMDEContainer .editor-preview { background: var(--surface); color: var(--ink); padding: 1rem 1.25rem; }
.EasyMDEContainer .editor-preview img { max-width: 100%; }
.EasyMDEContainer .editor-statusbar { color: var(--muted); }
.EasyMDEContainer .cm-s-easymde .cm-header-2 { font-size: 1.3em; }
.EasyMDEContainer .cm-s-easymde .cm-header-3 { font-size: 1.12em; }

/* ---- Mots-clés ---- */
.pos { font-weight: 700; font-size: 1.05rem; }
.pos.top3 { color: var(--up); }
.pos-history { display: flex; gap: 2px; align-items: flex-end; height: 22px; }
.pos-history span { width: 6px; background: var(--accent); border-radius: 2px 2px 0 0; opacity: .85; }
.pos-history span.none { background: var(--line); height: 3px !important; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip { display: inline-flex; gap: .4rem; align-items: center; padding: .3rem .7rem; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-weight: 400; cursor: pointer; margin: 0; }
.chip:has(input:checked) { border-color: var(--accent); background: var(--accent-wash); }
.chip input { accent-color: var(--accent); }
.chip small { color: var(--muted); }

/* ---- Connexion ---- */
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 1rem; }
.login-card { width: min(400px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 2rem; }
.login-card .brand { padding: 0; margin-bottom: 1.5rem; font-size: 1.4rem; }

/* ---- Mobile ---- */
.menu-toggle { display: none; }
@media (max-width: 980px) {
  .editor-grid { grid-template-columns: 1fr; }
  .editor-side { position: static; }
}
@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }
  .rail { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: .75rem; gap: .75rem; }
  .rail-top { display: flex; justify-content: space-between; align-items: center; }
  .menu-toggle { display: inline-flex; }
  .rail:not(.open) .rail-group, .rail:not(.open) .rail-foot { display: none; }
  .main { padding-top: 1.25rem; }
  h1 { font-size: 1.45rem; }
  .editor-main .title-input { font-size: 1.2rem; }
  .figure { border-right: 0; border-bottom: 1px solid var(--line-soft); }
  .two-col { grid-template-columns: 1fr; }
  .hide-mobile { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
.choice small { display: block; color: var(--muted); font-size: .88rem; margin-top: .15rem; }
[hidden] { display: none !important; }
.inv-tools { display: flex; gap: .75rem; justify-content: space-between; align-items: center; flex-wrap: wrap; margin-bottom: .75rem; }
.inv-tools input[type=search] { max-width: 18rem; }

/* ---- Le chat de Vigie ---- */
body.has-cat .main { padding-bottom: 5.5rem; }
.vigie-cat { position: fixed; left: 0; bottom: 0; z-index: 40; cursor: pointer; width: 86px; height: 56px; display: flex; align-items: flex-end; justify-content: center; -webkit-tap-highlight-color: transparent; }
.vigie-cat:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
.cat-flip { display: flex; align-items: flex-end; justify-content: center; width: 100%; }
.cat-svg { display: block; overflow: visible; }
.vigie-cat .cat-standing { display: none; }
.vigie-cat:not(.is-sleeping) .cat-sleeping { display: none; }
.vigie-cat:not(.is-sleeping) .cat-standing { display: block; }
/* respiration pendant le sommeil */
.is-sleeping .cat-sleeping { transform-origin: 50% 100%; animation: cat-breathe 3.2s ease-in-out infinite; }
@keyframes cat-breathe { 50% { transform: scale(1.035, 1.07); } }
.cat-zzz { position: absolute; right: 2px; top: -16px; font: 700 13px/1 var(--font); color: var(--muted); pointer-events: none; display: none; }
.cat-zzz span { position: relative; }
.is-sleeping .cat-zzz { display: block; animation: cat-zzz 3.6s ease-in-out infinite; }
.cat-zzz span:nth-child(1) { font-size: 11px; top: -6px; left: 2px; }
.cat-zzz span:nth-child(2) { font-size: 9px; top: -13px; left: 3px; }
@keyframes cat-zzz { 0% { opacity: 0; transform: translateY(6px); } 30%, 70% { opacity: .85; } 100% { opacity: 0; transform: translateY(-8px); } }
/* pattes */
.cat-standing .leg { transform-box: fill-box; transform-origin: 50% 0; }
.is-walking .leg-a, .is-walking .leg-d { animation: cat-leg .55s ease-in-out infinite; }
.is-walking .leg-b, .is-walking .leg-c { animation: cat-leg .55s ease-in-out infinite reverse; }
.is-running .leg-a, .is-running .leg-d { animation: cat-leg-run .22s linear infinite; }
.is-running .leg-b, .is-running .leg-c { animation: cat-leg-run .22s linear infinite reverse; }
@keyframes cat-leg { 0%, 100% { transform: rotate(22deg); } 50% { transform: rotate(-22deg); } }
@keyframes cat-leg-run { 0%, 100% { transform: rotate(48deg); } 50% { transform: rotate(-48deg); } }
.is-walking .cat-standing { animation: cat-bob .55s ease-in-out infinite; }
.is-running .cat-standing { animation: cat-bob .22s linear infinite; transform-origin: 50% 100%; }
@keyframes cat-bob { 50% { translate: 0 -1.5px; } }
.is-running .cat-flip { filter: drop-shadow(-6px 0 0 rgba(140, 147, 153, .25)); }
/* queue */
.cat-tail { transform-box: fill-box; transform-origin: 100% 100%; }
.is-walking .cat-tail, .is-sitting .cat-tail { animation: cat-tail 2.2s ease-in-out infinite; }
.is-running .cat-tail { transform: rotate(-35deg); }
@keyframes cat-tail { 50% { transform: rotate(-12deg); } }
/* réveil : étirement */
.is-waking .cat-standing { transform-origin: 50% 100%; animation: cat-stretch .9s ease-in-out; }
@keyframes cat-stretch { 40% { transform: scale(1.12, .86); } }
.is-sitting .eyes-open, .is-walking .eyes-open { animation: cat-blink 4s infinite; transform-box: fill-box; transform-origin: center; }
@keyframes cat-blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.1); } }
@media (prefers-reduced-motion: reduce) {
  .vigie-cat *, .vigie-cat { animation: none !important; }
}
@media print { .vigie-cat { display: none; } }

/* ---- Onglet Plan du site ---- */
.sm-switch { margin: 0 0 1rem; }
.sm-h3 { font-size: 1rem; margin: 1.25rem 0 .6rem; }
.sm-h3:first-of-type { margin-top: 0; }
.sm-tag { display: inline-block; font-size: .8rem; font-weight: 700; padding: .12rem .5rem; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); max-width: 26rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; }
.sm-tag.ok { color: var(--ok-ink); background: var(--ok-bg); border-color: transparent; }
.sm-tag.mid { color: var(--warn-ink); background: var(--warn-bg); border-color: transparent; }
.sm-tag.high { color: var(--error-ink); background: var(--error-bg); border-color: transparent; }
.value.sm-bad { color: var(--error-ink); }
.sm-issues { display: flex; flex-direction: column; gap: .5rem; }
.sm-issue { border: 1px solid var(--line); border-left-width: 4px; border-radius: var(--radius-m); padding: .65rem .9rem; }
.sm-issue.lvl-high { border-left-color: var(--error-ink); }
.sm-issue.lvl-mid { border-left-color: var(--warn-ink); }
.sm-issue.lvl-low { border-left-color: var(--line); }
.sm-issue summary { cursor: pointer; }
.sm-issue p { margin: .6rem 0 .4rem; color: var(--muted); max-width: 75ch; }
.sm-lvl { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-right: .25rem; }
.lvl-high .sm-lvl { color: var(--error-ink); }
.lvl-mid .sm-lvl { color: var(--warn-ink); }
.sm-urls { margin: .3rem 0 0; padding-left: 1.1rem; font-size: .9rem; max-height: 18rem; overflow: auto; }
.sm-urls li { margin: .15rem 0; word-break: break-all; }
.sm-pre { font-family: var(--mono); font-size: .85rem; background: var(--line-soft); padding: .8rem 1rem; border-radius: var(--radius-m); white-space: pre-wrap; word-break: break-all; margin: 0; max-height: 22rem; overflow: auto; }
.sm-howto p { max-width: 80ch; }
#sm-xml, #sm-robots { width: 100%; }

/* Petits écrans : la rangée d'onglets défile au lieu d'élargir la page */
.main, .site-head { min-width: 0; }
.site-head { max-width: 100%; }
.tabs { max-width: 100%; scrollbar-width: thin; }

/* ---- Schéma du site ---- */
:root { --add-ink: #1E4E8C; --add-bg: #E6EEF9; }
@media (prefers-color-scheme: dark) { :root { --add-ink: #A9C8F2; --add-bg: #1C2A3D; } }
.sm-legend { list-style: none; display: flex; flex-wrap: wrap; gap: .4rem .6rem; margin: 0 0 1.25rem; padding: 0; font-size: .9rem; }
.sm-legend li { display: inline-flex; align-items: center; gap: .35rem; padding: .25rem .65rem; border-radius: 999px; border: 1px solid var(--line); }
.sm-ico { display: inline-grid; place-items: center; width: 1.25rem; height: 1.25rem; border-radius: 50%; font-size: .75rem; font-weight: 700; flex: none; color: #fff; background: var(--muted); }
.st-ok .sm-ico { background: var(--accent); }
.st-add .sm-ico { background: var(--add-ink); }
.st-fix .sm-ico { background: #B07A00; }
.st-remove .sm-ico { background: var(--error-ink); }
@media (prefers-color-scheme: dark) { .st-ok .sm-ico, .st-add .sm-ico, .st-fix .sm-ico, .st-remove .sm-ico { color: #10181A; } .st-fix .sm-ico { background: var(--warn-ink); } }

.sm-map { overflow-x: auto; padding: .25rem .25rem 1rem; }
.sm-root { display: flex; justify-content: center; position: sticky; left: 0; padding-bottom: 1.4rem; }
.sm-root::after { content: ''; position: absolute; left: 50%; bottom: 0; height: 1.4rem; border-left: 2px solid var(--line); }
.sm-branches { display: flex; gap: 1rem; justify-content: safe center; }
.sm-branch { position: relative; flex: 1 1 0; min-width: 12.5rem; max-width: 17rem; padding-top: 1.4rem; }
/* Barre horizontale qui relie les rubriques entre elles, et trait vers chaque rubrique */
.sm-branch::before { content: ''; position: absolute; top: 0; left: -.5rem; right: -.5rem; border-top: 2px solid var(--line); }
.sm-branch:first-child::before { left: 50%; }
.sm-branch:last-child::before { right: 50%; }
.sm-branch:only-child::before { display: none; }
.sm-branch::after { content: ''; position: absolute; top: 0; left: 50%; height: 1.4rem; border-left: 2px solid var(--line); }
.sm-branch-head { display: flex; flex-direction: column; align-items: stretch; gap: .3rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); padding: .55rem; }
.sm-folder { font-weight: 700; font-family: var(--mono); font-size: .9rem; padding: .3rem .4rem; }
.sm-count { font-size: .8rem; color: var(--muted); padding: 0 .4rem; }
.sm-count .c-remove { color: var(--error-ink); font-weight: 700; }
.sm-count .c-fix { color: var(--warn-ink); font-weight: 700; }
.sm-count .c-add { color: var(--add-ink); font-weight: 700; }
.sm-leaves { list-style: none; margin: 0; padding: .4rem 0 0 .9rem; border-left: 2px solid var(--line); margin-left: 1rem; }
.sm-leaves li { position: relative; margin: .35rem 0 .35rem calc(var(--d, 0) * .9rem); }
.sm-leaves li::before { content: ''; position: absolute; left: calc(-.9rem - 2px - var(--d, 0) * .9rem); top: 50%; width: calc(.8rem + var(--d, 0) * .9rem); border-top: 2px solid var(--line); }
.sm-node { display: flex; align-items: center; gap: .45rem; padding: .35rem .55rem; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); text-decoration: none; font-size: .88rem; line-height: 1.25; min-width: 0; }
.sm-node:hover { border-color: var(--ink); }
.sm-node:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.sm-lab { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sm-node.st-ok { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.sm-node.st-add { border: 1.5px dashed var(--add-ink); background: var(--add-bg); }
.sm-node.st-fix { border-color: color-mix(in srgb, var(--warn-ink) 55%, transparent); background: var(--warn-bg); }
.sm-node.st-remove { border-color: color-mix(in srgb, var(--error-ink) 55%, transparent); background: var(--error-bg); }
.sm-node.st-remove .sm-lab { text-decoration: line-through; text-decoration-thickness: 1px; }
.sm-node-root { font-size: 1rem; font-weight: 700; padding: .55rem 1rem; }
.sm-node-head { font-weight: 700; }
.sm-more { margin-left: 1rem; }
.sm-more summary { cursor: pointer; font-size: .85rem; color: var(--muted); padding: .3rem 0 0 .9rem; }
.sm-more .sm-leaves { padding-top: .2rem; }
@media (max-width: 760px) {
  /* Sur téléphone : les rubriques l'une sous l'autre, reliées par un trait vertical */
  .sm-branches { flex-direction: column; gap: .9rem; min-width: 0; border-left: 2px solid var(--line); margin-left: 1rem; padding-left: 1rem; }
  .sm-root { justify-content: flex-start; padding-bottom: .9rem; }
  .sm-root::after { left: 1rem; height: .9rem; }
  .sm-branch { flex: none; padding-top: 0; min-width: 0; max-width: none; }
  .sm-branch::before { left: -1rem; right: auto; width: 1rem; top: 1.3rem; }
  .sm-branch:first-child::before, .sm-branch:last-child::before { left: -1rem; right: auto; }
  .sm-branch:only-child::before { display: block; }
  .sm-branch::after { display: none; }
}

/* ---- Aide à la rédaction du chat ---- */
.cat-helper { position: fixed; bottom: 68px; z-index: 60; width: min(400px, calc(100vw - 32px)); max-height: min(78vh, 640px); display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 12px 40px rgba(0, 0, 0, .18); }
.ch-head { display: flex; align-items: center; justify-content: space-between; padding: .7rem .9rem; border-bottom: 1px solid var(--line-soft); }
.ch-close { border: 0; background: none; font-size: 1.5rem; line-height: 1; color: var(--muted); cursor: pointer; padding: .1rem .4rem; border-radius: 6px; }
.ch-close:hover { color: var(--ink); background: var(--line-soft); }
.ch-body { padding: .9rem; overflow-y: auto; display: flex; flex-direction: column; gap: .7rem; }
.ch-msg { background: var(--line-soft); border-radius: 4px 12px 12px 12px; padding: .6rem .8rem; font-size: .93rem; }
.ch-msg p { margin: 0 0 .35rem; }
.ch-msg p:last-child { margin-bottom: 0; }
.ch-msg ul { margin: .2rem 0 .4rem; padding-left: 1.1rem; }
.ch-choices { display: flex; flex-wrap: wrap; gap: .5rem; }
.ch-form { display: flex; flex-direction: column; gap: .55rem; }
.ch-field { display: flex; flex-direction: column; gap: .2rem; flex: 1; min-width: 0; }
.ch-field label { font-size: .85rem; font-weight: 700; }
.ch-field input, .ch-field select { width: 100%; }
.ch-hint { font-size: .78rem; color: var(--muted); }
.ch-row { display: flex; gap: .6rem; }
.ch-prompt { width: 100%; min-height: 9rem !important; font-size: .78rem; }

/* ---- La poule ---- */
.vigie-hen { position: fixed; left: 0; bottom: 0; z-index: 39; width: 48px; height: 44px; display: flex; align-items: flex-end; justify-content: center; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.hen-flip { display: flex; align-items: flex-end; }
.hen-svg { display: block; overflow: visible; }
.hen-head, .hen-leg, .hen-wing { transform-box: fill-box; }
.hen-head { transform-origin: 20% 90%; }
.hen-leg { transform-origin: 50% 0; }
.is-walking .hen-svg { animation: hen-bob .45s ease-in-out infinite; }
.is-walking .hen-leg-a { animation: hen-step .45s ease-in-out infinite; }
.is-walking .hen-leg-b { animation: hen-step .45s ease-in-out infinite reverse; }
.is-walking .hen-head { animation: hen-nod .45s ease-in-out infinite; }
.is-pecking .hen-head { animation: hen-peck 1.1s ease-in-out infinite; }
.is-cot .hen-wing { transform-origin: 30% 30%; animation: hen-flap .18s ease-in-out 4; }
.hen-cot { position: absolute; top: -18px; left: 50%; transform: translateX(-50%); font: 700 12px/1 var(--font); color: var(--muted); opacity: 0; pointer-events: none; white-space: nowrap; }
.is-cot .hen-cot { animation: hen-cot 1.1s ease-out; }
@keyframes hen-bob { 50% { transform: translateY(-1.5px); } }
@keyframes hen-step { 0%, 100% { transform: rotate(14deg); } 50% { transform: rotate(-14deg); } }
@keyframes hen-nod { 50% { transform: translateX(2px); } }
@keyframes hen-peck { 0%, 55%, 100% { transform: rotate(0); } 65% { transform: rotate(48deg) translateY(6px); } 75% { transform: rotate(0); } 85% { transform: rotate(48deg) translateY(6px); } }
@keyframes hen-flap { 50% { transform: rotate(-30deg); } }
@keyframes hen-cot { 0% { opacity: 0; transform: translate(-50%, 4px); } 20% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; transform: translate(-50%, -8px); } }
@media (prefers-reduced-motion: reduce) { .vigie-hen *, .vigie-hen { animation: none !important; } }
@media print { .vigie-hen, .cat-helper { display: none; } }

/* ---- Onglet Audit ---- */
.au-switch { margin-bottom: 1rem; }
.au-head { display: flex; gap: 1.25rem; align-items: center; flex-wrap: wrap; }
.au-head-text { flex: 1 1 22rem; min-width: 0; }
.au-head-text h2 { margin: 0 0 .3rem; }
.au-head-text p { margin: 0; }
.au-run { flex: none; }
.au-score { --c: var(--accent); flex: none; width: 92px; height: 92px; border-radius: 50%; display: grid; place-content: center; text-align: center;
  background: radial-gradient(closest-side, var(--surface) 78%, transparent 79% 100%), conic-gradient(var(--c) calc(var(--p) * 1%), var(--line-soft) 0); }
.au-score span { font-size: 1.7rem; font-weight: 700; line-height: 1; }
.au-score small { font-size: .75rem; color: var(--muted); }
.au-score.mid { --c: #B07A00; }
.au-score.bad { --c: var(--error-ink); }
.au-list { display: flex; flex-direction: column; gap: .5rem; }
.au-item { border: 1px solid var(--line); border-left-width: 4px; border-radius: var(--radius-m); }
.au-item.st-ko { border-left-color: var(--error-ink); }
.au-item.st-warn { border-left-color: #B07A00; }
.au-item summary { display: flex; gap: .65rem; align-items: center; padding: .65rem .9rem; cursor: pointer; list-style: none; }
.au-item summary::-webkit-details-marker { display: none; }
.au-item summary::after { content: '▸'; margin-left: auto; color: var(--muted); }
.au-item[open] summary::after { content: '▾'; }
.au-title { display: flex; flex-direction: column; min-width: 0; }
.au-meta { font-size: .8rem; color: var(--muted); }
.au-ico { display: inline-grid; place-items: center; flex: none; width: 1.4rem; height: 1.4rem; border-radius: 50%; font-size: .8rem; font-weight: 700; color: #fff; background: var(--muted); }
.st-ko .au-ico { background: var(--error-ink); }
.st-warn .au-ico { background: #B07A00; }
.st-ok-ico { background: var(--accent); width: 1.2rem; height: 1.2rem; font-size: .7rem; }
@media (prefers-color-scheme: dark) { .au-ico { color: #10181A; } .st-warn .au-ico, .au-score.mid { --c: var(--warn-ink); } .st-warn .au-ico { background: var(--warn-ink); } }
.au-body { padding: 0 .9rem .8rem 2.95rem; }
.au-body p { margin: .2rem 0 .5rem; max-width: 80ch; }
.au-fix { background: var(--line-soft); border-radius: 8px; padding: .5rem .7rem; }
.au-infos { margin: 0; padding-left: 1.1rem; }
.au-infos li { margin: .35rem 0; }
.au-fine-sum { cursor: pointer; }
.au-fine { list-style: none; margin: .8rem 0 0; padding: 0; }
.au-fine li { display: flex; gap: .5rem; align-items: baseline; padding: .3rem 0; border-bottom: 1px solid var(--line-soft); font-size: .92rem; }
.au-fine li:last-child { border-bottom: 0; }
@media (max-width: 760px) { .au-body { padding-left: .9rem; } }

/* Notes par page */
.au-pages { display: flex; flex-direction: column; gap: .4rem; }
.au-page { border: 1px solid var(--line); border-radius: var(--radius-m); }
.au-page summary { display: flex; gap: .75rem; align-items: center; padding: .55rem .8rem; cursor: pointer; list-style: none; }
.au-page summary::-webkit-details-marker { display: none; }
.au-page summary::after { content: '▸'; margin-left: auto; color: var(--muted); }
.au-page[open] summary::after { content: '▾'; }
.au-pscore { flex: none; width: 2.6rem; height: 2.6rem; border-radius: 10px; display: grid; place-items: center; font-weight: 700; font-size: 1.05rem; background: var(--ok-bg); color: var(--ok-ink); }
.au-pscore.mid { background: var(--warn-bg); color: var(--warn-ink); }
.au-pscore.bad { background: var(--error-bg); color: var(--error-ink); }
.au-page .au-title strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.au-page .au-meta { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.au-page .au-body { padding-left: 4.15rem; }
.au-tips { margin: .1rem 0 .6rem; padding-left: 1.2rem; }
.au-tips li { margin: .3rem 0; }
.au-gain { display: inline-block; font-size: .75rem; font-weight: 700; color: var(--ok-ink); background: var(--ok-bg); border-radius: 999px; padding: 0 .45rem; margin-left: .25rem; }
.au-links { font-size: .9rem; margin: 0; }
.figure .value small { font-size: .9rem; font-weight: 400; }
@media (max-width: 760px) { .au-page .au-body { padding-left: .9rem; } }

/* ---- Onglet SEO ---- */
.seo-nav { display: flex; gap: .3rem; flex-wrap: nowrap; overflow-x: auto; margin-top: .8rem; padding-bottom: .2rem; max-width: 100%; scrollbar-width: thin; }
.seo-nav a { padding: .35rem .75rem; border-radius: 999px; text-decoration: none; color: var(--muted); font-size: .9rem; white-space: nowrap; border: 1px solid transparent; }
.seo-nav a:hover { color: var(--ink); background: var(--line-soft); }
.seo-nav a[aria-current="page"] { background: var(--accent); color: #fff; font-weight: 700; }
@media (prefers-color-scheme: dark) { .seo-nav a[aria-current="page"] { color: #10181A; } }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); border: 1px solid var(--line); border-radius: var(--radius-m); background: var(--surface); margin-bottom: 1.5rem; overflow: hidden; }
.kpi { padding: .9rem 1.1rem; border-right: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.kpi .label { font-size: .82rem; color: var(--muted); }
.kpi .value { font-size: 1.55rem; font-weight: 700; line-height: 1.2; margin: .15rem 0; }
.kpi .value small { font-size: .85rem; font-weight: 400; color: var(--muted); }
.delta { font-size: .8rem; font-weight: 700; white-space: nowrap; }
.delta.up { color: var(--up); } .delta.down { color: var(--down); } .delta.flat { color: var(--muted); font-weight: 400; }
.bars { display: flex; flex-direction: column; gap: .45rem; }
.bar-row { display: grid; grid-template-columns: 7.5rem 1fr 3.5rem; gap: .6rem; align-items: center; font-size: .9rem; }
.bar-row .track { background: var(--line-soft); border-radius: 6px; height: .9rem; overflow: hidden; position: relative; }
.bar-row .fill { height: 100%; background: var(--accent); border-radius: 6px; }
.bar-row .fill.prev { position: absolute; top: 0; left: 0; background: transparent; border-right: 2px dashed var(--muted); border-radius: 0; }
.bar-row .n { text-align: right; font-weight: 700; }
.moves { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: .6rem; }
.move { border: 1px solid var(--line); border-radius: var(--radius-m); padding: .7rem .9rem; text-decoration: none; color: var(--ink); }
.move:hover { border-color: var(--ink); }
.move .n { font-size: 1.4rem; font-weight: 700; display: block; }
.move.new .n, .move.up .n { color: var(--up); } .move.lost .n, .move.down .n { color: var(--down); }
.pos { display: inline-block; min-width: 2.4rem; text-align: center; font-weight: 700; border-radius: 6px; padding: .05rem .35rem; font-size: .85rem; }
.pos.b1 { background: var(--ok-bg); color: var(--ok-ink); } .pos.b2 { background: color-mix(in srgb, var(--ok-bg) 50%, var(--surface)); color: var(--ok-ink); }
.pos.b3 { background: var(--warn-bg); color: var(--warn-ink); } .pos.b4, .pos.b5 { background: var(--line-soft); color: var(--muted); }
.tag { display: inline-block; font-size: .72rem; font-weight: 700; padding: .05rem .4rem; border-radius: 999px; background: var(--line-soft); color: var(--muted); white-space: nowrap; }
.tag.i-transaction { background: #E3F1FB; color: #1C5A85; } .tag.i-commercial { background: #F3E8FB; color: #6A2C8C; } .tag.i-information { background: #EAF4EE; color: #2A6B45; } .tag.i-navigation { background: #FBF0E3; color: #8A5216; }
.tag.warn { background: var(--warn-bg); color: var(--warn-ink); } .tag.bad { background: var(--error-bg); color: var(--error-ink); } .tag.good { background: var(--ok-bg); color: var(--ok-ink); }
@media (prefers-color-scheme: dark) { .tag.i-transaction, .tag.i-commercial, .tag.i-information, .tag.i-navigation { background: var(--line-soft); color: var(--ink); } }
table.sortable th[data-sort] { cursor: pointer; user-select: none; }
table.sortable th[data-sort]::after { content: ' ↕'; color: var(--line); }
table.sortable th[aria-sort="ascending"]::after { content: ' ↑'; color: var(--ink); }
table.sortable th[aria-sort="descending"]::after { content: ' ↓'; color: var(--ink); }
.kw-filters { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-bottom: .8rem; }
.kw-filters select, .kw-filters input[type=search] { width: auto; min-width: 9rem; }
.kw-filters input[type=search] { flex: 1 1 14rem; }
.muted-note { font-size: .85rem; color: var(--muted); margin: .6rem 0 0; }
.grid-2 > .panel, .seo-grid > .panel { margin-bottom: 0; }
.seo-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1.5rem; margin-bottom: 1.5rem; }
.score-chips { display: flex; gap: .6rem; flex-wrap: wrap; }
.score-chip { display: flex; gap: .5rem; align-items: center; border: 1px solid var(--line); border-radius: 999px; padding: .3rem .8rem .3rem .3rem; text-decoration: none; color: var(--ink); }
.score-chip .au-pscore { width: 2.1rem; height: 2.1rem; border-radius: 50%; font-size: .9rem; }
.op-list .sub { white-space: normal; }
.cover-preview { margin-bottom: .7rem; border-radius: var(--radius-m); overflow: hidden; border: 1px solid var(--line); background: var(--line-soft); }
.cover-preview img { display: block; width: 100%; max-height: 220px; object-fit: cover; }
