:root {
  --bg: #f5f6f8; --surface: #ffffff; --ink: #16202c; --muted: #5d6b7a;
  --line: #dde2e8; --accent: #8b0a0a; --accent-ink: #ffffff; --accent-soft: #f6e9e9;
  --ok: #1d7a46; --error: #b3261e; --demo: #8a5a00; --demo-bg: #fff4dc;
  --radius: 10px;
  --free: #8fd6a6; --busy: #ef9a9a; --off: #ffffff; --booked: #9bb7e6;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #11161c; --surface: #1a2129; --ink: #e8edf2; --muted: #9aa8b6;
    --line: #2c3540; --accent: #ef6b6b; --accent-ink: #1a0606; --accent-soft: #3a1d1f;
    --ok: #6fd19a; --error: #ff8a80; --demo: #ffcf70; --demo-bg: #3a2e14;
    --free: #2e7048; --busy: #84302f; --off: #1a2129; --booked: #36548a;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.top { display: flex; justify-content: space-between; align-items: center;
  max-width: 960px; margin: 0 auto; padding: 16px; }
.brand img { display: block; height: 40px; width: auto; }
.lang, a { color: var(--accent); }
.tag { font-size: 14px; color: var(--muted); }
main.card { max-width: 640px; margin: 0 auto 40px; }
main.wide { max-width: 960px; margin: 0 auto 40px; padding: 0 16px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; margin-bottom: 20px; }
main.card { margin-left: 16px; margin-right: 16px; }
@media (min-width: 672px) { main.card { margin-left: auto; margin-right: auto; } }
h1 { font-size: 26px; margin: 0; }
h2 { font-size: 17px; margin: 24px 0 10px; }
.card > h2:first-child { margin-top: 0; }
.email { color: var(--muted); margin: 2px 0 16px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.lead { font-size: 18px; }
.chips, .times { display: flex; flex-wrap: wrap; gap: 8px; }
button { font: inherit; cursor: pointer; border-radius: 8px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); padding: 8px 14px; }
button:hover { border-color: var(--accent); }
button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
button.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
button.primary:disabled { opacity: .6; cursor: wait; }
button.danger { background: var(--error); color: #fff; border-color: var(--error); }
button.link { background: none; border: none; color: var(--accent); padding: 0; text-decoration: underline; }
.danger-text { color: var(--error) !important; }
.days { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; }
.days button { min-width: 74px; display: flex; flex-direction: column; align-items: center; padding: 8px 10px; }
.days .dow { font-size: 13px; text-transform: capitalize; }
.days .dnum { font-size: 20px; font-weight: 600; }
.days .mon { font-size: 12px; }
.times button { min-width: 84px; }
.summary { background: var(--accent-soft); border-radius: 8px; padding: 12px 14px; margin-bottom: 14px; }
.notice { background: var(--accent-soft); border-radius: 8px; padding: 4px 16px; }
.error { color: var(--error); }
.ok { color: var(--ok); }
.flash { padding: 10px 14px; border-radius: 8px; background: var(--surface); border: 1px solid var(--line); }
.flash.demo { background: var(--demo-bg); color: var(--demo); border-color: transparent; }
table { width: 100%; border-collapse: collapse; margin-top: 16px; font-size: 15px; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 500; font-size: 13px; }
tr.highlight { background: var(--accent-soft); }
tr.dim { opacity: .55; }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.row label.grow { flex: 1 1 320px; }
.row label.grow input { width: 100%; }
label { display: flex; flex-direction: column; font-size: 14px; color: var(--muted); gap: 4px; }
input, select { font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line);
  border-radius: 8px; padding: 7px 10px; }
.copy { display: flex; gap: 6px; }
.copy input { min-width: 0; flex: 1; font-size: 14px; }
code { font-size: 14px; }
@media (max-width: 640px) {
  table, thead, tbody, tr, th, td { display: block; }
  thead { display: none; }
  tr { border-bottom: 1px solid var(--line); padding: 8px 0; }
  td { border: none; padding: 4px 0; }
}
.who { display: flex; flex-wrap: wrap; gap: 12px; }
.person { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 220px; padding: 14px 16px; text-align: left; }
.person.current { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.place { font-weight: 600; margin-top: -4px; }
.pending-row { background: var(--demo-bg); }
.badge { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); white-space: nowrap; }
.badge.wait { background: var(--demo-bg); color: var(--demo); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.account-nav { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; justify-content: flex-end; }
.account-nav form { display: inline; }
.account-nav button.link { font-size: 14px; }
.stack { display: flex; flex-direction: column; gap: 12px; margin: 16px 0; }
.passkey-box { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 4px; }
details form { margin-top: 8px; }

/* Grille des disponibilités (admin) */
.week-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 10px; }
.week-nav .week-title { font-weight: 600; margin-right: auto; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; color: var(--muted); margin: 0 0 10px; }
.legend i { display: inline-block; width: 14px; height: 14px; border: 1px solid var(--line); border-radius: 3px;
  vertical-align: -2px; margin-right: 5px; }
.legend .free { background: var(--free); } .legend .busy { background: var(--busy); }
.legend .off { background: var(--off); } .legend .booked { background: var(--booked); }
.legend .hidden-free, .grid .stripe.on { background: repeating-linear-gradient(135deg, var(--free) 0 3px, transparent 3px 6px); }
.grid-wrap { overflow-x: auto; }
.grid { --cell-h: 13px; --stripe-h: 8px; display: grid; grid-template-columns: 44px repeat(7, minmax(72px, 1fr));
  min-width: 560px; user-select: none; -webkit-user-select: none; }
.grid .day-head { position: sticky; top: 0; background: var(--surface); text-align: center; font-size: 13px;
  padding: 4px 2px 6px; line-height: 1.2; display: flex; flex-direction: column; }
.grid .day-head.today span { color: var(--accent); font-weight: 600; }
.grid .time-label { font-size: 11px; color: var(--muted); text-align: right; padding-right: 6px;
  line-height: 1; transform: translateY(-5px); }
.grid .cell { border-left: 1px solid var(--line); border-top: 1px solid color-mix(in srgb, var(--line) 45%, transparent);
  cursor: pointer; touch-action: none; }
.grid .cell.hour { border-top-color: var(--line); }
.grid .cell.free { background: var(--free); }
.grid .cell.busy { background: var(--busy); }
.grid .cell.off { background: var(--off); }
.grid .cell.booked { background: var(--booked); }
.grid .cell.locked { cursor: not-allowed; }
/* Ligne rayée en haut ou en bas d'une journée : des plages libres sont cachées (nuit). */
.grid .stripe { border-left: 1px solid var(--line); border-top: 1px solid var(--line); }
.grid .stripe.on { cursor: pointer; }
.grid .cell.locked:not(.booked) { opacity: .45; }
.grid .cell:not(.locked):hover { filter: brightness(.93); }
.settings { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-top: 18px;
  padding-top: 14px; border-top: 1px solid var(--line); }
.settings .weekdays { display: flex; flex-wrap: wrap; gap: 4px 10px; }
.settings p { flex-basis: 100%; margin: 0; }
.settings .weekdays label { flex-direction: row; align-items: center; gap: 4px; color: var(--ink); }

/* Fuseau horaire : encadré du client et menu de la barre du haut de l'admin */
.zone-box { border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; margin: 16px 0 4px; }
.zone-box label { flex-direction: row; font-size: 15px; color: var(--ink); font-weight: 600; margin-bottom: 6px; }
.zone-box select { width: 100%; }
.zone-box p { margin: 6px 0 0; }
.zone-menu { position: relative; }
.zone-menu summary { cursor: pointer; list-style: none; white-space: nowrap; }
.zone-menu summary::-webkit-details-marker { display: none; }
.zone-menu summary:hover { color: var(--accent); }
.zone-menu .zone-form { position: absolute; right: 0; top: calc(100% + 6px); z-index: 10; width: min(360px, 90vw);
  display: flex; flex-direction: column; gap: 8px; padding: 14px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 6px 24px rgb(0 0 0 / .15); }
.zone-menu .zone-form p { margin: 0; }
.zone-menu .zone-form select { width: 100%; }
.zone-menu .zone-form > label { color: var(--ink); }
/* Recherche d'un fuseau par ville ou pays (static/fuseau.js) */
.zone-search { margin-bottom: 6px; }
.zone-search input { width: 100%; }
.zone-results { list-style: none; margin: 4px 0 0; padding: 0; border: 1px solid var(--line); border-radius: 8px;
  max-height: 280px; overflow-y: auto; background: var(--surface); }
.zone-results li { border-bottom: 1px solid var(--line); }
.zone-results li:last-child { border-bottom: none; }
.zone-results li.muted { padding: 8px 10px; }
.zone-results button { display: block; width: 100%; text-align: left; border: none; border-radius: 0;
  background: none; padding: 6px 10px; line-height: 1.35; }
.zone-results button:hover, .zone-results button:focus { background: var(--accent-soft); outline: none; }
