/* Thème de l'app iPhone (STYLE-ET-COULEURS.md) : brun café en sombre, crème en clair, terre cuite en accent. */
:root {
  --bg: #F6F0E2; --card: #FFFCF4; --fg: #1E1A16; --sec: #7A6D5E; --accent: #984528; --on-accent: #FFFFFF;
  --blue: #3F6F96; --green: #4E7E5C; --red: #B93A2D; --red-bg: #B93A2D; --orange: #9A6A0A; --brown: #8F7249; --ko: #9A8B78;
  --empty: #EADFCB; --bright: #FFFCF4; --ink: #1E1A16; --seg-on: #FFFCF4;
  --fill: rgba(80, 55, 30, .08); --sep: rgba(60, 40, 20, .12);
  --glass: rgba(255, 252, 244, .72); --shadow: 0 6px 24px rgba(40, 25, 10, .16);
  --safe-top: env(safe-area-inset-top, 0px); --safe-bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}
:root[data-theme="sombre"] {
  --bg: #16110E; --card: #221B16; --fg: #F4EBDD; --sec: #A39685; --accent: #DB8560; --on-accent: #1A130F;
  --blue: #7FA6C9; --green: #7DB38B; --red: #E4695B; --red-bg: #B4372B; --orange: #E0A63A; --brown: #B79A6B; --ko: #857668;
  --empty: #2A221C; --bright: #F4EBDD; --seg-on: #4A3F36;
  --fill: rgba(244, 235, 221, .08); --sep: rgba(244, 235, 221, .12);
  --glass: rgba(42, 34, 28, .74); --shadow: 0 6px 28px rgba(0, 0, 0, .5);
  --wm-filter: brightness(0) invert(1);   /* le logo Alfred Hotels est noir : on le passe en blanc sur fond sombre */
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] {
    --bg: #16110E; --card: #221B16; --fg: #F4EBDD; --sec: #A39685; --accent: #DB8560; --on-accent: #1A130F;
    --blue: #7FA6C9; --green: #7DB38B; --red: #E4695B; --red-bg: #B4372B; --orange: #E0A63A; --brown: #B79A6B; --ko: #857668;
    --empty: #2A221C; --bright: #F4EBDD; --seg-on: #4A3F36;
    --fill: rgba(244, 235, 221, .08); --sep: rgba(244, 235, 221, .12);
    --glass: rgba(42, 34, 28, .74); --shadow: 0 6px 28px rgba(0, 0, 0, .5);
    --wm-filter: brightness(0) invert(1);   /* le logo Alfred Hotels est noir : on le passe en blanc sur fond sombre */
  color-scheme: dark;
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--fg); }
body {
  font: 17px/1.3 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%; overscroll-behavior-y: none;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; touch-action: manipulation; }
input, textarea, select { background: transparent; border: 0; outline: 0; }
.rounded, .num { font-family: ui-rounded, "SF Pro Rounded", -apple-system, sans-serif; }
.num, .code { font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }
.boot { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; text-align: center; color: var(--sec); padding: 24px; }
.boot img { width: 56px; height: 56px; animation: bootPulse 1.4s ease-in-out infinite; }
@keyframes bootPulse { 50% { opacity: .45; transform: scale(.94); } }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ─── Écran ─── */
.screen { min-height: 100%; padding: calc(var(--safe-top) + 8px) 16px calc(var(--safe-bottom) + 120px); max-width: 640px; margin: 0 auto; }
.topfade { position: fixed; left: 0; right: 0; top: 0; height: calc(var(--safe-top) + 10px); z-index: 20; pointer-events: none;
  background: linear-gradient(var(--bg) 55%, transparent); }
.header { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 4px 0 12px; }
.header .logo { width: 34px; height: 34px; border-radius: 9px; flex: none; }
.header .t { flex: 1; min-width: 0; }
.header h1 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -.01em; }
.header .sub { font-size: 15px; color: var(--sec); }
.large-title { font-size: 34px; font-weight: 700; margin: 0; letter-spacing: -.01em; }
.big-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding: 14px 0 14px; }

.card { background: var(--card); border-radius: 26px; overflow: hidden; }
.card.pad { padding: 18px; }
.section-title { font-size: 15px; font-weight: 600; color: var(--sec); padding: 20px 18px 8px; }
.bloc-title { font-size: 20px; font-weight: 700; padding: 22px 4px 0; }
.floor-title { font-size: 15px; font-weight: 600; color: var(--sec); padding: 14px 18px 8px; }
.foot { font-size: 13px; color: var(--sec); padding: 8px 18px 0; }
.foot.warn { color: var(--orange); } .foot.bad { color: var(--red); }
.divider { height: .5px; background: var(--sep); margin-left: 18px; }
.divider.tile { margin-left: 70px; }
.problem { display: flex; gap: 10px; align-items: flex-start; background: var(--red-bg); color: #fff; font-size: 13px; font-weight: 600;
  border-radius: 18px; padding: 14px; margin-bottom: 14px; }

/* ─── Boutons ─── */
.press { transition: transform .12s ease-out, opacity .12s; }
.press:active { transform: scale(.97); opacity: .75; }
/* Taille par défaut des icônes (les règles plus bas l’ajustent) */
svg[viewBox="0 0 24 24"] { width: 20px; height: 20px; flex: none; }
.pill { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 44px; padding: 0 20px;
  border-radius: 999px; background: var(--accent); color: var(--on-accent); font-size: 15px; font-weight: 600; white-space: nowrap; }
.pill.soft { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); }
.pill.red { background: var(--red-bg); color: #fff; }
.pill.red.soft { background: color-mix(in srgb, var(--red) 12%, transparent); color: var(--red); }
.pill.green { background: var(--green); color: var(--on-accent); }
.pill[disabled] { opacity: .45; pointer-events: none; }
.pills { display: flex; gap: 10px; }
.glass-btn { width: 44px; height: 44px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; flex: none;
  background: var(--glass); backdrop-filter: blur(18px) saturate(1.6); -webkit-backdrop-filter: blur(18px) saturate(1.6);
  box-shadow: inset 0 0 0 .5px var(--sep), 0 2px 10px rgba(0, 0, 0, .08); color: var(--fg); position: relative; }
.glass-btn svg { width: 20px; height: 20px; }
.glass-btn .dot { position: absolute; top: 6px; right: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--red-bg); box-shadow: 0 0 0 2px var(--bg); }
.avatar { width: 44px; height: 44px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; flex: none;
  font-weight: 700; font-size: 16px; color: #fff; }
.row-btn { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; padding: 0 18px; text-align: left; }
.row-btn .ic { width: 24px; display: inline-flex; justify-content: center; color: var(--accent); }
.row-btn .ic svg { width: 20px; height: 20px; }
.row-btn .chev { margin-left: auto; color: var(--sec); }
.row-btn .right + .chev { margin-left: 0; }   /* valeur à droite collée à la flèche (sinon l’espace se partage et la valeur flotte au milieu) */
.row-btn.danger { color: var(--red); } .row-btn.danger .ic { color: var(--red); }
.field { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 18px; }
.field label { flex: none; }
.field input, .field select { flex: 1; min-width: 0; text-align: right; color: var(--fg); }
.field input::placeholder, .input::placeholder, textarea::placeholder { color: var(--sec); opacity: .8; }
.input { width: 100%; min-height: 44px; padding: 10px 12px; border-radius: 12px; background: var(--fill); }
textarea.input { min-height: 88px; resize: none; line-height: 1.35; }
.tr-lab { display: flex; align-items: center; gap: 12px; min-width: 0; }
.tr-ic { display: inline-flex; flex: none; color: var(--sec); }
.tr-ic svg { width: 22px; height: 22px; }
.tr-lab.red .tr-ic { color: var(--red); }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; padding: 0 18px; width: 100%; text-align: left; }
.switch { width: 51px; height: 31px; border-radius: 999px; background: var(--fill); position: relative; flex: none; transition: background .2s; box-shadow: inset 0 0 0 1px var(--sep); }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .25); transition: transform .25s cubic-bezier(.3, 1.3, .5, 1); }
.switch.on { background: var(--green); box-shadow: none; }
.switch.on::after { transform: translateX(20px); }

/* ─── Sélecteur segmenté ─── */
.seg { display: flex; padding: 3px; border-radius: 999px; background: var(--fill); gap: 0; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button { flex: 1 0 auto; min-height: 36px; padding: 0 12px; border-radius: 999px; font-size: 15px; font-weight: 500; white-space: nowrap; transition: background .2s; }
.seg button.on { background: var(--seg-on); font-weight: 600; box-shadow: 0 2px 4px rgba(0, 0, 0, .12); }
.filters { display: flex; flex-direction: column; gap: 10px; padding-top: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 12px; border-radius: 999px; font-size: 13px; font-weight: 600;
  color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); white-space: nowrap; }
.chip.on { background: var(--accent); color: var(--on-accent); }
.chip.brown { color: var(--brown); background: color-mix(in srgb, var(--brown) 14%, transparent); }
.chip svg { width: 12px; height: 12px; }

/* ─── Résumé ─── */
.progress { display: flex; align-items: center; gap: 14px; min-height: 46px; padding: 0 18px; }
.progress .l { width: 96px; flex: none; }
.progress .bar { flex: 1; height: 6px; border-radius: 3px; background: var(--fill); overflow: hidden; }
.progress .bar i { display: block; height: 100%; border-radius: 3px; transition: width .4s; }
.progress .n { min-width: 40px; text-align: right; color: var(--sec); font-variant-numeric: tabular-nums; }
.empty-day { padding: 18px; display: flex; flex-direction: column; gap: 14px; color: var(--sec); }

/* ─── Lignes de chambre ─── */
.room-row { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 64px; padding: 10px 16px; text-align: left; }
.room-row .main { flex: 1; min-width: 0; display: block; }
.room-row .code { font-size: 20px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.room-row.handled .code { color: var(--sec); }
.room-row .meta { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; font-size: 15px; color: var(--sec); overflow: hidden; overflow-wrap: anywhere; }   /* deux lignes au plus : le prénom n'est plus coupé sur téléphone */
.room-row .notes { font-size: 15px; font-weight: 600; color: var(--orange); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.room-row .who { font-size: 13px; font-weight: 600; }
.st-word { font-weight: 600; }
.st-done { color: var(--green); } .st-refused { color: var(--orange); } .st-cleared, .st-available { color: var(--blue); } .st-unavailable { color: var(--sec); }
.star { color: var(--orange); width: 14px; height: 14px; flex: none; }
.late { color: var(--red); font-size: 13px; font-weight: 700; }
.kind-tile { width: 38px; height: 38px; border-radius: 11px; flex: none; display: inline-flex; align-items: center; justify-content: center;
  font: 700 14px ui-rounded, -apple-system, sans-serif; }
.kind-tile.D { color: var(--blue); background: color-mix(in srgb, var(--blue) 22%, transparent); }
.kind-tile.R { color: var(--green); background: color-mix(in srgb, var(--green) 22%, transparent); }
.kind-tile.BR { color: var(--brown); background: color-mix(in srgb, var(--brown) 22%, transparent); }
.kind-tile.task { color: var(--accent); background: var(--fill); }
.kind-tile.task svg { width: 18px; height: 18px; }
.kind-tile.task.info { color: var(--sec); }
.kind-tile.task.all { color: var(--on-accent); background: var(--accent); }
.kind-tile.dim { opacity: .5; }
.badge { display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; flex: none; }
.badge svg { display: block; }
.b-done { background: var(--green); } .b-refused { background: var(--orange); } .b-cleared, .b-available { background: var(--blue); }
.b-unavailable { background: var(--ko); }
.b-verified { background: var(--green); }

/* ─── Urgent ─── */
.urgent-card { background: color-mix(in srgb, var(--red) 14%, var(--card)); border-radius: 26px; overflow: hidden; box-shadow: inset 0 0 0 1.5px var(--red); }
.urgent-card .room-row .code { color: var(--red); }
.urgent-tag { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 800; letter-spacing: .04em; color: #fff; background: var(--red-bg);
  padding: 2px 8px; border-radius: 999px; }
.pulse { animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.alarm { position: fixed; inset: 0; z-index: 200; background: #B3261E; color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: calc(var(--safe-top) + 24px) 24px calc(var(--safe-bottom) + 24px); text-align: center; gap: 14px; animation: flash 1s steps(2, start) infinite; }
@keyframes flash { 50% { background: #7E140E; } }
.alarm .big { font: 800 56px/1 ui-rounded, -apple-system, sans-serif; letter-spacing: .02em; }
.alarm .room { font: 800 72px/1 ui-rounded, -apple-system, sans-serif; }
.alarm .txt { font-size: 20px; font-weight: 600; max-width: 22em; }
.alarm button { margin-top: 18px; min-height: 64px; width: min(340px, 100%); border-radius: 999px; background: #fff; color: #B3261E; font-size: 22px; font-weight: 800; }

/* ─── Plan ─── */
.plan { padding: 18px 6px; }
.plan .lvl { display: flex; align-items: stretch; gap: 6px; }
.plan .flab { width: 24px; flex: none; font-size: 13px; font-weight: 700; color: var(--sec); text-align: center; padding-top: 10px; }
.plan .tower { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: flex-end; }
.plan .tower > .cell { flex: 1; }
.plan .cell { display: flex; flex-wrap: wrap; justify-content: center; align-content: center; gap: 4px; padding: 5px 4px;
  min-height: calc(var(--t) + 10px); box-shadow: inset 2px 0 var(--sep), inset -2px 0 var(--sep), inset 0 1px var(--sep); }
.plan .cell.base { box-shadow: inset 2px 0 var(--sep), inset -2px 0 var(--sep), inset 0 1px var(--sep), inset 0 -2px var(--sep); }
.plan .roof { height: 24px; position: relative; display: flex; align-items: flex-end; }
.plan .roof svg { width: 100%; height: 14px; display: block; color: var(--sec); }
.plan .names { display: flex; gap: 6px; padding-top: 12px; }
.plan .names div { flex: 1; text-align: center; font-weight: 700; }
.tile { position: relative; flex: none; width: var(--t); height: var(--t); border-radius: 9px; display: flex; align-items: center; justify-content: center; }
.tile .n { font: 700 calc(var(--t) * .34) ui-rounded, -apple-system, sans-serif; font-variant-numeric: tabular-nums; margin-top: calc(var(--t) * -.06); }
.tile .k { position: absolute; left: calc(var(--t) * .12); bottom: calc(var(--t) * .06); font: 800 max(10px, calc(var(--t) * .24)) ui-rounded, -apple-system, sans-serif; }
.tile .s { position: absolute; right: calc(var(--t) * .06); bottom: calc(var(--t) * .06); }
.tile .p { position: absolute; right: calc(var(--t) * .05); top: calc(var(--t) * .04); width: calc(var(--t) * .2); height: calc(var(--t) * .2); color: var(--orange); }
.tile .o { position: absolute; left: calc(var(--t) * .07); top: calc(var(--t) * .03); font: 800 calc(var(--t) * .2) -apple-system, sans-serif; }
.tile .mk { position: absolute; left: 50%; top: calc(var(--t) * .03); transform: translateX(-50%); display: flex; gap: 1px; pointer-events: none; }
.tile .mk i { font: 800 calc(var(--t) * .18) -apple-system, sans-serif; font-style: normal; line-height: 1; padding: 1px calc(var(--t) * .05); border-radius: 4px; color: #fff; }
.tile .mk .a { background: var(--blue); }
.tile .mk .b { background: none; padding: 0; display: inline-flex; }
.tile .mk .b img { width: calc(var(--t) * .22); height: calc(var(--t) * .22); min-width: 11px; min-height: 11px; display: block; border-radius: 3px; }
.tile .nd { position: absolute; left: calc(var(--t) * .08); top: calc(var(--t) * .08); width: calc(var(--t) * .15); height: calc(var(--t) * .15); border-radius: 50%; background: var(--orange); }
.tile.dep { background: var(--fill); color: var(--sec); }
.tile.dep.on { background: var(--bright); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .25); }
.tile.rec { color: var(--sec); box-shadow: inset 0 0 0 1.5px var(--ko); background-image: none; border: 1.5px dashed var(--ko); box-shadow: none; }
.tile.rec.on { color: var(--fg); border: 1.5px solid color-mix(in srgb, var(--fg) 75%, transparent); }
.tile.void { background: var(--empty); }
.tile.out { color: var(--sec); border: 1px dashed var(--ko); }
.tile.out .n { font-weight: 600; }
.tile.urg { box-shadow: 0 0 0 2.5px var(--red); }
.tile.sel { transform: scale(1.12); transition: transform .2s; z-index: 2; }

/* ─── Bulle (popover) ─── */
.scrim { position: fixed; inset: 0; z-index: 80; }
.bubble { position: fixed; z-index: 81; width: 300px; max-width: calc(100vw - 24px); max-height: min(480px, calc(100vh - 140px)); overflow-y: auto;
  background: var(--card); border-radius: 26px; box-shadow: var(--shadow), inset 0 0 0 .5px var(--sep); padding: 16px;
  transform-origin: var(--ox, 50%) var(--oy, 0); scrollbar-width: none; }
.bubble::-webkit-scrollbar { display: none; }
.bubble.anim { animation: pop .22s cubic-bezier(.2, 1.2, .4, 1); }
@keyframes pop { from { opacity: 0; transform: scale(.85); } }
.bubble .bh { display: flex; align-items: center; gap: 8px; }
.bubble .bh .title { font: 700 24px ui-rounded, -apple-system, sans-serif; font-variant-numeric: tabular-nums; }
.bubble .meta { font-size: 13px; color: var(--sec); margin-top: 3px; }
.bubble .bnote { font-size: 13px; font-weight: 600; color: var(--accent); margin-top: 2px; }
.bubble .stack { display: flex; flex-direction: column; gap: 14px; }
.icon-bar { display: flex; align-items: flex-start; gap: 2px; padding: 4px; border-radius: 26px; background: var(--fill); flex-wrap: wrap; }
.icon-bar .sep { width: 1px; height: 26px; background: var(--sep); margin: 9px 2px 0; }
.ib { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 52px; padding: 0 2px; }
.ib .c { width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--tint); }
.ib.on .c { background: var(--tint); color: var(--on-accent); }
.ib .c svg { width: 18px; height: 18px; }
.ib small { font-size: 10.5px; font-weight: 600; color: var(--sec); line-height: 1.1; text-align: center; padding-bottom: 3px; }
.del { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 44px; min-height: 44px; border-radius: 999px; color: var(--red); font-weight: 700; font-size: 15px; margin-left: auto; }
.del.armed { background: var(--red-bg); color: #fff; padding: 0 14px; }
.del svg { width: 18px; height: 18px; }
.mini-seg .seg button { font-size: 14px; min-height: 32px; padding: 0 8px; }
.note-item { display: flex; align-items: center; justify-content: space-between; gap: 6px; width: 100%; min-height: 40px; padding: 0 12px; border-radius: 12px;
  background: var(--fill); font-size: 15px; font-weight: 500; text-align: left; }
.note-item svg { width: 18px; height: 18px; color: var(--sec); flex: none; }
.add-line { display: flex; align-items: center; gap: 6px; padding: 0 6px 0 12px; min-height: 44px; border-radius: 12px; background: var(--fill); }
.add-line input { flex: 1; min-width: 0; }
.add-line button { color: var(--accent); width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; }
.add-line button svg { width: 26px; height: 26px; }
.kv { font-size: 13px; color: var(--sec); }
.kv b { color: var(--fg); font-weight: 600; }

/* ─── Feuille (sheet) ─── */
.sheet-scrim { position: fixed; inset: 0; z-index: 90; background: rgba(0, 0, 0, .35); }
.sheet-scrim.anim { animation: fade .25s; }
@keyframes fade { from { opacity: 0; } }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; top: calc(var(--safe-top) + 12px); z-index: 91; background: var(--bg); border-radius: 26px 26px 0 0;
  display: flex; flex-direction: column; max-width: 680px; margin: 0 auto; box-shadow: 0 -4px 30px rgba(0, 0, 0, .25); }
.sheet.level2 { z-index: 93; top: calc(var(--safe-top) + 24px); }
.sheet-scrim.level2 { z-index: 92; }
@keyframes up { from { transform: translateY(100%); } }
.sheet.anim { animation: up .32s cubic-bezier(.2, .9, .3, 1); }
.sheet .grab { width: 36px; height: 5px; border-radius: 3px; background: var(--sep); margin: 6px auto 0; flex: none; }
.sheet .nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 12px 8px; flex: none; }
.sheet .nav .ttl { font-size: 17px; font-weight: 600; text-align: center; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sheet .nav .glass-btn.ok { background: var(--accent); color: var(--on-accent); }
.sheet .body { flex: 1; overflow-y: auto; padding: 0 16px calc(var(--safe-bottom) + 24px); -webkit-overflow-scrolling: touch; }
.sheet .tools { flex: none; padding: 10px 16px calc(var(--safe-bottom) + 8px); border-top: .5px solid var(--sep); background: var(--bg); display: flex; flex-direction: column; gap: 8px; }
.tools .tr { display: flex; gap: 8px; }
.tool { flex: 1; min-height: 44px; border-radius: 999px; font-size: 15px; font-weight: 600; background: var(--glass);
  box-shadow: inset 0 0 0 .5px var(--sep), 0 1px 4px rgba(0, 0, 0, .06); white-space: nowrap; padding: 0 6px; }
.tool.on { background: var(--accent); color: var(--on-accent); box-shadow: none; }
.who-row { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.who-row::-webkit-scrollbar { display: none; }
.who-row .chip { min-height: 36px; }

/* ─── Barre d'onglets ─── */
.tabbar { position: fixed; z-index: 50; left: 50%; transform: translate(-50%, var(--tb-dy, 0px)); bottom: calc(var(--safe-bottom) + 10px); display: flex; gap: 2px; padding: 4px;
  border-radius: 999px; background: var(--glass); backdrop-filter: blur(20px) saturate(1.7); -webkit-backdrop-filter: blur(20px) saturate(1.7);
  box-shadow: var(--shadow), inset 0 0 0 .5px var(--sep); max-width: calc(100vw - 24px); }
.tabbar button { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-width: 64px; height: 54px;
  padding: 0 8px; border-radius: 999px; color: var(--fg); font-size: 10px; font-weight: 600; }
.tabbar button svg { width: 24px; height: 24px; }
.tabbar button.on { color: var(--accent); background: var(--fill); }
.tabbar .count { position: absolute; top: 3px; right: 10px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--red-bg); color: #fff;
  font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; }

/* ─── Annuler, messages courts ─── */
.undo { position: fixed; z-index: 60; left: 50%; transform: translateX(-50%); bottom: calc(var(--safe-bottom) + 84px); display: flex; align-items: center; gap: 14px;
  padding: 6px 6px 6px 20px; border-radius: 999px; background: var(--glass); backdrop-filter: blur(20px) saturate(1.7); -webkit-backdrop-filter: blur(20px) saturate(1.7);
  box-shadow: var(--shadow), inset 0 0 0 .5px var(--sep); max-width: calc(100vw - 32px); }
.undo.anim { animation: rise .25s cubic-bezier(.2, 1.1, .4, 1); }
.undo.in-sheet { z-index: 99; bottom: calc(var(--safe-bottom) + 140px); }
@keyframes rise { from { opacity: 0; transform: translate(-50%, 20px); } }
.undo span { font-size: 15px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.undo button { min-height: 44px; padding: 0 18px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-weight: 700; flex: none; }
.toast { position: fixed; z-index: 300; left: 50%; transform: translateX(-50%); top: calc(var(--safe-top) + 12px); max-width: calc(100vw - 32px);
  padding: 12px 18px; border-radius: 18px; background: var(--fg); color: var(--bg); font-size: 15px; font-weight: 600; box-shadow: var(--shadow); }
.toast.anim { animation: fade .2s; }
.toast.err { background: var(--red-bg); color: #fff; }
.live { position: fixed; z-index: 55; top: calc(var(--safe-top) + 6px); left: 50%; transform: translateX(-50%); font-size: 12px; font-weight: 700; padding: 4px 10px;
  border-radius: 999px; background: var(--orange); color: #fff; }

/* ─── Connexion ─── */
.login { max-width: 420px; margin: 0 auto; padding: calc(var(--safe-top) + 40px) 16px calc(var(--safe-bottom) + 24px); }
.login .brand { display: flex; flex-direction: column; align-items: center; gap: 10px; padding-bottom: 24px; text-align: center; }
.login .brand img { width: 60px; height: 60px; border-radius: 16px; }
.login .brand img.wordmark { width: min(240px, 70vw); height: auto; border-radius: 0; margin-bottom: 6px; }
.login .brand h1 { margin: 0; font-size: 28px; }
.login .brand .hk-logo-h { width: min(360px, 84vw); line-height: 0; color: var(--fg); }
.login .brand .hk-logo { width: 100%; height: auto; display: block; overflow: visible; }
.login .brand p { margin: 0; color: var(--sec); }
.demo-code { margin-top: 6px; font-size: 14px; color: var(--muted, var(--fg)); }
.demo-code b { font-size: 18px; letter-spacing: 2px; color: var(--fg); }
.pin-dots { display: flex; justify-content: center; gap: 16px; margin: 10px 0 8px; height: 16px; }
.pin-dots i { width: 14px; height: 14px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--fg); }
.pin-dots i.on { background: var(--fg); }
.pad { display: grid; grid-template-columns: repeat(3, 76px); gap: 16px 24px; justify-content: center; margin-top: 22px; }
.pad button { width: 76px; height: 76px; border-radius: 50%; background: var(--fill); font: 500 30px ui-rounded, -apple-system, sans-serif; }
.pad button.ok { background: var(--accent); color: var(--on-accent); font-size: 17px; font-weight: 700; }
.pad button.txt { background: none; font-size: 15px; font-weight: 600; color: var(--accent); }
.pad button svg { width: 26px; height: 26px; }
.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-10px); } 40%, 80% { transform: translateX(10px); } }

/* ─── Messages, signalements ─── */
.msg { padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.msg .top { display: flex; align-items: baseline; gap: 8px; font-size: 13px; color: var(--sec); }
.msg .top b { color: var(--fg); font-size: 15px; }
.msg .top .t { margin-left: auto; font-variant-numeric: tabular-nums; }
.msg .txt { font-size: 17px; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.unread .txt { font-weight: 600; }
.steps { display: flex; gap: 6px; flex-wrap: wrap; }
.step { min-height: 40px; padding: 0 14px; border-radius: 999px; font-size: 14px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px;
  background: var(--fill); color: var(--fg); }
.step.on { background: var(--green); color: var(--on-accent); }
.step svg { width: 14px; height: 14px; }
.track { font-size: 13px; color: var(--sec); display: flex; flex-direction: column; gap: 2px; }
.track b { color: var(--fg); font-weight: 600; }
.tagline { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--fill); color: var(--sec); }
.tagline.done { background: color-mix(in srgb, var(--green) 18%, transparent); color: var(--green); }
.thumb { width: 100%; max-height: 220px; object-fit: cover; border-radius: 14px; display: block; }
.photo-pick { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; border-radius: 14px; background: var(--fill); color: var(--accent); font-weight: 600; width: 100%; }
.photo-pick svg { width: 20px; height: 20px; }
.viewer { position: fixed; inset: 0; z-index: 250; background: rgba(0, 0, 0, .92); display: flex; align-items: center; justify-content: center; }
.viewer img { max-width: 100%; max-height: 100%; }

/* ─── Historique ─── */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; padding: 14px; }
.cal .h { text-align: center; font-size: 12px; font-weight: 600; color: var(--sec); }
.cal .d { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; border-radius: 50%; color: color-mix(in srgb, var(--sec) 60%, transparent); }
.cal .d.has { background: var(--accent); color: var(--on-accent); font-weight: 600; }
.cal .d.today { box-shadow: inset 0 0 0 1.5px var(--accent); color: var(--accent); }
.month-nav { display: flex; align-items: center; justify-content: space-between; min-height: 52px; }

/* ─── Divers ─── */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.pad16 { padding: 16px; }
.mt14 { margin-top: 14px; } .mt20 { margin-top: 20px; } .mt28 { margin-top: 28px; }
.muted { color: var(--sec); }
.small { font-size: 13px; }
.hint { font-size: 13px; color: var(--orange); }
.person-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; }
.right { margin-left: auto; }
/* Mouvements réduits : tout s'arrête sauf les alertes (clignotement lent, demandé par l'hôtel) */
@media (prefers-reduced-motion: reduce) { *:not(.blink):not(.alarm):not([data-blink]), *::before, *::after { animation: none !important; transition: none !important; } }
@media print { #app { display: none !important; } }

.conn { display: inline-flex; align-items: center; gap: 6px; flex: none; font-size: 12px; font-weight: 700; padding: 5px 10px; border-radius: 999px;
  background: color-mix(in srgb, var(--green) 16%, transparent); color: var(--green); white-space: nowrap; }
.conn i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.conn.off { background: color-mix(in srgb, var(--orange) 18%, transparent); color: var(--orange); }
.conn.off i { animation: pulse 1.2s infinite; }
@media (max-width: 380px) { .conn { font-size: 0; gap: 0; padding: 7px; } }

/* ─── Avis « chambre faite » (réception) ─── */
@keyframes blink { 0%, 100% { background: var(--red-bg); color: #fff; box-shadow: 0 0 0 0 color-mix(in srgb, var(--red) 55%, transparent); }
  50% { background: #6E140C; color: #fff; box-shadow: 0 0 0 7px transparent; } }
.blink { animation: blink 1.1s ease-in-out infinite; background: var(--red-bg); color: #fff; }
.notice { display: flex; align-items: center; gap: 14px; min-height: 68px; padding: 10px 14px 10px 16px; }
.notice .main { flex: 1; min-width: 0; cursor: pointer; }
.notice .code { font-size: 20px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.notice .meta { font-size: 15px; color: var(--sec); }
.notice:not(.wait) .code { color: var(--sec); }
.notice .ack { flex: none; min-height: 44px; padding: 0 18px; border-radius: 999px; font-weight: 700; font-size: 15px; }
.notice .acked { flex: none; width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--green);
  background: color-mix(in srgb, var(--green) 16%, transparent); }
.notice .acked svg { width: 16px; height: 16px; }
.notice-banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 52px; padding: 8px 8px 8px 20px;
  border-radius: 999px; margin-bottom: 14px; font-weight: 700; text-align: left; }
.notice-banner .go { flex: none; padding: 8px 16px; border-radius: 999px; background: rgba(255, 255, 255, .22); }

/* ─── Menu latéral : caché sur téléphone ─── */
.side-brand, .side-wm, .tabbar .side-me, .side-title { display: none; }

/* Menu déroulant Messagerie : sur téléphone une barre flottante au-dessus du menu ; sur ordinateur les trois entrées sous « Messagerie » */
.tabbar .subtabs { position: absolute; bottom: calc(100% + 10px); left: 50%; transform: translateX(-50%); display: flex; gap: 2px; padding: 4px; border-radius: 999px;
  background: var(--glass); backdrop-filter: blur(20px) saturate(1.7); -webkit-backdrop-filter: blur(20px) saturate(1.7); box-shadow: var(--shadow), inset 0 0 0 .5px var(--sep); }
.tabbar .grp-btn .chev { display: none; width: 16px; height: 16px; transition: transform .2s; }
.tabbar .grp-btn .chev svg { width: 100%; height: 100%; }
.tabbar.many .subtabs button:not(.on) .lbl { display: inline; }
.tabbar.many .subtabs button, .tabbar.many .subtabs button.on { min-width: 64px; padding: 0 8px; }

/* Beaucoup d'onglets (réception) sur téléphone ou tablette : icônes seules, le nom seulement pour l'onglet ouvert */
@media (max-width: 1023px) {
  .tabbar.many button { min-width: 46px; padding: 0 8px; }
  .tabbar.many button:not(.on) .lbl { display: none; }
  .tabbar.many button.on { padding: 0 14px; }
  .tabbar.many .count { right: 4px; }
}

/* ─── Petits téléphones (iPhone SE, 320–360 px) ─── */
@media (max-width: 360px) {
  .screen { padding-left: 12px; padding-right: 12px; }
  .tabbar button { min-width: 54px; padding: 0 4px; }
  .large-title { font-size: 30px; }
  .notice .ack { padding: 0 12px; }
  .seg button { padding: 0 8px; font-size: 13.5px; }
  .notice { gap: 10px; padding-left: 12px; }
}

/* ─── Tablette et ordinateur : les feuilles deviennent des fenêtres centrées ─── */
@media (min-width: 760px) and (min-height: 600px) {
  .sheet { top: 5vh; bottom: 5vh; border-radius: 24px; max-width: 680px; box-shadow: 0 10px 50px rgba(0, 0, 0, .35); }
  .sheet.level2 { top: 7vh; bottom: 7vh; }
  .sheet .grab { visibility: hidden; }
  .sheet .body { padding-bottom: 24px; }
  .sheet .tools { padding-bottom: 12px; border-radius: 0 0 24px 24px; }
}

/* ─── Ordinateur : menu à gauche, contenu large ─── */
@media (min-width: 1024px) {
  .topfade { display: none; }
  .screen { margin: 0 0 0 232px; max-width: none; padding: 28px 40px 60px; }
  .screen.no-side { margin: 0 auto; max-width: 640px; padding: 28px 16px 60px; }   /* connexion : pas de menu à gauche */
  .screen > * , .screen .duo { margin-left: auto; margin-right: auto; }
  .screen > .fold { margin-left: auto; margin-right: auto; }   /* « Clôturés » : même colonne que les cartes */
  .screen.tab-messages > *, .screen.tab-signalements > *, .screen.tab-historique > *, .screen.tab-equipe > * { max-width: 860px; }
  .screen.tab-feuilles > *, .screen.tab-gouvernante > * { max-width: 1120px; }
  .screen.tab-jour > .duo { max-width: 1320px; }
  .duo { display: grid; grid-template-columns: minmax(0, 1fr) var(--side, 470px); gap: 28px; align-items: start; }
  .duo .side { position: sticky; top: 24px; max-height: calc(100vh - 48px); overflow-y: auto; scrollbar-width: thin; padding-bottom: 8px; }
  .side-title { display: block; font-size: 22px; font-weight: 700; padding: 10px 4px 14px; }
  .header .logo { display: none; }

  .tabbar { left: 0; top: 0; bottom: 0; transform: none; width: 232px; max-width: none; flex-direction: column; align-items: stretch; gap: 4px;
    padding: 22px 14px 18px; border-radius: 0; box-shadow: inset -.5px 0 var(--sep); background: var(--card); backdrop-filter: none; -webkit-backdrop-filter: none; }
  .tabbar button { flex-direction: row; justify-content: flex-start; gap: 12px; height: 46px; min-width: 0; padding: 0 14px; border-radius: 12px; font-size: 16px; font-weight: 600; }
  .tabbar button svg { width: 22px; height: 22px; }
  .tabbar .subtabs { position: static; transform: none; flex-direction: column; gap: 2px; padding: 0 0 4px 20px; background: none; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; border-radius: 0; }
  .tabbar .subtabs button { height: 40px; font-size: 15px; }
  .tabbar .grp-btn .chev { display: inline-flex; margin-left: auto; }
  .tabbar .grp-btn .count + .chev { margin-left: 8px; }
  .tabbar button:hover:not(.on) { background: color-mix(in srgb, var(--fill) 60%, transparent); }
  .tabbar .count { position: static; margin-left: auto; height: 22px; min-width: 22px; border-radius: 11px; font-size: 12px; }
  .side-brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 22px; }
  .side-brand img { width: 40px; height: 40px; border-radius: 11px; }
  .side-brand b { display: block; font-size: 17px; }
  .side-brand span { display: block; font-size: 13px; color: var(--sec); }
  .tabbar .side-me { display: flex; flex-direction: row; align-items: center; justify-content: flex-start; gap: 10px; text-align: left; margin-top: auto; height: auto; min-height: 56px;
    padding: 8px 14px; font-size: 15px; border-top: .5px solid var(--sep); border-radius: 0; }
  .tabbar .side-me .me-txt { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; }
  .tabbar .side-me small { font-size: 12px; color: var(--sec); font-weight: 500; }

  .undo, .toast, .live { left: calc(50% + 116px); }
  .undo { bottom: 28px; }
  .undo.in-sheet { bottom: 28px; }
  .room-row:hover, .notice:hover { background: color-mix(in srgb, var(--fill) 45%, transparent); }
  .screen .pills { max-width: 640px; }
  .screen .mt14 > .pill, .screen > .pill { max-width: 420px; }
  .duo .side .pills { max-width: none; }
}

/* Plan : numéro complet (A204, SSA001), taille selon la longueur, comme sur les feuilles */
.tile .n.l4 { font-size: calc(var(--t) * .29); letter-spacing: -.02em; }
.tile .n.l5 { font-size: calc(var(--t) * .245); letter-spacing: -.03em; }
.tile .n.l6 { font-size: calc(var(--t) * .21); letter-spacing: -.03em; }

/* Message reçu : « Lu » clignote tant qu'il n'est pas touché ; avis de changement ; texte sur plusieurs lignes */
.step[data-blink] { animation: blink 1.1s ease-in-out infinite; background: var(--red-bg); color: #fff; }
.msg .txt { white-space: pre-line; }
.tagline.change { background: color-mix(in srgb, var(--orange) 16%, transparent); color: var(--orange); }
.msg .top .urgent-tag { margin-right: 2px; }
.notice .ack { background: var(--fill); color: var(--fg); }

/* ── Discussions : bulles, zone de réponse ── */
.thread-btn .dot { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: #fff; color: var(--red); font-size: 12px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }
.chat { display: flex; flex-direction: column; gap: 6px; padding: 4px 2px 8px; }
.chat-empty { color: var(--sec); font-size: 15px; text-align: center; padding: 14px 0; }
.bub { position: relative; -webkit-touch-callout: none; align-self: flex-start; max-width: 82%; background: var(--card); border-radius: 18px 18px 18px 6px; padding: 8px 12px; box-shadow: 0 1px 0 var(--sep); }
.bub.me { align-self: flex-end; background: var(--accent); color: var(--on-accent); border-radius: 18px 18px 6px 18px; }
.bub .who { font-size: 13px; font-weight: 700; padding-bottom: 2px; }
.bub .t { font-size: 16px; white-space: pre-line; overflow-wrap: anywhere; }
.bub .h { font-size: 11px; opacity: .65; text-align: right; padding-top: 2px; font-variant-numeric: tabular-nums; }
.reply-line { display: flex; gap: 8px; align-items: flex-end; }
.reply-line textarea { flex: 1; min-height: 44px; max-height: 140px; resize: none; field-sizing: content; }
.reply-line .send { width: 44px; height: 44px; flex: none; border-radius: 22px; background: var(--accent); color: var(--on-accent); display: inline-flex; align-items: center; justify-content: center; }
.reply-line .send svg { width: 20px; height: 20px; }

/* ── Groupe général ── */
.group-row { gap: 12px; }
.group-av { width: 40px; height: 40px; background: var(--accent); color: var(--on-accent); flex: none; }
.group-av svg { width: 22px; height: 22px; }
.gr-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.gr-prev { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.group-row .count { position: static; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 11px; background: var(--red-bg); color: #fff; font-size: 13px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.bub-ph { display: block; margin: 2px 0 4px; }
.bub-ph img { display: block; width: min(240px, 60vw); height: 180px; object-fit: cover; border-radius: 12px; }
.bub .h { display: flex; justify-content: flex-end; gap: 10px; align-items: baseline; }
.bub .rm { font-size: 11px; font-weight: 600; color: inherit; opacity: .8; text-decoration: underline; }
.bub .edit-box { display: grid; gap: 8px; min-width: min(260px, 60vw); }
.bub .edit-box textarea { width: 100%; }
.bub .edit-actions { display: flex; justify-content: flex-end; gap: 8px; }
.bub .rm.on {opacity: 1; color: #fff; background: var(--red-bg); border-radius: 8px; padding: 1px 6px; text-decoration: none; }
.reply-line .send.soft { background: var(--fill); color: var(--accent); cursor: pointer; }
.grp-pick { display: flex; align-items: center; gap: 10px; }
.grp-pick img { width: 64px; height: 64px; object-fit: cover; border-radius: 10px; }
.grp-pick .pill { flex: 1; }

.mention { font-weight: 700; color: var(--accent); }
.mention.me { background: color-mix(in srgb, var(--accent) 16%, transparent); border-radius: 6px; padding: 0 3px; }
.bub.me .mention { color: inherit; text-decoration: underline; }
.bub.me .mention.me { background: rgba(255, 255, 255, .22); }
.mention-row .chip { min-height: 32px; font-size: 14px; padding: 0 12px; flex: none; }

/* ── Logo Alfred Hotels (lettres seules, fond transparent) ── */
.wordmark { display: block; height: auto; filter: var(--wm-filter, none); }
.side-wm { padding: 4px 8px 18px; }
.side-wm .wordmark { width: 150px; }
.about-wm { display: flex; justify-content: center; padding: 22px 0 6px; }
.about-wm .wordmark { width: 150px; opacity: .85; }
@media (min-width: 1024px) { .side-wm { display: block; } }

/* ─── Préparer la journée : plein écran ─── */
.sheet.full { top: 0; bottom: 0; left: 0; right: 0; max-width: none; margin: 0; border-radius: 0; z-index: 95; padding-top: var(--safe-top); box-shadow: none; }
.sheet.full.anim { animation: fade .2s; }
.sheet.short { top: auto; max-height: 70%; }   /* petite confirmation : pas toute la hauteur */
.sheet.full .grab { display: none; }
.sheet-scrim:has(+ .sheet.full) { z-index: 94; }
.sheet.level2 { z-index: 97; }
.sheet-scrim.level2 { z-index: 96; }
.sheet .nav .ttl small { display: block; font-size: 12px; font-weight: 500; color: var(--sec); }
.sheet.full .nav { padding: 8px 14px; }
.sheet.full .tools { padding-top: 8px; gap: 6px; }
.sheet.full .plan { padding: 12px 6px; }
.sheet.full .tile { transition: transform .08s; }
.sheet.full .plan .tile:active { transform: scale(.94); }
.sheet .nav .nav-l { display: flex; align-items: center; gap: 8px; min-width: 44px; }

/* En-tête : Réglages, titre + résumé, Terminé */
.ed-nav .ttl { text-align: left; min-width: 0; }
.ed-nav .ttl h2 { margin: 0; font-size: 17px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ed-nav .ttl small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ed-done { width: auto; flex: none; gap: 6px; padding: 0 16px 0 12px; }
.ed-done svg { width: 18px; height: 18px; stroke-width: 2.6; }

/* Plan de l'éditeur */
.ed-card { user-select: none; -webkit-user-select: none; }
.ed-bat { margin: 2px 0 10px; }
.ed-bat .seg button { min-height: 44px; }
.ed-bat .seg-n { background: rgba(127, 127, 127, .25); color: inherit; }
.tile.et { overflow: hidden; }
.tile.et .n { margin-top: calc(var(--t) * -.1); }
.tile.et .k { left: calc(var(--t) * .08); top: calc(var(--t) * .05); bottom: auto; font-size: max(9px, calc(var(--t) * .19)); line-height: 1; }
.tile.et .p { right: calc(var(--t) * .06); top: calc(var(--t) * .05); width: calc(var(--t) * .2); height: calc(var(--t) * .2); }
.tile.et .p svg { width: 100%; height: 100%; }
.tile.et .mk { top: calc(var(--t) * .05); }
.tile.et .who { position: absolute; left: 0; right: 0; bottom: 0; height: calc(var(--t) * .27); display: flex; align-items: center; justify-content: center; gap: 2px;
  font: 800 max(8px, calc(var(--t) * .17)) -apple-system, sans-serif; color: #fff; letter-spacing: .01em; }
.tile.et.has .who { background: color-mix(in srgb, var(--pc) 78%, #000); }
.tile.et .who .s { position: static; display: inline-flex; }
.tile.et.dep { background: var(--bright); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .25), inset 0 0 0 1.5px color-mix(in srgb, var(--fg) 55%, transparent); }
.tile.et.rec { background: transparent; color: var(--fg); border: 1.5px dashed color-mix(in srgb, var(--fg) 70%, transparent); }
.tile.et.rec .who { bottom: -1.5px; left: -1.5px; right: -1.5px; }
.tile.et.out { background: transparent; border: none; box-shadow: inset 0 0 0 1px var(--sep); color: var(--sec); }
.tile.et.out .n { font-weight: 500; }
.tile.et.mine { box-shadow: 0 0 0 3px var(--pc), 0 2px 6px rgba(0, 0, 0, .2); }
.tile.et:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; z-index: 3; }

/* Légende sous le plan */
.ed-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 10px 6px 4px; font-size: 13px; color: var(--sec); }
.ed-legend > span { display: inline-flex; align-items: center; gap: 6px; }
.lt { width: 20px; height: 20px; border-radius: 5px; display: inline-flex; align-items: center; justify-content: center; font: 800 10px -apple-system, sans-serif; font-style: normal; color: var(--fg); }
.lt.dep { background: var(--bright); box-shadow: 0 1px 2px rgba(0, 0, 0, .25), inset 0 0 0 1.5px color-mix(in srgb, var(--fg) 55%, transparent); }
.lt.rec { border: 1.5px dashed color-mix(in srgb, var(--fg) 70%, transparent); }
.lt.out { box-shadow: inset 0 0 0 1px var(--sep); }

/* Dessins des outils (mêmes signes que sur les cases) */
.ti { flex: none; width: 24px; height: 24px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; font: 800 11px -apple-system, sans-serif; font-style: normal; line-height: 1; color: var(--fg); }
.ti.dep { background: var(--bright); box-shadow: 0 1px 2px rgba(0, 0, 0, .25), inset 0 0 0 1.5px color-mix(in srgb, var(--fg) 55%, transparent); color: var(--ink); }
.ti.rec { border: 1.5px dashed color-mix(in srgb, var(--fg) 70%, transparent); }
.ti.rm { color: var(--red); }
.ti.rm svg { width: 20px; height: 20px; stroke-width: 2.6; }
.ti.pr { color: var(--orange); }
.ti.pr svg { width: 20px; height: 20px; }
.ti.ar { width: 22px; height: 20px; border-radius: 5px; color: #fff; font-size: 12px; }
.ti.bk { width: 24px; height: 24px; border-radius: 6px; }
.ti.ar { background: var(--blue); }
.ti.bk img { width: 100%; height: 100%; display: block; border-radius: 6px; }
.ed-legend .ti { width: 20px; height: 20px; }
.ed-legend .ti.ar { width: 18px; height: 16px; font-size: 10px; }
.ed-legend .ti.bk { width: 18px; height: 18px; }
.ed-legend .ti.pr svg { width: 16px; height: 16px; }

/* Étiquette d'une personne (même que le bas des cases) */
.wt { flex: none; min-width: 34px; height: 24px; padding: 0 6px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center;
  font: 800 12px -apple-system, sans-serif; font-style: normal; color: #fff; background: color-mix(in srgb, var(--pc) 78%, #000); }
.wt.none { background: var(--fill); color: var(--sec); }
.ed-legend .wt { min-width: 0; height: 18px; font-size: 10px; padding: 0 5px; }

/* Panneau des outils */
.ed-ctl { display: flex; flex-direction: column; gap: 10px; }
  background: color-mix(in srgb, var(--accent) 11%, var(--card)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 25%, transparent); }
.ed-lab { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--sec); padding: 0 4px 6px; }
.ed-tools { display: grid; gap: 8px; }
.etool { position: relative; min-height: 48px; border-radius: 14px; background: var(--card); color: var(--fg); font-size: 15px; font-weight: 600;
  box-shadow: inset 0 0 0 1px var(--sep), 0 1px 3px rgba(0, 0, 0, .06); display: flex; align-items: center; gap: 10px; padding: 0 12px; text-align: left; }
.etool .lb { flex: 1; min-width: 0; }
.etool.on, .ewho.on { background: var(--accent); color: var(--on-accent); box-shadow: 0 0 0 2px var(--accent), 0 0 0 4px color-mix(in srgb, var(--accent) 30%, transparent); }
.etool.on .ti.rec { border-color: currentColor; color: var(--on-accent); }
.etool.on .ti.rm, .etool.on .ti.pr { color: var(--on-accent); }
.etool.danger:not(.on) .lb { color: var(--red); }
.ed-who { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.ewho { min-height: 48px; border-radius: 14px; background: var(--card); color: var(--fg); font-size: 15px; font-weight: 600; box-shadow: inset 0 0 0 1px var(--sep), 0 1px 3px rgba(0, 0, 0, .06);
  display: flex; align-items: center; gap: 8px; padding: 0 10px; text-align: left; }
.ewho .lb { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ewho .cnt { flex: none; white-space: nowrap; min-width: 26px; height: 24px; padding: 0 7px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 13px; background: var(--fill); }
.ewho.nobody { grid-column: 1 / -1; }
.ewho.on .cnt { background: rgba(255, 255, 255, .25); }
.ewho.on .wt { box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .8); }
.ed-help { font-size: 13px; line-height: 1.5; color: var(--sec); padding: 10px 6px 0; }
.ed-help p { margin: 0 0 6px; }
.ed-help b { color: var(--fg); font-weight: 600; }
.ed-help kbd { font: 600 11px ui-monospace, Menlo, monospace; min-width: 18px; display: inline-block; padding: 1px 5px; border-radius: 5px; text-align: center;
  border: 1px solid color-mix(in srgb, var(--fg) 30%, transparent); color: var(--fg); background: var(--card); }
.ed-extra { padding: 0 0 40px; }
.ed-extra .chip { min-height: 44px; padding: 0 14px; font-size: 14px; }
.ed-danger { padding: 14px 0 0; }
.ed-danger .pill svg { width: 18px; height: 18px; }
.sheet.full .body { padding-bottom: 24px; }

@media (min-width: 900px) {
  .sheet.full .ed.split { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 400px; }
  .ed-plan { overflow-y: auto; padding: 0 12px 16px 24px; }
  .ed-card { border-radius: 22px; }
  .ed-side { overflow-y: auto; padding: 0 24px 24px; border-left: .5px solid var(--sep); }
  .ed-side > .seg { margin-bottom: 14px; }
  .ed-side > .seg button { min-height: 44px; }
  .ed-side .ed-extra { padding-bottom: 8px; }
  .ed-side .ed-ctl { padding: 0 0 16px; gap: 14px; }
  .ed-tools.four, .ed-tools.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .etool, .ewho { min-height: 52px; font-size: 16px; }
  .ed-nav { padding-left: 24px !important; padding-right: 24px !important; }
}
/* Écran bas : outils plus serrés pour que tout tienne sans défiler */
@media (min-width: 900px) and (max-height: 820px) {
  .ed-side .ed-ctl { gap: 8px; }
  .ed-side .ed-lab { padding-bottom: 3px; }
  .etool, .ewho { min-height: 46px; font-size: 15px; }
  .editing-split .undo, .editing-split .toast, .editing-split .live { left: calc((100% - 400px) / 2); }
  .editing-split .undo, .editing-split .undo.in-sheet { bottom: 24px; }
}

/* Téléphone et tablette : outils en bas, compacts (icône au-dessus du nom) */
@media (max-width: 899px) {
  .sheet.full .tools.ed-ctl { gap: 8px; padding-top: 8px; }
  .tools .ed-lab { display: none; }
  .tools .ed-tools.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .tools .ed-tools.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tools .ed-tools { gap: 6px; }
  .tools .etool { flex-direction: column; justify-content: center; gap: 3px; min-height: 48px; padding: 4px 2px; font-size: 13px; text-align: center; border-radius: 12px; line-height: 1.1; }
  .tools .etool .ti { width: 22px; height: 20px; }
  .tools .etool .ti svg { width: 18px; height: 18px; }
  /* Personnes : une seule ligne qui défile (le bord droit s'efface pour montrer qu'il y en a d'autres) */
  .tools .ed-who { display: flex; flex-wrap: nowrap; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: -3px -16px; padding: 3px 16px;
    -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); }
  .tools .ed-who::-webkit-scrollbar { display: none; }
  .tools .ewho { flex: none; min-height: 44px; font-size: 14px; padding: 0 8px; gap: 6px; border-radius: 12px; }
  .tools .ewho:last-child { margin-right: 24px; }
  .tools .ewho .lb { overflow: visible; }
  .tools .ewho .wt { min-width: 30px; height: 22px; font-size: 11px; padding: 0 5px; }
  .tools .ewho .cnt { min-width: 22px; height: 22px; font-size: 12px; padding: 0 5px; }
  .editing .undo.in-sheet { bottom: calc(var(--safe-bottom) + 184px); }
}
@media (max-width: 360px) {
  .ed-bat .seg-n { display: none; }
  .ed-bat .seg button { padding: 0 8px; font-size: 14px; }
  .ed-done span { display: none; }
  .ed-done { padding: 0; width: 44px; border-radius: 50%; }
  .tools .etool { font-size: 12px; }
}
.chip .cnt { font-weight: 800; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center; background: rgba(127, 127, 127, .22); }
.chip.on .cnt { background: rgba(255, 255, 255, .28); }
.ed-tabs { flex: none; padding: 0 16px 8px; }
.ed-tabs .seg button { min-height: 44px; }
.ed-tabs .seg button, .ed-side > .seg button { padding: 0 6px; font-size: 14.5px; }
.tk-form { padding: 16px; display: flex; flex-direction: column; gap: 18px; }
.tk-step { display: flex; flex-direction: column; gap: 10px; }
.tk-q { display: flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 700; }
.tk-q b { flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: var(--on-accent); display: inline-flex; align-items: center; justify-content: center; font-size: 14px; }
.tk-step .chip { min-height: 44px; }
.tk-who { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tk-who .ewho.wide { grid-column: 1 / -1; }
.wt.all { background: var(--accent); }
.wt.all svg { width: 18px; height: 18px; }
.tk-step .seg button { min-height: 44px; }
.tk-form .hint { color: var(--red); font-weight: 600; }
.tk-list { padding: 4px 0; }
.tk-row { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 16px; }
.tk-row + .tk-row { border-top: .5px solid var(--sep); }
.tk-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tk-del { flex: none; min-height: 44px; padding: 0 12px; border-radius: 12px; display: inline-flex; align-items: center; gap: 6px; color: var(--red); font-size: 14px; font-weight: 600; }
.tk-del svg { width: 18px; height: 18px; }
.ed-present .toggle-row { min-height: 46px; padding-top: 0; padding-bottom: 0; }

/* ─── Discussion intégrée sous un message ou un signalement ─── */
.inline-thread { margin-top: 10px; padding-top: 10px; border-top: .5px solid var(--sep); display: flex; flex-direction: column; gap: 8px; }
.inline-thread .chat { padding: 0; }
.inline-thread .chat:empty { display: none; }
.inline-thread .reply-line textarea { min-height: 42px; }
.link-btn { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 4px; font-size: 14px; font-weight: 600; color: var(--sec); }
.link-btn svg { width: 14px; height: 14px; }

/* ─── Un message ou un signalement = un ticket à part ─── */
.tickets { display: flex; flex-direction: column; gap: 14px; }
.ticket { box-shadow: 0 1px 3px rgba(0, 0, 0, .06), inset 0 0 0 .5px var(--sep); }
.ticket .msg { padding: 16px 18px 14px; }
.ticket .msg.unread { box-shadow: inset 4px 0 var(--red); }

.seg-n { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; margin-left: 6px; border-radius: 10px; background: var(--red-bg); color: #fff; font-size: 12px; font-weight: 800; vertical-align: 1px; }

.fold { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 48px; margin: 18px 0 10px; padding: 0 18px; border-radius: 16px; background: var(--card); color: var(--sec); font-size: 15px; font-weight: 600; box-shadow: inset 0 0 0 .5px var(--sep); }
.fold .chev { width: 18px; height: 18px; transition: transform .2s; display: inline-flex; }
.fold .chev svg { width: 100%; height: 100%; }

/* ─── Confirmation (ex. « faite » sur une chambre pas disponible) ─── */
.confirm-scrim { position: fixed; inset: 0; z-index: 120; background: rgba(0, 0, 0, .4); animation: fade .15s; }
.confirm { position: fixed; z-index: 121; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(340px, calc(100vw - 40px)); background: var(--bg); border-radius: 24px; padding: 24px 20px 16px; box-shadow: 0 10px 50px rgba(0, 0, 0, .35); text-align: center; }
.confirm p { font-size: 17px; font-weight: 600; margin: 0 0 18px; }
.confirm-btns { display: flex; gap: 10px; }
.confirm-btns button { flex: 1; min-height: 50px; border-radius: 999px; font-size: 16px; font-weight: 700; background: var(--glass); box-shadow: inset 0 0 0 .5px var(--sep); }
.confirm-btns .yes { background: var(--accent); color: var(--on-accent); box-shadow: none; }

.notice-banner { border-radius: 24px; padding: 10px 10px 10px 20px; }
.notice-banner .nb-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.notice-banner .nb-prev { font-weight: 500; font-size: 14px; opacity: .95; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.notice-banner .nb-prev b { font-weight: 700; }

.notice-banner .nb-prev.one { -webkit-line-clamp: 1; }

/* Interrupteurs du plan (au-dessus) */
.chks{margin:0 0 12px;padding:0}
.chks.under{margin:12px 0 0}
.chks .toggle-row{min-height:46px}

/* ═══════════ Discussions : liste, conversation, bulles ═══════════ */
.chat-list { padding: 4px 0; overflow: hidden; }
.chat-sec { padding: 18px 18px 8px; }
.chat-row { display: flex; align-items: center; gap: 14px; width: 100%; padding: 10px 16px; text-align: left; }
.chat-row .cr-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.chat-row .cr-top { display: flex; align-items: baseline; gap: 8px; }
.chat-row .cr-top b { flex: 1; min-width: 0; font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-row .cr-t { font-size: 12px; color: var(--sec); font-variant-numeric: tabular-nums; }
.chat-row .cr-t.new { color: var(--accent); font-weight: 700; }
.chat-row .cr-last { font-size: 15px; color: var(--sec); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-row .count { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--red-bg); color: #fff; font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.avatar svg { width: 55%; height: 55%; }
.avatar.bot { background: var(--card); box-shadow: inset 0 0 0 1px var(--sep); }
.avatar.bot img { width: 70%; height: 70%; object-fit: contain; }

.screen.chat-open { padding: 0; max-width: none; }
.chat-view { display: flex; flex-direction: column; height: 100dvh; width: 100%; background: var(--bg); }
.chat-head { display: flex; align-items: center; gap: 10px; padding: calc(var(--safe-top) + 8px) 12px 8px; border-bottom: 1px solid var(--sep); background: var(--glass); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
.chat-head .ch-title { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.chat-head .ch-title b { font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-head .ch-title small { font-size: 12px; color: var(--sec); }
.chat-head .small-pill { height: 36px; padding: 0 14px; font-size: 14px; width: auto; flex: none; }
.chat-scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: none; display: flex; flex-direction: column; gap: 3px; padding: 10px 12px 14px; }
.chat-foot { padding: 8px 12px calc(var(--safe-bottom) + 10px); border-top: 1px solid var(--sep); background: var(--bg); display: grid; gap: 8px; }
.chat-foot .mention-row { margin: 0; }

.cbw { display: flex; flex-direction: column; align-items: flex-start; max-width: 100%; }
.cbw.me { align-items: flex-end; }
.cbw.flash .cb { animation: flash 1.2s; }
@keyframes flash { 0%, 60% { box-shadow: 0 0 0 3px var(--accent); } 100% { box-shadow: 0 1px 0 var(--sep); } }
.cb { position: relative; -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; max-width: min(82%, 520px); background: var(--card); border-radius: 18px 18px 18px 6px; padding: 7px 11px 5px; box-shadow: 0 1px 0 var(--sep); cursor: pointer; -webkit-tap-highlight-color: transparent; }
.cbw.me .cb { background: var(--accent); color: var(--on-accent); border-radius: 18px 18px 6px 18px; }
.cb.sel { outline: 2px solid color-mix(in srgb, var(--accent) 55%, transparent); }
.cb .who { font-size: 13px; font-weight: 700; padding-bottom: 1px; }
.cb .t { font-size: 16px; white-space: pre-line; overflow-wrap: anywhere; }
.cb .t.del { font-style: italic; opacity: .65; }
.cb .h { display: flex; justify-content: flex-end; align-items: baseline; gap: 6px; font-size: 11px; opacity: .7; padding-top: 1px; font-variant-numeric: tabular-nums; }
.cb .h i { font-style: italic; }
.cb .tk { letter-spacing: -2px; font-size: 12px; }
.cb .tk.all { color: #7fd0ff; opacity: 1; }
.cbw:not(.me) .cb .tk.all { color: var(--blue); }
.cb .bub-ph { display: block; margin: 2px 0 4px; }
.cb .quote { display: flex; flex-direction: column; text-align: left; width: 100%; margin: 2px 0 5px; padding: 4px 8px; border-radius: 8px; border-left: 3px solid var(--accent); background: var(--fill); font-size: 13px; gap: 1px; }
.cbw.me .cb .quote { background: rgba(255, 255, 255, .2); border-left-color: #fff; }
.cb .quote span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; opacity: .85; }
.cb .edit-box { display: grid; gap: 8px; min-width: min(280px, 64vw); }
.cb .edit-box textarea { width: 100%; }
.cb .edit-actions { display: flex; justify-content: flex-end; gap: 8px; }
.cb .mention { font-weight: 700; color: var(--accent); }
.cbw.me .cb .mention { color: inherit; text-decoration: underline; }
.cbw.me .cb .mention.me { background: rgba(255, 255, 255, .22); }
.cb .botcard { display: grid; gap: 4px; min-width: 200px; padding-bottom: 2px; }
.cb .bc-top { display: flex; align-items: center; gap: 8px; }
.cb .bc-ic { width: 26px; height: 26px; border-radius: 8px; background: var(--accent); color: var(--on-accent); display: inline-flex; align-items: center; justify-content: center; }
.cb .bc-ic svg { width: 16px; height: 16px; }
.cb .bc-line { font-size: 15px; }
.cb .bc-codes { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 2px; }
.cb .bc-codes span { background: var(--fill); border-radius: 8px; padding: 2px 8px; font-weight: 700; font-size: 14px; }
.cb.bot { border-left: 4px solid var(--accent); }

.reacts { display: flex; gap: 4px; margin: -6px 10px 2px; position: relative; z-index: 1; }
.rx { display: inline-flex; align-items: center; gap: 3px; padding: 1px 7px; border-radius: 12px; background: var(--card); box-shadow: 0 1px 3px rgba(0,0,0,.18); font-size: 14px; }
.rx small { font-size: 11px; font-weight: 700; color: var(--sec); }
.rx.mine { outline: 1.5px solid var(--accent); }
.msg-actions { display: grid; gap: 6px; margin: 4px 0 6px; max-width: min(92%, 420px); }
.rx-row { display: flex; gap: 2px; padding: 4px 6px; border-radius: 999px; background: var(--card); box-shadow: var(--shadow); width: fit-content; }
.rx-row button { font-size: 24px; width: 40px; height: 40px; border-radius: 50%; }
.ma-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.ma-btns button { padding: 6px 14px; border-radius: 999px; background: var(--card); box-shadow: 0 1px 0 var(--sep); font-size: 14px; font-weight: 600; color: var(--accent); }
.ma-btns button.red { color: var(--red); }
.ma-btns button.red.on { background: var(--red-bg); color: #fff; }
.msg-actions .vu { font-size: 13px; color: var(--sec); padding: 0 4px; }
.day-sep { align-self: center; margin: 10px 0 6px; }
.day-sep span { font-size: 12px; font-weight: 600; color: var(--sec); background: var(--fill); padding: 3px 12px; border-radius: 999px; text-transform: capitalize; }
.chat-scroll .more { align-self: center; font-size: 14px; font-weight: 600; color: var(--accent); padding: 8px 16px; }
.chat-scroll .legacy { margin: 6px 0; align-self: stretch; }
.reply-bar { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 10px; background: var(--fill); border-left: 3px solid var(--accent); }
.reply-bar span { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 13px; overflow: hidden; }
.reply-bar span b { font-size: 13px; }
.reply-bar button svg { width: 18px; height: 18px; }
@media (max-width: 1023px) { body.in-chat .tabbar { display: none; } }
/* Discussion ouverte sur téléphone : calée sur la zone réellement visible (--vvh / --vvt posées par keepChatFit, main.js). Safari garde parfois la hauteur « clavier ouvert » une fois le clavier baissé. */
@media (max-width: 1023px) { body.in-chat .chat-view { position: fixed; left: 0; top: var(--vvt, 0px); height: var(--vvh, 100dvh); z-index: 5; } }
.cbw.me .cb .quote b, .cbw.me .cb .who { color: inherit !important; }


/* ═══ Tâches : une carte partout (écran Jour, onglet Tâches) ═══ */
.tc-list { padding: 2px 0; margin-bottom: 4px; }
.tc { display: flex; align-items: flex-start; gap: 12px; padding: 12px 12px 12px 14px; position: relative; }
.tc-ic { flex: none; width: 34px; height: 34px; margin-top: 2px; border-radius: 10px; display: grid; place-items: center; background: var(--fill); color: var(--accent); }
.tc-ic svg { width: 19px; height: 19px; }
.tc-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.tc-main { display: flex; flex-direction: column; gap: 3px; text-align: left; width: 100%; min-height: 40px; justify-content: center; }
.tc-text { font-size: 16.5px; font-weight: 600; line-height: 1.3; white-space: pre-line; overflow-wrap: anywhere; }
.tc:not(.open) .tc-text { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.tc-meta { font-size: 13px; color: var(--sec); line-height: 1.35; }
.tc-new { color: var(--accent); }
.tc-urg { display: inline-block; margin-right: 6px; padding: 1px 7px; border-radius: 6px; background: var(--red-bg); color: #fff; font-size: 11.5px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; vertical-align: 2px; }
.tc-btns { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; align-self: center; }
.tc-b { min-height: 44px; min-width: 74px; padding: 0 14px; border-radius: 22px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-size: 15px; font-weight: 700; background: var(--fill); color: var(--fg); }
.tc-b svg { width: 16px; height: 16px; }
.tc-b.ok { background: var(--green); color: var(--on-accent); }
.tc-b.red { background: var(--red-bg); color: #fff; max-width: 120px; line-height: 1.1; text-align: center; }
.tc-b.red[data-blink] { animation: blink 1.1s ease-in-out infinite; }
.tc-b.soft { min-height: 34px; min-width: 0; font-size: 13px; font-weight: 600; color: var(--sec); background: none; padding: 0 8px; }
.tc-did { display: inline-flex; align-items: center; gap: 5px; font-size: 14px; font-weight: 700; color: var(--green); }
.tc-did svg { width: 15px; height: 15px; }
.tc.urg { background: color-mix(in srgb, var(--red) 9%, var(--card)); box-shadow: inset 4px 0 var(--red); }
.tc.urg .tc-ic { background: var(--red-bg); color: #fff; }
.tc.done .tc-text { color: var(--sec); font-weight: 500; }
.tc.done .tc-ic { color: var(--sec); }
.tc-track { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 13.5px; color: var(--sec); font-weight: 600; }
.tc-dots { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.tc-dot { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 10.5px; font-weight: 800; color: var(--pc); background: transparent; box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--pc) 55%, transparent); }
.tc-dot.seen { box-shadow: inset 0 0 0 2px var(--pc); }
.tc-dot.mid { background: color-mix(in srgb, var(--pc) 22%, transparent); box-shadow: inset 0 0 0 2px var(--pc); }
.tc-dot.ok { background: var(--pc); color: #fff; box-shadow: none; }
.tc-dot svg { width: 14px; height: 14px; }
.tc-closed { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 600; color: var(--green); }
.tc-closed svg { width: 15px; height: 15px; }
.tc-manage { display: flex; flex-wrap: wrap; gap: 8px; }
.tc-manage .red { color: var(--red); }
.tc-manage svg { width: 15px; height: 15px; }
.tc-ph img { max-width: 100%; border-radius: 12px; }
.tc-title { display: flex; align-items: center; gap: 8px; padding-bottom: 10px; }
.tc-title.red { color: var(--red); }
.tc-count { min-width: 22px; height: 22px; padding: 0 7px; border-radius: 11px; background: var(--accent); color: var(--on-accent); font-size: 13px; font-weight: 800; display: inline-grid; place-items: center; }
.tc-link { margin-left: auto; font-size: 14px; font-weight: 600; color: var(--accent); min-height: 36px; padding: 0 4px; text-transform: none; letter-spacing: 0; }
.big-head .small-pill { min-height: 40px; }
.refus-ph { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; min-height: 36px; padding: 0 12px; border-radius: 18px; background: var(--fill); font-size: 14px; font-weight: 600; color: var(--orange); }
.refus-ph svg { width: 17px; height: 17px; }
@media (max-width: 420px) {
  .tc { gap: 10px; padding: 12px 10px 12px 12px; }
  .tc-ic { width: 30px; height: 30px; }
  .tc-b { min-width: 64px; padding: 0 12px; }
}

/* ═══ Mouvement : sobre, court, et jamais rejoué à chaque clic ═══
   L'écran est mis à jour en douceur (les éléments restent en place) : une animation d'entrée ne joue donc qu'à l'apparition
   d'un élément, et les transitions (fond, largeur, rotation) se voient pour de vrai. */
:root { --ease: cubic-bezier(.22, .8, .24, 1); --spring: cubic-bezier(.3, 1.2, .5, 1); }

/* Changement d'onglet : fondu, puis les blocs montent l'un après l'autre */
@keyframes enter { from { opacity: 0; } }
@keyframes lift { from { opacity: 0; transform: translateY(10px); } }
.screen { animation: enter .2s ease-out; }
.screen > *, .screen .duo > .col > * { animation: lift .3s var(--ease) backwards; }
.screen > :nth-child(2), .duo > .col > :nth-child(2) { animation-delay: 30ms; }
.screen > :nth-child(3), .duo > .col > :nth-child(3) { animation-delay: 60ms; }
.screen > :nth-child(4), .duo > .col > :nth-child(4) { animation-delay: 90ms; }
.screen > :nth-child(5), .duo > .col > :nth-child(5) { animation-delay: 120ms; }
.screen > :nth-child(6), .duo > .col > :nth-child(6) { animation-delay: 150ms; }
.screen > :nth-child(n+7), .duo > .col > :nth-child(n+7) { animation-delay: 180ms; }
.screen.chat-open > * { animation: none; }

/* Touches : retour immédiat, retour au repos doux */
.press { transition: transform .16s var(--ease), opacity .16s, background-color .2s, color .2s; }
.press:active { transform: scale(.96); opacity: .8; transition-duration: .06s; }
.room-row, .notice, .chat-row, .row-btn, .toggle-row { transition: background-color .18s; }
.room-row:active, .notice:active, .chat-row:active, .row-btn:active, .toggle-row:active { background: var(--fill); transition-duration: .04s; }
.pill, .chip, .step, .glass-btn, .seg button, .ib, .tabbar button, .ack { transition: transform .16s var(--ease), opacity .16s, background-color .22s, color .22s, box-shadow .22s, filter .2s; }
.badge { transition: background-color .25s, width .25s var(--ease); }
.tile { transition: transform .14s var(--ease), box-shadow .22s, background-color .22s, color .22s; }
.tile:active { transform: scale(.93); }
.tile.sel { transform: scale(1.12); transition: transform .22s var(--spring); }
.switch, .switch::after { transition-duration: .22s; }
.switch::after { transition-timing-function: var(--spring); }
.seg button.on, .chip.on, .step.on { transition-duration: .22s; }
.pin-dots i { transition: background-color .12s, transform .18s var(--spring); }
.pin-dots i.on { transform: scale(1.18); }
.pad button { transition: transform .12s var(--ease), background-color .15s; }
.pad button:active { transform: scale(.9); background: color-mix(in srgb, var(--fg) 14%, transparent); }
.progress .bar i { transition: width .6s var(--ease), background-color .3s; }

/* Clavier : un contour net, seulement quand on navigue au clavier */
:focus { outline: none; }
:focus-visible { outline: 2.5px solid var(--accent); outline-offset: 2px; }
.field:focus-within { background: var(--fill); transition: background-color .18s; }
.input:focus-visible, .field input:focus-visible, textarea:focus-visible { outline-offset: 0; }
.input, textarea.input { transition: box-shadow .18s, background-color .18s; }
.input:focus, textarea.input:focus { box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 55%, transparent); }

/* Souris : un léger souligné de survol, jamais sur téléphone */
@media (hover: hover) {
  .pill:hover:not([disabled]) { filter: brightness(1.07); }
  .pill.soft:hover:not([disabled]) { filter: none; background: color-mix(in srgb, var(--accent) 22%, transparent); }
  .glass-btn:hover, .seg button:not(.on):hover, .chip:not(.on):hover, .step:not(.on):hover, .ib:hover { background-color: color-mix(in srgb, var(--fill) 120%, transparent); }
  .glass-btn:hover { transform: translateY(-1px); }
  .glass-btn:active { transform: scale(.96); }
  .tile:hover:not(.sel) { transform: translateY(-1px); }
  .room-row:hover, .notice:hover, .chat-row:hover, .row-btn:hover { background: color-mix(in srgb, var(--fill) 45%, transparent); }
}

/* Entrées : bulle, feuille, messages courts */
@keyframes sheetIn { from { opacity: 0; transform: translateY(18px) scale(.985); } }
@keyframes sheetOut { to { transform: translateY(100%); } }
@keyframes sheetFadeOut { to { opacity: 0; transform: translateY(14px) scale(.985); } }
@keyframes fadeOut { to { opacity: 0; } }
@keyframes popOut { to { opacity: 0; transform: scale(.92); } }
@keyframes drop { from { opacity: 0; transform: translate(-50%, -14px); } }
@keyframes fall { to { opacity: 0; transform: translate(-50%, 14px); } }
.sheet.out { animation: sheetOut .24s var(--ease) forwards; pointer-events: none; }
.sheet.full.out { animation: sheetFadeOut .2s ease-in forwards; }
.sheet-scrim.out, .scrim.out { pointer-events: none; }
.sheet-scrim.out { animation: fadeOut .24s ease-in forwards; }
.bubble.out { animation: popOut .12s ease-in forwards; pointer-events: none; }
@media (min-width: 760px) and (min-height: 600px) {
  .sheet.anim { animation: sheetIn .26s var(--ease); }
  .sheet.out { animation: sheetFadeOut .2s ease-in forwards; }
}
.toast.anim { animation: drop .26s var(--ease); }
@keyframes confirmIn { from { opacity: 0; transform: translate(-50%, -47%) scale(.94); } }
.confirm { animation: confirmIn .22s var(--ease); }
.viewer { animation: fade .2s; }
.viewer img { animation: pop .26s var(--ease); }

/* Pastilles de nouveautés : elles apparaissent avec un petit rebond */
@keyframes badgePop { from { transform: scale(.3); opacity: 0; } }
.tabbar .count, .seg-n, .glass-btn .dot { animation: badgePop .32s var(--spring); }
.tabbar .count.blink { animation: blink 1.1s ease-in-out infinite; }

/* Menu déroulant */
@keyframes subIn { from { opacity: 0; transform: translateX(-50%) translateY(8px); } }
@keyframes subInSide { from { opacity: 0; transform: translateY(-6px); } }
.tabbar .subtabs { animation: subIn .2s var(--ease); }
@media (min-width: 1024px) { .tabbar .subtabs { animation: subInSide .2s var(--ease); } }

/* Étapes cochées : la coche se dessine */
@keyframes tickIn { from { transform: scale(.4); opacity: 0; } }
.step.on svg, .notice .acked svg, .tagline.done svg { animation: tickIn .28s var(--spring); }

/* Discussions : les bulles arrivent doucement, les nouvelles réactions rebondissent */
@keyframes bubIn { from { opacity: 0; transform: translateY(6px) scale(.97); } }
.chat-scroll .cbw { animation: bubIn .2s var(--ease) backwards; }
.cbw.me { transform-origin: 100% 100%; } .cbw:not(.me) { transform-origin: 0 100%; }
@keyframes rxIn { from { transform: scale(.5); opacity: 0; } }
.reacts .rx { animation: rxIn .24s var(--spring); }
.rx-row button { transition: transform .15s var(--spring); }
.rx-row button:active { transform: scale(1.35); }

/* Plan : les cases apparaissent légèrement échelonnées au premier affichage */
@keyframes tileIn { from { opacity: 0; transform: scale(.88); } }
.tile { animation: tileIn .26s var(--ease) backwards; }

/* Discussions : bouton « Urgent » à côté de la saisie */
.reply-line .send.urg.on { background: var(--red-bg); color: #fff; }
.reply-line .send.red { background: var(--red-bg); }
.urg-hint { color: var(--red); font-weight: 600; }
.urg-kind { display: flex; gap: 8px; margin-top: 8px; }

/* ─── Écran Jour : aperçu calme des nouveaux messages (pas d'urgence : rien ne clignote) ─── */
.chat-peek { padding: 6px 0; margin-bottom: 14px; }
.pk-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 16px 4px; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--sec); }
.pk-head b { font-weight: 700; }
.pk-head span { font-weight: 700; color: var(--accent); }
.peek-row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 8px 16px; text-align: left; }
.peek-row + .peek-row { border-top: .5px solid var(--sep); }
.peek-row .pk-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.peek-row .pk-top { display: flex; align-items: baseline; gap: 8px; }
.peek-row .pk-top b { flex: 1; min-width: 0; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.peek-row .pk-t { font-size: 12px; color: var(--accent); font-weight: 700; font-variant-numeric: tabular-nums; }
.peek-row .pk-last { font-size: 14px; color: var(--sec); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.peek-row .count { flex: none; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--accent); color: var(--on-accent); font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.peek-more { display: block; width: 100%; min-height: 44px; padding: 0 16px; border-top: .5px solid var(--sep); text-align: left; font-size: 14px; font-weight: 600; color: var(--accent); }

/* ─── Bandeau rouge des urgences : mêmes lignes que l'aperçu normal, le rouge clignote ─── */
.urgent-peek { color: #fff; border-radius: 24px; background: var(--red-bg); }   /* fond rouge fixe : sans clignotement (seulement des « à faire »), le texte blanc restait sur fond clair */
.urgent-peek .pk-head { color: #fff; text-transform: none; letter-spacing: 0; font-size: 15px; padding: 10px 16px 6px; }
.urgent-peek .peek-row { color: #fff; }
.urgent-peek .todo-row { display: flex; align-items: center; gap: 10px; padding: 0 12px 0 0; }
.urgent-peek .todo-open { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 10px 0 10px 16px; text-align: left; color: #fff; }
.urgent-peek .todo-done { flex: none; min-width: 74px; height: 40px; padding: 0 16px; border-radius: 20px; background: #fff; color: #8f3a2d; font-weight: 800; font-size: 16px; }
.peek-row .pk-ctx { display: block; font-size: 13px; opacity: .8; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.urgent-peek .todo-take { min-width: 0; max-width: 104px; height: 44px; padding: 0 12px; font-size: 14px; line-height: 1.15; text-align: center; }
.urgent-peek .up-x { flex: none; width: 34px; height: 34px; margin: -4px -6px -4px 8px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: rgba(255, 255, 255, .18); }
.urgent-peek .up-x svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2.2; stroke-linecap: round; }
.urgent-peek .up-x:hover { background: rgba(255, 255, 255, .3); }
.urgent-peek .peek-row + .peek-row { border-top-color: rgba(255, 255, 255, .28); }
.urgent-peek .pk-t, .urgent-peek .pk-last { color: rgba(255, 255, 255, .92); }
.urgent-peek .avatar { box-shadow: 0 0 0 2px rgba(255, 255, 255, .85); }
.urgent-peek .up-more { padding: 10px 16px; color: #fff; font-size: 14px; font-weight: 600; border-top: .5px solid rgba(255, 255, 255, .28); }

/* ─── Feuilles : fenêtre « Qui imprimer ? » et options d'impression repliées en bas ─── */
.pp-name { display: flex; align-items: center; gap: 10px; min-width: 0; font-weight: 600; }
.pp-name .cnt { font-size: 13px; font-weight: 600; color: var(--sec); }
.pp-list .toggle-row { min-height: 52px; }
.pp-list .check { flex: none; width: 26px; height: 26px; border-radius: 8px; box-shadow: inset 0 0 0 2px var(--sep); display: inline-flex; align-items: center; justify-content: center; transition: background .15s; }
.pp-list .check.on { background: var(--accent); color: var(--on-accent); box-shadow: none; }
.pp-list .check svg { width: 16px; height: 16px; }
.pill[disabled] { opacity: .45; pointer-events: none; }
.sv-opts { margin-top: 14px; }
.sv-opts-btn { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 6px; font-size: 14px; font-weight: 600; color: var(--sec); }
.sv-opts-btn .chev { display: inline-flex; width: 18px; height: 18px; transition: transform .2s; }
.sv-opts-btn .chev.open { transform: rotate(180deg); }
.sv-opts-btn .chev svg { width: 100%; height: 100%; }

/* Discussion : rien ne se tasse dans la colonne qui défile (la carte urgente était coupée) */
.chat-scroll > * { flex-shrink: 0; }

/* ─── Carte d'un message-ordre : calme (en-tête discret, suivi en une ligne, champ de réponse à la demande) ─── */
.mc { gap: 6px; }
.mc-top { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--sec); }
.mc-top b { color: var(--fg); font-weight: 700; }
.mc-top .t { margin-left: auto; font-variant-numeric: tabular-nums; }
.mc-urg { font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--red); }
.mc.urg { box-shadow: inset 4px 0 var(--red); }
.mc .txt { font-size: 16px; }
.mc-tag { align-self: flex-start; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--fill); color: var(--sec); }
.mc-tag.change { background: color-mix(in srgb, var(--orange) 16%, transparent); color: var(--orange); }
.mc-closed { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--green); }
.mc-closed svg { width: 14px; height: 14px; }
.mc-track { display: flex; flex-direction: column; gap: 6px; padding-top: 4px; }
.mc-sum { font-size: 14px; color: var(--fg); }
.mc-bar { height: 6px; border-radius: 3px; background: var(--fill); overflow: hidden; }
.mc-bar i { display: block; height: 100%; border-radius: 3px; background: var(--green); transition: width .4s var(--ease); }
.mc-line { display: flex; align-items: baseline; gap: 8px; font-size: 14px; line-height: 1.35; }
.mc-dot { flex: none; width: 16px; height: 16px; align-self: center; border-radius: 50%; display: grid; place-items: center; box-shadow: inset 0 0 0 1.5px var(--sep); }
.mc-dot svg { width: 10px; height: 10px; stroke-width: 3; }
.mc-lab { flex: none; font-weight: 700; }
.mc-names { color: var(--sec); min-width: 0; overflow-wrap: anywhere; }
.mc-line.done .mc-dot { background: var(--green); box-shadow: none; color: #fff; }
.mc-line.done .mc-lab { color: var(--green); }
.mc-line.taken .mc-dot { background: color-mix(in srgb, var(--green) 22%, transparent); box-shadow: none; color: var(--green); }
.mc-line.taken .mc-lab { color: var(--green); }
.mc-line.wait .mc-lab { color: var(--sec); font-weight: 600; }
/* Événement du fil (« Nathan a pris en compte · 00:31 ») : une ligne grise centrée, pas une bulle */
.ev { align-self: center; text-align: center; margin: 2px 0; }
.ev span { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; color: var(--sec); }
.ev svg { width: 13px; height: 13px; color: var(--green); stroke-width: 3; }
.mc .inline-thread { margin-top: 4px; padding-top: 6px; gap: 4px; }
.th-actions { display: flex; gap: 4px; }
.th-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 12px 0 0; font-size: 14px; font-weight: 600; color: var(--accent); }
.th-btn + .th-btn { color: var(--sec); }
.th-btn svg { width: 14px; height: 14px; }
.chat-scroll .legacy-block { max-width: 640px; width: 100%; margin: 6px 0; align-self: stretch; display: flex; flex-direction: column; gap: 4px; }
.chat-scroll .legacy-block.mine { align-self: flex-end; margin-left: auto; margin-right: 0; }      /* mes messages à droite, comme mes bulles */
.chat-scroll .legacy-block.theirs { align-self: flex-start; margin-left: 0; margin-right: auto; }
/* La conversation continue sous la carte, collée à elle mais en dehors */
.thread-out { display: flex; flex-direction: column; gap: 6px; padding: 0 4px; }
.thread-out:empty { display: none; }
.thread-out .chat { padding: 0; }
.thread-out .chat:empty { display: none; }
.thread-out .reply-line textarea { min-height: 42px; }
.thread-out .th-actions { padding-left: 6px; }
.th-fold { display: flex; align-items: center; gap: 8px; min-height: 40px; font-size: 14px; font-weight: 600; color: var(--sec); }
.th-fold .chev { width: 16px; height: 16px; display: inline-flex; transition: transform .2s; }
.th-fold .chev svg { width: 100%; height: 100%; }
.th-new { font-size: 11px; font-weight: 800; color: #fff; background: var(--red-bg); padding: 2px 8px; border-radius: 999px; }
.th-btn[data-act="threadClose"] { color: var(--sec); }

/* ─── Bulle d'une chambre, section Modifier : sections nommées, boutons à bascule en grille ─── */
.bubble .cap { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--sec); padding: 0 4px 6px; }
.tg-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.tg { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px; border-radius: 14px; background: var(--fill); color: var(--tint); font-size: 14px; font-weight: 600; text-align: left; transition: background .15s, box-shadow .15s; }
.tg .gi { width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.tg .gi svg { width: 18px; height: 18px; }
.tg .gi img { width: 22px; height: 22px; border-radius: 6px; display: block; }
.tg .gl { color: var(--fg); line-height: 1.15; }
.tg.on { background: color-mix(in srgb, var(--tint) 16%, transparent); box-shadow: inset 0 0 0 2px var(--tint); }
.del-row { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; border-radius: 14px; color: var(--red); font-size: 14px; font-weight: 700; }
.del-row svg { width: 16px; height: 16px; }
.del-row.armed { background: var(--red-bg); color: #fff; }

/* ─── Type de chambre changé : repère visible d'un coup d'œil (liste et plan) jusqu'à « Pris en compte » ─── */
.kchange { display: inline-flex; align-self: flex-start; align-items: center; margin: 2px 0 3px; padding: 2px 9px; border-radius: 999px; font-size: 13px; font-weight: 800; color: #fff; background: var(--red-bg); animation: blink 1.1s ease-in-out infinite; }
.room-row.kchg { box-shadow: inset 4px 0 var(--red); }
.tile.kchg .k { background: var(--red-bg); color: #fff; border-radius: 4px; padding: 0 3px; }

/* Bandeau rouge : changement de chambre lisible en entier */
.peek-row .pk-lines { display: flex; flex-direction: column; gap: 1px; font-size: 14px; color: var(--sec); }
.urgent-peek .pk-lines { color: rgba(255, 255, 255, .92); }
.peek-row .pk-lines .chg { font-weight: 800; font-size: 15px; color: inherit; }
.urgent-peek .pk-lines .chg { color: #fff; }

/* Housekeepers : chambre pas encore disponible = grisée, en bas de la liste */
.room-row.dim { opacity: .5; }

/* Bulle, « Pour » : une couleur par personne (comme l'éditeur), « Personne » en dernier en gris */
.chip.who { --pc: var(--sec); background: color-mix(in srgb, var(--pc) 16%, transparent); color: var(--pc); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--pc) 35%, transparent); transition: background .15s, color .15s; }
.chip.who.on { background: var(--pc); color: #fff; box-shadow: none; }

/* ─── Connexion : propre, une seule grille de personnes, le logo Alfred Hotels en pied de page ─── */
.login { padding-top: calc(var(--safe-top) + 36px); }
.login .brand { gap: 6px; padding-bottom: 26px; }
.login .brand h1 { font-size: 30px; letter-spacing: -.01em; }
.who-title { text-align: center; font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--sec); padding-bottom: 12px; }
.who-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.who-grid > .who-card { grid-column: span 2; }
/* Dernière carte seule sur sa ligne : centrée, même largeur que les autres */
.who-grid > .who-card:last-child:nth-child(odd):not(:only-child) { grid-column: 2 / span 2; }
.who-grid + .who-grid { margin-top: 10px; }
.who-card { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 18px 8px 14px; border-radius: 20px; background: var(--card); box-shadow: inset 0 0 0 .5px var(--sep), 0 1px 3px rgba(0, 0, 0, .05); text-align: center; }
.who-card .avatar { width: 56px; height: 56px; font-size: 20px; margin-bottom: 8px; }
.who-card b { font-size: 17px; font-weight: 700; }
.who-card small { font-size: 12px; color: var(--sec); font-weight: 600; }
.login-foot { padding-top: 28px; display: flex; justify-content: center; }   /* juste sous la liste, pas collé en bas de l'écran */
.login-foot .wordmark { width: 130px; height: auto; opacity: .75; }
.who-cat { font-size: 13px; font-weight: 700; color: var(--sec); padding: 18px 6px 8px; }
.who-cat:first-of-type { padding-top: 0; }
.who-card { padding: 14px 8px 12px; }
.who-card .avatar { margin-bottom: 6px; }
.who-grid > .who-card:only-child { grid-column: 1 / -1; flex-direction: row; justify-content: center; gap: 12px; padding: 12px 8px; }
.who-card:only-child .avatar { margin-bottom: 0; width: 44px; height: 44px; font-size: 17px; }
.who-grid > .who-card.wide { grid-column: 1 / -1; flex-direction: column; gap: 2px; padding: 18px 8px 14px; }
.who-card.wide .avatar { width: 56px; height: 56px; font-size: 20px; margin-bottom: 8px; }

/* Choix de l'hôtel sur l'écran d'accueil */
.login .hotel-pick { width: min(320px, 100%); margin: 2px auto 0; }
.login .hotel-pick .seg button { min-height: 38px; }

/* Glisser vers la droite pour répondre : la bulle suit le doigt, une flèche apparaît à gauche, elle se colore quand c'est assez loin */
.cb, .bub { touch-action: pan-y; transition: transform .22s var(--ease); }
.cb.swiping, .bub.swiping { transition: none; }
.cb.swiping::before, .bub.swiping::before { content: ""; position: absolute; left: -44px; top: 50%; width: 32px; height: 32px; margin-top: -16px; border-radius: 50%; opacity: var(--p, 0); transform: scale(calc(.5 + var(--p, 0) * .5));
  background: var(--fill) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'><path d='M9 14 4 9l5-5'/><path d='M4 9h10.5a5.5 5.5 0 0 1 0 11H11'/></svg>") center / 18px no-repeat; }
.cb.swiping.ready::before, .bub.swiping.ready::before { background-color: var(--accent); background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'><path d='M9 14 4 9l5-5'/><path d='M4 9h10.5a5.5 5.5 0 0 1 0 11H11'/></svg>"); }
.bub .quote { display: flex; flex-direction: column; margin: 2px 0 5px; padding: 4px 8px; border-radius: 8px; border-left: 3px solid var(--accent); background: var(--fill); font-size: 13px; gap: 1px; text-align: left; }
.bub .quote span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; opacity: .85; }
.bub.me .quote { background: rgba(255, 255, 255, .2); border-left-color: #fff; }
.bub.me .quote b { color: inherit !important; }
.reply-quote { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 12px; border-left: 3px solid var(--accent); background: var(--fill); font-size: 13px; }
.reply-quote .rq-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.reply-quote .rq-main span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; opacity: .85; }
.reply-quote .rq-x { flex: none; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; }
.reply-quote .rq-x svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2.2; stroke-linecap: round; }

/* ─── Retouches (24 nov. 2026) ─── */
/* Alerte plein écran : un long message défile au lieu de pousser le bouton hors de l'écran ; plusieurs messages = compteur */
.alarm { overflow-y: auto; justify-content: safe center; }
.alarm .txt { overflow-wrap: anywhere; }
.alarm .alarm-n { font-size: 15px; font-weight: 700; padding: 6px 14px; border-radius: 999px; background: rgba(255, 255, 255, .2); }
/* Fenêtre et bulle reçoivent le focus à l'ouverture (clavier, lecteur d'écran) : pas de contour autour de toute la fenêtre */
.sheet:focus, .bubble:focus { outline: none; }
/* Boutons : pas de sélection de texte ni de menu « Copier » sur un appui long (iPhone) */
button { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.confirm:focus { outline: none; }
/* Plan vide d'un housekeeper : une phrase dit pourquoi (tout est fait, ou masqué par les interrupteurs) */
.plan-empty { margin: 0 4px 12px; padding: 12px 16px; border-radius: 18px; background: var(--fill); color: var(--sec); font-size: 15px; line-height: 1.35; }
.bubble.more-below { -webkit-mask-image: linear-gradient(#000 calc(100% - 34px), transparent); mask-image: linear-gradient(#000 calc(100% - 34px), transparent); }

/* Signalements : sur téléphone et tablette, le bouton « Signaler un problème » flotte en bas, juste au-dessus de la barre du bas */
.fab-report { position: fixed; z-index: 40; left: 50%; transform: translate(-50%, var(--tb-dy, 0px)); bottom: calc(var(--safe-bottom) + 84px); width: auto; min-width: 240px; box-shadow: 0 6px 20px rgba(0,0,0,.22); }
@media (min-width: 1024px) { .fab-report { display: none; } }
@media (max-width: 1023px) { .only-wide { display: none !important; } .tab-signalements { padding-bottom: calc(var(--safe-bottom) + 160px); } }

/* Bandeau Signalements de l'écran Jour : petite croix pour masquer (comme un appui sur la ligne) */
.tc-x { flex: none; align-self: center; width: 30px; height: 30px; margin-right: 8px; border-radius: 50%; display: grid; place-items: center; color: var(--sec); background: var(--fill); }
.tc-x svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2.2; stroke-linecap: round; }

/* ─── Barre du bas refaite pour téléphone et tablette (24 nov. 2026, demande de Nathan : « essaie d'améliorer encore, voire la refaire ») ───
   Pleine largeur de l'écran (marges de 10 px), onglets de largeur égale : toute la barre se touche, pas de largeur fixe qui déborde.
   Grosses icônes ; l'onglet ouvert a une pastille couleur de l'app. Réception (6 onglets) : icônes seules, l'onglet ouvert s'élargit avec son nom. */
@media (max-width: 1023px) {
  .tabbar { left: 10px; right: 10px; width: auto; max-width: 560px; margin: 0 auto; transform: translate(0, var(--tb-dy, 0px)); padding: 6px; gap: 2px;
    bottom: calc(var(--safe-bottom) + 12px); border-radius: 32px; }
  .tabbar button, .tabbar.many button { flex: 1 1 0; min-width: 0; height: 64px; padding: 0 2px; gap: 3px; border-radius: 26px; font-size: 11px; letter-spacing: -.1px; white-space: nowrap; }
  .tabbar button svg { width: 28px; height: 28px; flex: none; }
  .tabbar button.on { background: color-mix(in srgb, var(--accent) 15%, transparent); }
  .tabbar button:active { transform: scale(.94); }
  .tabbar .count { top: 5px; right: calc(50% - 22px); }
  .tabbar.many button.on { flex: 2.4 1 0; padding: 0 10px; }
  .tabbar.many .count { right: calc(50% - 20px); }
  .tabbar.many button.on .count { right: 8px; }
  .undo { bottom: calc(var(--safe-bottom) + 104px); }
  .screen { padding-bottom: calc(var(--safe-bottom) + 134px); }
}
@media (max-width: 400px) { .tabbar button, .tabbar.many button { font-size: 10px; letter-spacing: -.2px; } }
@media (max-width: 340px) { .tabbar:not(.many) button:not(.on) .lbl { display: none; } .tabbar:not(.many) button.on { flex: 2 1 0; } }

/* Barre du bas STABLE (24 nov. 2026, Nathan : « elle monte, redescend selon la catégorie » ; Plan et discussion étaient bien : la page n'y défile pas).
   Sur téléphone et tablette, c'est maintenant l'ÉCRAN qui défile (main.screen, plein écran fixe), jamais la page : la barre de Safari ne se replie plus,
   la zone visible ne change plus d'un onglet à l'autre, et la barre du bas (posée par le bas, comme avant) reste exactement à la même hauteur. */
@media (max-width: 1023px) {
  main.screen { position: fixed; inset: 0; max-width: none; margin: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior-y: none; -webkit-overflow-scrolling: touch;
    padding-left: max(16px, calc((100vw - 640px) / 2)); padding-right: max(16px, calc((100vw - 640px) / 2)); }
  main.screen.chat-open { padding: 0; overflow: hidden; }
  /* Page figée derrière l'écran (24 nov. 2026, Nathan : « elle bouge encore un petit peu selon le défilement ») : sur iPhone installé, la fenêtre
     change de hauteur (~60 pt) quand la page rebondit ou défile, et la barre suit. Corps de page fixe = plus rien à faire défiler côté page.
     PAS d'overflow:hidden (il raccourcit la fenêtre de façon permanente). Seulement une fois connecté : la connexion garde son défilement. */
  html:has(main.screen), body:has(main.screen) { height: 100%; }
  body:has(main.screen) { position: fixed; inset: 0; width: 100%; }
}
