/* Police servie par le Raspberry Pi lui-même : l'appli s'affiche même sans accès à Internet */
@font-face {
  font-family: "Bricolage Grotesque";
  src: url("/bricolage.woff2") format("woff2-variations"), url("/bricolage.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
:root {
  --ok-blue: #1F6FD1;
  --fail: #C62828;
  --bg: #EDF1F3;
  --surface: #FFFFFF;
  --surface-2: #E2E8EB;
  --ink: #17232B;
  --muted: #5B6B75;
  --line: #D3DCE0;
  --heat: #E0512A;
  --heat-soft: #FBE3DA;
  --cool: #1F73D6;
  --cool-soft: #DCE9FA;
  --dry: #9A7B1E;
  --ok: #24875C;
  --off: #93A1A9;
  --accent: var(--heat);
  --accent-soft: var(--heat-soft);
  --radius-lg: 22px;
  --radius-sm: 12px;
  --font: "Bricolage Grotesque", ui-rounded, -apple-system, system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #10181D; --surface: #18232A; --surface-2: #22303A; --ink: #E9EFF2; --muted: #93A4AE;
    --line: #2A3944; --heat: #FF7148; --heat-soft: #3A2219; --cool: #5AA2FF; --cool-soft: #16283F;
    --dry: #D9B44A; --ok: #4CC28C; --off: #5F707A; --ok-blue: #6AAEFF; --fail: #FF7B7B; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --ok-blue: #6AAEFF; --fail: #FF7B7B;
  --bg: #10181D; --surface: #18232A; --surface-2: #22303A; --ink: #E9EFF2; --muted: #93A4AE;
  --line: #2A3944; --heat: #FF7148; --heat-soft: #3A2219; --cool: #5AA2FF; --cool-soft: #16283F;
  --dry: #D9B44A; --ok: #4CC28C; --off: #5F707A; color-scheme: dark;
}
body[data-mode="cooling"] { --accent: var(--cool); --accent-soft: var(--cool-soft); }
body[data-mode="drying"] { --accent: var(--dry); --accent-soft: var(--surface-2); }
body[data-mode="stop"] { --accent: var(--off); --accent-soft: var(--surface-2); }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: var(--bg); }
body {
  margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font);
  font-size: 17px; line-height: 1.45; -webkit-font-smoothing: antialiased;
  padding: env(safe-area-inset-top) 0 calc(84px + env(safe-area-inset-bottom));
}
main { max-width: 560px; margin: 0 auto; padding: 20px 16px 24px; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }
h2 { font-size: 15px; color: var(--muted); font-weight: 500; margin: 30px 4px 10px; }
p { margin: 0; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.tnum { font-variant-numeric: tabular-nums; }

/* ---------- Statut de la maison ---------- */
.status { padding: 8px 4px 22px; }
.status .who { font-size: 30px; line-height: 1.15; font-weight: 600; letter-spacing: -0.02em; max-width: 18ch; }
.status .what { margin-top: 8px; color: var(--muted); }
.status .what b { color: var(--ink); font-weight: 600; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--off); margin-right: 7px; vertical-align: 1px; }
.dot.on { background: var(--ok); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ok) 20%, transparent); }

/* ---------- Pyrogel (en-tête illustré) ---------- */
.hero {
  position: relative; overflow: hidden; border-radius: 26px; background: #FAFBFD; color: #17232B;
  min-height: 196px; padding: 20px 18px; margin: 4px 0 20px; display: flex; align-items: flex-start;
}
.hero-text { position: relative; z-index: 1; width: 56%; flex: none; }
.hero .who { font-size: 23px; line-height: 1.15; font-weight: 600; letter-spacing: -0.02em; color: #17232B; }
.hero .what { margin-top: 8px; font-size: 15px; color: #4F5F69; }
.hero .what b { color: #17232B; font-weight: 600; }
.hero .mascot { position: absolute; right: 4px; bottom: 6px; width: 44%; height: 176px; object-fit: contain; object-position: right bottom; mix-blend-mode: multiply; pointer-events: none; }
.hero-back .mascot { right: 14px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .hero { background: #F4F6F8; } }
:root[data-theme="dark"] .hero { background: #F4F6F8; }

.hero-night { background: #E7EBF7; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .hero-night { background: #DCE2F4; } }
:root[data-theme="dark"] .hero-night { background: #DCE2F4; }

/* ---------- Modes de la maison (Présent, Absent, Télétravail, Nuit…) ---------- */
.scenes { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(76px, 1fr); gap: 8px; overflow-x: auto; scrollbar-width: none; margin-bottom: 4px; }
.scenes::-webkit-scrollbar { display: none; }
.scenes button {
  border: 1px solid var(--line); background: var(--surface); border-radius: 16px; padding: 12px 4px 10px;
  display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 13px; font-weight: 500; letter-spacing: -0.01em; color: var(--ink); min-height: 72px;
}
.scenes button span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 2px; }
.scenes svg, .micon svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.scenes button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.scenes button[aria-pressed="true"] svg { stroke: var(--accent); stroke-width: 2; }
.scenes.picker { margin-bottom: 0; }
h2.tight { margin: 20px 4px 8px; }
.micon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); flex: none; color: var(--muted); }
.micon.on { background: var(--ink); color: var(--bg); }
.micon.on svg { stroke: var(--accent); }
.rule { gap: 8px; padding-right: 16px; }
.rule.disabled .rtime, .rule.disabled .rdesc { opacity: .45; }
.plain { border: 0; background: none; padding: 0; text-align: left; display: flex; align-items: center; gap: 14px; min-width: 0; color: inherit; }
.rtime { font-size: 24px; font-weight: 600; letter-spacing: -0.02em; min-width: 96px; white-space: nowrap; }
.days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.days button { border: 1px solid var(--line); background: var(--surface); border-radius: 50%; aspect-ratio: 1; font-weight: 600; font-size: 15px; color: var(--muted); }
.days button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.daysets { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.stepper .ctrl output.offv { font-size: 16px; color: var(--muted); font-weight: 500; }
.allzones { margin: 14px 0 10px; }
.field input[type=time] { width: 100%; padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface); font-size: 22px; font-weight: 600; }

/* ---------- Suivi des commandes : gris en attente, bleu confirmé, rouge refusé ---------- */
.zone .temp.t-wait output, .zone .temp.t-wait sup { color: var(--muted); }
.zone .temp.t-ok output, .zone .temp.t-ok sup { color: var(--ok-blue); }
.zone .temp.t-fail output { color: var(--fail); }
.zone .cmdstate { grid-column: 2 / span 2; margin: 6px 0 -4px; font-size: 14px; }
.zone .cmdstate.t-wait { color: var(--muted); }
.zone .cmdstate.t-ok { color: var(--ok-blue); font-weight: 600; }
.zone .cmdstate.t-fail { color: var(--fail); font-weight: 600; }
.zone .temp.t-wait output { animation: waitpulse 1.6s ease-in-out infinite; }
@keyframes waitpulse { 50% { opacity: .55; } }
.plan .rt.t-wait { fill: var(--muted); }
.plan .rt.t-ok { fill: var(--ok-blue); }
.plan .rt.t-fail { fill: var(--fail); }
.cmdline { font-size: 14px; margin: 8px 4px 0; }
.cmdline.t-wait { color: var(--muted); }
.cmdline.t-ok { color: var(--ok-blue); font-weight: 500; }
.cmdline.t-fail { color: var(--fail); font-weight: 500; }
.modes button.t-wait { color: var(--muted) !important; }
.modes button.t-ok { color: var(--ok-blue) !important; }
@media (prefers-reduced-motion: reduce) { .zone .temp.t-wait output { animation: none; } }

/* ---------- Mode du gainable ---------- */
.modes { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; background: var(--surface-2); border-radius: 16px; }
.modes button {
  border: 0; background: transparent; border-radius: 12px; padding: 10px 4px 9px; font-size: 15px; font-weight: 500;
  color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.modes button svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.modes button[aria-pressed="true"] { background: var(--surface); color: var(--accent); box-shadow: 0 1px 2px rgba(20,35,43,.08); }

/* ---------- Plan ---------- */
.viewtoggle, .floors { display: inline-grid; grid-auto-flow: column; gap: 2px; padding: 3px; background: var(--surface-2); border-radius: 12px; }
.viewtoggle { display: grid; grid-template-columns: 1fr 1fr; margin: 26px 0 14px; }
.viewtoggle button, .floors button { border: 0; background: transparent; border-radius: 9px; padding: 8px 14px; font-size: 15px; font-weight: 500; color: var(--muted); }
.viewtoggle button[aria-pressed="true"], .floors button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(20,35,43,.08); }
.planbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.planhint { margin: 0 4px 10px; }
.planwrap { background: var(--surface); border-radius: var(--radius-lg); padding: 10px 8px; }
.plan { display: block; width: 100%; height: auto; font-family: var(--font); }
.plan .room { stroke: var(--ink); stroke-width: .45; stroke-opacity: .55; cursor: pointer; transition: fill .4s ease; }
.plan .room:focus-visible { outline: none; stroke: var(--accent); stroke-width: 1.2; stroke-opacity: 1; }
.plan .room.edit { stroke-dasharray: 1.4 1; }
.plan .walls { fill: none; stroke: var(--ink); stroke-width: 1.6; stroke-linejoin: round; pointer-events: none; }
.plan .stairs { fill: none; stroke: var(--ink); stroke-opacity: .35; stroke-width: .3; pointer-events: none; }
.plan text { text-anchor: middle; dominant-baseline: middle; pointer-events: none; fill: var(--ink); }
.plan .rn { font-weight: 500; }
.plan .rn.muted, .plan .rc { fill: var(--muted); }
.plan .rt { font-weight: 600; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.plan .rt.off { fill: var(--muted); font-weight: 500; }
.plan .rz { fill: var(--accent); font-weight: 600; }
.plan .rz.none { fill: var(--muted); font-weight: 400; }
.sheet-body .zone { background: var(--surface); }

/* ---------- Zones ---------- */
.zone {
  position: relative; display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; gap: 0 16px;
  background: var(--surface); border-radius: var(--radius-lg); padding: 18px 16px 18px 14px; margin-bottom: 12px;
}
.zone .gauge { grid-row: 1 / span 2; width: 10px; border-radius: 5px; background: var(--surface-2); position: relative; overflow: hidden; min-height: 96px; }
.zone .gauge i { position: absolute; left: 0; right: 0; bottom: 0; background: var(--accent); border-radius: 5px; transition: height .4s ease; }
.zone .gauge u { position: absolute; left: -2px; right: -2px; height: 2px; background: var(--ink); opacity: .55; text-decoration: none; transition: bottom .4s ease; }
.zone header { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; grid-column: 2 / span 2; }
.zone h3 { font-size: 19px; }
.zone .now { color: var(--muted); font-size: 15px; white-space: nowrap; }
.zone .temp { grid-column: 2; display: flex; align-items: flex-end; gap: 4px; margin-top: 6px; position: relative; }
.zone .temp output { font-size: 64px; line-height: .95; font-weight: 600; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.zone .temp sup { font-size: 24px; font-weight: 500; margin-bottom: 34px; color: var(--muted); }
.zone .temp .pending { position: absolute; left: 2px; top: 100%; font-size: 13px; color: var(--muted); }
.zone .steps { grid-column: 3; display: flex; gap: 8px; align-self: end; }
.round {
  width: 52px; height: 52px; border-radius: 50%; border: 0; background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center; font-size: 28px; font-weight: 500; line-height: 1;
}
.round:active { transform: scale(.94); }
.round:disabled { opacity: .35; }
.zone footer { grid-column: 2 / span 2; display: flex; align-items: center; justify-content: space-between; margin-top: 14px; gap: 10px; }
.zone.off .temp output, .zone.off .temp sup { color: var(--off); }
.zone.off .gauge i { background: var(--off); }
.chip { border: 1px solid var(--line); background: transparent; border-radius: 99px; padding: 6px 12px; font-size: 14px; color: var(--muted); }
.chip[aria-pressed="true"] { border-color: var(--ink); color: var(--ink); }

/* Interrupteur */
.switch { position: relative; width: 52px; height: 32px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: var(--surface-2); transition: background .2s; pointer-events: none; }
.switch span::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,.25); transition: transform .2s; }
.switch input:checked + span { background: var(--ok); }
.switch input:checked + span::after { transform: translateX(20px); }
.switch input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
.lbl { display: flex; align-items: center; gap: 10px; font-size: 15px; color: var(--muted); }

/* ---------- Listes ---------- */
.list { background: var(--surface); border-radius: var(--radius-lg); overflow: hidden; }
.row { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); min-height: 56px; width: 100%; background: none; border-left: 0; border-right: 0; border-top: 0; text-align: left; }
.row:last-child { border-bottom: 0; }
.row .grow { flex: 1; min-width: 0; }
.sub { font-size: 14px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.row .chev { color: var(--muted); font-size: 20px; }
.avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 600; background: var(--surface-2); flex: none; position: relative; }
.avatar.here::after { content: ""; position: absolute; right: -1px; bottom: -1px; width: 12px; height: 12px; border-radius: 50%; background: var(--ok); border: 2px solid var(--surface); }
.log li { list-style: none; padding: 10px 16px; border-bottom: 1px solid var(--line); font-size: 15px; display: flex; gap: 12px; }
.log li:last-child { border-bottom: 0; }
.log time { color: var(--muted); font-variant-numeric: tabular-nums; flex: none; width: 76px; }
.log { margin: 0; padding: 0; }

/* ---------- Formulaires ---------- */
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 14px; color: var(--muted); margin: 0 4px 6px; }
.field input[type=text], .field input[type=email], .field input[type=password], .field input[type=url] {
  width: 100%; padding: 13px 14px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface); font-size: 17px;
}
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 14px; padding: 14px 18px; font-weight: 600; background: var(--ink); color: var(--bg); width: 100%; }
.btn.ghost { background: var(--surface-2); color: var(--ink); }
.btn.danger { background: transparent; color: var(--heat); }
.btn[disabled] { opacity: .5; }
.card { background: var(--surface); border-radius: var(--radius-lg); padding: 18px 16px; }
.card + .card { margin-top: 12px; }
.note { font-size: 14px; color: var(--muted); margin: 10px 4px 0; }
.stepper { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--line); gap: 10px; }
.stepper:last-child { border-bottom: 0; }
.stepper .ctrl { display: flex; align-items: center; gap: 10px; }
.stepper .ctrl output { min-width: 58px; text-align: center; font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; }
.stepper .round { width: 40px; height: 40px; font-size: 22px; }
.stepper .round.cool { background: var(--cool-soft); color: var(--cool); }
.stepper .round.heat { background: var(--heat-soft); color: var(--heat); }
.banner { background: var(--accent-soft); border-radius: var(--radius-sm); padding: 12px 14px; font-size: 15px; margin-bottom: 14px; }
.check { display: flex; gap: 12px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.check:last-child { border-bottom: 0; }
.check input { width: 22px; height: 22px; accent-color: var(--ok); flex: none; }
.copy { display: flex; gap: 8px; }
.copy code { flex: 1; padding: 10px 12px; background: var(--surface-2); border-radius: 10px; font-size: 13px; overflow-x: auto; white-space: nowrap; }

dialog#sheet { border: 0; padding: 0; width: 100%; max-width: min(560px, 100vw); max-height: 92dvh; margin: auto auto 0; border-radius: 24px 24px 0 0; background: var(--bg); color: var(--ink); }
dialog#sheet::backdrop { background: rgba(8, 14, 18, .5); }
.sheet-body { padding: 20px 16px calc(24px + env(safe-area-inset-bottom)); }
.sheet-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; gap: 12px; }
.sheet-head h3 { font-size: 21px; }
.close { border: 0; background: var(--surface-2); width: 36px; height: 36px; border-radius: 50%; font-size: 20px; line-height: 1; }

/* ---------- Barre d'onglets ---------- */
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; display: flex; justify-content: center;
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--line); padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); z-index: 5;
}
.tabs button { flex: 1; max-width: 140px; border: 0; background: none; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; font-size: 12px; color: var(--muted); }
.tabs svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.tabs button[aria-current="page"] { color: var(--ink); }
.tabs button[aria-current="page"] svg { stroke: var(--accent); stroke-width: 2; }

#toast { position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); opacity: 0; background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-size: 15px; transition: .25s; pointer-events: none; max-width: 90vw; z-index: 20; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
.empty { text-align: center; padding: 34px 16px; }
.empty p + p { margin-top: 6px; }
.empty .btn { margin-top: 18px; width: auto; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---------- Maison : écrans d'Adam ---------- */
.tabs button { min-width: 0; }
.ec-total .ec-big { font-size: 44px; font-weight: 600; letter-spacing: -0.03em; line-height: 1.05; }
.ec-total.over .ec-big { color: var(--fail); }
.bar { height: 10px; border-radius: 99px; background: var(--surface-2); margin-top: 14px; overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: inherit; background: var(--ok); }
.ec-total.over .bar > span { background: var(--fail); }
.bar.thin { height: 6px; margin-top: 6px; grid-column: 1 / -1; }
.bar.thin > span { background: var(--accent); }
.ec-warn { margin-top: 12px; color: var(--fail); font-weight: 600; font-size: 15px; }
.ec-min { font-weight: 600; white-space: nowrap; }
.ec-svc { display: grid; gap: 12px; }
.ec-svc .svc { display: grid; grid-template-columns: 1fr auto; gap: 0 12px; font-size: 15px; }
.ec-bad { color: var(--fail); }

/* ---------- Maison : piscine ---------- */
.pool { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.pool-card { border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: var(--radius-lg);
  padding: 20px 14px 16px; display: flex; flex-direction: column; align-items: center; gap: 4px; min-height: 170px; text-align: center; }
.pool-card svg { width: 46px; height: 46px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; margin-bottom: 6px; color: var(--muted); }
.pool-card b { font-size: 18px; }
.pool-card span { font-weight: 600; color: var(--muted); }
.pool-card small { color: var(--muted); font-size: 12px; margin-top: auto; }
.pool-card.on { background: #0E6E8C; border-color: #0E6E8C; color: #fff; }
.pool-card.on svg, .pool-card.on span, .pool-card.on small { color: #DDF4FB; }
.pool-card.ko span { color: var(--fail); }
.pool-card.busy { opacity: .6; }
.pool-edit + .pool-edit { margin-top: 12px; }
.chips { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
body.locked .tabs { display: none; }

/* ---------- Maison : caméras ---------- */
.cams { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.cam { position: relative; border: 0; padding: 0; border-radius: 16px; overflow: hidden; background: #111; aspect-ratio: 16 / 10; color: #fff; text-align: left; }
.cam img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cam-badge { position: absolute; top: 8px; left: 8px; font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 99px; background: rgba(0,0,0,.55); }
.cam-badge.live::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #ff4d4d; margin-right: 5px; vertical-align: 1px; }
.cam-foot { position: absolute; inset: auto 0 0 0; padding: 18px 10px 8px; background: linear-gradient(transparent, rgba(0,0,0,.75)); display: flex; flex-direction: column; }
.cam-foot b { font-size: 15px; }
.cam-foot small { font-size: 11.5px; opacity: .85; }
.live { position: relative; border-radius: 16px; overflow: hidden; background: #000; aspect-ratio: 16 / 9; }
.live img { width: 100%; height: 100%; object-fit: cover; display: block; }
.live-dot { position: absolute; top: 10px; left: 10px; font-size: 11px; font-weight: 700; letter-spacing: .04em; color: #fff; background: #d23b3b; padding: 3px 8px; border-radius: 6px; }
.cam-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.cam-actions .btn { padding: 12px 6px; font-size: 14px; }
.micon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.micon.ev-personne, .micon.ev-sonnette { background: var(--heat-soft); color: var(--heat); }
.tabs button span { white-space: nowrap; font-size: 11px; }
.tabs button[hidden] { display: none; }

/* Coupures Internet (Écrans) */
.ec-actions { margin: 14px 0 4px; }
.ec-cut { color: var(--fail); }
.ec-cutcard { border-color: var(--fail); }
.chip.on { border-color: var(--fail); color: var(--fail); }
.ec-svc .svc .tnum { display: flex; align-items: center; gap: 8px; }
.ec-svc .chip { padding: 3px 10px; font-size: 13px; }
.ec-durees .chip { padding: 9px 14px; font-size: 15px; color: var(--ink); }
.ec-blocked { padding: 12px 16px; }
.ec-actions .btn.danger { background: var(--fail); color: #fff; border-color: var(--fail); }
.viewtoggle.ec-seg { display: flex; flex-wrap: wrap; margin: 0; }
.ec-seg button { padding: 8px 10px; font-size: 14px; }
.ec-seg button { flex: 1 1 auto; white-space: nowrap; }
.tag { display: inline-block; font-size: 12px; padding: 1px 7px; border-radius: 99px; background: var(--surface-2); color: var(--ink); font-weight: 500; vertical-align: 1px; }
.tag.muted { color: var(--muted); }
.ec-dom { align-items: center; }
.ec-dom b { word-break: break-all; }
.ec-dom .chip { padding: 4px 10px; font-size: 13px; flex: none; }
