/* InfoVelaux — feuille de style unique, polices système, aucun service tiers. */
:root {
  --bg: #f3f5f8;
  --surface: #ffffff;
  --surface-2: #eef1f5;
  --text: #17202b;
  --muted: #5b6675;
  --border: #d9dee6;
  --brand: #14365d;
  --brand-2: #1f4f86;
  --on-brand: #ffffff;
  --focus: #2563eb;
  --danger: #b3261e;
  --danger-bg: #fdecea;
  --ok: #1b6e2f;
  --radius: 14px;
  --shadow: 0 1px 2px rgb(16 24 40 / 6%), 0 2px 6px rgb(16 24 40 / 8%);
  --tabbar-h: 64px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e141c;
    --surface: #18212d;
    --surface-2: #212c3a;
    --text: #e6ebf1;
    --muted: #9aa6b5;
    --border: #2c3949;
    --brand: #14365d;
    --brand-2: #6aa4e8;
    --focus: #7cb2ff;
    --danger: #ff8a80;
    --danger-bg: #3a1d1c;
    --ok: #7fd18f;
    --shadow: 0 1px 2px rgb(0 0 0 / 40%);
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  /* Les défilements automatiques tiennent compte de l'en-tête et de la barre de navigation fixes. */
  scroll-padding-top: 80px;
  scroll-padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 16px);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 16px);
  -webkit-tap-highlight-color: transparent;
}

a {
  color: var(--brand-2);
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 0.875rem;
}

.center {
  text-align: center;
}

h1 {
  font-size: 1.5rem;
  line-height: 1.25;
  margin: 8px 0 16px;
}

h2 {
  font-size: 1.15rem;
  margin: 28px 0 8px;
}

/* --- En-tête -------------------------------------------------------------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: var(--brand);
  color: var(--on-brand);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
  margin-right: auto;
  min-width: 0;
}

.brand img {
  border-radius: 9px;
  box-shadow: 0 0 0 1px rgb(255 255 255 / 25%);
}

.brand-name {
  display: block;
  font-size: 1.1rem;
  letter-spacing: 0.01em;
}

.tagline {
  display: block;
  font-size: 0.75rem;
  opacity: 0.8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.net-status {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
  background: #fbc02d;
  color: #111;
}

.info-btn {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: inherit;
}

.info-btn[aria-current] {
  background: rgb(255 255 255 / 16%);
}

.info-btn svg,
.tabbar svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Bandeau des numéros d'urgence */
.sos {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  overflow-x: auto;
  scrollbar-width: none;
  background: var(--danger-bg);
  border-bottom: 1px solid var(--border);
}

.sos::-webkit-scrollbar {
  display: none;
}

.sos-label {
  flex: none;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--danger);
  margin-right: 2px;
}

.sos-num {
  flex: none;
  white-space: nowrap;
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
  font-size: 0.8rem;
}

.sos-num strong {
  color: var(--danger);
  font-size: 0.95rem;
}

/* --- Mise en page ---------------------------------------------------------------- */
main {
  max-width: 640px;
  margin: 0 auto;
  padding: 12px 16px;
}

.view {
  animation: fade 0.15s ease-out;
}

@keyframes fade {
  from {
    opacity: 0.4;
  }
}

/* --- Boutons et champs ------------------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 10px 18px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.btn:disabled {
  opacity: 0.55;
  cursor: progress;
}

.btn.primary {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--on-brand);
}

.btn.big {
  width: 100%;
  min-height: 54px;
  font-size: 1.05rem;
}

.btn.danger-outline {
  color: var(--danger);
  border-color: currentColor;
  background: transparent;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0 8px;
}

.actions.end {
  justify-content: flex-end;
}

select,
input[type="text"],
input[type="password"],
textarea {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

textarea {
  resize: vertical;
  min-height: 110px;
}

.select-compact {
  width: auto;
  min-height: 38px;
  padding: 6px 10px;
  font-size: 0.9rem;
}

fieldset {
  border: 0;
  margin: 0 0 22px;
  padding: 0;
  min-width: 0;
}

legend {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 10px;
  padding: 0;
}

.field {
  display: block;
  margin-bottom: 14px;
}

.field > span {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 6px;
}

.notice {
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.notice.danger {
  background: var(--danger-bg);
  border-color: transparent;
}

.dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--c, var(--muted));
  margin-right: 6px;
  flex: none;
}

/* --- Filtres du fil ---------------------------------------------------------------- */
.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chips.wrap {
  margin-top: 10px;
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font: inherit;
  font-size: 0.82rem;
  cursor: pointer;
}

.chip .dot {
  margin-right: 5px;
}

/* Filtres de niveau : toujours sur une seule ligne, quatre colonnes égales,
   quelle que soit la largeur de l'écran ou la taille de texte choisie. */
#level-filter {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  width: 100%;
}

.level-chip {
  justify-content: center;
  min-width: 0;
  padding: 5px 4px;
  font-size: clamp(0.7rem, 3.3vw, 0.85rem);
  white-space: nowrap;
}

.level-chip .dot {
  width: 8px;
  height: 8px;
  margin-right: 4px;
}

.chip-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Écrans étroits : la bordure colorée suffit, la pastille laisse sa place au texte. */
@media (max-width: 380px) {
  #level-filter {
    gap: 4px;
  }

  .level-chip {
    padding: 5px 2px;
  }

  .level-chip .dot {
    display: none;
  }
}

.chip[aria-pressed="true"] {
  color: var(--text);
  border-color: var(--brand-2);
  background: color-mix(in srgb, var(--brand-2) 12%, var(--surface));
  font-weight: 600;
}

.level-chip[aria-pressed="false"] .dot {
  background: transparent;
  box-shadow: inset 0 0 0 2px var(--c);
}

.level-chip[aria-pressed="true"] {
  border-color: var(--c);
  background: color-mix(in srgb, var(--c) 14%, var(--surface));
}

/* --- Cartes de signalement ---------------------------------------------------------- */
.feed {
  display: grid;
  gap: 12px;
}

.card {
  position: relative;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border-left: 6px solid var(--c);
  padding: 12px 14px 8px;
  overflow-wrap: anywhere;
}

.card.highlight {
  outline: 3px solid var(--c);
  outline-offset: 2px;
}

.card.resolved {
  opacity: 0.72;
}

.card.official {
  background: color-mix(in srgb, var(--brand-2) 7%, var(--surface));
}

.card-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.card-emoji {
  font-size: 1.6rem;
  line-height: 1;
  margin-top: 2px;
}

.card-title {
  flex: 1;
  min-width: 0;
}

.card-title h2 {
  margin: 0;
  font-size: 1.02rem;
}

.card-where {
  margin: 0;
  color: var(--muted);
  font-size: 0.875rem;
}

.badge {
  flex: none;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--c);
  color: var(--on);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.card-desc {
  margin: 8px 0 4px;
  white-space: pre-line;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin: 6px 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.tag {
  padding: 1px 8px;
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--text);
  font-weight: 600;
}

.tag-official {
  background: var(--brand);
  color: var(--on-brand);
}

.tag-verified,
.tag-resolved {
  color: var(--ok);
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  margin: 4px -8px 0;
  border-top: 1px solid var(--border);
  padding-top: 4px;
}

.act {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 6px 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--brand-2);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
}

.act {
  text-decoration: none;
}

.act:hover:not(:disabled) {
  background: var(--surface-2);
}

.act:disabled {
  color: var(--muted);
  cursor: default;
}

.act-subtle {
  margin-left: auto;
  color: var(--muted);
  font-weight: 500;
}

.act-danger {
  color: var(--danger);
}

.count {
  min-width: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text);
  text-align: center;
}

/* « Vu » : le signalement se réduit à une ligne */
.seen-btn {
  margin-left: auto;
  min-height: 32px;
  padding: 2px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--brand-2);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.seen-btn:hover {
  background: var(--surface-2);
}

.card.mini + .card.mini {
  margin-top: -4px;
}

.card.mini {
  padding: 0;
  box-shadow: none;
  border: 1px solid var(--border);
  border-left: 6px solid var(--c);
}

.mini-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 46px;
  padding: 6px 14px 6px 10px;
  border: 0;
  border-radius: 0 var(--radius) var(--radius) 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.9rem;
  text-align: left;
  cursor: pointer;
}

.mini-emoji {
  font-size: 1.15rem;
  line-height: 1;
}

.mini-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-row time,
.mini-views {
  flex: none;
  color: var(--muted);
  font-size: 0.8rem;
}

.empty {
  text-align: center;
  padding: 40px 16px;
}

.empty p {
  margin: 4px 0;
}

.empty .btn {
  margin-top: 16px;
}

.empty-emoji {
  font-size: 2.5rem;
}

/* --- Formulaire de signalement (compact : tout l'essentiel tient sur un écran) ---------- */
.report-form h1 {
  font-size: 1.2rem;
  margin: 2px 0 10px;
}

.report-form fieldset {
  margin-bottom: 14px;
}

.report-form legend {
  margin-bottom: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.report-form legend em {
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
}

.cat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.cat {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 0;
  min-height: 62px;
  padding: 6px 2px;
  border: 2px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  cursor: pointer;
}

.cat .cat-emoji {
  font-size: 1.45rem;
  line-height: 1.1;
}

.cat-label {
  max-width: 100%;
  font-size: clamp(0.66rem, 2.9vw, 0.8rem);
  line-height: 1.15;
  text-align: center;
  overflow-wrap: anywhere;
}

.cat[aria-pressed="true"] {
  border-color: var(--brand-2);
  background: color-mix(in srgb, var(--brand-2) 12%, var(--surface));
  font-weight: 700;
}

.level-seg {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.level-seg button {
  min-width: 0;
  min-height: 40px;
  padding: 4px 2px;
  border: 2px solid var(--c);
  border-radius: 10px;
  background: color-mix(in srgb, var(--c) 10%, var(--surface));
  color: var(--text);
  font: inherit;
  font-size: clamp(0.7rem, 3.2vw, 0.85rem);
  font-weight: 700;
  cursor: pointer;
}

.level-seg button[aria-pressed="true"] {
  background: var(--c);
  color: var(--on);
}

.level-hint {
  margin: 6px 0 0;
  font-size: 0.8rem;
  line-height: 1.35;
  color: var(--muted);
}

.where-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
}

.geo-btn {
  padding: 8px 12px;
  white-space: nowrap;
}

.geo-btn[aria-pressed="true"] {
  color: var(--muted);
  font-weight: 500;
}

.geo-status {
  margin: 6px 0 0;
  font-size: 0.8rem;
  color: var(--ok);
}

.geo-status.error {
  color: var(--danger);
}

#f-place {
  margin-top: 8px;
}

.urgent-box {
  margin-top: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--danger-bg);
  border: 2px solid var(--danger);
}

.urgent-box p {
  margin: 0 0 10px;
}

.urgent-calls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
}

.btn.call {
  flex-direction: column;
  gap: 0;
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
  line-height: 1.2;
}

@media (prefers-color-scheme: dark) {
  .btn.call {
    color: #111;
  }
}

.btn.call small {
  font-weight: 400;
  opacity: 0.9;
}

.seg {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.seg button {
  min-width: 0;
  min-height: 38px;
  padding: 4px 2px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: clamp(0.7rem, 3.1vw, 0.85rem);
  line-height: 1.15;
  cursor: pointer;
}

.seg button[aria-checked="true"] {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--on-brand);
  font-weight: 600;
}

/* La zone de détails s'agrandit quand on écrit. */
#f-desc {
  min-height: 64px;
  transition: min-height 0.15s;
}

#f-desc:focus {
  min-height: 110px;
}

.hint-row {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  align-items: flex-start;
  margin-top: 6px;
  font-size: 0.8rem;
}

.counter {
  margin-left: auto;
  white-space: nowrap;
}

.pii-warning {
  color: #8a4b00;
  font-weight: 600;
}

@media (prefers-color-scheme: dark) {
  .pii-warning {
    color: #ffb74d;
  }
}

.rules {
  padding: 8px 12px;
  margin-bottom: 8px;
  border-radius: 12px;
  background: var(--surface-2);
  font-size: 0.8rem;
}

.rules p {
  margin: 0;
}

.check {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  font-weight: 600;
}

.check input {
  width: 22px;
  height: 22px;
  accent-color: var(--brand);
}

/* Champ piège : hors de l'écran, sans display:none (que certains robots détectent) */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* --- Alertes -------------------------------------------------------------------------- */
.switch-list {
  display: grid;
  gap: 8px;
}

.switch-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  cursor: pointer;
}

.switch-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.switch-text strong {
  display: flex;
  align-items: center;
}

.switch-text .muted {
  font-size: 0.8rem;
  line-height: 1.35;
}

.switch {
  appearance: none;
  flex: none;
  position: relative;
  width: 48px;
  height: 28px;
  margin: 0;
  border-radius: 999px;
  background: var(--border);
  cursor: pointer;
  transition: background 0.15s;
  order: 2;
  margin-left: auto;
}

.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgb(0 0 0 / 30%);
  transition: transform 0.15s;
}

.switch:checked {
  background: var(--c, var(--brand-2));
}

.switch:checked::after {
  transform: translateX(20px);
}

.status {
  font-weight: 600;
  color: var(--muted);
}

.card-plain {
  margin: 20px 0;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
}

.card-plain h2 {
  margin-top: 0;
}

.card-plain summary {
  font-weight: 600;
  cursor: pointer;
}

.feed-links {
  padding-left: 18px;
  font-size: 0.85rem;
  overflow-wrap: anywhere;
}

/* --- Page Infos ------------------------------------------------------------------------- */
.prose p,
.prose li {
  line-height: 1.6;
}

.prose ul,
.prose ol {
  padding-left: 22px;
}

.prose li {
  margin-bottom: 6px;
}

.levels-help {
  list-style: none;
  padding: 0 !important;
}

.levels-help li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.levels-help .badge {
  min-width: 92px;
  text-align: center;
  margin-top: 2px;
}

/* --- Barre d'action pendant la saisie d'un signalement -------------------------------------- */
.compose-bar {
  position: fixed;
  inset: auto 0 0;
  z-index: 30;
  display: none;
  grid-template-columns: 1fr 2fr;
  gap: 10px;
  align-items: center;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding: 0 16px env(safe-area-inset-bottom);
  background: var(--surface);
  border-top: 1px solid var(--border);
  box-shadow: 0 -2px 10px rgb(16 24 40 / 6%);
}

.composing .compose-bar {
  display: grid;
}

.composing .tabbar,
.composing .site-footer {
  display: none;
}

/* --- Barre de navigation ------------------------------------------------------------------ */
.tabbar {
  position: fixed;
  inset: auto 0 0;
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--surface);
  border-top: 1px solid var(--border);
  box-shadow: 0 -2px 10px rgb(16 24 40 / 6%);
}

.tabbar a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.75rem;
  font-weight: 600;
}

.tabbar a[aria-current] {
  color: var(--brand-2);
}

.tab-cta {
  position: relative;
}

.cta-circle {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin-top: -26px;
  border-radius: 50%;
  background: var(--brand);
  color: var(--on-brand);
  box-shadow: 0 4px 12px rgb(20 54 93 / 35%);
  border: 4px solid var(--surface);
}

.cta-circle svg {
  width: 26px;
  height: 26px;
  stroke-width: 2.6;
}

.tab-cta[aria-current] .cta-circle {
  background: var(--brand-2);
}

/* --- Notifications à l'écran et boîte de dialogue ---------------------------------------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 14px);
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 12px;
  width: max-content;
  max-width: calc(100vw - 32px);
  padding: 12px 16px;
  border-radius: 12px;
  background: #1f2937;
  color: #fff;
  box-shadow: 0 6px 24px rgb(0 0 0 / 25%);
  transform: translate(-50%, 20px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
  pointer-events: auto;
}

.toast.error {
  background: #8c1d18;
}

.toast-action {
  flex: none;
  padding: 6px 12px;
  border: 1px solid rgb(255 255 255 / 50%);
  border-radius: 8px;
  background: transparent;
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.dialog {
  width: min(440px, calc(100vw - 32px));
  padding: 20px;
  border: 0;
  border-radius: 18px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 20px 50px rgb(0 0 0 / 30%);
}

.dialog::backdrop {
  background: rgb(10 15 25 / 55%);
}

.dialog h2 {
  margin-top: 0;
}

.radio-list {
  display: grid;
  gap: 6px;
}

.radio {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  cursor: pointer;
}

.radio input {
  margin-top: 4px;
  accent-color: var(--brand);
}

/* --- Invitation (installation, alertes) ----------------------------------------------------- */
.invite {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 12px);
  z-index: 35;
  display: flex;
  gap: 12px;
  max-width: 520px;
  margin: 0 auto;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 10px 30px rgb(0 0 0 / 20%);
  animation: rise 0.25s ease-out;
}

.invite-icon {
  font-size: 1.8rem;
  line-height: 1;
}

.invite-body p {
  margin: 4px 0 10px;
  font-size: 0.88rem;
  color: var(--muted);
}

.invite-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
}

/* --- Pied de page et accès administrateur ------------------------------------------------------ */
.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
  max-width: 640px;
  margin: 8px auto 0;
  padding: 0 16px;
}

.version-btn {
  padding: 10px 8px;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 0.75rem;
  cursor: default;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

.admin-link {
  color: var(--brand-2);
  font-weight: 600;
  cursor: pointer;
}

.admin-actions {
  display: grid;
  gap: 8px;
  margin: 12px 0;
}

/* --- Modération ------------------------------------------------------------------------------ */
.mod-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 12px 0 20px;
}

.stat {
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
}

.stat strong {
  display: block;
  font-size: 1.4rem;
}

.stat span {
  color: var(--muted);
  font-size: 0.8rem;
}

.stat-line {
  grid-column: 1 / -1;
  margin: 0;
}

.status-pill {
  padding: 1px 8px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.75rem;
  background: var(--surface-2);
}

.status-pending,
.status-review {
  background: #fff3cd;
  color: #6b4e00;
}

.status-hidden {
  background: var(--danger-bg);
  color: var(--danger);
}

.mod-log {
  font-size: 0.8rem;
  color: var(--muted);
  padding-left: 18px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

@media (min-width: 700px) {
  .topbar {
    padding-left: max(16px, calc(50vw - 320px + 16px));
    padding-right: max(16px, calc(50vw - 320px + 16px));
  }

  .sos {
    justify-content: center;
  }
}
