/* Dispo, prototype : interface neutre, sans DA. Une police système, des gris, des boutons en contour, la structure des wireframes. */
:root {
  --bg: #ffffff;
  --ink: #1a1a1a;
  --muted: #666666;
  --faint: #999999;
  --line: #d4d4d4;
  --line-strong: #1a1a1a;
  --fill: #e6e6e6;
  --soft: #f4f4f4;
  --font: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.4 var(--font); -webkit-tap-highlight-color: transparent; overflow-x: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
[tabindex="-1"]:focus { outline: none; }
/* Une demande en route : le bouton attend, et ne se relance pas */
[aria-busy="true"] { opacity: .6; cursor: progress; }
.btn[aria-busy="true"]::after { content: '…'; }
.offline { border: 1px solid var(--line-strong); border-radius: 4px; padding: 10px 12px; margin: 0 0 14px; font-size: 14px; }
[hidden] { display: none !important; }

.view { max-width: 560px; margin: 0 auto; padding: calc(env(safe-area-inset-top) + 20px) 16px calc(env(safe-area-inset-bottom) + 96px); }
body.bare .view { padding-bottom: calc(env(safe-area-inset-bottom) + 32px); }

h1 { font-size: 22px; font-weight: 700; margin: 0 0 14px; }
h1.big { font-size: 28px; line-height: 1.15; margin: 4px 0 8px; overflow-wrap: anywhere; }
h2 { font-size: 13px; font-weight: 600; color: var(--muted); margin: 22px 0 8px; }
p { margin: 0 0 10px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.label { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 0 0 4px; }
.stack { display: grid; gap: 10px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row > .btn { flex: 1 1 0; }
.spacer { flex: 1; }
hr { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }

/* Boutons : contour, 44 px de haut au moins */
.btn {
  min-height: 44px; padding: 10px 14px; border: 1px solid var(--line-strong); border-radius: 4px; background: var(--bg);
  font-weight: 500; text-align: center; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.btn.block { width: 100%; }
.btn.strong { border-width: 2px; font-weight: 600; }
.btn.on { background: var(--fill); border-width: 2px; font-weight: 600; }
.btn.quiet { border-color: var(--line); }
.btn.small { min-height: 44px; padding: 8px 12px; font-size: 14px; }
.btn:disabled { opacity: .45; cursor: default; }
.link { min-height: 44px; padding: 10px 0; border: 0; background: none; text-decoration: underline; text-underline-offset: 3px; display: inline-flex; align-items: center; text-align: left; }
.back { min-height: 44px; padding: 10px 0; border: 0; display: inline-flex; align-items: center; gap: 6px; text-decoration: none; font-weight: 500; }

/* Pastilles (cercles, quand) */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 44px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 4px; background: var(--bg); font-size: 15px; }
.chip[aria-pressed="true"] { background: var(--fill); border: 2px solid var(--line-strong); font-weight: 600; padding: 7px 11px; }

/* Barre « J'ai envie de… » */
.top-actions { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin: 14px 0 0; }
.envie-bar { min-height: 52px; padding: 12px 14px; border: 2px solid var(--line-strong); border-radius: 4px; background: var(--bg); text-align: left; font-size: 17px; font-weight: 500; }

/* Bandeau dispo ce soir */
.banner { border: 1px solid var(--line-strong); border-radius: 4px; padding: 12px 14px; margin-top: 14px; }
.banner strong { display: block; font-size: 16px; overflow-wrap: anywhere; }
.banner .row { margin-top: 10px; }

/* Carte d'une envie */
.card { border: 1px solid var(--line); border-radius: 4px; padding: 12px 14px; display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 10px; row-gap: 4px; cursor: pointer; background: var(--bg); }
.card > * { grid-column: 1 / -1; }
/* Le bouton « Chaud » vient en dernier dans le code (ordre de lecture) et s'affiche à droite du quoi */
.card > .line1 { grid-column: 1; grid-row: 1; display: flex; align-items: flex-start; gap: 10px; }
.card > .tag + .line1, .card > .tag + .line1 ~ .chaud { grid-row: 2; }
.card > .chaud { grid-column: 2; grid-row: 1; align-self: start; }
.card .quoi { font-size: 18px; font-weight: 700; flex: 1; min-width: 0; overflow-wrap: anywhere; padding-top: 9px; text-decoration: none; color: inherit; }
.card .meta { color: var(--muted); font-size: 14.5px; overflow-wrap: anywhere; }
.card .who { font-size: 14.5px; overflow-wrap: anywhere; }
.card .circles { color: var(--muted); font-size: 13px; }
.card .answers { display: flex; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.card .answers .btn { flex: 1 1 0; }
.card .answered { display: flex; align-items: center; gap: 8px; margin-top: 4px; font-weight: 600; flex-wrap: wrap; }
.card.cancelled .quoi { text-decoration: line-through; color: var(--muted); }
.tag { display: inline-block; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.list { display: grid; gap: 10px; }

/* Page Envie */
.people { list-style: none; margin: 0; padding: 0; }
.people li { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; }
.people li span:last-child { color: var(--muted); font-size: 14px; text-align: right; }
.private { background: var(--soft); border: 1px solid var(--line); border-radius: 4px; padding: 12px 14px; margin-top: 14px; }
.private p { margin: 0 0 4px; }
.comments { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.comments li { overflow-wrap: anywhere; }
.comments .at { color: var(--faint); font-size: 12.5px; }
.notice { border: 1px solid var(--line-strong); border-radius: 4px; padding: 12px 14px; margin: 14px 0 0; }

/* Formulaires */
label.field { display: grid; gap: 6px; margin: 0 0 14px; }
label.field > span { font-size: 14px; font-weight: 600; }
.input { width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 4px; background: var(--bg); font-size: 16px; }
.hint { font-size: 13px; color: var(--muted); }
.error { color: var(--ink); font-weight: 600; font-size: 14px; }
.group-label { font-size: 14px; font-weight: 600; margin: 0 0 6px; }
.field-group { margin: 0 0 14px; }

/* Rectangle gris à la place d'une capture (E1, E4) */
.shot { background: var(--fill); color: var(--muted); border-radius: 4px; padding: 14px; font-size: 13.5px; text-align: center; min-height: 72px; display: grid; place-items: center; margin: 6px 0 12px; }
.steps { padding-left: 20px; margin: 0; }
.steps li { margin: 0 0 4px; }

/* Moi */
.setting { border-top: 1px solid var(--line); padding: 14px 0; display: grid; gap: 6px; }
.setting:last-child { border-bottom: 1px solid var(--line); }
.setting .row { justify-content: space-between; flex-wrap: nowrap; }
.setting .row > div { min-width: 0; overflow-wrap: anywhere; }
.setting .row > .btn { flex: 0 0 auto; }
.circle-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 44px; }
.circle-row span { min-width: 0; overflow-wrap: anywhere; }
.code { font-family: ui-monospace, Consolas, monospace; font-size: 13px; overflow-wrap: anywhere; word-break: break-all; color: var(--muted); }

/* Onglets */
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; display: grid; grid-template-columns: repeat(3, 1fr);
  max-width: 560px; margin: 0 auto; padding: 0 0 env(safe-area-inset-bottom); background: var(--bg); border-top: 1px solid var(--line);
}
.tab { min-height: 56px; display: grid; place-items: center; text-decoration: none; color: var(--muted); font-size: 14px; font-weight: 500; }
.tab[aria-current="page"] { color: var(--ink); font-weight: 700; }

/* Feuille du bas (comme la coloc, sans animation) */
.sheet { border: 0; padding: 0; margin: auto auto 0; width: 100%; max-width: 560px; max-height: 92vh; background: var(--bg); color: var(--ink); border-radius: 12px 12px 0 0; }
.sheet::backdrop { background: rgb(0 0 0 / .4); }
.sheet-inner { outline: none; padding: 10px 16px calc(env(safe-area-inset-bottom) + 20px); }
.grabber { width: 40px; height: 4px; border-radius: 4px; background: var(--line); margin: 0 auto 16px; }
.sheet h3 { font-size: 21px; font-weight: 700; margin: 0 0 6px; overflow-wrap: anywhere; }
.sheet .actions { display: grid; gap: 8px; margin-top: 14px; }

.toast {
  position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 72px); transform: translateX(-50%); opacity: 0; visibility: hidden;
  background: var(--ink); color: var(--bg); padding: 10px 14px; border-radius: 4px; font-size: 14.5px; z-index: 20; max-width: calc(100% - 32px); pointer-events: none;
}
.toast.show { opacity: 1; visibility: visible; }

.center { text-align: center; }
.empty { border: 1px dashed var(--line); border-radius: 4px; padding: 18px 14px; }
details.past summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; font-weight: 600; }
.brand { font-weight: 700; font-size: 18px; margin: 0 0 16px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
