/* Maison : styles. Thème clair uniquement, sobre : fond blanc cassé chaud, cartes blanches,
   couleur signature sable chaud (#E3CFB4), accent caramel doré (#946130), harmonie sauge, icônes au trait, typo système. Mobile d'abord. */
:root {
  --bg: #FAF6EF;
  --bg2: #F3ECE1;
  --card: #FFFFFF;
  --card2: #FCFAF6;
  --text: #33302B;
  --text2: #57514A;
  --muted: #6F685E;
  --line: #EAE2D6;
  --line2: #F2ECE3;
  --accent: #946130;
  --accent-strong: #7A4F26;
  --accent-soft: #F6EBDD;
  --accent-ring: rgba(148, 97, 48, .22);
  --wall: #E3CFB4;          /* couleur signature : sable chaud (mur du salon) */
  --wall-soft: #F4EADC;
  --wall-active: #EBDCC6;
  --sage: #55684F;          /* harmonie, avec parcimonie */
  --sage-soft: #E8EDE3;
  --danger: #B8524A;
  --danger-soft: #F8EBE9;
  --warn: #8A6116;
  --warn-soft: #F8EFDC;
  --p-yohann: #5C7FB8;
  --p-partner: #B8739A;
  --p-both: #8A80B3;
  --shadow: 0 6px 22px rgba(120, 90, 45, .07);
  --shadow-md: 0 8px 28px rgba(120, 90, 45, .10);
  --shadow-lg: 0 16px 48px rgba(60, 40, 25, .18);
  --radius: 20px;
  --radius-sm: 14px;
  --tabbar-h: 68px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: light;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body { overflow-x: clip; }
body {
  background: var(--bg);
  color: var(--text);
  font: 16.5px/1.45 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  min-height: 100vh;
  overscroll-behavior-y: none;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
a { color: var(--accent); }
svg { display: block; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

svg.i { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

.muted { color: var(--muted); }
.small { font-size: 14px; }
.center { text-align: center; }
.strong { font-weight: 600; }
.grow { flex: 1; min-width: 0; }
.mt { margin-top: 16px; }
.err-text { color: var(--danger); }
button.plain { font: inherit; color: inherit; letter-spacing: inherit; text-transform: inherit; display: inline-flex; align-items: center; gap: 4px; }
button.plain svg.i { width: 16px; height: 16px; }
button.plain.link { color: var(--accent); font-weight: 600; }

/* ------------------------------------------------------------------ vues */
#views { max-width: 720px; margin: 0 auto; padding: calc(var(--safe-t) + 20px) 16px calc(var(--tabbar-h) + var(--safe-b) + 28px); }
.view { display: none; }
.view.active { display: block; animation: viewIn .25s ease both; }
@keyframes viewIn { from { transform: translateY(6px); } to { transform: none; } }

.head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin: 4px 2px 18px; }
.head h1 { font-size: 28px; line-height: 1.15; margin: 0; font-weight: 700; letter-spacing: -.02em; }
.head .sub { color: var(--muted); margin-top: 3px; font-size: 15px; }
.head .sub::first-letter { text-transform: uppercase; }
.icon-btn {
  width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--card); border: 1px solid var(--line); color: var(--text2); transition: transform .15s, background .15s;
}
.icon-btn:active { transform: scale(.93); background: var(--bg2); }
.icon-btn.accent { background: var(--accent); border-color: var(--accent); color: #fff; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.card + .card { margin-top: 12px; }

.section-h { display: flex; align-items: center; justify-content: space-between; margin: 28px 4px 12px; }
.section-h h2 { margin: 0; font-size: 18px; font-weight: 650; letter-spacing: -.01em; }
.link { display: inline-flex; align-items: center; gap: 2px; font-size: 14.5px; font-weight: 600; color: var(--accent); text-decoration: none; min-height: 36px; }
.link svg.i { width: 16px; height: 16px; stroke-width: 2.2; }

/* ------------------------------------------------------------------ tab bar */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; justify-content: space-around; align-items: stretch;
  height: calc(var(--tabbar-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  background: rgba(255, 255, 255, .94);
  -webkit-backdrop-filter: saturate(1.4) blur(16px); backdrop-filter: saturate(1.4) blur(16px);
  border-top: 1px solid var(--line);
}
.tabbar a {
  position: relative; flex: 1; max-width: 140px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; color: var(--muted); text-decoration: none; font-size: 12px; font-weight: 600; transition: color .2s;
}
.tabbar a svg.i { width: 24px; height: 24px; box-sizing: content-box; padding: 4px 18px; border-radius: 16px; transition: background .2s, color .2s; }
.tabbar a.active { color: var(--accent-strong); }
.tabbar a.active svg.i { background: var(--accent-soft); }
.tabbar a:active svg.i { transform: scale(.94); }
.badge {
  position: absolute; top: 4px; left: calc(50% + 10px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center;
  border: 2px solid #fff; box-sizing: content-box;
}
.badge:empty { display: none; }

/* ------------------------------------------------------------------ accueil */
.home-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin: 6px 2px 20px; }
.home-head .eyebrow { color: var(--muted); font-size: 14px; font-weight: 600; letter-spacing: .01em; }
.home-head .eyebrow::first-letter { text-transform: uppercase; }
.home-head h1 { margin: 2px 0 0; font-size: 30px; line-height: 1.15; font-weight: 700; letter-spacing: -.025em; }
.home-grid { display: grid; gap: 12px; margin-top: 12px; }
.home-card { padding: 16px 18px; }
.home-card.tap { cursor: pointer; }
.home-card.tap:active { background: var(--card2); }
.card-h { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.card-h h2 { flex: 1; margin: 0; font-size: 17px; font-weight: 650; display: flex; align-items: center; gap: 8px; }
.card-h .count { font-size: 13px; font-weight: 700; color: var(--accent-strong); background: var(--accent-soft); border-radius: 10px; padding: 1px 8px; }
.card-ic { width: 38px; height: 38px; border-radius: 12px; background: var(--accent-soft); color: var(--accent-strong); display: grid; place-items: center; flex: none; }
.card-ic svg.i { width: 20px; height: 20px; }
.empty-line { margin: 4px 0 2px; color: var(--muted); }
.foot { margin: 10px 0 0; padding-top: 10px; border-top: 1px solid var(--line2); color: var(--muted); font-size: 14.5px; }
.link-foot { display: block; text-decoration: none; color: var(--accent); font-weight: 600; }
.rows { display: flex; flex-direction: column; }
.row-ev { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 8px 0; border-top: 1px solid var(--line2); text-align: left; width: 100%; }
.row-ev:first-child { border-top: 0; }
.row-ev .t { font-variant-numeric: tabular-nums; font-weight: 650; min-width: 60px; color: var(--accent-strong); font-size: 15px; }
.row-ev .x { flex: 1; min-width: 0; font-weight: 550; overflow-wrap: break-word; }
.row-note { display: flex; align-items: flex-start; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line2); }
.row-note:first-child { border-top: 0; }
.row-note .check { margin-top: 1px; }
.row-note .txt { flex: 1; min-width: 0; }
.row-note .x { font-weight: 550; overflow-wrap: break-word; }
.row-note .meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; align-items: center; }
.who-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--text2); background: var(--bg2); border-radius: 8px; padding: 2px 8px; white-space: nowrap; }
.shop-sum { display: flex; align-items: baseline; gap: 8px; margin: 2px 0 10px; }
.shop-sum .big { font-size: 32px; font-weight: 700; letter-spacing: -.02em; line-height: 1; }
.shop-sum .lbl { color: var(--muted); font-weight: 500; }
.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pill { font-size: 14px; font-weight: 550; padding: 5px 11px; border-radius: 999px; background: var(--bg2); color: var(--text2); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pill.more { background: var(--accent-soft); color: var(--accent-strong); font-weight: 700; }

/* ------------------------------------------------------------------ formulaires */
.add-bar { display: flex; gap: 10px; align-items: center; }
.input, .textarea, select.input {
  width: 100%; min-height: 52px; border-radius: 14px; border: 1px solid var(--line); background: var(--card);
  padding: 0 16px; font-size: 16.5px; outline: none; transition: border-color .2s, box-shadow .2s; -webkit-appearance: none; appearance: none;
}
.textarea { padding: 13px 16px; min-height: 90px; resize: vertical; line-height: 1.4; }
.textarea.mono { font-family: ui-monospace, Menlo, monospace; font-size: 14px; min-height: 110px; }
.input:focus, .textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-ring); }
.input::placeholder, .textarea::placeholder { color: var(--muted); opacity: .85; }
input[type="date"].input, input[type="time"].input { line-height: 52px; display: flex; align-items: center; }
.add-bar .input { box-shadow: var(--shadow); }
.input.flat { box-shadow: none; background: var(--card2); }
.input.search { margin: 8px 0 10px; }
.add-btn {
  flex: none; width: 52px; height: 52px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center;
  transition: transform .15s, background .15s;
}
.add-btn:active { transform: scale(.92); background: var(--accent-strong); }
.add-btn svg.i { width: 24px; height: 24px; stroke-width: 2.2; }
.field { margin-top: 16px; }
.field > label, .label { display: block; font-size: 13.5px; font-weight: 600; color: var(--muted); margin: 0 4px 7px; }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; min-width: 0; }

.seg { display: flex; background: var(--bg2); border-radius: 14px; padding: 4px; gap: 4px; }
.seg button {
  flex: 1; min-height: 44px; border-radius: 10px; font-weight: 600; font-size: 15px; color: var(--muted); transition: background .2s, color .2s, box-shadow .2s;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 8px;
}
.seg button.on { background: var(--card); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, .08), 0 0 0 1px var(--line); }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 6px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.chips::-webkit-scrollbar { display: none; }
.chips.filters { margin: 16px 0 6px; }
.chip {
  flex: none; min-height: 40px; padding: 0 14px; border-radius: 999px; background: var(--card); border: 1px solid var(--line);
  font-size: 14.5px; font-weight: 550; display: inline-flex; align-items: center; gap: 6px; transition: transform .15s, background .2s; white-space: nowrap; color: var(--text2);
}
.chip svg.i { width: 18px; height: 18px; }
.chip:active { transform: scale(.95); }
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip .plus { color: var(--accent); width: 16px; height: 16px; stroke-width: 2.4; }
.suggest-wrap { margin-top: 14px; }
.suggest-wrap .label { margin-bottom: 8px; }

.btn {
  min-height: 50px; padding: 0 20px; border-radius: 14px; font-weight: 650; font-size: 16px; display: inline-flex; align-items: center;
  justify-content: center; gap: 8px; transition: transform .15s, opacity .2s, background .15s; background: var(--bg2); color: var(--text); text-decoration: none;
}
.btn svg.i { width: 19px; height: 19px; }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--accent); color: #fff; }
.btn.primary:active { background: var(--accent-strong); }
.btn.danger { background: transparent; color: var(--danger); }
.btn.soft { background: var(--accent-soft); color: var(--accent-strong); }
.btn.ghost { background: transparent; color: var(--text2); border: 1px solid var(--line); }
.btn.block { width: 100%; }
.btn.sm { min-height: 40px; padding: 0 14px; font-size: 14.5px; border-radius: 11px; }
.btn[disabled] { opacity: .55; pointer-events: none; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }

/* ------------------------------------------------------------------ listes (courses, notes) */
.list { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.item {
  display: flex; align-items: center; gap: 14px; min-height: 62px; padding: 9px 8px 9px 16px; border-top: 1px solid var(--line2);
  position: relative; transition: background .2s, opacity .3s;
}
.item:first-child { border-top: 0; }
.item.enter { animation: itemIn .35s cubic-bezier(.2, 1.1, .4, 1) both; }
@keyframes itemIn { from { opacity: 0; transform: translateX(-12px); } to { opacity: 1; transform: none; } }
.item .main { flex: 1; min-width: 0; cursor: pointer; padding: 4px 0; }
.item .name { font-size: 17px; font-weight: 520; overflow-wrap: break-word; }
.item .meta { font-size: 13px; color: var(--muted); margin-top: 3px; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.item.done .name { text-decoration: line-through; color: var(--muted); }
.item.done { background: var(--card2); }

.check {
  flex: none; width: 30px; height: 30px; border-radius: 50%; border: 2px solid #D9CFC1;
  display: grid; place-items: center; transition: background .2s, border-color .2s, transform .2s; position: relative; background: var(--card);
}
.check.sm { width: 26px; height: 26px; }
.check::before { content: ""; position: absolute; inset: -10px; }
.check svg.i { width: 16px; height: 16px; stroke: #fff; stroke-width: 3; opacity: 0; transform: scale(.4); transition: opacity .2s, transform .25s cubic-bezier(.3, 1.8, .5, 1); }
.check.sm svg.i { width: 14px; height: 14px; }
.check.on { background: var(--accent); border-color: var(--accent); animation: pop .3s ease; }
.check.on svg.i { opacity: 1; transform: none; }
@keyframes pop { 50% { transform: scale(1.15); } }

.del { flex: none; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; color: #A39A8E; }
.del:active { background: var(--bg2); }
.del svg.i { width: 19px; height: 19px; }

.tag { display: inline-flex; align-items: center; gap: 3px; font-size: 12.5px; font-weight: 600; padding: 2px 8px; border-radius: 8px; background: var(--bg2); color: var(--text2); }
.tag svg.i { width: 14px; height: 14px; stroke-width: 2.2; }
button.tag { cursor: pointer; min-height: 26px; }
.tag.late { background: var(--danger-soft); color: var(--danger); }
.tag.today { background: var(--warn-soft); color: var(--warn); }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; display: inline-block; }
.dot.p-yohann { background: var(--p-yohann); } .dot.p-partner { background: var(--p-partner); } .dot.p-both { background: var(--p-both); }

h3.group { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 22px 6px 8px; font-weight: 650; display: flex; align-items: center; gap: 8px; }
h3.group svg.i { width: 18px; height: 18px; color: var(--accent); }
h3.group .n { margin-left: auto; font-weight: 600; letter-spacing: 0; }
.basket-head { display: flex; align-items: center; justify-content: space-between; margin: 26px 4px 10px; }
.basket-head h3 { margin: 0; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 650; }

.empty { text-align: center; padding: 34px 20px 30px; color: var(--muted); }
.empty-ic { width: 64px; height: 64px; border-radius: 20px; margin: 0 auto 14px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; }
.empty-ic svg.i { width: 30px; height: 30px; stroke-width: 1.6; }
.empty .t { font-weight: 650; color: var(--text); font-size: 17.5px; margin-bottom: 4px; }

.compose { padding: 14px; }
.note-opts { display: flex; gap: 8px; align-items: center; margin-top: 10px; }
.note-opts .seg { flex: 1; min-width: 0; }
.note-opts .seg button { padding: 0 4px; font-size: 14.5px; }
.date-pill { flex: none; min-height: 52px; padding: 0 12px; border-radius: 12px; background: var(--bg2); font-weight: 600; font-size: 14.5px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; position: relative; overflow: hidden; }
.date-pill svg.i { width: 18px; height: 18px; }
.date-pill.set { background: var(--accent-soft); color: var(--accent-strong); }
.date-pill input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; }

/* ------------------------------------------------------------------ agenda */
.ag-day { margin-top: 18px; }
.ag-day-h { display: flex; align-items: baseline; gap: 8px; margin: 0 6px 8px; }
.ag-day-h .d { font-weight: 650; font-size: 16px; }
.ag-day-h .d::first-letter { text-transform: uppercase; }
.ag-day-h .rel { color: var(--accent); font-weight: 650; font-size: 13.5px; }
.ev { display: flex; gap: 14px; align-items: stretch; padding: 14px 16px; border-top: 1px solid var(--line2); cursor: pointer; transition: background .15s; }
.ev:first-child { border-top: 0; }
.ev:active { background: var(--card2); }
.ev .bar { width: 3px; border-radius: 3px; flex: none; }
.ev .bar.p-yohann { background: var(--p-yohann); } .ev .bar.p-partner { background: var(--p-partner); } .ev .bar.p-both { background: var(--p-both); }
.ev .when { min-width: 54px; font-variant-numeric: tabular-nums; font-weight: 650; font-size: 15px; }
.ev .when small { display: block; color: var(--muted); font-weight: 500; font-size: 13px; }
.ev .what { flex: 1; min-width: 0; }
.ev .what .title { font-weight: 600; font-size: 16.5px; overflow-wrap: break-word; }
.ev .what .ev-who { color: var(--muted); font-size: 13.5px; margin-top: 2px; }

.week-nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 16px 0 8px; }
.week-nav .lbl { font-weight: 650; text-align: center; flex: 1; }
.week-nav .lbl small { display: block; font-weight: 500; color: var(--muted); font-size: 13px; }
.week { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.week > * { min-width: 0; }
.wday { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; min-height: 62px; display: flex; gap: 14px; cursor: pointer; }
.wday .num { width: 46px; flex: none; text-align: center; }
.wday .num .dn { font-size: 12px; font-weight: 650; text-transform: uppercase; color: var(--muted); letter-spacing: .04em; }
.wday .num .dd { font-size: 22px; font-weight: 700; line-height: 1.2; }
.wday.today { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.wday.today .num .dd { color: #fff; background: var(--accent); border-radius: 50%; width: 36px; height: 36px; line-height: 36px; margin: 2px auto 0; font-size: 18px; }
.wday.past { opacity: .55; }
.wday .evs { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; justify-content: center; }
.wev { font-size: 14.5px; padding: 6px 10px; border-radius: 9px; font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; background: var(--bg2); border-left: 3px solid var(--p-both); }
.wev.p-yohann { border-left-color: var(--p-yohann); } .wev.p-partner { border-left-color: var(--p-partner); }
.wev b { font-variant-numeric: tabular-nums; margin-right: 4px; font-weight: 650; }
.wday .none { color: var(--muted); font-size: 14px; opacity: .7; }

.link-card { display: flex; align-items: center; gap: 14px; margin-top: 26px; text-decoration: none; color: var(--text); }
.link-card .lc-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.link-card .lc-txt b { font-weight: 600; }
svg.i.chev { width: 18px; height: 18px; color: #A89F93; }
#ics-box code { display: block; background: var(--bg2); padding: 12px 14px; border-radius: 10px; font-size: 13px; word-break: break-all; margin: 0 0 12px; user-select: all; -webkit-user-select: all; color: var(--text2); }
.steps { margin: 12px 0 0; padding-left: 22px; color: var(--muted); font-size: 14.5px; }
.steps li { margin: 6px 0; }
.steps b { color: var(--text); font-weight: 600; }

/* ------------------------------------------------------------------ maison */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tile {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; min-height: 120px; display: flex; flex-direction: column;
  justify-content: space-between; gap: 12px; text-align: left; position: relative; overflow: hidden; transition: transform .15s, background .25s, border-color .25s;
}
button.tile:active { transform: scale(.97); }
.tile .ic { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: var(--bg2); color: var(--text2); transition: background .25s, color .25s; flex: none; }
.tile .ic svg.i { width: 21px; height: 21px; }
.tile .nm { font-weight: 600; font-size: 15.5px; line-height: 1.25; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.tile .st { font-size: 13.5px; color: var(--muted); margin-top: 2px; }
.tile.on { background: var(--accent-soft); border-color: #EBDCC6; }
.tile.on .ic { background: var(--accent); color: #fff; }
.tile.on .st { color: var(--accent-strong); }
.tile.unavail { opacity: .5; }
.tile.wide { grid-column: 1 / -1; }
.tile-h { display: flex; align-items: center; gap: 12px; }
.tile.busy::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .55), transparent); animation: shimmer 1s infinite; }
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.sensor-v { font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
.sensor-v small { font-size: 15px; font-weight: 600; color: var(--muted); margin-left: 2px; }
.climate { display: flex; align-items: center; gap: 14px; }
.climate .cur { flex: 1; }
.climate .cur .big { font-size: 38px; font-weight: 700; line-height: 1; letter-spacing: -.03em; }
.climate .set { display: flex; align-items: center; gap: 10px; }
.climate .set .val { font-size: 21px; font-weight: 700; min-width: 64px; text-align: center; font-variant-numeric: tabular-nums; }
.round { width: 48px; height: 48px; border-radius: 50%; background: var(--bg2); display: grid; place-items: center; font-size: 24px; font-weight: 500; transition: transform .12s; color: var(--text2); }
.round:active { transform: scale(.9); }
.cover-btns { display: flex; gap: 8px; }
.cover-btns button { flex: 1; min-height: 46px; border-radius: 12px; background: var(--bg2); font-weight: 600; font-size: 15px; color: var(--text2); }
.cover-btns button:active { transform: scale(.96); }
.banner { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-radius: 14px; background: var(--danger-soft); color: var(--danger); font-weight: 550; font-size: 14.5px; margin-bottom: 12px; }
.banner svg.i { width: 20px; height: 20px; }
.connect-card { text-align: center; padding: 28px 22px; }
.connect-card h3 { margin: 0 0 6px; font-size: 19px; font-weight: 650; }
.connect-card p { margin: 0 0 18px; }
.connect-card .steps { text-align: left; max-width: 420px; margin: 0 auto 20px; }

/* ------------------------------------------------------------------ réglages */
.set-group { margin-top: 24px; }
.set-group > .label { margin-left: 6px; text-transform: uppercase; letter-spacing: .06em; font-size: 12.5px; }
.status { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.status::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--muted); }
.status.ok::before { background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.status.ko::before { background: var(--danger); box-shadow: 0 0 0 4px var(--danger-soft); }
.ha-line { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ha-line .small { margin-top: 4px; }
.card.menu { padding: 4px 0; }
.menu-row { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 64px; padding: 10px 16px; text-align: left; border-top: 1px solid var(--line2); }
.menu-row:first-child { border-top: 0; }
.menu-row:active { background: var(--card2); }
.menu-row .grow { display: flex; flex-direction: column; gap: 1px; }
.menu-row b { font-weight: 600; }
.ent { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-top: 1px solid var(--line2); cursor: pointer; }
.ent:first-child { border-top: 0; }
.ent .main { flex: 1; min-width: 0; }
.ent .main .n { font-weight: 550; overflow: hidden; text-overflow: ellipsis; }
.ent .main .i { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ent-list { max-height: 460px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--accent); font-weight: 600; font-size: 16px; min-height: 44px; margin: -6px 0 4px -6px; }
.back svg.i { width: 22px; height: 22px; stroke-width: 2.2; }
.notice { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: 14px; background: var(--accent-soft); color: var(--text2); margin-top: 12px; font-size: 15px; }
.notice svg.i { color: var(--accent-strong); margin-top: 1px; }

/* ------------------------------------------------------------------ feuille (modale) */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(51, 48, 43, .34); z-index: 50; opacity: 0; transition: opacity .25s; }
.sheet-backdrop.show { opacity: 1; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 51; max-width: 560px; margin: 0 auto; max-height: 92vh; overflow-y: auto;
  background: var(--card); border-radius: 24px 24px 0 0; box-shadow: var(--shadow-lg); padding: 10px 20px calc(24px + var(--safe-b));
  transform: translateY(105%); transition: transform .32s cubic-bezier(.2, .9, .3, 1); -webkit-overflow-scrolling: touch;
}
.sheet.show { transform: none; }
.sheet .grab { width: 38px; height: 5px; border-radius: 3px; margin: 0 auto 14px; background: #E4DACC; }
.sheet h2 { margin: 2px 0 6px; font-size: 21px; font-weight: 650; }
.sheet p { margin: 0; }
.sheet .actions { display: flex; gap: 10px; margin-top: 22px; }
.sheet .actions .btn { flex: 1; }
.cat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 16px; }
.cat-grid button { min-height: 56px; border-radius: 14px; background: var(--bg2); font-weight: 600; display: flex; align-items: center; gap: 10px; padding: 0 14px; text-align: left; color: var(--text2); border: 1px solid transparent; }
.cat-grid button svg.i { color: var(--accent); }
.cat-grid button.on { background: var(--accent-soft); color: var(--accent-strong); border-color: var(--accent); }
.switch-row { display: flex; align-items: center; justify-content: space-between; min-height: 52px; }
.switch { width: 52px; height: 32px; border-radius: 16px; background: #DAD0C2; position: relative; transition: background .2s; flex: none; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform .25s cubic-bezier(.3, 1.4, .5, 1); }
.switch.on { background: var(--accent); }
.switch.on::after { transform: translateX(20px); }

/* ------------------------------------------------------------------ toast */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + var(--safe-b) + 16px); transform: translate(-50%, 20px); z-index: 90;
  background: #33302B; color: #fff; padding: 12px 18px; border-radius: 14px; font-weight: 550; font-size: 15px; box-shadow: var(--shadow-lg);
  opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; width: max-content; max-width: calc(100% - 32px); text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: var(--danger); }

/* ------------------------------------------------------------------ connexion, configuration, « qui êtes-vous » */
body.locked .toast { bottom: calc(var(--safe-b) + 24px); }
.auth, .onboarding {
  position: fixed; inset: 0; z-index: 80; background: var(--bg); overflow-y: auto;
  display: flex; align-items: center; justify-content: center;
  padding: calc(var(--safe-t) + 24px) 20px calc(var(--safe-b) + 24px);
}
.auth.leaving { opacity: .6; transition: opacity .2s; }
.auth-inner { width: 100%; max-width: 380px; display: flex; flex-direction: column; align-items: center; text-align: center; animation: viewIn .35s ease both; }
.auth-logo { width: 76px; height: 76px; border-radius: 22px; box-shadow: var(--shadow-md); margin-bottom: 20px; }
.auth-badge { width: 72px; height: 72px; border-radius: 22px; background: var(--accent-soft); color: var(--accent-strong); display: grid; place-items: center; margin-bottom: 20px; }
.auth-badge svg.i { width: 32px; height: 32px; stroke-width: 1.6; }
.auth-inner h1 { margin: 0; font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
.auth-sub { margin: 6px 0 24px; color: var(--muted); font-size: 16px; }
.auth-card { width: 100%; background: var(--card); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow-md); padding: 20px; text-align: left; display: flex; flex-direction: column; gap: 12px; }
.auth-card.shake { animation: shake .4s ease; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.auth-hint { margin: 0; color: var(--muted); font-size: 14px; }
.auth-hint b { color: var(--text2); font-weight: 600; }
.auth-hint.center { margin-top: 22px; text-align: center; }
.auth-err { color: var(--danger); font-size: 14.5px; font-weight: 550; min-height: 0; }
.auth-err:empty { display: none; }
.pw-field { position: relative; }
.pw-field .input { padding-right: 52px; }
.pw-eye { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; color: var(--muted); }
.pw-eye:active { background: var(--bg2); }
.remember { display: flex; align-items: center; gap: 12px; min-height: 44px; font-weight: 550; color: var(--text2); cursor: pointer; user-select: none; -webkit-user-select: none; }
.remember input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.remember .box { width: 24px; height: 24px; border-radius: 7px; border: 2px solid #D9CFC1; display: grid; place-items: center; transition: background .15s, border-color .15s; flex: none; }
.remember .box svg.i { width: 15px; height: 15px; stroke: #fff; stroke-width: 3; opacity: 0; }
.remember input:checked + .box { background: var(--accent); border-color: var(--accent); }
.remember input:checked + .box svg.i { opacity: 1; }
.remember input:focus-visible + .box { outline: 2px solid var(--accent); outline-offset: 2px; }
.auth .btn.block { margin-top: 4px; }
.auth-inner > .btn.block { margin-top: 4px; }

.who-grid { display: grid; gap: 12px; width: 100%; }
.who {
  display: flex; align-items: center; gap: 16px; padding: 16px 18px; border-radius: 18px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow);
  font-size: 18px; font-weight: 600; text-align: left; transition: transform .15s, background .15s;
}
.who .chev { margin-left: auto; }
.who:active { transform: scale(.98); background: var(--card2); }
.avatar { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; font-size: 20px; font-weight: 700; color: #fff; flex: none; }
.avatar.p-yohann { background: var(--p-yohann); }
.avatar.p-partner { background: var(--p-partner); }

/* ------------------------------------------------------------------ grands écrans */
@media (min-width: 700px) {
  #views { padding-top: calc(var(--safe-t) + 34px); }
  .head h1, .home-head h1 { font-size: 34px; }
  .tiles { grid-template-columns: repeat(3, 1fr); }
  .home-grid { grid-template-columns: 1fr 1fr; align-items: start; }
  .week { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
  .wday { flex-direction: column; min-height: 180px; padding: 10px; gap: 8px; }
  .wday .num { width: auto; }
  .wday .evs { justify-content: flex-start; }
  .wev { font-size: 13px; white-space: normal; padding: 5px 7px; }
  .wev b { display: block; }
  .sheet { bottom: auto; top: 50%; border-radius: 24px; transform: translateY(-40%) scale(.97); opacity: 0; transition: transform .28s, opacity .2s; padding-bottom: 24px; }
  .sheet.show { transform: translateY(-50%); opacity: 1; }
}
@media (min-width: 1000px) {
  .tabbar { top: 0; bottom: 0; right: auto; width: 96px; height: auto; flex-direction: column; justify-content: center; gap: 10px; border-top: 0; border-right: 1px solid var(--line); padding: 0; }
  .tabbar a { flex: none; height: 72px; max-width: none; }
  #views { padding-left: 120px; padding-right: 24px; max-width: 900px; padding-bottom: 40px; }
  .toast { bottom: 28px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Maison : boutons globaux, pièces, volets (v4) */
.globals { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 700px) { .globals { grid-template-columns: 1fr 1fr; } }
.glob { padding: 16px; }
.glob-h { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.glob-t { font-weight: 650; font-size: 17px; letter-spacing: -.01em; }
.glob-s { color: var(--muted); font-size: 14.5px; }
.card-ic.lit { background: var(--accent); color: #fff; }
.glob-btns { display: flex; gap: 8px; }
.gbtn {
  flex: 1 1 0; min-width: 0; min-height: 54px; border-radius: 14px; background: var(--bg2); color: var(--text2); font-weight: 650; font-size: 15px;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 0 10px; transition: transform .15s, background .2s; white-space: nowrap;
}
.gbtn svg.i { width: 19px; height: 19px; }
.gbtn:active { transform: scale(.96); }
.gbtn.primary { background: var(--accent); color: #fff; }
.gbtn.primary:active { background: var(--accent-strong); }
.gbtn.my { flex: 0 0 auto; background: var(--accent-soft); color: var(--accent-strong); padding: 0 14px; }
.sc-label { margin: 22px 4px 8px; }
.chips.shortcuts .chip svg.i { color: var(--accent); }
.room { margin-top: 14px; padding: 16px; }
.room-h { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 0 2px 12px; flex-wrap: wrap; }
.room-h h2 { margin: 0; font-size: 18px; font-weight: 650; letter-spacing: -.01em; }
.room-s { color: var(--muted); font-size: 13.5px; }
.room .tiles + .covers, .room .tiles + .tile, .room .covers + .tile { margin-top: 12px; }
.room .tile.wide { display: flex; }
.covers { display: flex; flex-direction: column; gap: 10px; }
.cover-all { background: var(--card2); border: 1px dashed var(--line); border-radius: 14px; padding: 10px 12px 12px; }
.ca-t { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14.5px; color: var(--text2); margin-bottom: 8px; }
.ca-t svg.i { width: 18px; height: 18px; color: var(--accent); }
.cover-row { border: 1px solid var(--line); border-radius: 16px; padding: 12px; position: relative; overflow: hidden; background: var(--card); }
.cover-row.unavail { opacity: .5; }
.cover-row.unavail button { pointer-events: none; }
.cover-row.busy::after, .cover-all.busy::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .55), transparent); animation: shimmer 1s infinite; pointer-events: none; }
.cv-h { display: flex; align-items: center; gap: 12px; }
.cv-h .grow { flex: 1; min-width: 0; }
.cv-h .ic { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--bg2); color: var(--text2); flex: none; }
.cv-h .ic svg.i { width: 20px; height: 20px; }
.cv-h .nm { font-weight: 600; font-size: 15.5px; }
.cv-h .st { font-size: 13.5px; color: var(--muted); }
.my-pos { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 600; color: var(--accent-strong); background: var(--accent-soft); border-radius: 10px; padding: 3px 8px; white-space: nowrap; }
.my-pos svg.i { width: 13px; height: 13px; }
.pos-bar { height: 4px; border-radius: 2px; background: var(--bg2); margin: 10px 0 0; overflow: hidden; }
.pos-bar i { display: block; height: 100%; background: var(--accent); border-radius: 2px; transition: width .4s; }
.pos-bar i.w0 { width: 0%; }
.pos-bar i.w5 { width: 5%; }
.pos-bar i.w10 { width: 10%; }
.pos-bar i.w15 { width: 15%; }
.pos-bar i.w20 { width: 20%; }
.pos-bar i.w25 { width: 25%; }
.pos-bar i.w30 { width: 30%; }
.pos-bar i.w35 { width: 35%; }
.pos-bar i.w40 { width: 40%; }
.pos-bar i.w45 { width: 45%; }
.pos-bar i.w50 { width: 50%; }
.pos-bar i.w55 { width: 55%; }
.pos-bar i.w60 { width: 60%; }
.pos-bar i.w65 { width: 65%; }
.pos-bar i.w70 { width: 70%; }
.pos-bar i.w75 { width: 75%; }
.pos-bar i.w80 { width: 80%; }
.pos-bar i.w85 { width: 85%; }
.pos-bar i.w90 { width: 90%; }
.pos-bar i.w95 { width: 95%; }
.pos-bar i.w100 { width: 100%; }
.cover-row .cover-btns { margin-top: 10px; }
.cover-btns button { display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-width: 0; padding: 0 6px; }
.cover-btns button svg.i { width: 17px; height: 17px; }
.cover-btns button.my { background: var(--accent-soft); color: var(--accent-strong); flex: .8; }

.set-hint { margin: -2px 4px 10px; color: var(--muted); font-size: 14px; }
.dev-card { padding: 0; overflow: hidden; }
.dev-card .menu-row { padding: 14px 16px; }
.dev-room { padding: 14px 16px 6px; font-size: 12.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); border-top: 1px solid var(--line2); }
.ent.dev { cursor: default; padding: 10px 16px; }
.version { margin-top: 10px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.update-bar {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--tabbar-h) + var(--safe-b) + 14px); z-index: 60;
  display: flex; align-items: center; gap: 14px; padding: 8px 8px 8px 16px; border-radius: 16px; background: var(--text); color: #fff;
  font-weight: 600; font-size: 15px; box-shadow: var(--shadow-lg); width: max-content; max-width: calc(100% - 32px);
}

/* ---------- Photos de profil (servies avec la session uniquement) et écran Profil */
.av { position: relative; display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; overflow: hidden; flex: none;
  color: #fff; font-weight: 700; font-size: 16px; background: var(--muted); vertical-align: middle; }
.av.p-yohann { background: var(--p-yohann); }
.av.p-partner { background: var(--p-partner); }
.av img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center; display: block; }
.av.xs { width: 20px; height: 20px; font-size: 10px; box-shadow: 0 0 0 1.5px #fff; }
.av.md { width: 42px; height: 42px; font-size: 17px; }
.av.xl { width: 112px; height: 112px; font-size: 40px; box-shadow: 0 6px 20px rgba(120, 90, 45, .12); }
.av.hero { width: 132px; height: 132px; font-size: 48px; box-shadow: 0 0 0 8px var(--accent-soft), 0 10px 30px rgba(120, 90, 45, .12); }
.av-pair { display: inline-flex; }
.av-pair .av + .av { margin-left: -7px; }
.who-chip .av.xs, .item .meta .by .av.xs { margin-left: -4px; }
.item .meta .by { display: inline-flex; align-items: center; gap: 5px; }
.ev .what .ev-who { display: flex; align-items: center; gap: 6px; }
.me-btn { border-radius: 50%; padding: 2px; background: var(--card); box-shadow: 0 0 0 1px var(--line); transition: transform .15s; flex: none; }
.me-btn:active { transform: scale(.94); }
.who-pics { display: flex; justify-content: center; gap: 22px; width: 100%; margin-top: 6px; }
.who-pic { display: flex; flex-direction: column; align-items: center; gap: 12px; font-weight: 650; font-size: 17px; color: var(--text); padding: 8px; border-radius: 20px; transition: transform .15s; }
.who-pic:active { transform: scale(.96); }
@media (max-width: 340px) { .who-pics .av.xl { width: 96px; height: 96px; } }
.profile-top { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; margin: 0 0 8px; }
.profile-top .back { margin: 0; justify-content: center; }
.profile-title { margin: 0; text-align: center; font-size: 19px; font-weight: 650; letter-spacing: -.01em; }
.profile { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 18px 0 8px; }
.profile-name { margin-top: 18px; font-size: 24px; font-weight: 700; letter-spacing: -.02em; }
.btn.pill { border-radius: 999px; margin-top: 14px; padding: 0 22px; }
.globals { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 700px) { .globals { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.glob, .room, .cover-row, .cover-all { min-width: 0; }
.gbtn { overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 420px) {
  .glob-btns.three .gbtn:not(.my) svg.i { display: none; }
  .glob-btns.three .gbtn { padding: 0 8px; }
}
@media (max-width: 420px) {
  .cover-btns { gap: 6px; }
  .cover-btns button:not(.my) svg.i { display: none; }
  .cover-btns button { font-size: 14.5px; }
}

/* ---------- v4.1 : organisation par type (Lumières, Volets, Autres) */
.types { display: flex; flex-direction: column; gap: 12px; }
.type-block { min-width: 0; }
.mini-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; margin-top: 12px; }
.mini-tiles .tile { padding: 10px; gap: 8px; min-height: 0; border-radius: 14px; }
.mini-tiles .tile .ic { width: 34px; height: 34px; }
.mini-tiles .tile .ic svg.i { width: 18px; height: 18px; }
.mini-tiles .tile .nm { font-size: 14.5px; -webkit-line-clamp: 1; }
.mini-tiles .tile .st { font-size: 12.5px; margin-top: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cv-list { margin-top: 12px; border-top: 1px solid var(--line2); }
.cv { display: flex; align-items: center; gap: 6px; padding: 8px 0; border-bottom: 1px solid var(--line2); position: relative; min-width: 0; }
.cv:last-child { border-bottom: 0; padding-bottom: 0; }
.cv.unavail { opacity: .5; }
.cv.unavail button { pointer-events: none; }
.cv.busy::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .6), transparent); animation: shimmer 1s infinite; pointer-events: none; }
.cv-info { flex: 1; min-width: 0; line-height: 1.2; }
.cv-info .nm { font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cv-info .st { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.my-line { display: flex; align-items: center; gap: 3px; font-size: 11.5px; font-weight: 600; color: var(--accent-strong); margin-top: 2px; white-space: nowrap; }
.my-line svg.i { width: 11px; height: 11px; }
.cv-stop { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: var(--muted); border: 1px solid var(--line); }
.cv-stop svg.i { width: 13px; height: 13px; }
.cv-stop:active { transform: scale(.9); background: var(--bg2); }
.cv-btns { display: flex; gap: 5px; flex: none; }
.cvb { width: 54px; height: 46px; border-radius: 12px; background: var(--bg2); color: var(--text2); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; font-size: 11.5px; font-weight: 650; transition: transform .12s; }
.cvb svg.i { width: 17px; height: 17px; }
.cvb:active { transform: scale(.93); }
.cvb.my { background: var(--accent-soft); color: var(--accent-strong); }
@media (max-width: 350px) { .cvb { width: 48px; } .cv-stop { width: 26px; height: 26px; } }
.others { padding: 14px 16px; background: var(--card2); box-shadow: none; }
.others-t { font-size: 13px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.others .mini-tiles .tile { background: var(--card); }
.others .tile.wide { margin-top: 12px; }
.sc-row { margin-top: 12px; }
.sc-row .sc-label { display: block; margin: 0 2px 6px; font-size: 12.5px; font-weight: 600; color: var(--muted); }

/* ==================================================================== v4.2 : design bleu */
.card { border-color: transparent; box-shadow: var(--shadow); }
.input, .textarea { border-color: var(--line); }

/* --- bandeau d'accueil */
.home-hero {
  margin: calc(-1 * (var(--safe-t) + 20px)) -16px 0; padding: calc(var(--safe-t) + 22px) 20px 20px;
  border-radius: 0 0 28px 28px;
  box-shadow: 0 10px 30px rgba(138, 85, 54, .25);
}
@media (min-width: 700px) { .home-hero { margin: 0 0 0; border-radius: 28px; padding-top: 22px; } }
.hero-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.home-hero .eyebrow { font-size: 14px; font-weight: 600; opacity: .85; }
.home-hero .eyebrow::first-letter { text-transform: uppercase; }
.home-hero h1 { margin: 2px 0 0; font-size: 27px; line-height: 1.15; font-weight: 700; letter-spacing: -.02em; }
.home-hero .me-btn { background: rgba(255, 255, 255, .25); box-shadow: none; }
.hero-wx { display: flex; align-items: center; gap: 14px; margin-top: 16px; }
.wx-big svg.i { width: 54px; height: 54px; stroke-width: 1.4; color: #fff; }
.wx-t { font-size: 40px; font-weight: 700; line-height: 1; letter-spacing: -.03em; }
.wx-l { font-size: 15px; opacity: .92; margin-top: 3px; }
.hero-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 4px; margin-top: 16px; background: rgba(255, 255, 255, .13); border-radius: 16px; padding: 10px 6px; }
.hs { text-align: center; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.hs b { font-size: 16px; font-weight: 700; white-space: nowrap; }
.hs span { font-size: 12px; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#wx-card:not(:empty) { margin-top: 14px; }
#wx-card + .card { margin-top: 12px; }
.home-hero + #wx-card:empty + .card { margin-top: 16px; }

/* --- carte météo */
.wx-card { padding: 16px 16px 12px; }
.wx-card .card-h { margin-bottom: 4px; }
.wx-hours { display: flex; gap: 6px; overflow-x: auto; padding: 6px 0 10px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.wx-hours::-webkit-scrollbar { display: none; }
.wxh { flex: none; width: 52px; display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 8px 0; border-radius: 14px; background: var(--card2); }
.wxh:first-child { background: var(--accent-soft); }
.wxh .t { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.wxh svg.i { width: 22px; height: 22px; color: var(--accent); stroke-width: 1.6; }
.wxh b { font-size: 14.5px; }
.wx-days { border-top: 1px solid var(--line2); }
.wxd { display: grid; grid-template-columns: 48px 26px 1fr auto; align-items: center; gap: 8px; padding: 7px 2px; border-bottom: 1px solid var(--line2); font-size: 14.5px; }
.wxd:last-child { border-bottom: 0; }
.wxd .d { font-weight: 600; text-transform: capitalize; }
.wxd svg.i { width: 22px; height: 22px; color: var(--accent); stroke-width: 1.6; }
.wxd .rain { display: inline-flex; align-items: center; gap: 3px; color: var(--muted); font-size: 12.5px; }
.wxd .rain svg.i { width: 13px; height: 13px; color: #7B8C72; }
.wxd .mm { font-variant-numeric: tabular-nums; color: var(--muted); }
.wxd .mm b { color: var(--text); }

/* --- vignettes d'appareils */
.vtiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
@media (min-width: 560px) { .vtiles { grid-template-columns: repeat(3, 1fr); } }
.vt {
  position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: stretch; text-align: left; min-width: 0;
  aspect-ratio: 1 / .8; min-height: 112px; padding: 14px; border-radius: 18px; background: var(--card); border: 1px solid var(--line);
  box-shadow: 0 4px 14px rgba(120, 90, 45, .05); transition: transform .15s, background .25s, border-color .25s;
}
.vt:active { transform: scale(.97); }
.vt-top { display: flex; align-items: flex-start; justify-content: space-between; }
.vt-ic svg.i { width: 30px; height: 30px; stroke-width: 1.5; color: var(--muted); transition: color .25s; }
.tgl { position: relative; width: 38px; height: 22px; border-radius: 11px; background: #E4DACC; transition: background .22s; flex: none; }
.tgl::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(51, 48, 43, .25); transition: transform .22s cubic-bezier(.3, 1.3, .5, 1); }
.vt-nm { margin-top: auto; font-weight: 650; font-size: 15.5px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vt-st { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vt.on { background: #F7EFE3; border-color: #EBDCC6; }
.vt.on .vt-ic svg.i { color: var(--accent); }
.vt.on .tgl { background: var(--accent); }
.vt.on .tgl::after { transform: translateX(16px); }
.vt.on .vt-st { color: var(--accent); font-weight: 600; }
.vt.unavail { opacity: .5; pointer-events: none; }
.vt.busy::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .55), transparent); animation: shimmer 1s infinite; pointer-events: none; }
.others .vt { background: var(--card); }
.others .vt.on { background: #F7EFE3; }

/* --- blocs et boutons globaux (« Active Devices ») */
.glob-t { font-size: 18px; font-weight: 700; color: var(--text); }
.gbtn { background: #F3ECE1; color: var(--accent-strong); }
.gbtn.primary { box-shadow: 0 6px 16px rgba(138, 85, 54, .28); }
.gbtn.my { background: var(--card); color: var(--accent-strong); box-shadow: inset 0 0 0 1.5px #EBDCC6; }
.cvb { background: #F3ECE1; color: var(--accent-strong); }
.cvb.my { background: var(--card); box-shadow: inset 0 0 0 1.5px #EBDCC6; }
.cv-stop { border-color: #E4DACC; color: var(--accent-strong); }
.others { background: var(--card); box-shadow: var(--shadow); }

/* --- barre d'onglets bleue avec bouton + central */
.tabbar {
  background: var(--accent); border-top: 0; border-radius: 24px 24px 0 0; -webkit-backdrop-filter: none; backdrop-filter: none;
  box-shadow: 0 -8px 26px rgba(120, 90, 45, .18); align-items: stretch; padding-left: 6px; padding-right: 6px;
}
.tabbar a { color: rgba(255, 255, 255, .72); }
.tabbar a svg.i { padding: 4px 14px; }
.tabbar a.active { color: #fff; }
.tabbar a.active svg.i { background: rgba(255, 255, 255, .2); }
.tabbar .badge { background: #fff; color: var(--accent-strong); border-color: var(--accent); }
.fab {
  flex: none; align-self: flex-start; width: 62px; height: 62px; margin: -24px 4px 0; border-radius: 50%; display: grid; place-items: center;
  background: #33302B; color: #fff; box-shadow: 0 0 0 6px var(--bg), 0 10px 22px rgba(51, 48, 43, .3); transition: transform .15s;
}
.fab svg.i { width: 28px; height: 28px; stroke-width: 2.3; }
.fab:active { transform: scale(.93); }
body.locked .tabbar { display: none; }

/* --- sélecteur Courses / À penser (onglet « Listes ») */
.lists-seg { margin: 0 0 18px; }
.lists-seg button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
.lists-seg button svg.i { width: 18px; height: 18px; }
.seg-n { font-size: 11.5px; font-weight: 700; min-width: 18px; height: 18px; line-height: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: #fff; }
.seg-n:empty { display: none; }

/* --- ajout rapide */
.qa-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 16px; }
.qa-grid button { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 18px 6px; border-radius: 18px; background: var(--card2); border: 1px solid var(--line); font-weight: 650; color: var(--text); }
.qa-grid button:active { transform: scale(.96); background: var(--accent-soft); }
.qa-ic { width: 52px; height: 52px; border-radius: 16px; background: var(--accent); color: #fff; display: grid; place-items: center; }
.qa-added { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.qa-added .pill { display: inline-flex; align-items: center; gap: 5px; background: var(--accent-soft); color: var(--accent-strong); }
.qa-added .pill svg.i { width: 15px; height: 15px; }

/* --- connexion, « Qui êtes-vous ? » */
.auth, .onboarding { background: linear-gradient(180deg, #EFE3D0 0%, var(--bg) 50%); }
.auth-card { border-color: transparent; }
.av.hero { box-shadow: 0 0 0 8px #F4EADC, 0 10px 30px rgba(120, 90, 45, .18); }

/* ==================================================================== v4.3 : rien ne doit élargir la page */
.who-chip { max-width: 100%; min-width: 0; overflow: hidden; }
.who-chip .lbl, .item .meta .by, .tag { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .meta .by { max-width: 100%; }
.item .main, .row-note .txt, .ev .what, .lc-txt, .row-ev .x, .cv-info, .menu-row .grow, .ha-line > div { min-width: 0; }
.item .name, .row-note .x, .row-ev .x, .ev .title, .ev .ev-who, .wev, .pill, .head h1, .head .sub, .home-hero h1, .profile-name,
.card-h h2, .glob-s, .auth-inner h1, .auth-sub, .sheet h2, .sheet p, .muted, .notice, .empty, .lc-txt b, .ent .n, code, .qa-added .pill {
  overflow-wrap: break-word;
}
.chips { flex-wrap: wrap; overflow: visible; padding-bottom: 2px; }
.chip { max-width: 100%; min-width: 0; }
.chip { white-space: normal; overflow-wrap: break-word; text-align: left; padding-top: 6px; padding-bottom: 6px; }
.chip svg.i { flex: none; }
.pills { flex-wrap: wrap; min-width: 0; }
.pill { max-width: 100%; }
.row-ev { min-width: 0; }
.row-ev .who-chip { flex-shrink: 1; }
.seg { min-width: 0; }
.seg button { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who-pic span { max-width: 130px; overflow-wrap: break-word; text-align: center; }
.home-hero h1 { min-width: 0; }
.hero-top > div { min-width: 0; }
/* grilles : jamais de colonne élargie par un contenu trop long */
.home-grid { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 700px) { .home-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.tiles, .cat-grid, .vtiles { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
@media (min-width: 560px) { .vtiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.qa-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.profile-top { grid-template-columns: 44px minmax(0, 1fr) 44px; }
.wxd { grid-template-columns: 48px 26px minmax(0, 1fr) auto; }
.cat-grid button { min-width: 0; overflow-wrap: break-word; }
.row-note { min-width: 0; }
/* météo discrète dans le bandeau ; la carte Météo est au milieu de l'accueil */
.wx-chip { display: inline-flex; align-items: center; gap: 6px; margin-top: 12px; padding: 5px 12px 5px 9px; border-radius: 999px; background: rgba(255, 255, 255, .18); color: #fff; font-weight: 650; font-size: 15px; }
.wx-chip svg.i { width: 20px; height: 20px; stroke-width: 1.7; }
.wx-chip:active { background: rgba(255, 255, 255, .28); }
.home-hero + .card { margin-top: 16px; }
#wx-card:not(:empty) { margin-top: 12px; scroll-margin-top: 16px; }
/* « Aujourd'hui » : le titre garde la place, la pastille « pour qui » se tronque */
.row-ev .x { flex: 1 1 0; min-width: 0; }
.row-ev .who-chip { flex: 0 1 auto; max-width: 45%; }
.row-ev .t { flex: none; }
.tabbar .badge { left: auto; right: calc(50% - 28px); }
.dev-name { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; text-align: left; color: var(--text); max-width: 100%; overflow-wrap: break-word; }
.dev-name svg.i { width: 15px; height: 15px; color: var(--accent); flex: none; }
.rename-form { display: flex; gap: 6px; }
.rename-form .input { min-height: 40px; padding: 6px 12px; flex: 1; min-width: 0; }
/* blocs de volets (2 colonnes), 4 boutons-icônes en 2×2, zones tactiles ≥ 40 px */
.vblocks { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; margin-top: 14px; }
@media (min-width: 560px) { .vblocks { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.vb { position: relative; overflow: hidden; min-width: 0; padding: 12px; border-radius: 18px; background: var(--card); border: 1px solid var(--line); box-shadow: 0 4px 14px rgba(120, 90, 45, .05); display: flex; flex-direction: column; }
.vb.open { background: #F7EFE3; border-color: #EBDCC6; }
.vb.unavail { opacity: .5; }
.vb.unavail button { pointer-events: none; }
.vb.busy::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .55), transparent); animation: shimmer 1s infinite; pointer-events: none; }
.vb-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 6px; }
.vb-ic svg.i { width: 28px; height: 28px; stroke-width: 1.5; color: var(--muted); }
.vb.open .vb-ic svg.i { color: var(--accent); }
.vb .my-pos { padding: 2px 7px; font-size: 11.5px; }
.vb-nm { margin-top: 8px; font-weight: 650; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vb-st { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vb.open .vb-st { color: var(--accent-strong); }
.vb .pos-bar { margin-top: 8px; }
.vb-btns { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 6px; margin-top: 10px; }
.vbb { min-height: 40px; border-radius: 12px; background: #F3ECE1; color: var(--accent-strong); display: grid; place-items: center; transition: transform .12s; }
.vbb svg.i { width: 19px; height: 19px; }
.vbb:active { transform: scale(.93); }
.vbb.my { background: var(--card); box-shadow: inset 0 0 0 1.5px #EBDCC6; }
/* Courses : liste simple, champ multi-lignes */
.add-bar { align-items: flex-end; }
.shop-ta { resize: none; min-height: 52px; max-height: 180px; padding-top: 14px; padding-bottom: 14px; line-height: 1.35; overflow-y: auto; }
.add-hint { margin: 6px 6px 14px; font-size: 13px; color: var(--muted); }

/* ==================================================================== v4.3 : palette « mur du salon » (contrastes WCAG vérifiés) */
.home-hero { background: linear-gradient(160deg, #EDDEC8 0%, var(--wall) 70%); color: var(--text); box-shadow: 0 10px 28px rgba(120, 90, 45, .16); }
.home-hero .eyebrow { opacity: 1; color: var(--text2); }
.home-hero .me-btn { background: rgba(255, 255, 255, .45); }
.wx-chip { background: rgba(255, 255, 255, .5); color: var(--text); }
.wx-chip:active { background: rgba(255, 255, 255, .7); }
.wxh svg.i, .wxd svg.i { color: var(--accent); }
.tabbar { background: var(--wall); box-shadow: 0 -8px 24px rgba(120, 90, 45, .16); }
.tabbar a { color: var(--text2); }
.tabbar a.active { color: var(--text); }
.tabbar a.active svg.i { background: var(--wall-active); }
.tabbar .badge { background: var(--accent); color: #fff; border-color: var(--wall); }
.fab { background: var(--accent); box-shadow: 0 0 0 6px var(--bg), 0 10px 22px rgba(148, 97, 48, .35); }
.fab:active { background: var(--accent-strong); }
.vt.on, .vb.open { background: var(--wall-soft); border-color: var(--wall-active); }
.vt.on .vt-st, .vb.open .vb-st { color: var(--accent-strong); }
.vt.on .vt-ic svg.i, .vb.open .vb-ic svg.i { color: var(--accent); }
.tgl { background: #E2D8CA; }
.vt.on .tgl { background: var(--accent); }
.others .vt.on { background: var(--wall-soft); }
.gbtn, .cvb, .vbb { background: var(--bg2); color: var(--accent-strong); }
.gbtn.my, .cvb.my, .vbb.my { background: var(--card); color: var(--accent-strong); box-shadow: inset 0 0 0 1.5px var(--wall-active); }
.gbtn.primary { background: var(--accent); color: #fff; box-shadow: 0 6px 16px rgba(148, 97, 48, .25); }
.card-ic.lit { background: var(--accent); color: #fff; }
.pos-bar i { background: var(--accent); }
.vb.open .pos-bar i { background: var(--sage); }
.my-pos, .my-line { color: var(--sage); }
.my-pos { background: var(--sage-soft); }
.status.ok::before { background: var(--sage); box-shadow: 0 0 0 4px var(--sage-soft); }
.auth, .onboarding { background: linear-gradient(180deg, #EFE3D0 0%, var(--bg) 50%); }
.av.hero { box-shadow: 0 0 0 8px var(--wall-soft), 0 10px 30px rgba(120, 90, 45, .18); }
.qa-ic { background: var(--accent); }
.seg-n { background: var(--accent); }
.update-bar { background: var(--text); }
.dev-sub { display: flex; align-items: center; gap: 10px; margin-top: 6px; font-size: 13px; color: var(--text2); }
.switch.sm { width: 40px; height: 24px; border-radius: 12px; }
.switch.sm::after { width: 18px; height: 18px; top: 3px; left: 3px; }
.switch.sm.on::after { transform: translateX(16px); }
.ent.dev.has-sub { align-items: flex-start; }
.row-ev .x, .item .name, .row-note .x, .ev .title, .vt-nm { word-break: normal; }
.row-ev { gap: 10px; }
.row-ev .t { min-width: 0; }
.row-ev .who-chip { max-width: 40%; }
/* double authentification */
.code-input { font-size: 22px; letter-spacing: .15em; text-align: center; font-variant-numeric: tabular-nums; }
.center-link { align-self: center; min-height: 40px; }
.mt-s { margin-top: 6px; }
.qr-box { width: min(240px, 100%); margin: 14px auto; padding: 8px; background: #fff; border-radius: 16px; border: 1px solid var(--line); }
.qr-box svg { width: 100%; height: auto; display: block; }
.secret-key { display: block; text-align: center; font-size: 16px; letter-spacing: .06em; padding: 10px; border-radius: 12px; background: var(--bg2); margin: 6px 0 10px; overflow-wrap: break-word; }
.backup-codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.backup-codes code { text-align: center; padding: 8px; border-radius: 10px; background: var(--bg2); font-size: 16px; letter-spacing: .05em; }

/* ==================================================================== v4.6 : agenda (vue mois, types) */
.t-rdv { --tbg: #DCE7F2; --tfg: #1F4466; }
.t-anniversaire { --tbg: #F6DCE4; --tfg: #7A2443; }
.t-absence { --tbg: #E1EDD5; --tfg: #35561F; }
.t-famille { --tbg: #F6E4C6; --tfg: #6B4510; }
.t-travail { --tbg: #E5E1F3; --tfg: #3F3470; }
.t-sortie { --tbg: #F8DDD2; --tfg: #7E3517; }
.t-autre { --tbg: #ECE8E1; --tfg: #4A443C; }
.month-nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 16px 0 10px; }
.month-nav .lbl { display: flex; flex-direction: column; align-items: center; font-weight: 650; font-size: 18px; text-transform: capitalize; }
.month-nav .lbl .link { font-size: 13.5px; min-height: 28px; text-transform: none; }
.month-card { padding: 8px 6px 6px; }
.mhead { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); text-align: center; font-size: 12px; font-weight: 700; color: var(--muted); padding-bottom: 4px; }
.mw { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); grid-template-rows: 24px repeat(3, 17px) 15px; border-top: 1px solid var(--line2); position: relative; }
.md { grid-row: 1 / -1; display: flex; justify-content: center; align-items: flex-start; padding-top: 3px; border-left: 1px solid var(--line2); min-width: 0; background: none; }
.md.gs-1 { border-left: 0; }
.md.out .mdn { color: #B5AC9F; }
.md .mdn { font-size: 13px; font-weight: 600; width: 22px; height: 20px; line-height: 20px; border-radius: 10px; text-align: center; }
.md.today .mdn { background: var(--accent); color: #fff; }
.md.sel { background: var(--accent-soft); }
.mb, .ml, .mmore { pointer-events: none; min-width: 0; z-index: 1; align-self: center; }
.mb { height: 15px; margin: 0 2px; border-radius: 4px; background: var(--tbg); color: var(--tfg); font-size: 10.5px; font-weight: 650; line-height: 15px; padding: 0 4px; overflow: hidden; }
.mb.cl { margin-left: 0; border-top-left-radius: 0; border-bottom-left-radius: 0; }
.mb.cr { margin-right: 0; border-top-right-radius: 0; border-bottom-right-radius: 0; }
.mb span, .ml span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ml { display: flex; align-items: center; gap: 2px; font-size: 10px; color: var(--text2); padding: 0 2px; overflow: hidden; }
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--tfg, var(--accent)); flex: none; display: inline-block; }
.mmore { font-size: 10px; font-weight: 700; color: var(--accent-strong); text-align: center; }
@media (min-width: 560px) {
  .mw { grid-template-rows: 26px repeat(3, 19px) 16px; }
  .mb { height: 17px; line-height: 17px; font-size: 11.5px; }
  .ml { font-size: 11.5px; }
}
.gs-1 { grid-column-start: 1; }
.gs-2 { grid-column-start: 2; }
.gs-3 { grid-column-start: 3; }
.gs-4 { grid-column-start: 4; }
.gs-5 { grid-column-start: 5; }
.gs-6 { grid-column-start: 6; }
.gs-7 { grid-column-start: 7; }
.gspan-1 { grid-column-end: span 1; }
.gspan-2 { grid-column-end: span 2; }
.gspan-3 { grid-column-end: span 3; }
.gspan-4 { grid-column-end: span 4; }
.gspan-5 { grid-column-end: span 5; }
.gspan-6 { grid-column-end: span 6; }
.gspan-7 { grid-column-end: span 7; }
.gr-2 { grid-row-start: 2; }
.gr-3 { grid-row-start: 3; }
.gr-4 { grid-row-start: 4; }
.gr-5 { grid-row-start: 5; }
.ag-day { margin-top: 14px; }
.ev .bar.t-rdv, .ev .bar.t-anniversaire, .ev .bar.t-absence, .ev .bar.t-famille, .ev .bar.t-travail, .ev .bar.t-sortie, .ev .bar.t-autre { background: var(--tfg); }
.ev .what { min-width: 0; }
.ev .ev-who { flex-wrap: wrap; row-gap: 4px; }
.ev-type { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; font-weight: 600; padding: 1px 7px 1px 5px; border-radius: 8px; background: var(--tbg); color: var(--tfg); }
.ev-type svg.i, .ev-loc svg.i { width: 13px; height: 13px; }
.ev-loc { display: inline-flex; align-items: center; gap: 3px; font-size: 12.5px; color: var(--muted); min-width: 0; overflow-wrap: break-word; }
.ev-notes { font-size: 13px; color: var(--muted); margin-top: 3px; overflow-wrap: break-word; }
.ev .rec svg.i { width: 13px; height: 13px; display: inline-block; vertical-align: -1px; color: var(--muted); }
.wev.t-rdv, .wev.t-anniversaire, .wev.t-absence, .wev.t-famille, .wev.t-travail, .wev.t-sortie, .wev.t-autre { background: var(--tbg); color: var(--tfg); border-left-color: var(--tfg); }
.row-ev .t { display: inline-flex; align-items: center; gap: 5px; }
.type-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.tchip { display: inline-flex; align-items: center; gap: 5px; min-height: 38px; padding: 0 11px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--card); font-size: 14px; font-weight: 600; color: var(--text2); }
.tchip svg.i { width: 16px; height: 16px; color: var(--tfg); }
.tchip.on { background: var(--tbg); color: var(--tfg); border-color: var(--tfg); }
.seg.wrap { flex-wrap: wrap; }
.seg.wrap button { flex: 1 1 30%; }
.av.p-child { background: #8A7FA8; }
.notice.small { font-size: 13.5px; padding: 10px 12px; margin: 0 0 10px; }

/* v4.7 : agendas Google (lecture seule) */
.t-google { --tbg: #E2E8EF; --tfg: #2E4157; }
.ev .bar.t-google, .dot.t-google { background: var(--tfg); }
.wev.t-google { background: var(--tbg); color: var(--tfg); border-left-color: var(--tfg); }
.g-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 600; color: var(--tfg, #2E4157); background: #E2E8EF; padding: 4px 10px; border-radius: 10px; margin: 2px 0 12px; }
.g-badge svg.i { width: 15px; height: 15px; }
.g-detail { display: flex; flex-direction: column; gap: 10px; margin: 4px 0 14px; }
.g-detail > div { display: flex; gap: 10px; align-items: flex-start; overflow-wrap: break-word; min-width: 0; }
.g-detail svg.i { color: var(--accent); flex: none; margin-top: 1px; }
.gcal-person { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line2); }
.gcal-h { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.gcal-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.gcal-row .status { flex: none; }
.gcal-row .grow { min-width: 0; overflow-wrap: break-word; }
.gcal-add .input { min-width: 0; font-size: 14px; }
.status.ko::before { background: var(--danger); }

/* v4.8 : énergie */
.maison-seg { margin: 0 0 16px; }
.maison-seg button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
.maison-seg button svg.i { width: 18px; height: 18px; }
.en-sum { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.en-sum > div { min-width: 0; }
.en-main { font-size: 16px; overflow-wrap: break-word; }
.en-main b { font-weight: 700; }
.en-cmp { display: flex; align-items: center; gap: 5px; font-size: 13.5px; font-weight: 600; margin-top: 4px; color: var(--text2); }
.en-cmp svg.i { width: 15px; height: 15px; flex: none; }
.en-cmp.up { color: #A8433A; }
.en-cmp.down { color: var(--sage); }
.en-src { margin: 8px 0 0; font-size: 12px; color: var(--muted); }
.spark { width: 120px; height: 36px; flex: none; }
.spark polyline { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.spark circle { fill: var(--accent); }
.en-card { padding: 14px 14px 12px; }
.en-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; min-height: 36px; }
.seg.sm { padding: 3px; border-radius: 11px; flex: none; }
.seg.sm button { min-height: 30px; padding: 0 12px; font-size: 14px; }
.en-pick { font-size: 13px; font-weight: 600; color: var(--accent-strong); text-align: right; min-width: 0; overflow-wrap: break-word; }
.en-chart { width: 100%; height: auto; display: block; touch-action: manipulation; }
.en-chart .eb { fill: var(--wall); }
.en-chart .eb.sel { fill: var(--accent); }
.en-chart .hit { fill: transparent; cursor: pointer; }
.en-chart .grid { stroke: var(--line); stroke-width: 1; stroke-dasharray: 3 3; }
.en-chart .axis { fill: var(--muted); font-size: 10px; font-family: inherit; }
.en-totals { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.en-totals > div { background: var(--bg2); border-radius: 12px; padding: 8px 10px; display: flex; flex-direction: column; min-width: 0; }
.en-totals span { font-size: 12px; color: var(--muted); }
.en-totals b { font-size: 17px; font-weight: 700; }
.en-totals small { font-size: 12px; color: var(--muted); }
.ghost-btn { visibility: hidden; }
.en-chart .eb { fill: #AD8752; }            /* 3,3:1 sur blanc (objet graphique ≥ 3:1) */
.en-chart .eb.sel { fill: #6E4A24; }        /* 7,9:1 */
.spark polyline { stroke: #946130; }
.seg.sm button { flex: none; min-width: 48px; overflow: visible; }
.en-nav .lbl { text-transform: none; font-size: 16.5px; text-align: center; }
#home-energy:not(:empty) { margin-top: 12px; }
