/* ============================================================
   Templates Support OVHcloud — design system
   ============================================================ */

:root {
  --brand:        #0050d7;
  --brand-deep:   #000e9c;
  --brand-soft:   #e8efff;
  --brand-ink:    #ffffff;

  --bg:           #f4f6fb;
  --bg-grad:      radial-gradient(1200px 600px at 12% -10%, #e6edff 0%, transparent 60%),
                  radial-gradient(900px 500px at 100% 0%, #eaf6ff 0%, transparent 55%);
  --surface:      #ffffff;
  --surface-2:    #fafbfe;
  --surface-3:    #f0f3f9;
  --border:       #e2e7f0;
  --border-strong:#cdd5e4;

  --text:         #101426;
  --text-2:       #495166;
  --text-3:       #7b839a;

  --ok:           #00a870;
  --warn:         #d98600;
  --danger:       #d92d4b;
  --danger-soft:  #fdecef;

  --shadow-sm:    0 1px 2px rgba(16, 20, 38, .05), 0 1px 3px rgba(16, 20, 38, .04);
  --shadow-md:    0 4px 12px rgba(16, 20, 38, .07), 0 2px 4px rgba(16, 20, 38, .04);
  --shadow-lg:    0 24px 60px rgba(16, 20, 38, .16), 0 8px 20px rgba(16, 20, 38, .08);

  --r-sm: 8px;  --r-md: 12px;  --r-lg: 16px;  --r-xl: 22px;
  --sidebar-w: 268px;
  --drawer-w: 620px;
  --ease: cubic-bezier(.22, .78, .3, 1);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

[data-theme="dark"] {
  --brand:        #4c8dff;
  --brand-deep:   #7fb0ff;
  --brand-soft:   #17233f;
  --brand-ink:    #061024;

  --bg:           #080b14;
  --bg-grad:      radial-gradient(1100px 560px at 10% -10%, #131c34 0%, transparent 60%),
                  radial-gradient(900px 500px at 100% 0%, #0f1e2c 0%, transparent 55%);
  --surface:      #111726;
  --surface-2:    #151c2e;
  --surface-3:    #1b2337;
  --border:       #232c42;
  --border-strong:#33405e;

  --text:         #e9edf7;
  --text-2:       #a6b0c8;
  --text-3:       #737f9b;

  --ok:           #3ddba0;
  --warn:         #f0b03c;
  --danger:       #ff6b85;
  --danger-soft:  #2a1620;

  --shadow-sm:    0 1px 2px rgba(0, 0, 0, .4);
  --shadow-md:    0 6px 16px rgba(0, 0, 0, .45);
  --shadow-lg:    0 30px 70px rgba(0, 0, 0, .6);
}

* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  background-image: var(--bg-grad);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

h1, h2, h3 { margin: 0; line-height: 1.25; letter-spacing: -.015em; }
button, input, select, textarea { font: inherit; color: inherit; }
.muted { color: var(--text-3); font-style: normal; }
.spacer { flex: 1; }
[hidden] { display: none !important; }

::selection { background: color-mix(in srgb, var(--brand) 26%, transparent); }

/* ── Scrollbars ─────────────────────────────────────────────── */
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 99px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: var(--text-3); background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ============================================================
   Primitives
   ============================================================ */

.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 16px; border-radius: var(--r-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text);
  font-weight: 550; font-size: 14px; cursor: pointer;
  transition: background .16s var(--ease), border-color .16s var(--ease), transform .12s var(--ease), box-shadow .16s var(--ease);
  white-space: nowrap;
}
.btn:hover { background: var(--surface-3); border-color: var(--text-3); }
.btn:active { transform: translateY(1px); }
.btn--primary {
  background: var(--brand); border-color: transparent; color: var(--brand-ink);
  box-shadow: 0 1px 2px color-mix(in srgb, var(--brand) 40%, transparent);
}
.btn--primary:hover { background: color-mix(in srgb, var(--brand) 88%, #000); border-color: transparent; }
.btn--ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn--ghost:hover { background: var(--surface-3); border-color: transparent; color: var(--text); }
.btn--danger-ghost { background: transparent; border-color: transparent; color: var(--danger); }
.btn--danger-ghost:hover { background: var(--danger-soft); border-color: transparent; }
.btn--sm { padding: 6px 12px; font-size: 13px; }
.btn--block { width: 100%; justify-content: center; padding: 11px; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; flex: none;
  border-radius: var(--r-sm); border: 1px solid transparent;
  background: transparent; color: var(--text-2);
  cursor: pointer; font-size: 15px;
  transition: background .16s var(--ease), color .16s var(--ease);
}
.icon-btn:hover { background: var(--surface-3); color: var(--text); }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 12.5px; font-weight: 600; color: var(--text-2); letter-spacing: .01em; }
.field input, .field select, .field textarea {
  width: 100%; padding: 10px 12px;
  border: 1px solid var(--border-strong); border-radius: var(--r-sm);
  background: var(--surface); color: var(--text);
  transition: border-color .16s var(--ease), box-shadow .16s var(--ease);
}
.field textarea { resize: vertical; font-family: var(--mono); font-size: 13.5px; line-height: 1.65; }
.field input:focus, .field select:focus, .field textarea:focus,
.search input:focus, .select select:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent);
}
.field__label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.var-help { font-size: 12px; color: var(--text-3); font-weight: 500; }
.var-help code { font-family: var(--mono); background: var(--surface-3); padding: 1px 5px; border-radius: 4px; }

.avatar {
  width: 30px; height: 30px; flex: none;
  border-radius: 50%; border: 2px solid var(--surface);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11.5px; font-weight: 700; color: #fff;
  background: var(--brand); letter-spacing: .02em;
}
.avatar--btn { width: 36px; height: 36px; cursor: pointer; border-color: transparent; font-size: 12.5px; transition: transform .16s var(--ease); }
.avatar--btn:hover { transform: scale(1.06); }
.avatar--sm { width: 24px; height: 24px; font-size: 10px; }

/* ============================================================
   Layout
   ============================================================ */

.app { display: flex; height: 100vh; overflow: hidden; }

/* ── Sidebar ────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w); flex: none;
  display: flex; flex-direction: column;
  background: color-mix(in srgb, var(--surface) 72%, transparent);
  backdrop-filter: blur(14px);
  border-right: 1px solid var(--border);
  padding: 18px 14px 12px;
  overflow-y: auto; overscroll-behavior: contain;
  z-index: 30;
}
.sidebar__head { display: flex; align-items: center; justify-content: space-between; padding: 0 6px 18px; }
.sidebar__close { display: none; }

.brand { display: flex; align-items: center; gap: 10px; font-size: 15px; letter-spacing: -.02em; }
.brand__mark {
  width: 26px; height: 26px; flex: none; display: block;
  filter: drop-shadow(0 2px 6px color-mix(in srgb, var(--brand) 36%, transparent));
}
.brand__text { font-weight: 450; color: var(--text-2); }
.brand__text b { font-weight: 700; color: var(--text); }
.brand--lg { font-size: 17px; margin-bottom: 22px; }
.brand--lg .brand__mark { width: 34px; height: 34px; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav__item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: var(--r-sm);
  border: none; background: transparent; color: var(--text-2);
  font-size: 14px; font-weight: 500; text-align: left; cursor: pointer;
  transition: background .16s var(--ease), color .16s var(--ease);
}
.nav__item:hover { background: var(--surface-3); color: var(--text); }
.nav__item.is-active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.nav__ico { opacity: .8; }
.nav__item em {
  margin-left: auto; font-style: normal; font-size: 11.5px; font-weight: 600;
  color: var(--text-3); background: var(--surface-3);
  padding: 1px 7px; border-radius: 99px; min-width: 24px; text-align: center;
}
.nav__item.is-active em { background: color-mix(in srgb, var(--brand) 16%, transparent); color: var(--brand); }

.sidebar__section { margin-top: 22px; }
.sidebar__section--grow { flex: 1; }
.sidebar__title {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .09em;
  color: var(--text-3); padding: 0 10px; margin-bottom: 9px;
}
.chips { display: flex; flex-wrap: wrap; gap: 5px; padding: 0 4px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px; border-radius: 99px;
  border: 1px solid var(--border); background: var(--surface-2);
  color: var(--text-2); font-size: 12.5px; font-weight: 500; cursor: pointer;
  transition: all .16s var(--ease);
}
.chip:hover { border-color: var(--border-strong); color: var(--text); transform: translateY(-1px); }
.chip.is-on { background: var(--brand); border-color: transparent; color: var(--brand-ink); font-weight: 600; }
.chip__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--brand); flex: none; }
.chip.is-on .chip__dot { background: currentColor; opacity: .8; }
.chips--tags .chip { font-size: 12px; padding: 4px 9px; }
.chips--tags .chip::before { content: "#"; opacity: .5; }

.sidebar__foot {
  margin-top: 18px; padding: 12px 8px 4px; border-top: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
}
.presence { display: flex; }
.presence .avatar { margin-right: -8px; box-shadow: 0 0 0 2px var(--surface); }
.presence .avatar:last-child { margin-right: 0; }
.presence__label { font-size: 12px; color: var(--text-3); line-height: 1.3; }

.sidebar-scrim, .drawer-scrim {
  position: fixed; inset: 0; background: rgba(8, 11, 20, .45);
  backdrop-filter: blur(2px); z-index: 25;
  opacity: 0; pointer-events: none; transition: opacity .24s var(--ease);
}
.sidebar-scrim.is-on, .drawer-scrim.is-on { opacity: 1; pointer-events: auto; }
.drawer-scrim { z-index: 40; }

/* ── Main ───────────────────────────────────────────────────── */
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; overflow: hidden; }

.topbar {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 22px; flex: none;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 66%, transparent);
  backdrop-filter: blur(14px);
  z-index: 10;
}
.topbar__burger { display: none; }
.topbar__actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }

.search { position: relative; flex: 1; max-width: 560px; }
.search input {
  width: 100%; padding: 10px 66px 10px 38px;
  border: 1px solid var(--border-strong); border-radius: 99px;
  background: var(--surface); color: var(--text);
  transition: border-color .16s var(--ease), box-shadow .16s var(--ease);
}
.search input::-webkit-search-cancel-button { display: none; }
.search__ico {
  position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
  pointer-events: none; color: var(--text-3);
}
.search__kbd {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  font-family: var(--font); font-size: 11px; font-weight: 600; color: var(--text-3);
  background: var(--surface-3); border: 1px solid var(--border);
  padding: 2px 7px; border-radius: 5px; pointer-events: none;
}

.select { position: relative; display: inline-flex; }
.select select {
  appearance: none; padding: 8px 30px 8px 12px;
  border: 1px solid var(--border-strong); border-radius: var(--r-sm);
  background: var(--surface); font-size: 13.5px; color: var(--text-2); cursor: pointer;
}
.select::after {
  content: "▾"; position: absolute; right: 11px; top: 50%; transform: translateY(-50%);
  pointer-events: none; color: var(--text-3); font-size: 11px;
}

.toolbar {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 24px 6px; flex: none;
}
.toolbar__info { display: flex; align-items: baseline; gap: 8px; font-size: 13.5px; }
.toolbar__info strong { font-size: 14px; font-weight: 650; }
.toolbar__info .muted { font-size: 13px; }
.toolbar .btn { margin-left: auto; }

/* ── Grille de cartes ───────────────────────────────────────── */
.grid {
  flex: 1; overflow-y: auto; overscroll-behavior: contain;
  padding: 12px 24px 40px;
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  align-content: start;
}

.card {
  position: relative;
  display: flex; flex-direction: column; gap: 10px;
  padding: 16px 16px 13px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); box-shadow: var(--shadow-sm);
  cursor: pointer; text-align: left;
  transition: transform .18s var(--ease), box-shadow .18s var(--ease), border-color .18s var(--ease);
  animation: card-in .34s var(--ease) both;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.card.is-active { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 16%, transparent); }
.card.is-flash { animation: flash .9s var(--ease); }

@keyframes card-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes flash {
  0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 60%, transparent); border-color: var(--ok); }
  100% { box-shadow: var(--shadow-sm); }
}

.card__top { display: flex; align-items: center; gap: 8px; }
.card__cat {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; font-weight: 650; color: var(--text-2);
  background: var(--surface-3); padding: 3px 9px; border-radius: 99px;
}
.card__cat i { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.card__channel { font-size: 11.5px; color: var(--text-3); font-weight: 500; }
.card__fav {
  margin-left: auto; width: 28px; height: 28px; border-radius: 50%;
  border: none; background: transparent; cursor: pointer;
  color: var(--text-3); font-size: 15px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
  transition: transform .16s var(--ease), color .16s var(--ease), background .16s var(--ease);
}
.card__fav:hover { background: var(--surface-3); transform: scale(1.12); }
.card__fav.is-on { color: var(--warn); }

.card__title { font-size: 15.5px; font-weight: 640; letter-spacing: -.01em; }
.card__summary {
  font-size: 13.5px; color: var(--text-2); line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card__tags { display: flex; flex-wrap: wrap; gap: 4px; }
.tag {
  font-size: 11px; color: var(--text-3); background: var(--surface-2);
  border: 1px solid var(--border); padding: 2px 7px; border-radius: 5px;
}
.tag--lang { text-transform: uppercase; font-weight: 700; letter-spacing: .04em; }

.card__foot {
  display: flex; align-items: center; gap: 10px;
  margin-top: auto; padding-top: 10px; border-top: 1px solid var(--border);
  font-size: 12px; color: var(--text-3);
}
.card__stat { display: inline-flex; align-items: center; gap: 4px; }
.card__author { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; }

.card__editing {
  position: absolute; top: -9px; right: 12px;
  font-size: 10.5px; font-weight: 650; color: #fff;
  padding: 2px 9px; border-radius: 99px;
  display: flex; align-items: center; gap: 5px;
  box-shadow: var(--shadow-sm); animation: pop .2s var(--ease);
}
.card__editing::before {
  content: ""; width: 5px; height: 5px; border-radius: 50%; background: #fff;
  animation: blink 1.1s ease-in-out infinite;
}
@keyframes blink { 50% { opacity: .25; } }
@keyframes pop { from { transform: scale(.8); opacity: 0; } }

/* ── État vide ──────────────────────────────────────────────── */
.empty {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; text-align: center; padding: 40px 24px 90px;
  animation: card-in .3s var(--ease) both;
}
.empty__ico { color: var(--text-3); opacity: .7; margin-bottom: 4px; line-height: 0; }
.empty p { max-width: 380px; margin: 0 0 10px; font-size: 14px; }

/* ============================================================
   Panneau détail
   ============================================================ */

.drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: min(var(--drawer-w), 100vw);
  background: var(--surface); border-left: 1px solid var(--border);
  box-shadow: var(--shadow-lg); z-index: 45;
  transform: translateX(102%); transition: transform .32s var(--ease);
  display: flex; flex-direction: column;
}
.drawer.is-open { transform: none; }
.drawer__inner { display: flex; flex-direction: column; height: 100%; overflow: hidden; }

.dt__head {
  padding: 18px 22px 14px; border-bottom: 1px solid var(--border); flex: none;
  background: var(--surface-2);
}
.dt__head-top { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.dt__title { font-size: 20px; font-weight: 680; letter-spacing: -.02em; margin-bottom: 6px; }
.dt__summary { font-size: 13.5px; color: var(--text-2); }
.dt__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 12px; font-size: 12px; color: var(--text-3); }
.dt__meta b { color: var(--text-2); font-weight: 600; }

.dt__body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 18px 22px 28px; }

.dt__section + .dt__section { margin-top: 24px; }
.dt__section-title {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .09em;
  color: var(--text-3); margin-bottom: 10px;
  display: flex; align-items: center; gap: 8px;
}
.dt__section-title::after { content: ""; flex: 1; height: 1px; background: var(--border); }

.vars { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.vars .field > span { font-family: var(--mono); font-size: 11.5px; color: var(--brand); }
.vars input { padding: 8px 10px; font-size: 13.5px; }

.preview {
  white-space: pre-wrap; word-break: break-word;
  font-family: var(--mono); font-size: 13px; line-height: 1.7;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 16px 18px;
  max-height: 46vh; overflow-y: auto;
}
.preview mark {
  background: color-mix(in srgb, var(--brand) 16%, transparent);
  color: var(--brand); font-weight: 600;
  padding: 1px 4px; border-radius: 4px; border: 1px dashed color-mix(in srgb, var(--brand) 40%, transparent);
}
.preview mark.is-filled {
  background: color-mix(in srgb, var(--ok) 16%, transparent);
  color: var(--ok); border-style: solid; border-color: color-mix(in srgb, var(--ok) 40%, transparent);
}

.dt__foot {
  flex: none; padding: 14px 22px; border-top: 1px solid var(--border);
  background: var(--surface-2);
  display: flex; align-items: center; gap: 8px;
}

.comments { display: flex; flex-direction: column; gap: 12px; }
.comment { display: flex; gap: 10px; animation: card-in .26s var(--ease) both; }
.comment__body { flex: 1; min-width: 0; }
.comment__head { display: flex; align-items: baseline; gap: 8px; font-size: 12.5px; }
.comment__head b { font-weight: 640; }
.comment__text {
  font-size: 13.5px; color: var(--text-2); margin-top: 2px;
  background: var(--surface-2); border: 1px solid var(--border);
  padding: 8px 12px; border-radius: 4px 12px 12px 12px;
  white-space: pre-wrap; word-break: break-word;
}
.comment-form { display: flex; gap: 8px; margin-top: 14px; }
.comment-form input {
  flex: 1; padding: 9px 12px; border-radius: 99px;
  border: 1px solid var(--border-strong); background: var(--surface);
}
.comment-form input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }

.like-btn { display: inline-flex; align-items: center; gap: 6px; }
.like-btn.is-on { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, transparent); background: var(--danger-soft); }

/* ============================================================
   Modale éditeur
   ============================================================ */

.modal {
  position: fixed; inset: 0; z-index: 60;
  display: flex; align-items: center; justify-content: center; padding: 24px;
  background: rgba(8, 11, 20, .5); backdrop-filter: blur(3px);
  opacity: 0; pointer-events: none; transition: opacity .22s var(--ease);
}
.modal.is-open { opacity: 1; pointer-events: auto; }
.modal__card {
  width: min(860px, 100%); max-height: 92vh;
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-xl); box-shadow: var(--shadow-lg);
  transform: translateY(14px) scale(.985); transition: transform .26s var(--ease);
}
.modal.is-open .modal__card { transform: none; }
.modal__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px; border-bottom: 1px solid var(--border); flex: none;
}
.modal__head h2 { font-size: 17px; font-weight: 660; }
.modal__body { padding: 20px 22px; overflow-y: auto; display: flex; flex-direction: column; gap: 16px; }
.modal__foot {
  display: flex; align-items: center; gap: 8px;
  padding: 14px 22px; border-top: 1px solid var(--border); flex: none;
  background: var(--surface-2); border-radius: 0 0 var(--r-xl) var(--r-xl);
}

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field--full { grid-column: 1 / -1; }

.var-bar { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 2px; }
.var-bar button {
  font-family: var(--mono); font-size: 11.5px;
  padding: 3px 8px; border-radius: 5px; cursor: pointer;
  border: 1px dashed var(--border-strong); background: var(--surface-2); color: var(--text-2);
  transition: all .14s var(--ease);
}
.var-bar button:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); border-style: solid; }

/* ============================================================
   Onboarding
   ============================================================ */

.onboarding {
  position: fixed; inset: 0; z-index: 80;
  display: flex; align-items: center; justify-content: center; padding: 24px;
  background: var(--bg); background-image: var(--bg-grad);
}
.onboarding__card {
  width: min(430px, 100%); padding: 32px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-xl); box-shadow: var(--shadow-lg);
  animation: card-in .4s var(--ease) both;
}
.onboarding h1 { font-size: 22px; font-weight: 680; margin-bottom: 8px; }
.onboarding p { margin: 0 0 22px; font-size: 14px; }
.onboarding form { display: flex; flex-direction: column; gap: 14px; }

/* ============================================================
   Toasts
   ============================================================ */

.toasts {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  z-index: 90; display: flex; flex-direction: column; gap: 8px; align-items: center;
  pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 9px;
  padding: 10px 16px; border-radius: 99px;
  background: var(--text); color: var(--bg);
  font-size: 13.5px; font-weight: 500; box-shadow: var(--shadow-lg);
  animation: toast-in .28s var(--ease) both;
  max-width: 90vw;
}
.toast.is-out { animation: toast-out .24s var(--ease) forwards; }
.toast__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); flex: none; }
.toast--info .toast__dot { background: var(--brand); }
.toast--warn .toast__dot { background: var(--warn); }
@keyframes toast-in { from { opacity: 0; transform: translateY(14px) scale(.96); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(8px) scale(.97); } }

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 1080px) {
  :root { --drawer-w: 520px; }
}

@media (max-width: 860px) {
  .sidebar {
    position: fixed; top: 0; bottom: 0; left: 0;
    transform: translateX(-102%); transition: transform .3s var(--ease);
    background: var(--surface);
  }
  .sidebar.is-open { transform: none; }
  .sidebar__close { display: inline-flex; }
  .topbar__burger { display: inline-flex; }
  .topbar { padding: 12px 14px; }
  .search__kbd { display: none; }
  .toolbar { padding: 14px 16px 4px; }
  .grid { padding: 10px 16px 40px; grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .modal { padding: 0; }
  .modal__card { max-height: 100vh; height: 100%; border-radius: 0; border: none; }
  .modal__foot { border-radius: 0; }
  .drawer { width: 100vw; border-left: none; }
  #sort { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ============================================================
   Connexion, compte et administration
   ============================================================ */

.form-error {
  margin: 0; padding: 9px 12px; border-radius: var(--r-sm);
  background: var(--danger-soft); color: var(--danger);
  font-size: 13px; font-weight: 500;
  border: 1px solid color-mix(in srgb, var(--danger) 30%, transparent);
  animation: card-in .22s var(--ease) both;
}

.login-foot { margin: 18px 0 0; font-size: 12px; text-align: center; line-height: 1.5; }

.modal__card--sm { width: min(480px, 100%); }
.stack { display: flex; flex-direction: column; gap: 14px; }
.modal__body > section + section { margin-top: 24px; }

.account__id {
  display: flex; align-items: center; gap: 12px;
  padding: 14px; border-radius: var(--r-md);
  background: var(--surface-2); border: 1px solid var(--border);
  margin-bottom: 22px;
}
.account__id .avatar { width: 42px; height: 42px; font-size: 15px; }
.account__id-text { min-width: 0; }
.account__id-text b { display: block; font-size: 15px; font-weight: 650; }
.account__id-text > span { font-size: 12.5px; color: var(--text-3); }

.role-pill {
  display: inline-block; font-size: 10.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em;
  padding: 2px 8px; border-radius: 99px; margin-left: 6px;
  background: var(--brand-soft); color: var(--brand);
}
.role-pill--agent { background: var(--surface-3); color: var(--text-3); }

.secpanel {
  display: grid; gap: 10px; padding: 14px;
  border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--border);
  font-size: 13px;
}
.secpanel__row { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.secpanel__row > b { font-weight: 600; color: var(--text-2); min-width: 130px; font-size: 12.5px; }
.secpanel code {
  font-family: var(--mono); font-size: 12px;
  background: var(--surface-3); padding: 2px 7px; border-radius: 5px; color: var(--brand);
}
.secpanel__hint { font-size: 12px; color: var(--text-3); line-height: 1.5; margin: 0; }

.userlist { display: flex; flex-direction: column; gap: 6px; }
.user-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--r-md);
  background: var(--surface-2); border: 1px solid var(--border);
}
.user-row.is-off { opacity: .55; }
.user-row__id { min-width: 0; flex: 1; }
.user-row__id b { font-size: 14px; font-weight: 620; }
.user-row__id > span { display: block; font-size: 12px; color: var(--text-3); }
.user-row__actions { display: flex; gap: 4px; flex: none; }
.user-row__actions .icon-btn { width: 30px; height: 30px; font-size: 13px; }

/* ============================================================
   Icônes Lucide (voir icons.js)
   ============================================================ */

.ico { flex: none; display: block; }

/* Les icônes sont tracées par défaut. `fill: currentColor` l'emporte sur
   l'attribut fill="none" du SVG, ce qui donne la version pleine des états
   actifs — favori posé, vote « utile » exprimé. */
.card__fav.is-on .ico,
.icon-btn.is-fav .ico,
.like-btn.is-on .ico { fill: currentColor; }

.icon-btn.is-fav { color: var(--warn); }

/* Dans une ligne de texte (statistiques de carte, boutons), l'icône se cale
   sur la ligne de base plutôt que sur le haut de la boîte. */
.card__stat .ico { opacity: .85; }
.btn .ico, .comment-form .ico { margin-right: -1px; }
