:root {
  color-scheme: dark;
  --fond: #090d14;
  --fond-2: #0d131d;
  --surface: #121a26;
  --surface-2: #172231;
  --surface-3: #1c2939;
  --texte: #f4f7fb;
  --texte-2: #c7d0dc;
  --muet: #8290a3;
  --trait: #29384a;
  --trait-fort: #3b4d62;
  --accent: #ff5a5f;
  --accent-2: #ff7c72;
  --accent-doux: #351d24;
  --sur-accent: #16080a;
  --puce: var(--accent);
  --degrade-marque: linear-gradient(135deg, #ff5a5f, #4d8dff);
  --sur-marque: #ffffff;
  --tabbar-base: #131c28;
  --ok: #37d39a;
  --ok-doux: #123127;
  --warn: #ffb43d;
  --warn-doux: #362a13;
  --danger: #ff6b78;
  --danger-doux: #381820;
  --rayon: 18px;
  --rayon-petit: 12px;
  --sidebar: 238px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.zone-actus {
  --accent: #ff5a5f;
  --accent-2: #ff8075;
  --accent-doux: #351d24;
  --sur-accent: #16080a;
  --puce: var(--accent);
}
.zone-autour {
  --accent: #5e9cff;
  --accent-2: #83b5ff;
  --accent-doux: #172943;
  --sur-accent: #071120;
  --puce: var(--accent);
}
.zone-sources {
  --accent: #ffb43d;
  --accent-2: #ffd076;
  --accent-doux: #362a13;
  --sur-accent: #1a1002;
  --puce: var(--accent);
}
.zone-activite {
  --accent: #41cdb5;
  --accent-2: #75e4d0;
  --accent-doux: #12332f;
  --sur-accent: #031815;
  --puce: var(--accent);
}
.zone-admin {
  --accent: #d49cff;
  --accent-2: #e1baff;
  --accent-doux: #2d2039;
  --sur-accent: #16091e;
  --puce: var(--accent);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--fond); }
body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 80% -20%, color-mix(in srgb, var(--accent) 9%, transparent), transparent 34rem),
    var(--fond);
  color: var(--texte);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
img, svg { display: block; }
.lucide { width: 1.12em; height: 1.12em; flex: 0 0 auto; }
.muted { color: var(--muet); }

.layout { min-height: 100vh; }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 20;
  display: flex;
  width: var(--sidebar);
  flex-direction: column;
  gap: 6px;
  padding: 24px 16px;
  border-right: 1px solid var(--trait);
  background: #0b1018;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 54px;
  margin: 0 4px 22px;
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -.02em;
}
.brand-ico {
  display: inline-grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 12px;
  background: var(--degrade-marque);
  color: var(--sur-marque);
}
.brand-ico svg { width: 25px; height: 25px; }
.sidebar > a {
  display: flex;
  min-height: 47px;
  align-items: center;
  gap: 12px;
  padding: 0 13px;
  border: 1px solid transparent;
  border-radius: 13px;
  color: var(--texte-2);
  font-weight: 660;
}
.sidebar > a:hover { border-color: var(--trait); background: var(--surface); color: var(--texte); }
.sidebar > a.active { border-color: color-mix(in srgb, var(--accent) 45%, var(--trait)); background: var(--accent-doux); color: var(--accent-2); }
.sidebar .ico { display: grid; width: 22px; place-items: center; }
.logout-form { margin-top: auto; }
.logout-form button {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--trait);
  border-radius: 12px;
  background: transparent;
  color: var(--muet);
}
.logout-form button:hover { color: var(--texte); border-color: var(--trait-fort); }

.topbar, .tabbar { display: none; }
.content {
  width: min(1160px, calc(100% - var(--sidebar)));
  min-height: 100vh;
  margin-left: var(--sidebar);
  padding: 42px clamp(28px, 5vw, 72px) 90px;
}

h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(2rem, 5vw, 3.3rem); line-height: 1.06; letter-spacing: -.045em; }
h2 { margin-bottom: 14px; font-size: 1.18rem; letter-spacing: -.018em; }
h3 { margin-bottom: 7px; font-size: 1.05rem; }
.eyebrow { margin: 0 0 6px; color: var(--accent-2); font-size: .75rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.head-actions, .action-bar, .carte-actions, .inline-end { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.inline-end { justify-content: flex-end; margin-top: 24px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 38px 0 15px; }
.section-head h2 { margin: 0; }
.back { display: inline-flex; align-items: center; gap: 7px; margin-bottom: 22px; color: var(--muet); font-weight: 700; }
.back:hover { color: var(--accent-2); }

.notice {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  margin-bottom: 25px;
  padding: 15px 17px;
  border: 1px solid color-mix(in srgb, var(--accent) 36%, var(--trait));
  border-radius: var(--rayon-petit);
  background: color-mix(in srgb, var(--accent-doux) 65%, var(--surface));
  color: var(--texte-2);
}
.notice p { margin: 0; }
.notice-ico { display: grid; margin-top: 2px; color: var(--accent-2); }
.flash, .alerte {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 18px;
  padding: 13px 15px;
  border: 1px solid var(--trait-fort);
  border-radius: var(--rayon-petit);
  background: var(--surface);
}
.flash.ok { border-color: color-mix(in srgb, var(--ok) 45%, var(--trait)); color: var(--ok); }
.flash.err, .alerte { border-color: color-mix(in srgb, var(--danger) 45%, var(--trait)); background: var(--danger-doux); color: #ffb3bb; }

.btn, button.btn {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 15px;
  border: 1px solid transparent;
  border-radius: 12px;
  font-weight: 760;
  line-height: 1.2;
}
.btn.primaire { background: var(--accent); color: var(--sur-accent); }
.btn.primaire:hover { background: var(--accent-2); }
.btn.secondaire { border-color: color-mix(in srgb, var(--accent) 45%, var(--trait)); background: var(--accent-doux); color: var(--accent-2); }
.btn.secondaire:hover { border-color: var(--accent); }
.btn.fantome { border-color: var(--trait); background: transparent; color: var(--texte-2); }
.btn.fantome:hover { border-color: var(--trait-fort); color: var(--texte); }
.btn.danger { border-color: color-mix(in srgb, var(--danger) 55%, var(--trait)); background: var(--danger-doux); color: #ffadb7; }
.icon-btn {
  display: inline-grid;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--trait);
  border-radius: 12px;
  background: transparent;
  color: var(--muet);
}
.icon-btn:hover, .icon-btn.active { border-color: var(--accent); background: var(--accent-doux); color: var(--accent-2); }
.danger-text { color: var(--danger); }

.stats-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 20px 0 25px;
}
.stats-row > a, .stats-row > span {
  display: flex;
  min-height: 78px;
  flex-direction: column;
  justify-content: center;
  padding: 13px 16px;
  border: 1px solid var(--trait);
  border-radius: 14px;
  background: var(--surface);
}
.stats-row > a:hover { border-color: var(--accent); }
.stats-row strong { color: var(--texte); font-size: 1.45rem; line-height: 1.1; }
.stats-row span span, .stats-row small { color: var(--muet); font-size: .82rem; }

.tabs { display: flex; gap: 7px; margin: 18px 0; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { flex: 0 0 auto; padding: 9px 13px; border: 1px solid var(--trait); border-radius: 999px; color: var(--muet); font-size: .88rem; font-weight: 720; }
.tabs a:hover { color: var(--texte); }
.tabs a.active { border-color: var(--accent); background: var(--accent-doux); color: var(--accent-2); }

.filters {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto auto auto;
  gap: 9px;
  margin-bottom: 22px;
}
.search-wrap { position: relative; }
.search-wrap > .lucide { position: absolute; top: 50%; left: 13px; z-index: 1; color: var(--muet); transform: translateY(-50%); }
.search-wrap input { width: 100%; padding-left: 40px; padding-right: 46px; }
.micro { position: absolute; inset: 4px 4px 4px auto; display: grid; width: 38px; place-items: center; border: 0; border-radius: 9px; background: transparent; color: var(--muet); }
.micro.ecoute { background: var(--danger-doux); color: var(--danger); outline: 1px solid var(--danger); }

input, select, textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--trait);
  border-radius: 11px;
  outline: 0;
  background: #0d141e;
  color: var(--texte);
}
input, select { padding: 9px 12px; }
textarea { min-height: 100px; padding: 12px 13px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: 2px solid color-mix(in srgb, var(--accent) 20%, transparent); }
input[type="color"] { width: 58px; padding: 4px; }
label { display: grid; gap: 7px; color: var(--texte-2); font-size: .9rem; font-weight: 680; }
label small { color: var(--muet); font-weight: 450; }
label.check { display: flex; min-height: 44px; align-items: center; gap: 9px; align-self: end; }
label.check input { width: 19px; min-height: 19px; accent-color: var(--accent); }

.form-card, .panel {
  margin-bottom: 24px;
  padding: clamp(18px, 4vw, 27px);
  border: 1px solid var(--trait);
  border-radius: var(--rayon);
  background: var(--surface);
}
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px; margin-bottom: 20px; }
.form-grid .full { grid-column: 1 / -1; }
.compact-form { display: flex; align-items: end; gap: 12px; }
.compact-form label:first-of-type { flex: 1; }
.highlight { border-color: color-mix(in srgb, var(--accent) 45%, var(--trait)); background: color-mix(in srgb, var(--accent-doux) 45%, var(--surface)); }
.error-panel { border-color: color-mix(in srgb, var(--danger) 50%, var(--trait)); }
.danger-zone { display: flex; align-items: end; justify-content: flex-end; gap: 12px; margin-top: 38px; padding-top: 20px; border-top: 1px solid var(--trait); }
.danger-zone input[type="number"] { width: 110px; }

.cards-list { display: grid; gap: 13px; }
.carte {
  position: relative;
  display: flex;
  gap: 16px;
  padding: 20px;
  overflow: hidden;
  border: 1px solid var(--trait);
  border-radius: var(--rayon);
  background: var(--surface);
}
.carte::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--puce); }
.carte:hover { border-color: color-mix(in srgb, var(--puce) 52%, var(--trait)); }
.carte.is-new { background: color-mix(in srgb, var(--accent-doux) 35%, var(--surface)); }
.carte-main { min-width: 0; flex: 1; }
.actu-visuel { width: clamp(170px, 24vw, 245px); aspect-ratio: 16 / 9; flex: 0 0 auto; align-self: flex-start; overflow: hidden; border: 1px solid var(--trait); border-radius: 14px; background: var(--fond-2); }
.actu-visuel img, .article-hero img { width: 100%; height: 100%; object-fit: cover; }
.actu-visuel:hover { border-color: color-mix(in srgb, var(--puce) 55%, var(--trait)); }
.carte h2 { margin: 6px 0 9px; font-size: clamp(1.05rem, 2vw, 1.25rem); line-height: 1.3; }
.carte h2 a:hover { color: var(--accent-2); }
.meta-line { display: flex; align-items: center; flex-wrap: wrap; gap: 7px 10px; color: var(--muet); font-size: .78rem; }
.puce { display: inline-flex; align-items: center; gap: 5px; color: var(--puce); font-weight: 800; }
.resume { margin-bottom: 12px; color: var(--texte-2); }
.points { margin: 11px 0 15px; padding: 0; list-style: none; }
.points li { position: relative; margin: 6px 0; padding-left: 19px; color: var(--texte-2); }
.points li::before { content: ""; position: absolute; top: .62em; left: 2px; width: 6px; height: 6px; border-radius: 50%; background: var(--puce); }
.points.large li { margin: 11px 0; color: var(--texte); font-size: 1rem; }
.lien-offre { display: flex; align-items: flex-start; gap: 8px; color: var(--accent-2); font-size: .91rem; }
.carte-actions { margin-top: 15px; }
.carte-actions form { display: flex; }
.pourquoi { padding: 10px 12px; border-left: 2px solid var(--puce); background: color-mix(in srgb, var(--puce) 7%, transparent); color: var(--texte-2); font-size: .9rem; }
.details-inline { display: flex; flex-wrap: wrap; gap: 8px 15px; color: var(--muet); font-size: .84rem; }
.details-inline span { display: inline-flex; align-items: center; gap: 5px; }
.date-puce { display: grid; width: 57px; height: 62px; flex: 0 0 auto; place-content: center; border: 1px solid color-mix(in srgb, var(--puce) 50%, var(--trait)); border-radius: 14px; background: color-mix(in srgb, var(--puce) 10%, var(--fond)); text-align: center; }
.date-puce strong { color: var(--texte); font-size: 1.45rem; line-height: 1; }
.date-puce span { margin-top: 4px; color: var(--puce); font-size: .69rem; font-weight: 800; }

.badge { display: inline-flex; align-items: center; width: max-content; padding: 3px 8px; border: 1px solid var(--trait); border-radius: 999px; color: var(--texte-2); font-size: .71rem; font-weight: 780; white-space: nowrap; }
.badge.ok { border-color: color-mix(in srgb, var(--ok) 48%, var(--trait)); background: var(--ok-doux); color: #82ebc1; }
.badge.warn { border-color: color-mix(in srgb, var(--warn) 48%, var(--trait)); background: var(--warn-doux); color: #ffd080; }
.badge.err { border-color: color-mix(in srgb, var(--danger) 48%, var(--trait)); background: var(--danger-doux); color: #ffadb7; }
.badge.gris { color: var(--muet); }

.detail-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 9px 15px; margin: 0 0 18px; color: var(--muet); }
.article-hero { width: 100%; max-height: 520px; aspect-ratio: 16 / 8; margin: 0 0 20px; overflow: hidden; border: 1px solid var(--trait); border-radius: var(--rayon); background: var(--fond-2); }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.article-text { max-width: 76ch; color: var(--texte-2); font-size: 1.02rem; }
.article-text p { margin-bottom: 1.1em; }
.callout { margin-top: 19px; padding: 14px 16px; border-left: 3px solid var(--accent); background: var(--accent-doux); }
.callout p { margin: 6px 0 0; color: var(--texte-2); }
.facts { margin: 0; }
.facts > div { display: grid; grid-template-columns: minmax(105px, .45fr) 1fr; gap: 15px; padding: 11px 0; border-bottom: 1px solid var(--trait); }
.facts > div:last-child { border-bottom: 0; }
.facts dt { display: flex; align-items: center; gap: 7px; color: var(--muet); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.facts a { display: inline-flex; align-items: center; gap: 5px; color: var(--accent-2); }

.mini-list { display: grid; gap: 8px; }
.mini-list > a { display: flex; min-height: 57px; align-items: center; justify-content: space-between; gap: 15px; padding: 11px 13px; border: 1px solid var(--trait); border-radius: 12px; background: var(--surface); }
.mini-list > a:hover { border-color: var(--accent); }
.mini-list > a > span { display: grid; min-width: 0; }
.mini-list strong { overflow: hidden; text-overflow: ellipsis; }
.mini-list small { color: var(--muet); }
.empty { display: grid; min-height: 210px; place-items: center; align-content: center; padding: 25px; border: 1px dashed var(--trait-fort); border-radius: var(--rayon); color: var(--muet); text-align: center; }
.empty > .lucide { width: 34px; height: 34px; margin-bottom: 10px; color: var(--accent); }
.empty h2 { margin-bottom: 5px; color: var(--texte); }
.empty p { margin: 0; }
.empty.compact { min-height: 130px; }

.progress-card { display: none; margin: 0 0 20px; padding: 15px 17px; border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--trait)); border-radius: 14px; background: var(--accent-doux); }
.progress-card.visible { display: block; }
.progress-top { display: flex; justify-content: space-between; gap: 15px; }
.progress-track { height: 7px; margin: 11px 0 8px; overflow: hidden; border-radius: 999px; background: var(--fond); }
.progress-track span { display: block; width: 12%; height: 100%; border-radius: inherit; background: var(--accent); transition: width .25s ease; }
.progress-card p { margin: 0; color: var(--muet); font-size: .84rem; }

.actions-grid { display: grid; gap: 12px; margin: 18px 0 26px; }
.actions-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.action-tile { display: flex; width: 100%; min-height: 78px; align-items: center; gap: 13px; padding: 15px; border: 1px solid var(--trait); border-radius: 15px; background: var(--surface); color: var(--texte); text-align: left; }
.action-tile:hover { border-color: var(--accent); }
.action-tile > .lucide { width: 25px; height: 25px; color: var(--accent); }
.action-tile span { display: grid; }
.action-tile small { color: var(--muet); font-weight: 450; }

.table-list { display: grid; gap: 9px; }
.source-row, .subject-row { display: flex; align-items: center; gap: 13px; padding: 15px; border: 1px solid var(--trait); border-radius: 14px; background: var(--surface); }
.source-row { border-left: 3px solid var(--puce); }
.source-icon { display: grid; width: 43px; height: 43px; flex: 0 0 auto; place-items: center; border-radius: 12px; background: color-mix(in srgb, var(--puce) 12%, var(--fond)); color: var(--puce); }
.source-main { min-width: 0; flex: 1; }
.source-main h2 { margin: 4px 0 2px; }
.source-main p { margin: 0; }
.source-message { color: var(--danger); font-size: .82rem; }
.row-actions { display: flex; gap: 7px; }
.muted-row { opacity: .58; }
.subject-row form:first-child { display: grid; grid-template-columns: auto minmax(160px, 1fr) auto auto auto; align-items: center; gap: 10px; flex: 1; }
.color-dot { width: 11px; height: 11px; border-radius: 50%; background: var(--puce); }

/* Sources, thèmes et médias fiables. Les deux pages partagent la même zone
   ambre et restent des réglages passifs de l'unique recherche manuelle. */
.section-head.compact { margin: 0 0 17px; }
.source-tabs { margin-top: 0; }
.source-add-panel { margin-top: 22px; }
.source-quick-form { margin-bottom: 0; }
.source-submit { margin-top: 0; }
.source-managed { align-items: flex-start; }
.source-managed .row-actions { align-self: center; }
.source-assign { display: grid; grid-template-columns: repeat(2, minmax(130px, 1fr)); gap: 8px; margin-top: 11px; }
.source-assign select { min-height: 38px; padding-block: 6px; color: var(--texte-2); font-size: .82rem; }

.themes-panel { margin-top: 38px; scroll-margin-top: 20px; }
.theme-list { display: grid; gap: 11px; }
.theme-card { padding: 14px; border: 1px solid var(--trait); border-left: 3px solid var(--puce); border-radius: 14px; background: var(--surface-2); }
.theme-top { display: flex; align-items: center; gap: 10px; }
.theme-edit { display: grid; grid-template-columns: auto minmax(170px, 1fr) auto auto; align-items: center; gap: 9px; min-width: 0; flex: 1; }
.theme-edit input[type="color"] { width: 45px; min-height: 40px; }
.theme-edit input[name="nom"] { min-height: 40px; font-weight: 760; }
.theme-edit .icon-btn, .theme-top > form .icon-btn { width: 40px; height: 40px; }
.category-list { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.category-chip { display: inline-flex; min-height: 34px; align-items: center; gap: 5px; padding: 4px 5px 4px 11px; border: 1px solid var(--trait); border-radius: 999px; background: var(--fond-2); color: var(--texte-2); font-size: .8rem; font-weight: 700; }
.category-chip form { display: inline-flex; }
.category-chip button { display: grid; width: 27px; height: 27px; padding: 0; place-items: center; border: 0; border-radius: 50%; background: transparent; color: var(--muet); }
.category-chip button:hover { background: var(--danger-doux); color: var(--danger); }
.category-chip .lucide { width: 14px; height: 14px; }
.category-add { display: flex; align-items: center; gap: 6px; min-width: min(270px, 100%); }
.category-add input { min-height: 36px; }
.category-add .icon-btn { width: 36px; height: 36px; }
.theme-add { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--trait); }

.tag-fieldset { margin: 0; padding: 0; border: 0; }
.tag-fieldset legend { margin-bottom: 8px; color: var(--texte-2); font-size: .9rem; font-weight: 680; }
.tag-choices { display: flex; flex-wrap: wrap; gap: 7px; }
.tag-choices label { display: inline-flex; min-height: 38px; align-items: center; gap: 7px; padding: 6px 11px; border: 1px solid var(--trait); border-radius: 999px; background: var(--fond-2); cursor: pointer; }
.tag-choices label:has(input:checked) { border-color: var(--accent); background: var(--accent-doux); color: var(--accent-2); }
.tag-choices input { width: 17px; min-height: 17px; accent-color: var(--accent); }
.trusted-hint { margin: -5px 0 0; font-size: .82rem; }
.trusted-import-panel { display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, .8fr); align-items: end; gap: 22px; }
.trusted-import-panel h2 { margin-bottom: 7px; }
.trusted-import-panel p { margin-bottom: 0; }
.trusted-import-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.trusted-import-form .btn { grid-column: 1 / -1; }
.trusted-list-head { align-items: end; }
.trusted-search { width: min(390px, 100%); }
.trusted-search input { padding-left: 40px; }
.trusted-tags button { flex: 0 0 auto; min-height: 38px; padding: 8px 12px; border: 1px solid var(--trait); border-radius: 999px; background: transparent; color: var(--muet); font-size: .84rem; font-weight: 720; }
.trusted-tags button:hover { color: var(--texte); }
.trusted-tags button.active { border-color: var(--accent); background: var(--accent-doux); color: var(--accent-2); }
.trusted-tags button span { color: var(--muet); font-size: .72rem; }
.trusted-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px; }
.trusted-card { display: flex; min-width: 0; min-height: 155px; flex-direction: column; justify-content: space-between; gap: 15px; padding: 16px; border: 1px solid var(--trait); border-radius: 15px; background: var(--surface); }
.trusted-card:hover { border-color: var(--trait-fort); }
.trusted-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.trusted-card-top > div { min-width: 0; }
.trusted-card h2 { margin: 0 0 5px; overflow-wrap: anywhere; }
.trusted-card a { display: inline-flex; max-width: 100%; align-items: center; gap: 5px; overflow: hidden; color: var(--accent-2); font-size: .85rem; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.trusted-card-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.trusted-card[hidden] { display: none; }

.service-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.service-card { display: flex; align-items: flex-start; gap: 13px; padding: 17px; border: 1px solid var(--trait); border-radius: 15px; background: var(--surface); }
.service-card > div { min-width: 0; flex: 1; }
.service-card p { margin-bottom: 0; color: var(--texte-2); }
.service-card .icon-btn { width: 38px; height: 38px; }
.service-ico { display: grid; width: 43px; height: 43px; flex: 0 0 auto; place-items: center; border-radius: 12px; background: var(--accent-doux); color: var(--accent-2); }

.admin-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; margin-bottom: 25px; }
.admin-tile { display: flex; min-height: 105px; align-items: center; gap: 14px; padding: 18px; border: 1px solid var(--trait); border-radius: var(--rayon); background: var(--surface); }
.admin-tile:hover { border-color: var(--accent); }
.admin-tile > span:nth-child(2) { display: grid; min-width: 0; flex: 1; }
.admin-tile small { color: var(--muet); }
.tile-ico { display: grid; width: 48px; height: 48px; place-items: center; border-radius: 14px; background: var(--accent-doux); color: var(--accent-2); }
.tile-ico .lucide { width: 23px; height: 23px; }

.data-table { overflow-x: auto; border: 1px solid var(--trait); border-radius: 14px; }
table { width: 100%; border-collapse: collapse; background: var(--surface); font-size: .86rem; }
th, td { padding: 11px 13px; border-bottom: 1px solid var(--trait); text-align: left; vertical-align: top; }
th { background: var(--surface-2); color: var(--muet); font-size: .73rem; letter-spacing: .06em; text-transform: uppercase; }
tbody tr:last-child td { border-bottom: 0; }

.bars { display: flex; height: 135px; align-items: end; gap: 5px; padding-top: 10px; }
.bars > div { display: flex; height: 100%; min-width: 7px; flex: 1; flex-direction: column; justify-content: end; gap: 5px; }
.bars span { width: 100%; min-height: 4px; border-radius: 4px 4px 1px 1px; background: var(--accent); }
.bars small { color: var(--muet); font-size: .6rem; text-align: center; }

.pagination { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 24px; color: var(--muet); }

.login-page { display: grid; min-height: 100vh; place-items: center; padding: 22px; background: radial-gradient(circle at 50% 0, #202638, transparent 45rem), var(--fond); }
.login-box { width: min(430px, 100%); padding: clamp(23px, 6vw, 36px); border: 1px solid var(--trait); border-radius: 24px; background: var(--surface); }
.login-brand { display: flex; align-items: center; gap: 13px; margin-bottom: 23px; }
.login-brand h1 { font-size: 2.25rem; }
.login-box form { display: grid; gap: 15px; }
.error-box { text-align: center; }
.error-box .login-brand { justify-content: center; }
.error-box .notice { text-align: left; }

@media (max-width: 980px) {
  .filters { grid-template-columns: 1fr 1fr; }
  .filters .search-wrap { grid-column: 1 / -1; }
  .detail-grid { grid-template-columns: 1fr; }
  .service-grid { grid-template-columns: 1fr; }
  .trusted-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .trusted-import-panel { grid-template-columns: 1fr; }
}

@media (max-width: 740px) {
  :root { --rayon: 16px; }
  body { padding-top: env(safe-area-inset-top); }
  .sidebar { display: none; }
  .topbar {
    position: fixed;
    inset: env(safe-area-inset-top) 0 auto;
    z-index: 30;
    display: flex;
    height: 62px;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    border-bottom: 1px solid var(--trait);
    background: #0b1018;
  }
  .topbar .brand-ico { width: 39px; height: 39px; }
  .topbar-title { flex: 1; font-size: 1.05rem; font-weight: 800; }
  .topbar-admin { min-height: 38px; padding: 8px 10px; border-radius: 10px; color: var(--muet); font-size: .85rem; font-weight: 750; }
  .topbar-admin.on { background: var(--accent-doux); color: var(--accent-2); }
  .topbar-bell { position: relative; display: grid; width: 38px; height: 38px; place-items: center; border: 1px solid var(--trait); border-radius: 11px; }
  .notif-dot { position: absolute; top: -6px; right: -5px; display: grid; min-width: 19px; height: 19px; place-items: center; padding: 0 4px; border: 2px solid #0b1018; border-radius: 999px; background: var(--accent); color: var(--sur-accent); font-size: .61rem; font-weight: 900; }
  .content { width: 100%; margin-left: 0; padding: 86px 14px calc(104px + env(safe-area-inset-bottom)); }
  .tabbar {
    position: fixed;
    right: 12px;
    bottom: calc(10px + env(safe-area-inset-bottom));
    left: 12px;
    z-index: 35;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    min-height: 68px;
    padding: 7px;
    border-radius: 26px;
    background: var(--tabbar-base);
  }
  .tab { display: grid; min-width: 0; place-items: center; align-content: center; gap: 3px; border-radius: 19px; color: var(--muet); }
  .tab.on { background: var(--accent-doux); color: var(--accent-2); }
  .t-ico .lucide { width: 21px; height: 21px; }
  .t-lbl { max-width: 100%; overflow: hidden; font-size: .61rem; font-weight: 760; text-overflow: ellipsis; white-space: nowrap; }
  h1 { font-size: 2.15rem; }
  .page-head { align-items: flex-start; flex-direction: column; margin-bottom: 19px; }
  .page-head > form, .page-head > .btn, .head-actions { width: 100%; }
  .page-head > form .btn, .page-head > .btn, .head-actions .btn { flex: 1; }
  .notice { margin-bottom: 18px; }
  .stats-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats-row > a, .stats-row > span { min-height: 68px; }
  .filters { grid-template-columns: 1fr; }
  .filters .search-wrap { grid-column: auto; }
  .filters .btn { width: 100%; }
  input, select, textarea { font-size: 16px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .full { grid-column: auto; }
  .compact-form { align-items: stretch; flex-direction: column; }
  .carte { padding: 16px; }
  .actu-card { flex-direction: column; }
  .actu-visuel { width: 100%; aspect-ratio: 16 / 9; }
  .article-hero { aspect-ratio: 16 / 9; }
  .carte-actions .btn { padding-inline: 12px; }
  .piste-card { align-items: flex-start; }
  .date-puce { width: 50px; height: 57px; }
  .actions-grid.two, .admin-grid { grid-template-columns: 1fr; }
  .source-row { align-items: flex-start; }
  .source-icon { display: none; }
  .row-actions { flex-direction: column; }
  .source-assign { grid-template-columns: 1fr; }
  .theme-top { align-items: flex-start; }
  .theme-edit { grid-template-columns: auto minmax(0, 1fr) auto; }
  .theme-edit .muted { grid-column: 2 / -1; }
  .category-add { width: 100%; }
  .category-add input { min-width: 0; }
  .trusted-import-form { grid-template-columns: 1fr; }
  .trusted-import-form .btn { grid-column: auto; }
  .trusted-list-head { align-items: stretch; }
  .trusted-search { width: 100%; }
  .trusted-grid { grid-template-columns: 1fr; }
  .subject-row { align-items: stretch; }
  .subject-row form:first-child { grid-template-columns: auto 1fr auto; }
  .subject-row form:first-child .muted, .subject-row form:first-child .icon-btn { grid-column: 2 / -1; }
  .service-card { padding: 14px; }
  .service-ico { display: none; }
  .facts > div { grid-template-columns: 1fr; gap: 4px; }
  .action-bar { align-items: stretch; }
  .action-bar form { flex: 1 1 auto; }
  .action-bar .btn { width: 100%; }
  .danger-zone { align-items: stretch; flex-direction: column; }
  .danger-zone label, .danger-zone input[type="number"], .danger-zone .btn { width: 100%; }
  .bars { height: 105px; }
  .bars small { display: none; }
  .pagination { flex-wrap: wrap; }
}

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