/* Mandelieu · Famille Ibled
   Palette tirée de la photo : bleu crépuscule, abricot des nuages, collines nocturnes. */
:root {
  --dusk: #1b2340;
  --dusk-2: #2c3a66;
  --sky: #7189c7;
  --apricot: #f2a477;
  --ember: #d9683f;
  --ember-ink: #b44d27;
  --cream: #f8f3ec;
  --paper: #fffdf9;
  --ink: #1c2233;
  --ink-2: #4a5268;
  --ink-3: #7b8298;
  --line: #e7dfd3;
  --ok: #2f8a5f;
  --danger: #b8402a;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(27, 35, 64, .06), 0 8px 24px -12px rgba(27, 35, 64, .18);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 16px/1.5 var(--sans); color: var(--ink); background: var(--cream); }
a { color: var(--ember-ink); }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.2; margin: 0 0 .6em; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.05rem; margin-top: 1.4em; color: var(--dusk-2); }
code { font: .92em ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
:focus-visible { outline: 3px solid var(--apricot); outline-offset: 2px; }

/* ---------- Page publique (attente / connexion) ---------- */
body.public { min-height: 100vh; min-height: 100dvh; background: var(--dusk); color: #fff; }
.backdrop {
  position: fixed; inset: 0; z-index: 0;
  background: url("fond.jpg") center 70% / cover no-repeat;
}
.backdrop::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(20, 26, 48, .15) 0%, rgba(20, 26, 48, 0) 35%, rgba(12, 15, 26, .55) 72%, rgba(10, 12, 20, .88) 100%);
}
#nights:empty { display: none; }
@media (max-width: 760px) { .backdrop { background-image: url("fond-mobile.jpg"); background-position: 42% 60%; } }
.public-main {
  position: relative; z-index: 1; min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column; justify-content: space-between; gap: 2rem;
  padding: max(2.2rem, env(safe-area-inset-top)) 1.25rem max(1.5rem, env(safe-area-inset-bottom));
  max-width: 1100px; margin: 0 auto;
}
.brand { text-shadow: 0 2px 24px rgba(10, 14, 30, .45); }
.brand-family { margin: 0; font-size: .82rem; letter-spacing: .28em; text-transform: uppercase; opacity: .9; }
.brand-title { font-size: clamp(3rem, 13vw, 6.5rem); font-weight: 500; margin: .1em 0 .1em; letter-spacing: -.01em; }
.brand-sub { margin: 0; font-family: var(--serif); font-style: italic; font-size: 1.1rem; opacity: .92; }
.glass {
  width: 100%; max-width: 420px; padding: 1.5rem 1.4rem;
  background: rgba(22, 27, 46, .58); border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 20px; backdrop-filter: blur(18px) saturate(1.2); -webkit-backdrop-filter: blur(18px) saturate(1.2);
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .6);
}
.glass h2 { font-size: 1.5rem; }
.glass .lead { color: rgba(255, 255, 255, .85); margin-top: -.2rem; }
.glass .fine { color: rgba(255, 255, 255, .7); }
.glass label { color: rgba(255, 255, 255, .9); }
.glass input { background: rgba(255, 255, 255, .96); }
.glass a { color: var(--apricot); }
.glass .steps { padding-left: 1.2rem; display: grid; gap: 1rem; }
.glass .steps li::marker { color: var(--apricot); font-weight: 700; }
@media (min-width: 900px) {
  .public-main { flex-direction: row; align-items: flex-end; padding: 3rem 3rem 3rem; }
  .brand { align-self: flex-start; }
  .glass { flex: 0 0 420px; }
}

/* ---------- Formulaires ---------- */
label { display: grid; grid-template-columns: minmax(0, 1fr); gap: .3rem; font-size: .9rem; font-weight: 600; color: var(--ink-2); }
input, select, textarea {
  font: inherit; font-size: 16px; color: var(--ink); width: 100%;
  padding: .65rem .75rem; border: 1px solid #d8d0c3; border-radius: 10px; background: #fff;
  min-height: 46px; min-width: 0; max-width: 100%;
}
textarea { min-height: auto; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--ember); box-shadow: 0 0 0 3px rgba(242, 164, 119, .35); }
input[type="color"] { padding: 3px; width: 46px; flex: 0 0 46px; cursor: pointer; }
.stack { display: grid; gap: .9rem; }
.row2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: .7rem; }
.actions { display: flex; gap: .6rem; flex-wrap: wrap; }
.inline-form { display: flex; gap: .6rem; align-items: flex-end; flex-wrap: wrap; margin-top: 1rem; }
.inline-form label { flex: 1 1 180px; }
.grid-form { display: grid; gap: .7rem; grid-template-columns: 1fr; }
@media (min-width: 760px) { .grid-form { grid-template-columns: 1.2fr 1.6fr 1fr auto; align-items: end; } }
.code-input { font: 600 1.6rem/1 ui-monospace, Menlo, monospace; letter-spacing: .25em; text-align: center; }
.code-input.sm { font-size: 1.15rem; }
fieldset { border: 0; padding: 0; margin: 0; }
legend { font-size: .9rem; font-weight: 600; color: var(--ink-2); margin-bottom: .4rem; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  min-height: 46px; padding: .6rem 1.15rem; border-radius: 999px; border: 1px solid transparent;
  font: 600 1rem var(--sans); text-decoration: none; cursor: pointer;
}
.btn-sm { min-height: 38px; padding: .4rem .9rem; font-size: .9rem; }
.btn-primary { background: var(--ember); color: #fff; }
.btn-primary:hover { background: var(--ember-ink); }
.btn-ghost { background: transparent; color: var(--dusk-2); border-color: #cfc6b8; }
.btn-ghost:hover { background: #fff; }
.glass .btn-ghost { color: #fff; border-color: rgba(255, 255, 255, .4); }
.link-btn { background: none; border: 0; padding: .25rem 0; font: inherit; font-size: .9rem; color: var(--dusk-2); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.link-btn.light { color: rgba(255, 255, 255, .8); margin-top: .8rem; }
.link-btn.danger { color: var(--danger); }
.link-btn[disabled] { opacity: .4; cursor: not-allowed; }
.icon-btn { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; font-size: 1.6rem; line-height: 1; text-decoration: none; color: var(--dusk-2); border: 1px solid var(--line); background: #fff; }

.flash { margin: 0 0 1rem; padding: .7rem .9rem; border-radius: 10px; font-size: .95rem; border-left: 4px solid; }
.flash-ok { background: #e8f4ec; border-color: var(--ok); color: #1f5a3e; }
.flash-error { background: #fbe9e4; border-color: var(--danger); color: #7c2a1b; }
.flash-info { background: #e9eef9; border-color: var(--sky); color: #2c3a66; }
.fine { font-size: .85rem; color: var(--ink-3); }
.empty { color: var(--ink-3); font-style: italic; }
.center { text-align: center; }

/* ---------- Application ---------- */
.top {
  position: relative; color: #fff;
  background: linear-gradient(180deg, rgba(27, 35, 64, .55), rgba(27, 35, 64, .92)), url("fond-mobile.jpg") center 38% / cover;
  padding-top: env(safe-area-inset-top);
}
.top-inner { max-width: 1180px; margin: 0 auto; padding: 1rem 1.1rem .4rem; display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.top-brand { color: #fff; text-decoration: none; display: grid; }
.top-family { font-size: .7rem; letter-spacing: .26em; text-transform: uppercase; opacity: .85; }
.top-title { font-family: var(--serif); font-size: 1.9rem; line-height: 1.1; }
.top-user { display: grid; justify-items: end; font-size: .82rem; gap: .1rem; }
.top-user .who { opacity: .92; text-align: right; }
.top-user .link-btn { color: rgba(255, 255, 255, .85); font-size: .82rem; }
.tabs { max-width: 1180px; margin: 0 auto; display: flex; gap: .2rem; padding: 0 .7rem; overflow-x: auto; scrollbar-width: none; }
.tabs a { color: rgba(255, 255, 255, .78); text-decoration: none; font-weight: 600; padding: .75rem .7rem .8rem; border-bottom: 3px solid transparent; white-space: nowrap; }
.tabs a.on { color: #fff; border-color: var(--apricot); }
.subtabs { position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; justify-content: center; gap: .25rem; padding: .5rem .6rem; background: rgba(248, 243, 236, .92); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.subtabs a { flex: 0 0 auto; text-align: center; padding: .45rem .8rem; border-radius: 999px; text-decoration: none; color: var(--ink-2); font-weight: 600; font-size: .95rem; white-space: nowrap; }
@media (max-width: 520px) { .subtabs a { padding: .4rem .65rem; font-size: .9rem; } }
.subtabs a.on { background: var(--dusk); color: #fff; }
.page { max-width: 1180px; margin: 0 auto; padding: 1.1rem .8rem calc(3rem + env(safe-area-inset-bottom)); }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.15rem 1rem; margin-bottom: 1rem; }
.card.highlight { border-color: var(--apricot); box-shadow: 0 0 0 3px rgba(242, 164, 119, .3), var(--shadow); }
.card.narrow { max-width: 640px; margin-inline: auto; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.page-head { margin: .2rem .2rem 1rem; }
.page-head h2 { margin: 0; }
.cols { display: grid; gap: 0 1rem; grid-template-columns: minmax(0, 1fr); }
.cols > *, .side, .main-col { min-width: 0; }
body.app { overflow-x: hidden; }
@media (min-width: 960px) {
  .page { padding-inline: 1.4rem; }
  .card { padding: 1.4rem 1.5rem; }
  .cols { grid-template-columns: minmax(0, 1.55fr) minmax(320px, 1fr); align-items: start; }
  .side { position: sticky; top: 4.2rem; }
}
.role { font-weight: 700; }
.role-admin { color: var(--apricot); }
.card .role-admin { color: var(--ember-ink); }

/* Calendrier */
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .6rem; }
.cal-head h2 { margin: 0; font-size: 1.5rem; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
.dow { text-align: center; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); padding: .2rem 0 .35rem; }
.day { min-height: 64px; background: #fff; border: 1px solid #efe8dd; border-radius: 8px; padding: 3px 0 4px; display: flex; flex-direction: column; gap: 2px; overflow: hidden; }
.day .num { font-size: .82rem; font-weight: 600; padding: 0 5px; color: var(--ink-2); }
.day.out { background: transparent; border-color: transparent; }
.day.out .num { color: #c4bcb0; }
.day.past:not(.out) { background: #faf7f2; }
.day.past .num { color: var(--ink-3); }
.day.today { border-color: var(--ember); box-shadow: inset 0 0 0 1px var(--ember); }
.day.today .num { color: var(--ember-ink); }
.day[data-pick] { cursor: pointer; }
.day[data-pick]:hover { border-color: var(--apricot); }
.day.picked { background: #fff1e8; border-color: var(--ember); }
.bar { display: block; font-size: .68rem; font-weight: 700; line-height: 1.5; color: #fff; padding: 0 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: var(--sky); margin-left: -1px; margin-right: -1px; }
.bar-start { margin-left: 4px; border-radius: 5px 0 0 5px; }
.bar-airbnb { background: repeating-linear-gradient(135deg, #8b8f9c 0 5px, #a2a6b2 5px 10px); }
.day.past .bar { opacity: .55; }
@media (min-width: 760px) { .day { min-height: 84px; } .bar { font-size: .74rem; } }
.legend { list-style: none; padding: 0; margin: .9rem 0 .2rem; display: flex; flex-wrap: wrap; gap: .4rem 1rem; font-size: .88rem; color: var(--ink-2); }
.legend li { display: flex; align-items: center; gap: .4rem; }
.dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: var(--sky); flex: 0 0 12px; }
.dot-airbnb { background: repeating-linear-gradient(135deg, #8b8f9c 0 3px, #a2a6b2 3px 6px); }
.sync { margin: .2rem 0 0; }
.sync-err { color: var(--danger); }

/* Choix de l'enfant */
.who-pick { display: flex; flex-wrap: wrap; gap: .45rem; }
.who-pick legend { width: 100%; }
.pill input, .seg input { position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; min-height: 0; padding: 0; }
.pill, .seg label { position: relative; }
.pill span { display: inline-flex; align-items: center; gap: .45rem; min-height: 42px; padding: .4rem .9rem .4rem .7rem; border-radius: 999px; border: 1.5px solid var(--line); background: #fff; font-weight: 600; color: var(--ink); cursor: pointer; }
.pill span::before { content: ""; width: 12px; height: 12px; border-radius: 50%; background: var(--c, var(--sky)); }
.pill input:checked + span { border-color: var(--c, var(--sky)); background: var(--c, var(--sky)); color: #fff; }
.pill input:checked + span::before { background: #fff; }
.pill input:focus-visible + span { outline: 3px solid var(--apricot); outline-offset: 2px; }
.seg { display: flex; border: 1px solid #d8d0c3; border-radius: 999px; padding: 3px; background: #fff; }
.seg label { flex: 1; display: block; }
.seg span { display: block; text-align: center; padding: .5rem; border-radius: 999px; cursor: pointer; color: var(--ink-2); }
.seg input:checked + span { background: var(--dusk); color: #fff; }
.seg input:focus-visible + span { outline: 3px solid var(--apricot); }

/* Listes */
.list { list-style: none; margin: 0; padding: 0; }
.item { display: flex; gap: .75rem; align-items: flex-start; padding: .85rem 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.item:first-child { border-top: 0; }
.item > .dot { margin-top: .4rem; }
.item-main { flex: 1 1 200px; display: grid; gap: .1rem; min-width: 0; }
.item-main span { color: var(--ink-2); font-size: .93rem; }
.item-main em { color: var(--ink-3); font-size: .88rem; }
.item-actions { display: flex; gap: .9rem; flex-wrap: wrap; align-items: center; }
.item-actions form, .row-actions form { display: inline; }
.details { margin: .25rem 0; color: var(--ink-2); font-size: .93rem; white-space: normal; }
.meta { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; font-size: .82rem !important; color: var(--ink-3) !important; margin-top: .2rem; }
.tag { display: inline-block; font-size: .74rem; font-weight: 700; padding: .12rem .5rem; border-radius: 999px; background: #eee8de; color: var(--ink-2); }
.tag-haute { background: #fbe1d8; color: var(--danger); }
.tag-basse { background: #edf0f6; color: #5a6380; }
.tag-st-en_cours { background: #e3e9f8; color: var(--dusk-2); }
.tag-st-fait, .tag-ok { background: #e2f1e8; color: var(--ok); }
.tag-now { background: var(--apricot); color: #4a2210; justify-self: start; }
.kind { flex: 0 0 auto; font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; padding: .3rem .5rem; border-radius: 6px; margin-top: .1rem; }
.kind-probleme { background: #fbe1d8; color: var(--danger); }
.kind-idee { background: #fff0c9; color: #7a5a00; }
.todo.done strong { text-decoration: line-through; color: var(--ink-3); }
.chips { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: .6rem; }
.chip { display: inline-block; padding: .4rem .8rem; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--ink-2); text-decoration: none; font-size: .88rem; font-weight: 600; }
.chip.on { background: var(--dusk); border-color: var(--dusk); color: #fff; }

/* Contacts */
.contact-grid { display: grid; gap: 0 1rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 760px) { .contact-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .contact-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.contact-group h3 { margin: 0 0 .5rem; font-size: .8rem; font-family: var(--sans); text-transform: uppercase; letter-spacing: .14em; color: var(--ember-ink); }
.contact { padding: .7rem 0; border-top: 1px solid var(--line); display: grid; gap: .3rem; }
.contact:first-of-type { border-top: 0; }
.contact-name { display: grid; }
.contact-name span { color: var(--ink-3); font-size: .9rem; }
.contact-links { display: flex; flex-direction: column; gap: .15rem; font-size: .95rem; }
.contact-links a { text-decoration: none; }
.call { font-weight: 700; color: var(--dusk-2); }
.call::before { content: "☏ "; color: var(--ember); }
.contact .link-btn { justify-self: start; }
.danger-zone { margin-top: 1rem; padding-top: .8rem; border-top: 1px solid var(--line); }

/* Compte / admin */
.kv { display: grid; grid-template-columns: max-content 1fr; gap: .5rem 1rem; margin: 0; }
.kv dt { color: var(--ink-3); font-size: .9rem; }
.kv dd { margin: 0; display: flex; flex-wrap: wrap; gap: .4rem; align-items: baseline; }
code.big { font-size: 1.15rem; background: #f3ede4; padding: .2rem .5rem; border-radius: 6px; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.table th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); padding: .5rem .6rem; border-bottom: 1px solid var(--line); }
.table td { padding: .7rem .6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr.inactive td { opacity: .55; }
.table select { min-height: 38px; padding: .3rem .5rem; width: auto; }
.row-actions { display: flex; flex-wrap: wrap; gap: .3rem .9rem; }
.table.compact td { padding: .45rem .6rem; }
@media (max-width: 759px) {
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; }
  .table tr { padding: .6rem 0; border-bottom: 1px solid var(--line); }
  .table td { border: 0; padding: .2rem 0; }
  .table td[data-label]::before { content: attr(data-label) " · "; font-size: .75rem; color: var(--ink-3); text-transform: uppercase; letter-spacing: .05em; }
  .table td:first-child::before { content: none; }
}
.child-form { display: flex; gap: .5rem; align-items: center; flex: 1 1 100%; flex-wrap: wrap; }
.child-form input[name="name"] { flex: 1 1 120px; width: auto; }
.child-form select { flex: 1 1 140px; width: auto; }
.child-form.add { margin-top: .8rem; padding-top: .8rem; border-top: 1px dashed var(--line); }
.copy-row { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
code.url { flex: 1 1 260px; word-break: break-all; background: #f3ede4; padding: .5rem .6rem; border-radius: 8px; font-size: .8rem; }

/* 2FA */
.qr { background: #fff; padding: 10px; border-radius: 12px; width: max-content; max-width: 100%; margin: .7rem 0; }
.qr svg { display: block; width: 210px; height: 210px; }
.secret code { font-size: 1rem; letter-spacing: .08em; background: rgba(255, 255, 255, .12); padding: .25rem .45rem; border-radius: 6px; word-break: break-all; }
.codes { list-style: none; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.codes code { display: block; text-align: center; padding: .55rem; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .2); border-radius: 8px; font-size: 1.02rem; letter-spacing: .06em; }
details summary { cursor: pointer; }

@media (prefers-reduced-motion: no-preference) {
  .btn, .chip, .pill span, .day { transition: background-color .15s, border-color .15s, color .15s; }
}
/* Compteurs & historique */
.t-right { text-align: right !important; }
.nowrap { white-space: nowrap; }
.meter-sum { display: grid; gap: .7rem; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.meter-box { display: flex; flex-direction: column; gap: .15rem; padding: .8rem .9rem; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.meter-box .meter-name { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); }
.meter-box strong { font-size: 1.35rem; }
.meter-box small { font-size: .85rem; font-weight: 600; color: var(--ink-3); }
.unit-input { max-width: 6rem; }
.item.inactive { opacity: .55; }
.pager { align-items: center; margin-top: .8rem; }
@media (max-width: 759px) { .table td.t-right { text-align: left !important; } }

@media print {
  .top, .subtabs, .side, .item-actions { display: none !important; }
  body { background: #fff; }
  .card { box-shadow: none; }
}

/* ---------- Pastilles et alertes ---------- */
.badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; margin-left: .2rem; border-radius: 999px; background: var(--danger); color: #fff; font-size: .72rem; font-weight: 700; vertical-align: 1px; }
.badge.soon { background: #fff0c9; color: #7a5a00; }
.tabs a .badge.soon { background: var(--apricot); color: #4a2210; }
.alerts { display: grid; gap: .4rem; margin-bottom: 1rem; }
.alert { margin: 0; padding: .65rem .9rem; border-radius: 12px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: .3rem 1rem; font-size: .93rem; }
.alert-late { background: #fbe1d8; }
.alert-late strong { color: var(--danger); }
.alert-soon { background: #fff0c9; }
.alert-soon strong { color: #7a5a00; }
.alert a { color: var(--ink); font-weight: 600; }
.tag-wait { background: #fff0c9; color: #7a5a00; }
.subnav { margin-bottom: 1rem; }
.subnav .chip { display: inline-flex; align-items: center; }

/* ---------- Réservations : personnes présentes, pré-demandes ---------- */
.bar-pending { background: color-mix(in srgb, var(--c, var(--sky)) 22%, #fff); color: var(--ink); box-shadow: inset 0 0 0 1px var(--c, var(--sky)); font-style: italic; }
.dot-pending { background: color-mix(in srgb, var(--c, var(--ink-2)) 22%, transparent); box-shadow: inset 0 0 0 1.5px var(--c, var(--ink-2)); }
.guests { display: grid; gap: .45rem; }
#guest-rows { display: grid; gap: .45rem; }
.g-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto auto; gap: .4rem; align-items: center; }
.g-min { display: inline-flex; align-items: center; gap: .25rem; font-size: .8rem; font-weight: 600; color: var(--ink-2); white-space: nowrap; margin: 0; }
.g-min input { width: 18px; height: 18px; min-height: 0; padding: 0; accent-color: var(--ember); }
.g-del { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: #fff; color: var(--ink-2); cursor: pointer; font-size: 1.05rem; line-height: 1; }
.g-del:disabled { opacity: .35; cursor: default; }
.g-count { margin: 0; padding: .55rem .8rem; border-radius: 10px; background: #fff; border: 1px solid var(--line); font-size: .9rem; color: var(--ink-2); }
.g-count b { color: var(--ink); font-size: 1.05rem; }
.names { margin: .25rem 0 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: .25rem .4rem; }
.names li { font-size: .8rem; padding: .05rem .5rem; border-radius: 999px; background: #fff; border: 1px solid var(--line); color: var(--ink-2); }
details.refuse { display: inline-block; }
details.refuse summary { list-style: none; cursor: pointer; display: inline; }
details.refuse summary::-webkit-details-marker { display: none; }
details.refuse[open] form { margin-top: .4rem; }

/* ---------- Inventaire et linge ---------- */
.filters { margin-bottom: .8rem; align-items: end; }
.room { margin-top: 1.1rem; }
.room h3 { display: flex; justify-content: space-between; gap: .5rem; align-items: baseline; margin: 0 0 .3rem; font-family: var(--sans); font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; color: var(--ember-ink); }
.room h3 .fine { text-transform: none; letter-spacing: 0; font-weight: 600; }
.room-title { font-family: var(--serif) !important; font-size: 1.3rem !important; text-transform: none !important; letter-spacing: 0 !important; color: var(--ink) !important; }
.bed { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: .5rem; margin: .4rem 0 .9rem; }
.bed div { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: .55rem .75rem; display: grid; gap: .05rem; align-content: start; }
.bed dt { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-3); }
.bed dd { margin: 0; font-weight: 700; }
.bed dd.todo { color: #7a5a00; font-weight: 600; font-style: italic; }
.parure { margin-top: 1rem; }
.parure h4 { margin: 0 0 .3rem; font-size: 1rem; }
.parure h4 span { color: var(--ink-2); font-weight: 600; }

/* ---------- Bateau ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .6rem; margin-bottom: .8rem; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: .7rem .85rem; display: grid; gap: .1rem; }
.kpi b { font-size: 1.3rem; }
.kpi span { font-size: .8rem; color: var(--ink-3); }
.spec { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: .45rem 1rem; margin: .8rem 0 0; font-size: .95rem; }
.spec dt { color: var(--ink-3); font-weight: 600; }
.spec dd { margin: 0; overflow-wrap: anywhere; }
.mt { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .2rem .9rem; padding: .9rem 0; border-top: 1px solid var(--line); }
.mt:first-of-type { border-top: 0; }
.mt-body { display: grid; gap: .15rem; min-width: 0; }
.mt .due { width: 64px; text-align: center; border-radius: 10px; padding: .45rem .2rem; background: #e2f1e8; color: var(--ok); align-self: start; }
.mt .due b { display: block; font-size: 1.25rem; line-height: 1.05; }
.mt .due small { display: block; font-size: .66rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.mt.late .due { background: var(--danger); color: #fff; }
.mt.soon .due { background: #fff0c9; color: #7a5a00; }
.mt details { font-size: .86rem; color: var(--ink-3); }
.mt details ul { margin: .3rem 0 0; padding-left: 1.1rem; }
.mt .item-actions { margin-top: .3rem; }
.done-form { display: flex; gap: .5rem; align-items: end; flex-wrap: wrap; margin-top: .4rem; padding: .6rem; border-radius: 10px; background: #fff; border: 1px solid var(--line); }
.done-form label { flex: 1 1 140px; }
.jtype { flex: 0 0 auto; font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; padding: .3rem .5rem; border-radius: 6px; margin-top: .1rem; background: #e3e9f8; color: var(--dusk-2); }
.jtype.in { background: #e2f1e8; color: var(--ok); }
.jtype.out { background: #fff0c9; color: #7a5a00; }
.jtype.inc { background: #fbe1d8; color: var(--danger); }
.checks { list-style: none; margin: 0; padding: 0; }
.checks li { border-top: 1px solid var(--line); }
.checks li:first-child { border-top: 0; }
.checks label { display: flex; gap: .7rem; align-items: flex-start; padding: .6rem 0; cursor: pointer; font-weight: 400; margin: 0; }
.checks input, .chk input { width: 22px; height: 22px; min-height: 0; padding: 0; flex: 0 0 22px; accent-color: var(--ember); margin: .05rem 0 0; }
.checks input:checked + span { color: var(--ink-3); text-decoration: line-through; }
.chk { display: flex; gap: .6rem; align-items: center; }

/* ---------- Livret ---------- */
.livret-toc h3 { margin: .2rem 0 .5rem; font-family: var(--sans); font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-3); }
.livret-toc h3 ~ h3 { margin-top: 1rem; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .5rem; }
.tile { display: block; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: .7rem .8rem; text-decoration: none; color: var(--ink); font-weight: 600; font-size: .92rem; }
.tile:hover { border-color: var(--apricot); }
.livret-section { scroll-margin-top: 4rem; }
.rich { max-width: 68ch; line-height: 1.65; }
.rich h4 { margin: 1rem 0 .3rem; color: var(--dusk-2); font-size: 1rem; }
.rich p { margin: 0 0 .7rem; }
.rich ul { margin: 0 0 .7rem; padding-left: 1.2rem; }
.rich li { margin-bottom: .2rem; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: .6rem; margin-top: .6rem; }
.photo-grid figure { margin: 0; }
.photo-grid img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; display: block; background: #eee; }
.photo-grid figcaption { font-size: .8rem; color: var(--ink-3); margin-top: .25rem; display: flex; justify-content: space-between; gap: .4rem; flex-wrap: wrap; }
.top-link { display: inline-block; margin-top: .4rem; }

/* ---------- Pages imprimables (inventaire, linge) ---------- */
body.print-page { background: #fff; padding: 1.2rem; max-width: 1000px; margin: 0 auto; font-size: 14px; }
.print-bar { display: flex; gap: .5rem; }
.print-page h1 { font-size: 1.6rem; margin-bottom: .2rem; }
.print-room { margin: 1.4rem 0 .2rem; font-size: 1.2rem; }
.print-sub { color: var(--ink-2); margin: 0 0 .6rem; }
.print-fill { margin: .8rem 0; }
.print-table { width: 100%; border-collapse: collapse; }
.print-table th { background: var(--ember); color: #fff; text-align: left; padding: .35rem .5rem; font-size: .85rem; }
.print-table td { border-bottom: 1px solid #ddd; padding: .35rem .5rem; vertical-align: middle; }
.print-group td { background: var(--dusk); color: #fff; font-weight: 700; }
.box-col { width: 4.5rem; text-align: center; }
.box { display: inline-block; width: 14px; height: 14px; border: 1.5px solid #555; border-radius: 2px; }
.print-sign .lines span { display: block; border-bottom: 1px solid #bbb; height: 1.6rem; }
.print-sign .sign-boxes { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 1.4rem; }
.print-sign .sign-boxes div { border: 1px solid #555; height: 6rem; padding: .3rem .5rem; font-size: .85rem; }
@media print {
  .no-print, .alerts { display: none !important; }
  body.print-page { padding: 0; }
  .print-table tr { break-inside: avoid; }
  .print-table th, .print-group td { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
@media (max-width: 520px) {
  .g-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .spec { grid-template-columns: minmax(0, 1fr); }
  .spec dt { margin-top: .4rem; }
}

/* ---------- Compteurs : Tempo et tarifs ---------- */
.tempo-grid { display: grid; grid-template-columns: 4.6rem minmax(0, 1fr) minmax(0, 1fr); gap: .4rem .5rem; align-items: center; }
.tempo-grid legend { grid-column: 1 / -1; }
.tempo-grid .mh { font-size: .72rem; font-weight: 700; letter-spacing: .08em; color: var(--ink-3); text-align: center; }
.tempo-grid strong { font-size: 1rem; font-variant-numeric: tabular-nums; }
.tempo-grid.small { font-size: .88rem; font-variant-numeric: tabular-nums; max-width: 340px; }
.ml { font-weight: 700; font-size: .86rem; display: inline-flex; align-items: center; gap: .4rem; }
.ml::before { content: ""; width: 11px; height: 11px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .15); }
.ml-bleu::before { background: #3b6fd6; }
.ml-blanc::before { background: #fff; }
.ml-rouge::before { background: #d64545; }
.meter-tempo { grid-column: span 2; }
@media (max-width: 520px) { .meter-tempo { grid-column: auto; } }
.tarif { display: grid; gap: .35rem; padding: .8rem 0; border-top: 1px solid var(--line); }
.tarif:first-of-type { border-top: 0; padding-top: 0; }
.tarif-form { margin-top: .8rem; padding-top: .6rem; border-top: 1px dashed var(--line); }
.tarif-form h3 { margin: 0; }
