/* Suivi des domaines — interface mobile */
:root {
  --navy: #10243c; --navy-2: #1b3a5c; --bg: #f3f5f9; --card: #fff; --ink: #142033; --muted: #5d6b7e;
  --line: #dde3ec; --danger: #c62828; --warn: #d97b00; --info: #1e6fd9; --ok: #2e7d32; --gold: #f1c35c;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  padding-bottom: calc(76px + env(safe-area-inset-bottom));
}
body.no-tabs { padding-bottom: 24px; }
a { color: var(--info); }

.top {
  position: sticky; top: 0; z-index: 5; background: var(--navy); color: #fff;
  padding: calc(12px + env(safe-area-inset-top)) 18px 12px;
}
.top h1 { margin: 0; font-size: 19px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
main { max-width: 640px; margin: 0 auto; padding: 14px 14px 8px; }
h2 { font-size: 15px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); margin: 22px 4px 8px; }
h2 small { background: var(--line); color: var(--ink); border-radius: 99px; padding: 1px 8px; font-size: 12px; margin-left: 4px; letter-spacing: 0; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px; margin: 0 0 12px; }
.card.narrow { max-width: 420px; margin: 32px auto; text-align: left; }
.logo { display: block; margin: 0 auto 12px; border-radius: 16px; }
.empty { color: var(--muted); text-align: center; }
.muted, small { color: var(--muted); }
.hint { font-size: 14px; color: var(--muted); margin: 6px 4px; }
.back { margin: 0 0 10px; }
.back a { text-decoration: none; font-weight: 600; }

/* Messages */
.flash { border-radius: 10px; padding: 10px 14px; margin: 0 0 12px; background: #e7f5ea; color: #1d5e2a; font-weight: 600; }
.flash.error { background: #fdecea; color: #8d1c16; }

/* Tableau de bord */
.summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tile {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 10px;
  text-decoration: none; color: var(--ink); text-align: center;
}
.tile b { display: block; font-size: 28px; line-height: 1.1; }
.tile span { font-size: 13px; color: var(--muted); }
.tile.bad { border-color: #f1b7b3; background: #fff5f4; }
.tile.bad b { color: var(--danger); }
.tile.good b { color: var(--ok); }

/* Listes */
.list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.list > li > a, .list > li > div {
  display: flex; gap: 12px; align-items: center; background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px 14px; color: var(--ink); text-decoration: none;
}
.list > li > a > span:not(.dot):not(.date):not(.next), .list > li > div > span:not(.dot) { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.list small { display: block; font-size: 13px; }
.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--ok); }
.danger .dot { background: var(--danger); box-shadow: 0 0 0 4px #c628281f; }
.warning .dot { background: var(--warn); }
.info .dot { background: var(--info); }
.alert.danger > * { border-left: 4px solid var(--danger) !important; }
.alert.warning > * { border-left: 4px solid var(--warn) !important; }
.alert.info > * { border-left: 4px solid var(--info) !important; }

.due .date {
  flex: none; width: 48px; text-align: center; font-size: 12px; color: var(--muted); text-transform: uppercase;
  background: var(--bg); border-radius: 8px; padding: 4px 0; line-height: 1.2;
}
.due .date b { display: block; font-size: 20px; color: var(--ink); }
.due.near .date { background: #fff1db; }
.due.late .date { background: #fdecea; }
.due.late .date b { color: var(--danger); }

.dom b { display: block; overflow-wrap: anywhere; }
.dom .next { flex: none; text-align: right; font-size: 12px; color: var(--muted); line-height: 1.3; }

.chips { display: flex; gap: 6px; overflow-x: auto; margin: 0 0 10px; padding-bottom: 2px; }
.chips a {
  flex: none; padding: 6px 14px; border-radius: 99px; border: 1px solid var(--line); background: var(--card);
  color: var(--ink); text-decoration: none; font-size: 14px;
}
.chips a[aria-current] { background: var(--navy); border-color: var(--navy); color: #fff; }
.search { margin: 0 0 10px; }

/* Formulaires */
label { display: block; font-size: 14px; font-weight: 600; margin: 12px 0 0; }
label small { font-weight: 400; }
input, select, textarea {
  display: block; width: 100%; margin-top: 5px; padding: 11px 12px; font: 16px system-ui, sans-serif; color: var(--ink);
  background: #fff; border: 1px solid #b9c5d4; border-radius: 9px;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible { outline: 3px solid #8cbcf0; outline-offset: 1px; }
.row { display: flex; gap: 10px; }
.row > label { flex: 1; min-width: 0; }
button, .button {
  display: inline-block; border: 0; border-radius: 10px; padding: 12px 16px; font: 600 15px system-ui, sans-serif;
  cursor: pointer; text-decoration: none; text-align: center; color: var(--ink); background: var(--line);
}
.primary { background: var(--navy); color: #fff; }
.ghost { background: #fff; border: 1px solid #b9c5d4; color: var(--ink); }
.ghost.danger { color: var(--danger); border-color: #efb4b0; }
.wide { display: block; width: 100%; margin-top: 14px; }
button:disabled { opacity: .6; }
details > summary { cursor: pointer; font-weight: 600; list-style-position: inside; }
details.card[open] > summary { margin-bottom: 4px; }
details.add > summary { color: var(--info); }
.check-now { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 20px 4px; font-size: 14px; color: var(--muted); }
.check-now button { padding: 9px 12px; font-size: 14px; flex: none; }
.contact { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 4px; }
.contact .button { padding: 9px 14px; font-size: 14px; }
.head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.head p { margin: 0; }
.head .button { flex: none; padding: 9px 12px; font-size: 14px; }
.renew, .logout { margin: 0; }
.danger-zone form + form { margin-top: 0; }

/* Faits (état du domaine) */
.facts { margin: 0; }
.facts > div { display: flex; justify-content: space-between; gap: 14px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.facts > div:last-child { border-bottom: 0; }
.facts dt { color: var(--muted); flex: none; }
.facts dd { margin: 0; text-align: right; font-weight: 600; overflow-wrap: anywhere; }
.facts dd small { display: block; font-weight: 400; }
.good { color: var(--ok); }
.bad { color: var(--danger); }

/* Actions */
.todo { list-style: none; margin: 0; padding: 0; }
ul.card.todo { padding: 4px 12px; }
.todo li { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.todo li:last-child { border-bottom: 0; }
.todo li > span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.todo small { display: block; font-size: 13px; }
.todo form { margin: 0; flex: none; }
.todo .check {
  width: 28px; height: 28px; padding: 0; border-radius: 50%; border: 2px solid #9aa9bb; background: #fff;
  color: #fff; font-size: 15px; line-height: 1;
}
.todo .done .check { background: var(--ok); border-color: var(--ok); }
.todo .done > span { text-decoration: line-through; color: var(--muted); }
.todo .late small { color: var(--danger); font-weight: 600; }
.todo .del { background: none; color: #9aa9bb; font-size: 22px; padding: 2px 8px; }
.add-action { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 4px; }
.done-list > summary { margin: 18px 4px 8px; color: var(--muted); }

/* Barre d'onglets */
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; display: flex; background: #fff;
  border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom);
}
.tabs a {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0 9px;
  font-size: 12px; color: var(--muted); text-decoration: none;
}
.tabs svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tabs a[aria-current] { color: var(--navy); font-weight: 700; }
.tabs a[aria-current] svg { stroke-width: 2.4; }

@media (min-width: 700px) {
  main { padding-top: 22px; }
}

/* Espacements des paragraphes dans les cartes */
.card p { margin: 0 0 10px; }
.card p:last-child { margin-bottom: 0; }
.card form:first-child label:first-of-type { margin-top: 0; }
.chips { scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
h2[id], [id].card { scroll-margin-top: 70px; }
