/* SuperM — thème sombre, responsive */
:root {
  --bg: #0f1624;
  --surface: #151e2f;
  --raised: #1b2638;
  --line: #26334a;
  --text: #e6eaf2;
  --muted: #93a0b8;
  --accent: #60A5FA;
  --accent-strong: #60A5FA;
  --danger: #f4a0a0;
  --danger-bg: #3a1f27;
  --bar-h: 43px;
  --radius: 6px;
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 var(--font);
}

a { color: var(--accent-strong); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Barre supérieure ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--bar-h);
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0 1rem;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  height: 100%;
  text-decoration: none;
}
.brand img {
  display: block;
  height: 36px;   /* logo 142x80 : la largeur suit (~64px) */
  width: auto;
}

.topbar-menu { display: contents; }

.topbar-inner {
  flex: 1;
  min-width: 0;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: .5rem;
}

.nav ul {
  display: flex;
  height: var(--bar-h);
  margin: 0;
  padding: 0;
  list-style: none;
}
.nav li { display: flex; }
.nav a,
.nav span {
  display: flex;
  align-items: center;
  padding: 0 .9rem;
  color: var(--muted);
  font-size: .9rem;
  text-decoration: none;
  border-bottom: 2px solid transparent;
}
.nav a:hover { color: var(--text); }
.nav a[aria-current="page"] { color: var(--text); border-bottom-color: var(--accent); }
.nav .is-disabled { opacity: .4; cursor: default; }

/* Lien Accueil : icône seule sur desktop */
/* Raccourci Ajout (contact / entreprise) : icône seule sur desktop, légende au survol (attribut title) */
.nav .nav-add svg { flex: none; }
.nav .nav-add:hover { color: var(--accent-strong); }
.nav .nav-add .nav-add-label {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.nav .nav-home svg { flex: none; }
.nav .nav-home .nav-home-label {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Sélecteur de société */
.workspace { flex: none; min-width: 0; margin: 0; }
.workspace-select {
  height: 34px;
  max-width: 12rem;
  padding: 0 1.9rem 0 .7rem;
  color: var(--text);
  font: inherit;
  font-size: .9rem;
  background: var(--raised) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2393a0b8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat right .55rem center / 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}
.workspace-select:hover { border-color: var(--accent); }
.workspace-select option { color: var(--text); background: var(--surface); }

/* Recherche : bouton "?" + barre déployée sur toute la barre du haut */
.search-toggle { flex: none; }
.iconbtn.search-toggle--mobile { display: none; }

.searchbar {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: none;
  align-items: center;
  gap: .75rem;
  padding: 0 1rem;
  background: var(--surface);
  animation: searchbar-in .18s ease;
}
.searchbar.is-open { display: flex; }
@keyframes searchbar-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: none; }
}

.searchbar-field { position: relative; flex: 1; min-width: 0; }
.searchbar-input {
  width: 100%;
  height: 40px;
  padding: 0 3.2rem 0 .9rem;
  color: var(--text);
  font: inherit;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  -webkit-appearance: none;
  appearance: none;
}
.searchbar-input::placeholder { color: var(--muted); }
.searchbar-input::-webkit-search-cancel-button { display: none; }
.searchbar-input:focus { border-color: var(--accent); outline: none; }

.searchbar-submit {
  position: absolute;
  top: 4px;
  right: 4px;
  bottom: 4px;
  display: grid;
  place-items: center;
  width: 40px;
  padding: 0;
  color: var(--bg);
  background: var(--accent);
  border: 0;
  border-radius: calc(var(--radius) - 2px);
  cursor: pointer;
}
.searchbar-submit:hover { filter: brightness(1.1); }
.searchbar-close { flex: none; width: 36px; height: 36px; }

.user { display: flex; align-items: center; gap: .9rem; min-width: 0; margin-left: auto; }
.user form { margin: 0; }
.user-name {
  max-width: 24ch;
  overflow: hidden;
  color: var(--muted);
  font-size: .85rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.linkbtn {
  padding: .3rem .7rem;
  color: var(--text);
  font: inherit;
  font-size: .85rem;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
}
.linkbtn:hover { color: var(--accent-strong); border-color: var(--accent); }

.iconbtn {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
}
.iconbtn:hover { color: var(--accent-strong); border-color: var(--accent); }

/* Bouton accordéon (mobile) */
.burger {
  display: none;
  width: 40px;
  height: 40px;
  margin-left: auto;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: var(--radius);
  cursor: pointer;
}
.burger span {
  display: block;
  width: 20px;
  height: 2px;
  margin: 4px auto;
  background: var(--text);
  transition: transform .2s ease, opacity .2s ease;
}
.burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ---------- Pages ---------- */
.page {
  flex: 1;
  width: 100%;
  max-width: none;
  margin: 0 auto;
  padding: 1.5rem .75rem;
}
.page h1 { margin: 0 0 .35rem; font-size: 1.6rem; font-weight: 650; }
.page h2 { margin: 0 0 1rem; font-size: 1.05rem; font-weight: 600; }
.lede { margin: 0 0 2rem; color: var(--muted); }

.panel {
  padding: 1.25rem 1.4rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.facts {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: .5rem 1.5rem;
  margin: 0;
}
.facts dt { color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }

.foot {
  padding: 1rem;
  color: var(--muted);
  font-size: .8rem;
  text-align: center;
}


/* ---------- Tableau de bord ---------- */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Grille de briques : chaque brique fait ~1/3 de la largeur de la page */
.dash {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 23rem), 23rem));
  gap: 1.25rem;
  align-items: start;
}

.frame {
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.counts {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 1px;
  background: var(--line);
  border-bottom: 1px solid var(--line);
}
.count { padding: .6rem .9rem; background: var(--surface); }
.count-value {
  display: block;
  font-size: 1.6rem;
  font-weight: 650;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.count-value.is-empty { color: var(--line); }
.count-label { display: block; color: var(--muted); font-size: .8rem; }

.feed-ctrl {
  display: flex;
  align-items: center;
  gap: .3rem;
  padding: 0 .9rem;
  background: var(--surface);
}
.feed-ctrl .iconbtn { width: 26px; height: 26px; }
.iconbtn:disabled { opacity: .35; cursor: default; }
.iconbtn:disabled:hover { color: var(--muted); border-color: var(--line); }

.feed-scroll {
  height: 9.5rem;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--bg);
  border-top: 1px solid var(--line);
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}
.feed-scroll:focus-visible { outline-offset: -2px; }
.feed-list { margin: 0; padding: 0; list-style: none; }

.feed-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: .6rem;
  padding: .4rem .9rem;
  font-size: .85rem;
  line-height: 1.35;
  border-bottom: 1px solid var(--line);
}
.feed-item:last-child { border-bottom: 0; }

.feed-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed-action { color: var(--muted); font-size: .75rem; }
.feed-action.is-new { color: var(--accent-strong); font-weight: 600; }

.feed-meta {
  display: flex;
  gap: .4rem;
  min-width: 0;
  color: var(--muted);
  font-size: .75rem;
}
.tag { flex: none; }
.tag-company { color: var(--accent-strong); }
.feed-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed-when { color: var(--muted); font-size: .75rem; text-align: right; font-variant-numeric: tabular-nums; }

.feed-status { margin: 0; padding: .5rem .9rem; color: var(--muted); font-size: .75rem; text-align: center; }
.empty { margin: 0; padding: 1rem .9rem; color: var(--muted); font-size: .85rem; text-align: center; }

/* ---------- Connexion ---------- */
.login {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 1.5rem 1rem;
}
.login-card {
  width: 100%;
  max-width: 400px;
  padding: 2rem 1.75rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.login-card h1 { margin: 0 0 .4rem; font-size: 1.7rem; font-weight: 700; }
.login-card .lede { margin-bottom: 1.5rem; }

.btn-ms {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .7rem;
  width: 100%;
  padding: .75rem 1rem;
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.btn-ms:hover { border-color: var(--accent); }

.hint { margin: 1rem 0 0; color: var(--muted); font-size: .85rem; text-align: center; }

.alert {
  margin: 0 0 1.25rem;
  padding: .7rem .9rem;
  color: var(--danger);
  font-size: .9rem;
  background: var(--danger-bg);
  border: 1px solid #5a2d39;
  border-radius: var(--radius);
}

/* ---------- Mobile : menu accordéon en haut à droite ---------- */
@media (max-width: 760px) {
  .topbar { gap: 0; }
  .burger { display: block; }

  .topbar-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: grid;
    grid-template-rows: 0fr;
    visibility: hidden;
    background: var(--surface);
    border-bottom: 1px solid transparent;
    transition: grid-template-rows .24s ease, visibility 0s linear .24s;
  }
  .topbar-menu.is-open {
    grid-template-rows: 1fr;
    visibility: visible;
    border-bottom-color: var(--line);
    box-shadow: 0 12px 24px rgba(0, 0, 0, .35);
    transition: grid-template-rows .24s ease, visibility 0s;
  }

  .topbar-inner {
    min-height: 0;
    height: auto;
    overflow: hidden;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0;
    padding: 0 1rem;
  }

  .nav ul { flex-direction: column; height: auto; }
  .nav a,
  .nav span {
    width: 100%;
    padding: .85rem 0;
    font-size: 1rem;
    border-bottom: 1px solid var(--line);
  }
  .nav a[aria-current="page"] { color: var(--accent-strong); border-bottom-color: var(--line); }
  .nav .nav-add { gap: .6rem; }
  .nav .nav-add .nav-add-label {
    position: static;
    width: auto;
    height: auto;
    margin: 0;
    overflow: visible;
    clip: auto;
    white-space: normal;
    border: 0;
  }
  .nav .nav-home { gap: .6rem; }
  .nav .nav-home .nav-home-label {
    position: static;
    width: auto;
    height: auto;
    margin: 0;
    overflow: visible;
    clip: auto;
    white-space: normal;
  }

  .workspace { margin-left: .75rem; }
  .workspace-select { height: 36px; max-width: 9.5rem; }
  .topbar-inner .search-toggle { display: none; }
  .iconbtn.search-toggle--mobile { display: grid; width: 40px; height: 40px; margin-left: auto; }
  .burger { margin-left: .25rem; }
  .searchbar-input { font-size: 1rem; }

  .user { justify-content: space-between; margin-left: 0; padding: .9rem 0 1rem; }
  .user-name { max-width: none; flex: 1; }

  .page { padding: 1.5rem .75rem; }
  .facts { grid-template-columns: 1fr; gap: .1rem; }
  .facts dd { margin-bottom: .7rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* ---------- Fiches (entreprise / contact) — à ajouter à la fin de style.css ---------- */
.crumb { margin: 0 0 .75rem; color: var(--muted); font-size: .85rem; }
.crumb a { color: var(--muted); text-decoration: none; }
.crumb a:hover { color: var(--accent-strong); }

.badges { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin: 0 0 1.5rem; }
.badge {
  padding: .1rem .55rem;
  color: var(--muted);
  font-size: .75rem;
  border: 1px solid var(--line);
  border-radius: 999px;
}
.badge.is-ok  { color: var(--accent-strong); border-color: var(--accent); }
.badge.is-off { color: var(--danger); border-color: #5a2d39; background: var(--danger-bg); }
.badge-alias { color: var(--muted); font-size: .85rem; }

.detail {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 22rem), 1fr));
  gap: 1.25rem;
  align-items: start;
  margin-bottom: 2rem;
}
.note { margin: 0; overflow-wrap: anywhere; }
.section-title { margin-top: 0; }

.table-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tbl th, .tbl td { padding: .55rem .9rem; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl th { color: var(--muted); font-size: .8rem; font-weight: 600; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr.is-off td { opacity: .55; }

/* Lignes du fil cliquables : le lien du libellé couvre toute la ligne (lien étiré) */
.feed-item { position: relative; }
.feed-link { color: inherit; text-decoration: none; }
.feed-link::after { content: ""; position: absolute; inset: 0; }
.feed-item:hover { background: var(--raised); }
.feed-item:hover .feed-label { color: var(--accent-strong); }
.feed-link:focus-visible { outline: none; }
.feed-item:has(.feed-link:focus-visible) { outline: 2px solid var(--accent); outline-offset: -2px; }
/* Lien secondaire (ex. l'entreprise d'un contact) : reste au-dessus du lien étiré */
.feed-sub a { position: relative; z-index: 1; color: inherit; text-decoration: none; }
.feed-sub a:hover { color: var(--accent-strong); text-decoration: underline; }

/* ---------- Fiche entreprise : colonne de pavés à gauche, contacts à droite ---------- */
.company-layout {
  display: grid;
  grid-template-columns: minmax(0, 26rem) minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
}
.company-main { display: flex; flex-direction: column; gap: 1.25rem; min-width: 0; }
.company-head { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin: 0 0 1rem; }
.company-head h1 { margin: 0; font-size: 1.07rem; }
.company-main .badges { margin: -.4rem 0 1rem; }
.company-contacts { min-width: 0; }
.company-contacts .section-title { margin-bottom: .75rem; }

@media (max-width: 1000px) {
  .company-layout { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Fiche entreprise : retouches (notes sans titre, tableau, copier/partager, mobile) ---------- */
.panel--private { position: relative; border-style: dashed; }
.note-lock { float: right; margin: .15rem 0 0 .6rem; color: var(--muted); }

.tbl tbody tr:hover td { background: var(--raised); }
.tbl td a { text-decoration: none; }
.tbl td a:hover { text-decoration: underline; }
.tbl .c-tel a { font-variant-numeric: tabular-nums; }
.tbl .col-share { width: 1%; padding-right: .2rem; text-align: left; }

/* Lien e-mail / téléphone : texte sur desktop, bouton icône sur mobile */
.ct-link .ct-ico { display: none; }

/* Copier (PC) / Partager (écran tactile) */
.contact-btn { touch-action: manipulation; }
.iconbtn.share-btn { display: none; }
@media (pointer: coarse) {
  .iconbtn.share-btn { display: grid; }
  .iconbtn.copy-btn { display: none; }
}
.contact-btn .ico-check { display: none; }
.contact-btn.is-done { color: var(--accent-strong); border-color: var(--accent); }
.contact-btn.is-done .ico-main { display: none; }
.contact-btn.is-done .ico-check { display: block; }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
  z-index: 100;
  max-width: calc(100% - 2rem);
  padding: .6rem .9rem;
  color: var(--text);
  font-size: .9rem;
  background: var(--raised);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  opacity: 0;
  transform: translate(-50%, .5rem);
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* Empilement (≤1000px) : le pavé « Suivi » passe tout en bas */
@media (max-width: 1000px) {
  .company-main { display: contents; }
  .panel-head   { order: 1; }
  .panel-note   { order: 2; }
  .panel--private { order: 3; }
  .company-contacts { order: 4; }
  .panel-suivi  { order: 5; }
}

/* Smartphone */
@media (max-width: 760px) {
  .page { padding: 1rem .6rem; }
  .crumb { margin-bottom: .5rem; }
  .company-layout { gap: .9rem; }
  .company-layout .panel { padding: .8rem .95rem; }

  /* Pavé entreprise compact : nom + badge sur une ligne */
  .company-head { flex-wrap: nowrap; align-items: center; gap: .5rem; margin: 0 0 .6rem; }
  .page .company-head h1 { flex: 1 1 0; min-width: 0; font-size: 1.2rem; line-height: 1.25; overflow-wrap: anywhere; }
  .company-head .badge { flex: none; }
  .company-main .badges { margin: 0 0 .6rem; }
  .company-layout .facts { grid-template-columns: max-content minmax(0, 1fr); gap: .2rem .9rem; font-size: .9rem; }
  .company-layout .facts dd { margin-bottom: 0; }

  /* Liste de contacts : une « carte » par ligne, sans défilement horizontal */
  .company-contacts .table-wrap { overflow: visible; }
  .tbl, .tbl tbody { display: block; }
  .tbl tr {
    display: grid;
    grid-template-columns: 2.25rem minmax(0, 1fr) 2.25rem 2.25rem;
    grid-template-areas:
      "share name mail tel"
      "share job  mail tel";
    column-gap: .5rem;
    align-items: center;
    padding: .5rem .6rem;
    border-bottom: 1px solid var(--line);
  }
  .tbl tbody tr:last-child { border-bottom: 0; }
  .tbl td { padding: 0; border: 0; white-space: normal; }
  .tbl tbody tr:hover td { background: transparent; }

  .tbl .col-share { grid-area: share; width: auto; padding: 0; }
  .tbl .c-name { grid-area: name; min-width: 0; overflow-wrap: anywhere; }
  .tbl .c-job  { grid-area: job; min-width: 0; color: var(--muted); font-size: .8rem; line-height: 1.3; }
  .tbl .c-job:empty { display: none; }
  .tbl .c-mail { grid-area: mail; }
  .tbl .c-tel  { grid-area: tel; }

  .tbl .iconbtn { width: 36px; height: 36px; }
  .tbl td a.ct-link {
    display: grid; place-items: center;
    width: 36px; height: 36px;
    color: var(--accent-strong);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    text-decoration: none;
  }
  .tbl td a.ct-link:hover { border-color: var(--accent); text-decoration: none; }
  .ct-link .ct-text { display: none; }
  .ct-link .ct-ico { display: block; }
}

/* Sprite d'icônes SVG : hors flux (une classe, pas de style inline) */
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ---------- Recherche (menu déroulant + page de résultats) ---------- */
.sr-pop {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 60;
  max-height: min(70vh, 30rem);
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 12px 24px rgba(0, 0, 0, .35);
}
.sr-pop[hidden] { display: none; }

.sr-head {
  margin: 0;
  padding: .5rem .9rem .3rem;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.sr-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: .2rem 1rem;
  padding: .5rem .9rem;
  color: var(--text);
  font-size: .9rem;
  text-decoration: none;
  border-top: 1px solid var(--line);
}
.sr-head + .sr-item { border-top: 0; }
.sr-item:hover, .sr-item.is-active { background: var(--raised); }
.sr-item:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.sr-item.is-off { opacity: .55; }
.sr-main { display: flex; flex-direction: column; min-width: 0; }
.sr-name { overflow: hidden; color: var(--accent-strong); text-overflow: ellipsis; white-space: nowrap; }
.sr-sub  { overflow: hidden; color: var(--muted); font-size: .8rem; text-overflow: ellipsis; white-space: nowrap; }
.sr-meta { color: var(--muted); font-size: .8rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sr-item mark { color: inherit; background: rgba(96, 165, 250, .28); border-radius: 2px; }
.sr-empty { padding: .9rem; color: var(--muted); font-size: .85rem; text-align: center; }
.sr-all {
  display: block;
  padding: .55rem .9rem;
  color: var(--accent-strong);
  font-size: .85rem;
  text-align: center;
  text-decoration: none;
  border-top: 1px solid var(--line);
}
.sr-all:hover { background: var(--raised); }

/* Page de résultats */
.sr-form { max-width: 32rem; margin: 0 0 1.25rem; }
.sr-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 26rem), 1fr)); gap: 1.25rem; align-items: start; }
.sr-panel { padding: 0; overflow: hidden; }
.page .sr-head { margin: 0; padding: .75rem .9rem .4rem; font-size: .72rem; font-weight: 600; }
.sr-list { margin: 0; padding: 0; list-style: none; }
.sr-list li:first-child .sr-item { border-top: 0; }

@media (max-width: 760px) {
  .sr-item { grid-template-columns: minmax(0, 1fr); }
  .sr-meta { white-space: normal; overflow-wrap: anywhere; }
}

/* ---------- Ajout (entreprise / contact) : add.php ---------- */
.page--add { max-width: 68rem; }
.add-panel { max-width: 40rem; margin: 0 auto; }
.add-panel--form { max-width: none; }
.add-panel h1 { margin: 0 0 .4rem; font-size: 1.07rem; }
.add-lede { margin: 0 0 1.25rem; color: var(--muted); font-size: .88rem; }
.add-lede a { color: var(--muted); text-decoration: none; }
.add-lede a:hover { color: var(--accent-strong); }

.add-form { display: flex; flex-direction: column; gap: 1rem; }
.add-label, .field label { color: var(--muted); font-size: .85rem; }
.add-input {
  width: 100%;
  min-height: 40px;
  padding: .5rem .9rem;
  color: var(--text);
  font: inherit;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
select.add-input { padding-right: .6rem; }
textarea.add-input { resize: vertical; }
.add-input::placeholder { color: var(--muted); }
.add-input:focus { border-color: var(--accent); outline: none; }
.add-input[aria-invalid="true"] { border-color: #5a2d39; }

.add-results {
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.add-results:empty { display: none; }
.add-results .sr-item:first-of-type { border-top: 0; }

.btn-primary {
  align-self: flex-start;
  max-width: 100%;
  padding: .6rem 1.1rem;
  overflow: hidden;
  color: #0b1220;
  font: inherit;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: var(--accent);
  border: 0;
  border-radius: var(--radius);
  cursor: pointer;
}
.btn-primary:hover { filter: brightness(1.1); }

.add-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: .9rem 1rem; }
.field { display: flex; flex-direction: column; gap: .3rem; min-width: 0; }
.field--wide, .field--12 { grid-column: span 12; }
.field--3 { grid-column: span 3; }
.field--4 { grid-column: span 4; }
.field--6 { grid-column: span 6; }
.field--check { justify-content: flex-end; }
.field--check label { display: flex; align-items: center; gap: .5rem; min-height: 40px; color: var(--text); font-size: .95rem; }
.req { color: var(--danger); }
.add-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1.1rem; }
.add-head .add-lede { margin: 0; }
.add-actions { display: flex; align-items: center; flex-shrink: 0; gap: .6rem; }
.add-actions .btn-primary, .add-actions .linkbtn { display: inline-flex; align-items: center; min-height: 38px; padding-top: 0; padding-bottom: 0; text-decoration: none; }

.form-error {
  margin: 0 0 1rem;
  padding: .6rem .9rem;
  color: var(--danger);
  font-size: .9rem;
  background: var(--danger-bg);
  border: 1px solid #5a2d39;
  border-radius: var(--radius);
}
.form-error ul { margin: 0; padding-left: 1.1rem; }

@media (max-width: 800px) {
  .field--3, .field--4 { grid-column: span 6; }
}
@media (max-width: 600px) {
  .add-grid { grid-template-columns: minmax(0, 1fr); }
  .field--3, .field--4, .field--6, .field--12, .field--wide { grid-column: 1 / -1; }
  .add-head { flex-wrap: wrap; }
}
