/* Hub bichette.fr
   Concept : un annuaire sobre. Un en-tête avec le nom de la maison, puis des tuiles groupées par usage.
   Aucune police externe, aucun script : rapide, lisible partout, conforme RGPD. */
:root {
  --bg: #eef0ef;
  --surface: #ffffff;
  --ink: #17232c;
  --muted: #5c6a72;
  --line: #d5dbdd;
  --accent: #1f4d5c;
  --accent-soft: #e3edf0;
  --brass: #8a6420;
  --ok: #2f7d4f;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: "Avenir Next", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101a1f;
    --surface: #172429;
    --ink: #e9eff0;
    --muted: #93a5ab;
    --line: #28383e;
    --accent: #7fb8c6;
    --accent-soft: #1c3139;
    --brass: #d1a64a;
    --ok: #5fbf84;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.5;
  padding-left: max(18px, env(safe-area-inset-left, 0px));
  padding-right: max(18px, env(safe-area-inset-right, 0px));
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: max(32px, env(safe-area-inset-bottom, 0px));
}
.wrap { max-width: 940px; margin: 0 auto; }

/* En-tête */
.head { padding: 44px 0 30px; display: flex; align-items: center; gap: 20px; }
.mark { flex: none; width: 64px; height: 64px; color: var(--accent); }
.mark svg { width: 100%; height: 100%; display: block; }
.brand { min-width: 0; }
.brand h1 { font-family: var(--serif); font-weight: 700; font-size: clamp(30px, 6.4vw, 46px); line-height: 1.08; letter-spacing: -.01em; margin: 0; text-wrap: balance; }
.brand p { margin: 8px 0 0; color: var(--muted); font-size: 16px; }
.rule { height: 1px; background: var(--line); border: 0; margin: 0 0 6px; position: relative; }
.rule::after { content: ""; position: absolute; left: 0; top: -1px; width: 72px; height: 3px; background: var(--brass); }

/* Groupes et tuiles */
.group { padding-top: 28px; }
.group h2 { font-size: 13px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 0 0 12px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.tile {
  position: relative; display: flex; flex-direction: column; gap: 10px; min-width: 0;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  padding: 16px 16px 14px; color: inherit; text-decoration: none;
}
a.tile { transition: border-color .15s ease, background-color .15s ease; }
a.tile:hover { border-color: var(--accent); }
a.tile:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.tile-top { display: flex; align-items: flex-start; gap: 12px; }
.ico { flex: none; width: 40px; height: 40px; border-radius: 9px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; }
.ico svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.tile h3 { margin: 0; font-size: 18px; font-weight: 650; line-height: 1.25; }
.tile p { margin: 4px 0 0; color: var(--muted); font-size: 15px; line-height: 1.4; }
.tile-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 4px; min-height: 28px; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; }
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.badge::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.badge.live { color: var(--ok); }
.badge.live::before { background: var(--ok); }
.badge.lock { color: var(--brass); }
.badge.lock::before { display: none; }
.badge.lock svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.go { flex: none; width: 22px; height: 22px; color: var(--accent); }
.go svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; display: block; }
.tile.soon { background: transparent; border-style: dashed; }
.tile.soon .ico { background: transparent; border: 1px dashed var(--line); color: var(--muted); }
.tile.soon h3 { color: var(--muted); }

.foot { margin-top: 44px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; display: flex; flex-wrap: wrap; gap: 6px 16px; justify-content: space-between; }

/* Page 404 */
.err { padding: 72px 0 24px; max-width: 560px; }
.err .code { font-family: var(--serif); font-size: clamp(64px, 18vw, 110px); line-height: 1; color: var(--accent); margin: 0; }
.err h1 { font-family: var(--serif); font-size: clamp(26px, 5vw, 34px); margin: 12px 0 8px; }
.err p { color: var(--muted); margin: 0 0 22px; }
.btn { display: inline-block; background: var(--accent); color: var(--bg); text-decoration: none; font-weight: 650; padding: 11px 18px; border-radius: 8px; }
.btn:focus-visible { outline: 3px solid var(--brass); outline-offset: 2px; }

@media (max-width: 480px) {
  .head { padding: 30px 0 22px; gap: 14px; }
  .mark { width: 52px; height: 52px; }
}
@media (prefers-reduced-motion: reduce) { a.tile { transition: none; } }

/* ---------- Connexion, administration ---------- */
.who { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.who-name { display: flex; flex-direction: column; text-align: right; font-weight: 650; line-height: 1.2; }
.who-name small { color: var(--muted); font-weight: 400; font-size: 13px; }
.quiet { color: inherit; text-underline-offset: 3px; }
.narrow { max-width: 520px; margin: 0 auto; padding-top: 24px; display: flex; flex-direction: column; gap: 16px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 18px; min-width: 0; }
.panel h2 { font-family: var(--serif); font-size: 22px; margin: 0 0 8px; letter-spacing: 0; text-transform: none; color: var(--ink); }
.panel p { margin: 0 0 14px; color: var(--muted); font-size: 15px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; min-width: 0; }
.field span { font-size: 14px; font-weight: 600; }
.field input, .field select {
  font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 8px;
  padding: 11px 12px; min-width: 0; width: 100%;
}
.field input:focus-visible, .field select:focus-visible { outline: 3px solid var(--accent); outline-offset: 1px; }
.field input.code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 22px; letter-spacing: .12em; text-transform: uppercase; text-align: center; }
button.btn { border: 0; cursor: pointer; font: inherit; }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); font-weight: 600; }
.btn.danger { background: transparent; color: #b3261e; border: 1px solid var(--line); font-weight: 600; }
@media (prefers-color-scheme: dark) { .btn.danger { color: #f08a82; } }
.btn.small { padding: 6px 10px; font-size: 14px; border-radius: 6px; }
.notice { border-radius: 8px; padding: 12px 14px; margin: 0; border: 1px solid var(--line); background: var(--surface); }
.notice.err { border-color: #b3261e; }
.notice.ok { border-color: var(--ok); }
.secret { margin-top: 8px; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 22px; letter-spacing: .08em; user-select: all; word-break: break-all; }
.checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 15px; }
.checks .ko { color: #b3261e; }
.checks .ok { color: var(--ok); }
.admin { display: flex; flex-direction: column; gap: 18px; padding-top: 16px; }
.crumb { margin: 0; }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0 12px; align-items: end; }
.row .btn { margin-bottom: 14px; }
.scroll { overflow-x: auto; }
table.list { width: 100%; border-collapse: collapse; font-size: 15px; }
table.list th { text-align: left; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.list td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.list .sub { display: block; color: var(--muted); font-size: 13px; }
td.actions { white-space: nowrap; text-align: right; }
td.actions form { display: inline-block; margin-left: 6px; }
.code-chip { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-weight: 600; letter-spacing: .08em; user-select: all; }
.state { font-size: 13px; font-weight: 600; padding: 2px 8px; border-radius: 99px; border: 1px solid var(--line); white-space: nowrap; }
.state.on { color: var(--ok); border-color: var(--ok); }
.state.wait { color: var(--brass); border-color: var(--brass); }
.state.off { color: var(--muted); }
.empty { color: var(--muted); }
form.inline { display: inline; }

@media (max-width: 640px) {
  .head { flex-wrap: wrap; }
  .brand { flex: 1 1 0; }
  .who { width: 100%; margin-left: 0; justify-content: space-between; }
  .who-name { text-align: left; }
}
