:root {
  color-scheme: dark;
  --bg: #06111f;
  --bg-deep: #030b15;
  --panel: #0d1d30;
  --panel-strong: #10243a;
  --panel-soft: #0a1828;
  --ink: #eef7ff;
  --muted: #91a6bb;
  --line: #203a53;
  --border: #203a53;
  --primary: #0aa7f5;
  --primary-dark: #0781c4;
  --primary-soft: rgba(10, 167, 245, .13);
  --cyan: #21c7ff;
  --green: #20d579;
  --red: #ff5b5b;
  --amber: #ffb000;
  --purple: #a66cff;
  --shadow: 0 20px 58px rgba(0, 0, 0, .34);
  --glow: 0 0 0 1px rgba(25, 179, 255, .12), 0 14px 38px rgba(0, 0, 0, .23);
  --radius: 14px;
}
* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg-deep); }
html, body { margin: 0; min-height: 100%; font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: var(--ink); background: radial-gradient(circle at 70% -20%, #0d3151 0, var(--bg) 34%, var(--bg-deep) 100%); }
body { overflow-x: hidden; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .68; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.full { width: 100%; }
.mobile-only { display: none; }
a { color: var(--cyan); }

/* Chargement et identité visuelle */
.boot-shell { position: fixed; inset: 0; z-index: 1000; display: grid; place-content: center; justify-items: center; gap: 10px; padding: 24px; text-align: center; background: radial-gradient(circle at 50% 18%, #103b60 0, #071626 43%, #030b15 100%); transition: opacity .22s ease, visibility .22s ease; }
.boot-shell.hidden { opacity: 0; visibility: hidden; pointer-events: none; display: grid !important; }
.boot-logo { width: 142px; height: 142px; object-fit: contain; filter: drop-shadow(0 0 28px rgba(33,199,255,.34)); }
.boot-shell h1 { margin: 0; font-size: 34px; letter-spacing: -.03em; }
.boot-shell p { margin: 0; color: var(--muted); }
.boot-loader { width: 164px; height: 4px; overflow: hidden; margin-top: 12px; border-radius: 99px; background: rgba(33,199,255,.13); }
.boot-loader span { display: block; width: 42%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, transparent, var(--cyan), transparent); animation: boot-slide 1.15s ease-in-out infinite; }
@keyframes boot-slide { from { transform: translateX(-115%); } to { transform: translateX(350%); } }

/* Authentification */
.auth-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 50% 0, #103b60 0, #071626 45%, #030b15 100%); }
.auth-shell::before { content: ""; position: fixed; inset: 0; pointer-events: none; opacity: .18; background-image: linear-gradient(rgba(33,199,255,.12) 1px, transparent 1px), linear-gradient(90deg, rgba(33,199,255,.12) 1px, transparent 1px); background-size: 44px 44px; mask-image: radial-gradient(circle, #000, transparent 72%); }
.auth-card { position: relative; width: min(430px, 100%); background: linear-gradient(145deg, rgba(16,36,58,.98), rgba(8,24,40,.98)); border-radius: 22px; padding: 32px; box-shadow: var(--shadow); border: 1px solid #244b6c; }
.brand { display: flex; gap: 12px; align-items: center; }
.brand-large { margin-bottom: 30px; align-items: center; }
.brand-mark { position: relative; width: 56px; height: 56px; flex: 0 0 56px; display: grid; place-items: center; }
.brand-mark img { display: block; width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 0 12px rgba(33,199,255,.28)); }
.brand-large .brand-mark { width: 82px; height: 82px; flex-basis: 82px; margin-right: 3px; }
.brand-large .brand-mark img { filter: drop-shadow(0 0 20px rgba(33,199,255,.32)); }
.brand h1, .brand p { margin: 0; }
.brand-copy { min-width: 0; }
.brand-title-line { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.brand-title-line strong { font-size: 20px; line-height: 1.1; }
.sidebar-version { display: inline-flex; align-items: center; padding: 2px 6px; border: 1px solid rgba(33,199,255,.25); border-radius: 6px; background: rgba(10,167,245,.10); color: #8ee6ff; font-size: 10px; font-weight: 800; line-height: 1.35; white-space: nowrap; }
.brand p, .brand small { color: var(--muted); display: block; }
.auth-card h2 { margin: 0 0 6px; }

/* Formulaires */
label { display: grid; gap: 7px; font-weight: 650; font-size: 14px; margin: 16px 0; }
label small { font-weight: 400; color: var(--muted); }
input, select, textarea { width: 100%; border: 1px solid #29435d; border-radius: 10px; padding: 11px 12px; background: #081827; color: var(--ink); outline: none; }
input::placeholder, textarea::placeholder { color: #698198; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(10,167,245,.14), 0 0 22px rgba(10,167,245,.08); }

.password-field { position: relative; display: block; width: 100%; min-width: 0; }
.password-field input { padding-right: 48px; }
.password-toggle {
  position: absolute;
  z-index: 2;
  right: 5px;
  top: 50%;
  transform: translateY(-50%);
  width: 38px;
  height: 34px;
  display: grid;
  place-items: center;
  margin: 0;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #87a4bd;
  box-shadow: none;
}
.password-toggle:hover,
.password-toggle:focus-visible {
  transform: translateY(-50%);
  color: #dff7ff;
  border-color: rgba(33,199,255,.28);
  background: rgba(10,167,245,.10);
  box-shadow: 0 0 14px rgba(10,167,245,.12);
}
.password-toggle.is-visible { color: var(--cyan); background: rgba(10,167,245,.12); }
.password-toggle svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.password-field:focus-within .password-toggle { color: #cceeff; }
.password-inline-toggle { width: 42px; min-width: 42px; height: 38px; padding: 0; display: grid; place-items: center; }
.password-inline-toggle svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.password-inline-toggle.is-visible { color: var(--cyan); border-color: rgba(33,199,255,.32); background: rgba(10,167,245,.12); }
select option { background: #0b1c2d; color: var(--ink); }
button, a.button { border: 1px solid transparent; border-radius: 9px; padding: 10px 14px; font-weight: 750; transition: transform .16s ease, border-color .16s ease, background .16s ease, box-shadow .16s ease; }
button:hover, a.button:hover { transform: translateY(-1px); }
button.primary, a.button.primary { color: #fff; background: linear-gradient(180deg, #0eaaf6, #087fc7); border-color: #27baff; box-shadow: 0 0 18px rgba(10,167,245,.22); }
button.primary:hover, a.button.primary:hover { background: linear-gradient(180deg, #27baff, #0792df); box-shadow: 0 0 24px rgba(10,167,245,.32); }
button.ghost, a.button.ghost { background: #102238; color: #dcecff; border-color: #2c4864; }
button.ghost:hover, a.button.ghost:hover { border-color: #4380aa; background: #142b45; }
button.danger { color: #ff8989; background: rgba(255,91,91,.09); border-color: rgba(255,91,91,.28); }
button.small { padding: 7px 10px; font-size: 13px; }
a.button { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.icon-button { background: transparent; color: var(--muted); padding: 7px 10px; font-size: 21px; border-color: transparent; }
.icon-button:hover { color: white; background: #132a43; }
.error { color: #ffc1c1; background: rgba(255,91,91,.11); border: 1px solid rgba(255,91,91,.36); padding: 12px; border-radius: 10px; }

/* Structure */
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 278px 1fr; }
.sidebar { background: linear-gradient(180deg, #071729 0%, #051220 58%, #030c16 100%); color: #fff; padding: 24px 16px 18px; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; border-right: 1px solid #18324a; box-shadow: 18px 0 50px rgba(0,0,0,.18); }
.sidebar::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 160px; pointer-events: none; background: radial-gradient(circle at 15% 15%, rgba(15,170,246,.15), transparent 56%); }
.sidebar .brand { position: relative; padding: 0 12px 28px; }
.sidebar .brand strong { font-size: 21px; }
.sidebar .brand small { color: #8fa8bd; margin-top: 2px; }
.sidebar nav { position: relative; display: grid; gap: 8px; }
.sidebar nav button { min-height: 49px; text-align: left; background: transparent; color: #b7cadb; border: 1px solid transparent; padding: 12px 15px; display: flex; gap: 13px; align-items: center; border-radius: 9px; }
.sidebar nav button span { width: 24px; height: 24px; display: grid; place-items: center; color: #8ca9c0; font-size: 20px; }
.sidebar nav button:hover { background: rgba(19,65,99,.35); color: white; border-color: rgba(49,141,198,.18); }
.sidebar nav button.active { color: #dff5ff; background: linear-gradient(90deg, rgba(10,167,245,.22), rgba(10,167,245,.06)); border-color: #0ba8f5; box-shadow: inset 3px 0 0 #21c7ff, 0 0 20px rgba(10,167,245,.13); }
.sidebar nav button.active span { color: var(--cyan); }
.sidebar-bottom { margin-top: auto; display: grid; gap: 13px; }
.local-badge { display: grid; gap: 4px; font-size: 12px; color: #a9bdce; padding: 0 10px; }
.local-badge .local-status { color: #b7cadb; }
.local-badge .local-status::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--green); margin-right: 8px; box-shadow: 0 0 10px rgba(32,213,121,.7); }
.local-badge small { color: #6f8ba3; }
main { min-width: 0; background: linear-gradient(180deg, rgba(6,17,31,.42), rgba(3,11,21,.7)); }
.topbar { min-height: 94px; background: rgba(4,14,25,.82); backdrop-filter: blur(15px); border-bottom: 1px solid #1a354d; padding: 20px 30px; display: flex; align-items: center; gap: 18px; position: sticky; top: 0; z-index: 10; }
.topbar h1, .topbar p { margin: 0; }
.topbar h1 { font-size: 27px; letter-spacing: -.02em; }
.topbar p { color: var(--muted); font-size: 14px; margin-top: 3px; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.user-label { color: #b5c6d6; font-size: 14px; }
#scanBtn::before, #dashboardScanBtn::before { content: "⌁"; margin-right: 8px; color: #d9f7ff; }
.content { padding: 22px 24px 42px; max-width: 1720px; margin: 0 auto; }

/* Cartes et tableau de bord */
.cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; }
.stat-card, .panel { background: linear-gradient(145deg, rgba(16,36,58,.96), rgba(9,25,42,.98)); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--glow); }
.stat-card { min-height: 160px; padding: 20px; position: relative; overflow: hidden; }
.stat-card::after { content: ""; position: absolute; inset: auto -40px -75px auto; width: 150px; height: 150px; border-radius: 50%; background: radial-gradient(circle, var(--stat-glow, rgba(10,167,245,.16)), transparent 66%); }
.stat-main { display: grid; grid-template-columns: 52px 1fr; gap: 14px; align-items: center; position: relative; z-index: 1; }
.stat-icon { width: 50px; height: 50px; border-radius: 50%; display: grid; place-items: center; font-size: 23px; color: var(--stat-color, var(--primary)); border: 1px solid color-mix(in srgb, var(--stat-color, var(--primary)) 65%, transparent); background: color-mix(in srgb, var(--stat-color, var(--primary)) 11%, transparent); box-shadow: inset 0 0 18px color-mix(in srgb, var(--stat-color, var(--primary)) 9%, transparent); }
.stat-copy small { display: block; color: #b4c4d3; }
.stat-card .value { font-size: 38px; line-height: 1; font-weight: 850; margin-top: 6px; letter-spacing: -.03em; }
.stat-known { --stat-color: #2eaaff; --stat-glow: rgba(46,170,255,.22); }
.stat-online { --stat-color: var(--green); --stat-glow: rgba(32,213,121,.19); }
.stat-offline { --stat-color: var(--red); --stat-glow: rgba(255,91,91,.18); }
.stat-unnamed { --stat-color: var(--amber); --stat-glow: rgba(255,176,0,.18); }
.stat-foot { position: absolute; left: 20px; right: 20px; bottom: 17px; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 12px; color: #6f89a1; font-size: 11px; }
.stat-pulse { flex: 1; height: 18px; opacity: .85; color: var(--stat-color); }
.stat-pulse svg { width: 100%; height: 100%; overflow: visible; }
.stat-pulse path { stroke: currentColor; stroke-width: 2; fill: none; filter: drop-shadow(0 0 4px currentColor); }
.panel { padding: 20px; margin-top: 18px; }
.panel-head { display: flex; justify-content: space-between; gap: 16px; align-items: center; margin-bottom: 16px; }
.panel-head h2, .panel-head p { margin: 0; }
.panel-head h2 { font-size: 21px; }
.panel-head p { color: var(--muted); font-size: 14px; margin-top: 4px; }
.dashboard-analysis { position: relative; overflow: hidden; min-height: 180px; display: grid; grid-template-columns: 150px minmax(0,1fr) auto; align-items: center; gap: 24px; }
.dashboard-analysis::after { content: ""; position: absolute; right: 11%; top: 23px; width: 330px; height: 120px; opacity: .19; background-image: radial-gradient(circle, #19b9ff 1.3px, transparent 1.7px); background-size: 14px 14px; mask-image: radial-gradient(ellipse at center, #000 10%, transparent 74%); }
.radar { position: relative; width: 124px; height: 124px; border-radius: 50%; border: 1px solid rgba(33,199,255,.42); background: repeating-radial-gradient(circle, transparent 0 20px, rgba(33,199,255,.22) 21px 22px), linear-gradient(90deg, transparent 49.5%, rgba(33,199,255,.18) 50%, transparent 50.5%), linear-gradient(transparent 49.5%, rgba(33,199,255,.18) 50%, transparent 50.5%); box-shadow: inset 0 0 25px rgba(10,167,245,.12), 0 0 22px rgba(10,167,245,.1); }
.radar::before { content: ""; position: absolute; inset: 7px; border-radius: 50%; background: conic-gradient(from 200deg, transparent 0 68%, rgba(10,167,245,.04) 72%, rgba(10,167,245,.75) 96%, transparent 100%); animation: radarSpin 4s linear infinite; }
.radar::after { content: ""; position: absolute; width: 9px; height: 9px; left: calc(50% - 4.5px); top: calc(50% - 4.5px); border-radius: 50%; background: #32d6ff; box-shadow: 0 0 18px #32d6ff; }
@keyframes radarSpin { to { transform: rotate(360deg); } }
.analysis-copy { position: relative; z-index: 1; }
.analysis-copy h2, .analysis-copy p { margin: 0; }
.analysis-copy h2 { font-size: 23px; }
.analysis-copy > p { margin-top: 4px; color: var(--muted); }
.analysis-facts { display: flex; align-items: center; gap: 26px; flex-wrap: wrap; margin-top: 22px; }
.analysis-fact { color: #d9e9f7; }
.analysis-fact span { display: block; color: var(--muted); font-size: 12px; margin-top: 5px; }
.analysis-action { position: relative; z-index: 2; min-width: 210px; text-align: right; }
.status-badge { display: inline-flex; align-items: center; gap: 7px; padding: 6px 10px; border-radius: 6px; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; border: 1px solid transparent; }
.status-badge.online, .status-badge.success { color: #70f0aa; background: rgba(32,213,121,.09); border-color: rgba(32,213,121,.26); }
.status-badge.offline, .status-badge.failed { color: #ff8585; background: rgba(255,91,91,.1); border-color: rgba(255,91,91,.25); }
.status-badge.unnamed, .status-badge.warning { color: #ffd163; background: rgba(255,176,0,.1); border-color: rgba(255,176,0,.25); }
.dashboard-devices { padding-bottom: 12px; }
.dashboard-devices .panel-head { margin-bottom: 6px; }
.dashboard-list { border: 1px solid #1f3c56; border-radius: 11px; overflow: hidden; }
.dashboard-device { min-height: 65px; display: grid; grid-template-columns: 48px minmax(0,1fr) auto auto; gap: 14px; align-items: center; padding: 10px 14px; border-bottom: 1px solid #1b354d; background: rgba(6,20,34,.28); }
.dashboard-device:last-child { border-bottom: 0; }
.dashboard-device:hover { background: rgba(14,50,76,.34); }
.device-mini-icon { width: 40px; height: 40px; border-radius: 8px; display: grid; place-items: center; color: #3ec9ff; background: rgba(10,167,245,.1); border: 1px solid rgba(10,167,245,.18); font-size: 19px; }
.dashboard-device h3, .dashboard-device p { margin: 0; }
.dashboard-device h3 { font-size: 15px; }
.dashboard-device p { color: var(--muted); font-size: 12px; margin-top: 4px; overflow-wrap: anywhere; }
.device-age { color: #829ab0; font-size: 12px; white-space: nowrap; }
.dashboard-list-footer { display: flex; justify-content: center; padding: 12px 0 2px; }
.link-button { border: 0; padding: 7px 10px; background: transparent; color: var(--cyan); font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; }

/* Pages métier */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.toolbar input, .toolbar select { width: auto; min-width: 170px; margin: 0; }
.table-wrap { overflow-x: auto; border: 1px solid #1e3952; border-radius: 10px; }
table { width: 100%; border-collapse: collapse; min-width: 800px; }
th, td { padding: 13px 12px; border-bottom: 1px solid #1b354d; text-align: left; vertical-align: middle; }
th { color: #7690a7; background: rgba(3,14,25,.32); font-size: 11px; text-transform: uppercase; letter-spacing: .055em; }
td { font-size: 13px; }
tbody tr { transition: background .15s ease; }
tbody tr:hover { background: rgba(19,56,82,.35); }
tbody tr:last-child td { border-bottom: 0; }
.name-cell strong { display: block; }
.name-cell small { display: block; color: var(--muted); margin-top: 3px; }
.status-dot { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.status-dot::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #647b8e; }
.status-dot.online::before { background: var(--green); box-shadow: 0 0 9px rgba(32,213,121,.65); }
.status-dot.offline::before { background: var(--red); box-shadow: 0 0 8px rgba(255,91,91,.42); }
.badge { display: inline-flex; align-items: center; padding: 5px 8px; border-radius: 6px; background: #132a42; border: 1px solid #284761; font-size: 11px; color: #bdd0df; }
.badge.suggest { color: #6ddaff; background: rgba(10,167,245,.10); border-color: rgba(10,167,245,.25); }
.actions { display: flex; gap: 7px; white-space: nowrap; }
.empty { padding: 38px 20px; text-align: center; color: var(--muted); border: 1px dashed #31516d; background: rgba(5,18,31,.28); border-radius: 11px; }
.scan-state { display: flex; align-items: center; gap: 10px; padding: 13px 15px; background: rgba(10,167,245,.1); border: 1px solid rgba(10,167,245,.24); border-radius: 11px; color: #82ddff; }
.spinner { width: 18px; height: 18px; border: 3px solid rgba(10,167,245,.18); border-top-color: var(--cyan); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.two-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.record-grid { display: grid; gap: 10px; }
.record-card { border: 1px solid #213d56; background: rgba(5,18,31,.26); border-radius: 10px; padding: 14px; display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 12px; align-items: center; }
.record-card:hover { border-color: #315a7a; background: rgba(12,40,61,.3); }
.record-card h3, .record-card p { margin: 0; }
.record-card p { color: var(--muted); font-size: 13px; margin-top: 5px; overflow-wrap: anywhere; }
.vault-gate { max-width: 520px; margin: 60px auto; text-align: center; }
.vault-icon { width: 72px; height: 72px; margin: 0 auto 16px; border-radius: 18px; display: grid; place-items: center; font-size: 32px; background: rgba(10,167,245,.1); color: var(--cyan); border: 1px solid rgba(10,167,245,.22); box-shadow: 0 0 24px rgba(10,167,245,.10); }
.vault-gate form { text-align: left; margin-top: 24px; }
.warning-box { background: rgba(255,176,0,.09); color: #ffd47b; border: 1px solid rgba(255,176,0,.30); padding: 12px; border-radius: 10px; }
.info-box { background: rgba(10,167,245,.09); color: #9de6ff; border: 1px solid rgba(10,167,245,.27); padding: 13px; border-radius: 10px; }
.settings-grid { max-width: 820px; }
.timeline { display: grid; gap: 8px; }
.timeline-item { display: grid; grid-template-columns: 150px 90px 1fr; gap: 15px; padding: 12px; border: 1px solid #1d3951; border-radius: 9px; background: rgba(6,20,34,.24); font-size: 13px; }

/* Dialogues */
dialog { color: var(--ink); background: linear-gradient(145deg, #10243a, #091a2c); border: 1px solid #2a4b67; padding: 0; width: min(620px, calc(100vw - 28px)); border-radius: 15px; box-shadow: 0 28px 85px rgba(0,0,0,.58), 0 0 30px rgba(10,167,245,.08); }
dialog::backdrop { background: rgba(0,7,14,.74); backdrop-filter: blur(5px); }
.dialog-form { padding: 22px; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid #203d57; padding-bottom: 13px; }
.dialog-head h2 { margin: 0; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.identity-box { background: rgba(4,17,29,.52); border: 1px solid #203c55; border-radius: 9px; padding: 12px; margin-top: 14px; color: var(--muted); font-size: 14px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.secret-value { display: flex; gap: 10px; align-items: stretch; }
.secret-value code { flex: 1; padding: 14px; background: #020b13; color: #dff6ff; border: 1px solid #203c55; border-radius: 9px; overflow-wrap: anywhere; min-width: 0; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 100; max-width: 390px; background: #0b1f33; color: white; border: 1px solid #2f5a79; padding: 13px 17px; border-radius: 10px; box-shadow: var(--shadow); }

/* Mise à jour */
.update-hero { overflow: hidden; }
.update-security-details { margin-top: 4px; padding: 0; overflow: hidden; }
.update-security-details > summary { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 14px; list-style: none; color: #cfeeff; }
.update-security-details > summary::-webkit-details-marker { display: none; }
.update-security-details > summary::before { content: "▸"; color: var(--cyan); margin-right: 8px; transition: transform .16s ease; }
.update-security-details[open] > summary::before { transform: rotate(90deg); }
.update-security-details > summary span:first-child { flex: 1; }
.update-security-content { display: grid; gap: 10px; padding: 0 14px 14px; }
.version-pill { display: inline-flex; align-items: center; padding: 8px 12px; border-radius: 7px; background: rgba(10,167,245,.11); color: #7edfff; border: 1px solid rgba(10,167,245,.25); font-weight: 750; font-size: 12px; white-space: nowrap; }
.fingerprint { display: inline-block; margin-top: 6px; font-size: 12px; overflow-wrap: anywhere; }
.update-form { max-width: 780px; }
.update-live { margin-top: 22px; padding: 18px; border: 1px solid rgba(10,167,245,.25); background: rgba(5,22,37,.55); border-radius: 12px; }
.update-live h3, .update-live p { margin: 0; }
.update-live p { margin-top: 5px; }
.update-progress { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 16px; }
.update-step { display: flex; align-items: center; gap: 10px; min-height: 58px; border: 1px solid #203c55; border-radius: 9px; padding: 10px 12px; background: #091a2b; color: var(--muted); }
.update-step strong, .update-step small { display: block; }
.update-step strong { font-size: 13px; color: inherit; }
.update-step small { margin-top: 2px; font-size: 11px; }
.update-step-icon { width: 25px; height: 25px; flex: 0 0 25px; display: grid; place-items: center; border-radius: 50%; background: #19324a; font-weight: 800; }
.update-step.done { color: #78efae; border-color: rgba(32,213,121,.28); background: rgba(32,213,121,.06); }
.update-step.done .update-step-icon { color: #03120a; background: var(--green); }
.update-step.running { color: #8ce4ff; border-color: rgba(10,167,245,.42); background: rgba(10,167,245,.08); }
.update-step.running .update-step-icon { color: white; background: var(--primary); animation: spin 1.1s linear infinite; }
.update-step.failed { color: #ff9696; border-color: rgba(255,91,91,.34); background: rgba(255,91,91,.07); }
.update-step.failed .update-step-icon { color: white; background: var(--red); }
.update-success { color: #73efaa; background: rgba(32,213,121,.08); }
.update-failed { color: #ff9999; background: rgba(255,91,91,.08); }
.update-running { color: #82ddff; background: rgba(10,167,245,.09); }
.update-queued { color: #ffd16d; background: rgba(255,176,0,.08); }
.update-table { min-width: 900px; }

/* Accès appareils / extension */
.device-actions { flex-wrap: wrap; justify-content: flex-end; min-width: 270px; }
.split-actions { align-items: center; }
.action-spacer { flex: 1; }
.compact-dialog { max-width: 500px; }
.credential-copy-grid { display: grid; gap: 12px; margin-top: 16px; }
.credential-copy-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 13px; border: 1px solid #203c55; border-radius: 10px; background: rgba(4,17,29,.45); }
.credential-copy-row small { display: block; color: var(--muted); margin-bottom: 4px; }
.credential-copy-row code { display: block; overflow-wrap: anywhere; font-size: 14px; }
.extension-banner { display:flex; justify-content:space-between; gap:18px; align-items:center; padding:14px 18px; margin-bottom:16px; border-radius:11px; border:1px solid rgba(255,176,0,.34); background:rgba(255,176,0,.08); }
.extension-banner.ready { border-color:rgba(32,213,121,.34); background:rgba(32,213,121,.07); }
.extension-banner strong, .extension-banner span { display:block; }
.extension-banner span { margin-top:3px; color:var(--muted); }
.checkbox-row { display:flex !important; align-items:flex-start; gap:10px; font-weight:600; }
.checkbox-row input { width:auto; margin-top:3px; }
.advanced-box { border:1px solid var(--border); border-radius:10px; padding:12px 14px; background:rgba(4,17,29,.42); }
.advanced-box summary { cursor:pointer; font-weight:700; }
.install-steps { padding-left:24px; line-height:1.55; }
.local-key-ready { display:flex; align-items:center; justify-content:space-between; gap:18px; }
.compact-form { margin-top:14px; }
.compact-form label { margin:0; }

/* Adaptation */
@media (max-width: 1180px) {
  .app-shell { grid-template-columns: 245px 1fr; }
  .cards { grid-template-columns: repeat(2, 1fr); }
  .dashboard-analysis { grid-template-columns: 130px minmax(0,1fr); }
  .analysis-action { grid-column: 1 / -1; text-align: left; }
  .dashboard-analysis::after { right: 2%; }
  .two-columns { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .app-shell { display: block; }
  .sidebar { position: fixed; z-index: 30; width: 270px; transform: translateX(-105%); transition: transform .2s ease; box-shadow: 20px 0 40px rgba(0,0,0,.48); }
  .sidebar.open { transform: translateX(0); }
  .mobile-only { display: inline-block; }
  .topbar { padding: 14px 15px; min-height: 76px; }
  .topbar h1 { font-size: 20px; }
  .topbar p, .user-label { display: none; }
  .top-actions { gap: 7px; }
  .top-actions button { padding: 9px 10px; font-size: 13px; }
  .content { padding: 15px 12px 30px; }
  .cards { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-card { min-height: 145px; padding: 14px; }
  .stat-main { grid-template-columns: 40px 1fr; gap: 10px; }
  .stat-icon { width: 40px; height: 40px; font-size: 18px; }
  .stat-card .value { font-size: 29px; }
  .stat-foot { left: 14px; right: 14px; }
  .panel { padding: 14px; }
  .panel-head { align-items: flex-start; flex-direction: column; }
  .toolbar { width: 100%; }
  .toolbar input, .toolbar select, .toolbar button { flex: 1; min-width: 130px; }
  .dashboard-analysis { grid-template-columns: 1fr; text-align: left; }
  .radar { width: 95px; height: 95px; }
  .dashboard-analysis::after { display: none; }
  .analysis-action { min-width: 0; }
  .dashboard-device { grid-template-columns: 42px minmax(0,1fr) auto; }
  .dashboard-device .device-age { display: none; }
  .form-grid { grid-template-columns: 1fr; gap: 0; }
  .timeline-item { grid-template-columns: 1fr; gap: 4px; }
  .toast { left: 14px; right: 14px; bottom: 14px; }
  .update-progress { grid-template-columns: 1fr; }
  .version-pill { white-space: normal; }
  .device-actions { min-width: 210px; justify-content: flex-start; }
  .credential-copy-row { grid-template-columns: 1fr; }
  .credential-copy-row .actions { flex-wrap: wrap; }
  .split-actions { flex-wrap: wrap; }
  .action-spacer { display: none; }
  .extension-banner, .local-key-ready { align-items:flex-start; flex-direction:column; }
}
@media (max-width: 480px) {
  .cards { grid-template-columns: 1fr; }
  .dashboard-device { grid-template-columns: 40px minmax(0,1fr); }
  .dashboard-device .status-badge { grid-column: 2; justify-self: start; }
}

/* Tri des appareils et catégories personnalisées */
.table-sort {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-transform: inherit;
  letter-spacing: inherit;
  padding: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  white-space: nowrap;
}
.table-sort:hover { color: #bdeeff; }
.table-sort.active { color: var(--cyan); }
.sort-indicator { min-width: 12px; font-size: 13px; line-height: 1; }
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
.category-picker { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 9px; align-items: stretch; }
.category-picker select, .category-picker button { margin: 0; }
.category-dialog-form { max-height: min(760px, calc(100vh - 40px)); overflow: auto; }
.category-create-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; margin: 16px 0; }
.category-create-row input, .category-create-row button { margin: 0; }
.category-list { display: grid; gap: 8px; max-height: 390px; overflow: auto; padding-right: 3px; }
.category-list-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 11px 12px; border: 1px solid #203c55; border-radius: 9px; background: rgba(4,17,29,.42); }
.category-list-row strong, .category-list-row small { display: block; }
.category-list-row small { color: var(--muted); margin-top: 3px; }

@media (max-width: 560px) {
  .category-picker, .category-create-row { grid-template-columns: 1fr; }
  .category-list-row { align-items: flex-start; }
}


/* Rézo Accès distant */
.vpn-state-success { color:#52f0a0; border-color:rgba(46,213,130,.38); background:rgba(23,130,79,.18); }
.vpn-state-warning { color:#ffc65c; border-color:rgba(255,177,32,.38); background:rgba(166,102,0,.2); }
.vpn-state-danger { color:#ff7777; border-color:rgba(255,76,76,.4); background:rgba(163,37,37,.2); }
.vpn-state-neutral { color:#a9bfd3; border-color:#294866; background:rgba(23,47,72,.65); }
.remote-hero { display:grid; grid-template-columns:112px 1fr; gap:24px; align-items:center; margin-bottom:22px; padding:26px; border:1px solid #214b6c; border-radius:18px; background:radial-gradient(circle at 12% 50%,rgba(0,184,255,.18),transparent 28%),linear-gradient(135deg,#0b2136,#0a1728); box-shadow:0 18px 50px rgba(0,0,0,.2); }
.remote-shield { position:relative; display:grid; place-items:center; width:100px; height:100px; border:1px solid #167bb1; border-radius:28px; background:linear-gradient(145deg,#0b3552,#071626); box-shadow:inset 0 0 30px rgba(0,195,255,.14),0 0 28px rgba(0,177,255,.13); }
.remote-shield span { font-size:54px; font-weight:800; color:#ecfbff; text-shadow:0 0 14px #00c8ff; }
.remote-shield i { position:absolute; inset:12px; border:1px solid rgba(60,208,255,.45); border-radius:20px; }
.remote-title-line { display:flex; align-items:center; flex-wrap:wrap; gap:14px; }
.remote-title-line h2 { margin:0; font-size:30px; }
.remote-hero p { margin:8px 0 16px; color:#9eb6ca; }
.remote-endpoint { display:flex; flex-wrap:wrap; gap:12px 24px; align-items:center; }
.remote-endpoint strong { color:#46d9ff; font-family:ui-monospace,SFMono-Regular,Consolas,monospace; }
.remote-endpoint span { color:#9eb6ca; }
.remote-grid { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1.1fr); gap:20px; }
.remote-grid .panel { margin-top:0; }
.remote-config-form .form-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
.remote-checks { display:flex; flex-wrap:wrap; gap:9px; margin:14px 0 20px; }
.remote-checks span { padding:7px 10px; border:1px solid #294866; border-radius:999px; color:#9eb6ca; font-size:12px; }
.remote-checks .check-ok { color:#56e9a0; border-color:rgba(46,213,130,.34); background:rgba(23,130,79,.12); }
.remote-checks .check-warning { color:#ffc65c; border-color:rgba(255,177,32,.32); background:rgba(166,102,0,.12); }
.remote-install-warning { margin:0 0 20px; border-color:#74571b; }
.command-box { display:flex; justify-content:space-between; align-items:center; gap:18px; padding:14px 16px; border:1px solid #245273; border-radius:12px; background:#061524; }
.command-box code { color:#6ce2ff; line-height:1.65; overflow-wrap:anywhere; }
.vpn-peer-form { display:grid; grid-template-columns:1.4fr 1fr auto; gap:12px; align-items:end; margin-bottom:18px; }
.vpn-peer-form label { margin:0; }
.vpn-peer-list { display:grid; gap:10px; }
.vpn-peer-row { display:grid; grid-template-columns:44px minmax(180px,1fr) auto; gap:12px; align-items:center; padding:13px; border:1px solid #22415e; border-radius:13px; background:rgba(8,29,47,.7); }
.vpn-peer-icon { display:grid; place-items:center; width:40px; height:40px; border:1px solid #1b78aa; border-radius:11px; color:#48d9ff; background:#09253b; font-size:22px; }
.vpn-peer-main { display:grid; gap:3px; }
.vpn-peer-main span,.vpn-peer-main small { color:#8fa9bd; }
.vpn-peer-actions { grid-column:2 / -1; display:flex; flex-wrap:wrap; gap:8px; justify-content:flex-end; }
.remote-steps { display:grid; grid-template-columns:repeat(3,1fr); gap:16px; margin-top:20px; }
.remote-steps article { position:relative; padding:22px 20px 18px 58px; border:1px solid #203f5a; border-radius:15px; background:linear-gradient(145deg,#0d2237,#0a1828); }
.remote-steps article>span { position:absolute; left:18px; top:20px; display:grid; place-items:center; width:27px; height:27px; border-radius:50%; background:#0a9edd; color:#fff; font-weight:800; }
.remote-steps h3 { margin:0 0 7px; }
.remote-steps p { margin:0; color:#93aabd; line-height:1.55; }
.remote-security-note { margin-top:16px; }
.vpn-qr-dialog { max-width:480px; }
.vpn-qr-frame { display:grid; place-items:center; margin:18px auto; padding:18px; max-width:330px; border-radius:16px; background:#fff; }
.vpn-qr-frame img { display:block; width:100%; height:auto; }

@media (max-width:1050px) {
  .remote-grid { grid-template-columns:1fr; }
  .remote-steps { grid-template-columns:1fr; }
}
@media (max-width:720px) {
  .remote-hero { grid-template-columns:1fr; text-align:center; }
  .remote-shield { margin:auto; }
  .remote-title-line,.remote-endpoint { justify-content:center; }
  .remote-config-form .form-grid,.vpn-peer-form { grid-template-columns:1fr; }
  .vpn-peer-row { grid-template-columns:44px 1fr; }
  .vpn-peer-row>.badge { grid-column:2; justify-self:start; }
  .vpn-peer-actions { grid-column:1 / -1; justify-content:flex-start; }
  .command-box { align-items:stretch; flex-direction:column; }
}

/* V0.3.23 — verrou de sécurité permanent du VPN historique */
.remote-safety-hero { border-color: rgba(218, 154, 36, .45); }
.remote-shield-locked { filter: grayscale(.25); }
.remote-quarantine-panel { max-width: 980px; }
.remote-quarantine-panel .remote-checks { display: grid; gap: .65rem; margin: 1rem 0; }
.remote-quarantine-panel .remote-checks .ok { color: var(--success, #2e7d32); font-weight: 700; }

/* V0.3.25 — sécurité, diagnostic et sauvegardes */
.safety-hero { display:grid; grid-template-columns:72px 1fr; gap:20px; align-items:center; padding:24px; margin-bottom:20px; border:1px solid #245273; border-radius:18px; background:linear-gradient(135deg,#0b2136,#081827); }
.safety-hero.healthy { border-color:rgba(46,213,130,.45); }
.safety-hero.warning { border-color:rgba(255,177,32,.45); }
.safety-orb { display:grid; place-items:center; width:64px; height:64px; border-radius:20px; border:1px solid #1b78aa; background:#09253b; font-size:34px; font-weight:900; color:#65e8ff; }
.safety-hero.healthy .safety-orb { color:#56e9a0; border-color:rgba(46,213,130,.5); }
.safety-hero.warning .safety-orb { color:#ffc65c; border-color:rgba(255,177,32,.5); }
.safety-hero h2 { margin:0; }
.safety-hero p { margin:8px 0 12px; color:var(--muted); }
.safety-inline { display:flex; flex-wrap:wrap; gap:9px 18px; color:#9eb6ca; font-size:13px; }
.safety-inline strong { color:#e9f8ff; }
.safety-cards { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:14px; margin-bottom:20px; }
.safety-card { margin:0; display:grid; gap:7px; min-height:126px; align-content:center; }
.safety-card small,.safety-card span { color:var(--muted); }
.safety-card strong { font-size:23px; color:#eefaff; }
.safety-actions-panel .toolbar { margin-top:14px; }
.button-link { display:inline-flex; align-items:center; justify-content:center; text-decoration:none; }
.backup-list { display:grid; gap:9px; }
.backup-row { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:13px 14px; border:1px solid #203f5a; border-radius:12px; background:rgba(4,17,29,.42); }
.backup-row strong,.backup-row span { display:block; }
.backup-row span { margin-top:4px; color:var(--muted); font-size:13px; }
.safety-rules { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
.safety-rules span { padding:11px 13px; border:1px solid rgba(46,213,130,.25); border-radius:10px; color:#aeeacb; background:rgba(23,130,79,.1); }
@media (max-width:1100px) { .safety-cards { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media (max-width:700px) { .safety-hero { grid-template-columns:1fr; text-align:center; } .safety-orb { margin:auto; } .safety-inline { justify-content:center; } .safety-cards,.safety-rules { grid-template-columns:1fr; } .backup-row { align-items:flex-start; flex-direction:column; } }

/* V0.3.26 — analyse réseau détaillée, interfaces et événements */
.scan-metrics { display:flex; flex-wrap:wrap; gap:8px; margin-top:14px; }
.scan-metric { min-width:88px; padding:8px 10px; border:1px solid #24435e; border-radius:9px; background:rgba(5,20,34,.55); }
.scan-metric strong,.scan-metric span { display:block; }
.scan-metric strong { font-size:19px; line-height:1; color:#e8f7ff; }
.scan-metric span { margin-top:4px; color:var(--muted); font-size:11px; }
.scan-metric.new { border-color:rgba(46,170,255,.35); }
.scan-metric.online { border-color:rgba(32,213,121,.35); }
.scan-metric.offline,.scan-metric.conflict { border-color:rgba(255,91,91,.35); }
.scan-metric.changed { border-color:rgba(255,176,0,.35); }
.dashboard-network-grid { display:grid; grid-template-columns:minmax(0,1.35fr) minmax(320px,.65fr); gap:18px; }
.dashboard-network-grid .panel { min-width:0; }
.network-event-list { display:grid; gap:8px; }
.network-event { display:grid; grid-template-columns:38px minmax(0,1fr); gap:11px; align-items:start; padding:11px 12px; border:1px solid #203e58; border-radius:10px; background:rgba(4,16,28,.42); }
.network-event .event-icon { display:grid; place-items:center; width:34px; height:34px; border-radius:9px; font-weight:900; color:#79dfff; border:1px solid rgba(46,170,255,.3); background:rgba(46,170,255,.09); }
.network-event.offline .event-icon,.network-event.conflict .event-icon { color:#ff9393; border-color:rgba(255,91,91,.3); background:rgba(255,91,91,.09); }
.network-event.online .event-icon { color:#75efac; border-color:rgba(32,213,121,.3); background:rgba(32,213,121,.09); }
.network-event.changed .event-icon { color:#ffd36e; border-color:rgba(255,176,0,.3); background:rgba(255,176,0,.09); }
.network-event strong,.network-event p,.network-event small { display:block; margin:0; }
.network-event p { margin-top:3px; color:#bfd0dd; font-size:13px; }
.network-event small { margin-top:4px; color:#708ba2; font-size:11px; }
.trust-list { display:grid; gap:10px; }
.trust-list span { padding:11px 12px; border:1px solid #22425e; border-radius:10px; color:#b9d2e4; background:rgba(5,21,35,.45); }
.compact-empty { padding:20px 14px; }
.interface-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; }
.interface-card { padding:14px; border:1px solid #24435f; border-radius:12px; background:rgba(4,17,29,.46); min-width:0; }
.interface-card.default-route { border-color:rgba(32,213,121,.42); box-shadow:inset 0 0 20px rgba(32,213,121,.04); }
.interface-head { display:flex; align-items:center; justify-content:space-between; gap:10px; }
.interface-card p { margin:7px 0; color:var(--muted); font-size:12px; }
.interface-card small { display:block; margin-top:9px; color:#7590a6; overflow-wrap:anywhere; }
.interface-addresses { display:flex; flex-wrap:wrap; gap:6px; }
.interface-addresses span { padding:5px 7px; border-radius:6px; background:#102940; color:#cfefff; font-size:12px; }
.conflict-panel.has-conflicts { border-color:rgba(255,91,91,.45); }
.conflict-list { display:grid; gap:9px; }
.conflict-row { display:grid; grid-template-columns:150px minmax(0,1fr); gap:14px; align-items:center; padding:12px 14px; border:1px solid rgba(255,91,91,.28); border-radius:10px; background:rgba(255,91,91,.06); }
.conflict-row>div { display:flex; flex-wrap:wrap; gap:7px; }
.conflict-row span { padding:5px 8px; border-radius:6px; background:#172f46; color:#c9d9e6; font-size:12px; }
.scan-history { display:grid; gap:10px; }
.scan-history-row { display:grid; grid-template-columns:minmax(220px,.8fr) minmax(420px,1.6fr) auto; gap:15px; align-items:center; padding:13px 14px; border:1px solid #203e58; border-radius:11px; background:rgba(4,16,28,.42); }
.scan-history-row>div>strong,.scan-history-row>div>span { display:block; }
.scan-history-row>div>span { margin-top:4px; color:var(--muted); font-size:12px; }
.scan-history-row .scan-metrics { margin-top:7px; }
.scan-history-row .scan-metric { min-width:74px; padding:6px 8px; }
.scan-history-row .scan-metric strong { font-size:15px; }
.scan-history-row>p { grid-column:1 / -1; margin:0; }
.detection-cell strong,.detection-cell small { display:block; }
.detection-cell small { margin-top:4px; color:var(--muted); max-width:230px; overflow-wrap:anywhere; }
@media (max-width:1150px) {
  .dashboard-network-grid { grid-template-columns:1fr; }
  .interface-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .scan-history-row { grid-template-columns:1fr auto; }
  .scan-history-row>div:nth-child(2) { grid-column:1 / -1; grid-row:2; }
}
@media (max-width:700px) {
  .interface-grid { grid-template-columns:1fr; }
  .conflict-row,.scan-history-row { grid-template-columns:1fr; }
  .scan-history-row>.status-badge { justify-self:start; }
  .scan-metric { min-width:calc(50% - 5px); flex:1; }
}


/* V0.3.27 — identification rapide des appareils */
.device-filter-bar { align-items: stretch; }
.bulk-toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 12px; margin-bottom: 12px; border: 1px solid #203d57; border-radius: 10px; background: rgba(5,18,31,.32); }
.bulk-toolbar select { width: auto; min-width: 220px; margin: 0 0 0 auto; }
.check-row { display: inline-flex; align-items: center; gap: 8px; margin: 0; cursor: pointer; }
.check-row input { width: auto; margin: 0; }
.device-identification-table { min-width: 1490px; }
.quick-name-cell { min-width: 260px; }
.quick-name-row { display: flex; gap: 7px; align-items: center; }
.quick-name-row input { min-width: 150px; margin: 0; padding: 8px 9px; }
.quick-category-cell { min-width: 190px; }
.quick-category-cell select { min-width: 175px; margin: 0; padding: 8px; }
.quick-category-cell .link-button { display: block; padding: 5px 0 0; text-align: left; font-size: 11px; }
.device-marker-actions { white-space: nowrap; }
.marker-button { width: 34px; height: 34px; padding: 0; border-radius: 8px; border: 1px solid #284761; background: #0b2034; color: #7892a8; cursor: pointer; font-size: 17px; }
.marker-button.active.important { color: #ffd163; border-color: rgba(255,176,0,.45); background: rgba(255,176,0,.12); }
.marker-button.active.watched { color: #73ddff; border-color: rgba(10,167,245,.45); background: rgba(10,167,245,.12); }
.important-device { box-shadow: inset 3px 0 0 rgba(255,176,0,.7); }
.watched-device { background: rgba(10,167,245,.035); }
.device-dates { min-width: 205px; }
.device-dates span, .device-dates small, td.code small { display: block; color: var(--muted); font-size: 11px; margin-top: 3px; }
.device-dates span:first-child { margin-top: 0; }
.badge.new-device { margin-top: 7px; color: #7ee5ff; border-color: rgba(10,167,245,.35); }
.device-flags-form { display: flex; gap: 22px; flex-wrap: wrap; margin-top: 14px; padding: 12px; border: 1px solid #203c55; border-radius: 9px; }
.dialog-spacer { flex: 1; }
.tiny { font-size: 11px; padding: 6px 8px; }
@media (max-width: 760px) {
  .bulk-toolbar select { margin-left: 0; width: 100%; }
  .quick-name-row { align-items: stretch; }
  .quick-name-row input { min-width: 130px; }
  .dialog-actions { flex-wrap: wrap; }
  .dialog-spacer { display: none; }
}

/* V0.3.30 — qualification conservative des candidats Tuya */
.tuya-hero { margin-top:0; display:flex; align-items:center; justify-content:space-between; gap:24px; border-color:rgba(0,190,255,.35); background:linear-gradient(135deg,rgba(7,33,52,.92),rgba(6,20,34,.82)); }
.tuya-hero h2 { margin:6px 0 8px; font-size:28px; }
.tuya-hero p { margin:0; max-width:900px; color:#a9c3d6; line-height:1.55; }
.eyebrow { color:#66d9ff; text-transform:uppercase; letter-spacing:.12em; font-size:11px; font-weight:800; }
.tuya-summary-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(210px,1fr)); gap:14px; margin:16px 0; }
.summary-card { display:grid; gap:6px; margin:0; }
.summary-card small { color:var(--muted); }
.summary-card strong { font-size:30px; }
.summary-card span { color:#7f9aae; font-size:12px; }
.tuya-principles { margin-bottom:16px; }
.tuya-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; }
.tuya-card { padding:16px; border:1px solid #24445f; border-radius:13px; background:rgba(3,18,31,.56); min-width:0; }
.tuya-card-head { display:flex; align-items:flex-start; justify-content:space-between; gap:14px; }
.tuya-card-head h3 { margin:3px 0 5px; }
.tuya-card-head p,.tuya-card-head small { margin:0; color:var(--muted); overflow-wrap:anywhere; }
.tuya-facts { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; margin:14px 0; }
.tuya-facts span { padding:9px; border:1px solid #203d56; border-radius:9px; background:#0a1e31; min-width:0; }
.tuya-facts small,.tuya-facts strong { display:block; overflow-wrap:anywhere; }
.tuya-facts small { color:#7893a8; font-size:10px; text-transform:uppercase; letter-spacing:.06em; }
.tuya-facts strong { margin-top:4px; font-size:12px; color:#d8e9f5; }
.tuya-identifiers { display:grid; gap:5px; margin:10px 0; color:#9fb8cb; font-size:12px; }
.tuya-identifiers code { color:#cceeff; }
.evidence-list { margin:10px 0 0; padding-left:20px; color:#9fb8cb; }
.evidence-list li { margin:5px 0; }
.tuya-actions { margin-top:14px; align-items:center; }
.badge.tuya-ready { color:#72efad; border-color:rgba(32,213,121,.38); background:rgba(32,213,121,.09); }
.badge.tuya-warning { color:#ffd36e; border-color:rgba(255,176,0,.38); background:rgba(255,176,0,.09); }
.badge.tuya-neutral { color:#a6bfd2; border-color:#365068; background:#10243a; }
.badge.tuya-local { color:#8fe6ff; border-color:rgba(10,167,245,.38); background:rgba(10,167,245,.09); }
@media (max-width:1100px) { .tuya-summary-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } .tuya-grid { grid-template-columns:1fr; } }
@media (max-width:700px) { .tuya-hero { align-items:stretch; flex-direction:column; } .tuya-summary-grid { grid-template-columns:1fr 1fr; } .tuya-facts { grid-template-columns:1fr; } }

.badge.tuya-confirmed { color:#72efad; border-color:rgba(32,213,121,.45); background:rgba(32,213,121,.12); }
.badge.tuya-probable { color:#ffd36e; border-color:rgba(255,176,0,.42); background:rgba(255,176,0,.1); }
.badge.tuya-manual { color:#c5a7ff; border-color:rgba(164,116,255,.45); background:rgba(164,116,255,.11); }
.badge.tuya-unconfirmed { color:#91a6b7; border-color:#344a5d; background:#0d2032; }
.tuya-card-unconfirmed { opacity:.86; border-style:dashed; }
.tuya-card-manual { border-color:rgba(164,116,255,.48); box-shadow:inset 0 0 0 1px rgba(164,116,255,.08); }
.tuya-panel-actions { display:flex; align-items:center; gap:12px; flex-wrap:wrap; justify-content:flex-end; }

/* V0.3.30 — lecture locale Tuya authentifiée, sans changement d'état */
.tuya-test-line { display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin:10px 0; }
.tuya-test-line small { color:var(--muted); }
.tuya-test-result { margin-top:14px; padding:14px; border:1px solid #2a4b65; border-radius:10px; background:#081b2c; }
.tuya-test-result p { margin:9px 0; color:#b7ccdb; }
.tuya-test-result details { margin-top:10px; }
.tuya-test-head { display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.tuya-test-head small { color:var(--muted); }
.tuya-dps-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; margin-top:10px; }
.tuya-dps-grid span { display:block; padding:9px; border:1px solid #203d56; border-radius:8px; background:#0a1e31; min-width:0; }
.tuya-dps-grid small,.tuya-dps-grid strong { display:block; overflow-wrap:anywhere; }
.tuya-dps-grid small { color:#7893a8; font-size:10px; text-transform:uppercase; }
.tuya-dps-grid strong { margin-top:4px; color:#d8e9f5; font-size:12px; }
@media (max-width:700px) { .tuya-dps-grid { grid-template-columns:1fr; } }

/* V0.3.32 — three explicit local integration paths */
.tuya-path-cards{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin:14px 0}.tuya-path-card{display:block;width:100%;text-align:left;border:1px solid var(--border);border-radius:14px;padding:14px;background:var(--panel-soft);color:var(--text);cursor:pointer;transition:border-color .15s ease,transform .15s ease,background .15s ease}.tuya-path-card:hover,.tuya-path-card:focus-visible{border-color:var(--accent);background:rgba(14,165,233,.09);transform:translateY(-1px);outline:none}.tuya-path-card strong,.tuya-path-card span,.tuya-path-card em{display:block}.tuya-path-card span{margin-top:6px;color:var(--muted);font-size:.9rem}.tuya-path-card em{margin-top:10px;color:var(--accent);font-size:.82rem;font-style:normal;font-weight:700}.path-fields{border:1px solid var(--border);border-radius:14px;padding:14px;background:var(--panel-soft)}.path-fields.hidden{display:none}.tuya-path-form{max-width:820px}.tuya-facts{grid-template-columns:repeat(4,minmax(0,1fr))}@media(max-width:760px){.tuya-path-cards{grid-template-columns:1fr}.tuya-facts{grid-template-columns:repeat(2,minmax(0,1fr))}}


/* V0.3.32 — confirmations cohérentes et mise à jour en une étape */
.confirmation-message{white-space:pre-line;line-height:1.55;margin:4px 0 0}
.update-selection-status{padding:12px 14px;border:1px dashed var(--border);border-radius:12px}
.update-confirm-summary{display:grid;gap:8px;padding:14px;border:1px solid var(--border);border-radius:14px;background:var(--panel-soft)}
.update-confirm-summary strong{font-size:1rem}.update-confirm-summary span{display:block;color:var(--muted)}

/* V0.3.34 — identification guidée et dialogue Tuya lisible */
.tuya-hero-actions{display:flex;gap:10px;align-items:center;flex-wrap:wrap;justify-content:flex-end}
.tuya-config-dialog{width:min(920px,calc(100vw - 28px));max-height:min(92vh,940px);overflow:hidden}
.tuya-config-dialog .tuya-path-form{padding:0;max-width:none;max-height:min(92vh,940px);display:flex;flex-direction:column;overflow:hidden}
.sticky-dialog-head{position:sticky;top:0;z-index:4;padding:20px 22px 14px;background:linear-gradient(145deg,#10243a,#0d2034)}
.dialog-scroll-body{padding:0 22px 22px;overflow-y:auto;overscroll-behavior:contain}
.sticky-dialog-actions{position:sticky;bottom:0;z-index:4;margin:0;padding:14px 22px;background:linear-gradient(180deg,rgba(9,26,44,.97),#091a2c);border-top:1px solid #294660;box-shadow:0 -12px 28px rgba(0,0,0,.24)}
.tuya-identity-box{display:grid;gap:10px;color:#c2d3e1}
.tuya-identity-title{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap}
.tuya-identity-title strong{font-size:1rem;color:#f4f9fc}
.tuya-identity-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.tuya-identity-grid span{display:block;padding:9px;border:1px solid #23435d;border-radius:8px;background:#081b2d;min-width:0}
.tuya-identity-grid small,.tuya-identity-grid strong{display:block;overflow-wrap:anywhere}
.tuya-identity-grid small{color:#7893a8;font-size:10px;text-transform:uppercase;letter-spacing:.05em}
.tuya-identity-grid strong{margin-top:3px;font-size:12px}
.tuya-secret-state{display:flex;gap:8px;flex-wrap:wrap;color:#9eb5c7;font-size:12px}
.tuya-recommendation-box{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:13px 14px;border:1px solid #274862;border-radius:12px;background:rgba(8,27,44,.65);margin-top:14px}
.tuya-recommendation-box p{margin:4px 0 0;color:var(--muted);font-size:12px}
.tuya-recommendation-result{margin:10px 0 14px;padding:13px;border:1px solid rgba(10,167,245,.36);border-radius:10px;background:rgba(10,167,245,.08)}
.tuya-recommendation-result h3,.tuya-recommendation-result p{margin:0}
.tuya-recommendation-result p{margin-top:6px;color:#bad3e4}
.tuya-recommendation-result ul{margin:9px 0 0;padding-left:20px;color:#9eb6c8}
.tuya-recommendation-result .actions{margin-top:12px}
.tuya-identify-dialog{width:min(720px,calc(100vw - 28px))}
.identify-step{margin-top:16px}
.identify-step>p{line-height:1.55}
.identify-baseline{display:grid;gap:8px;padding:12px;border:1px solid #25445e;border-radius:10px;background:#081b2d}
.identify-baseline span{display:flex;justify-content:space-between;gap:12px;color:#b8ccda}
.identify-result-card{padding:14px;border:1px solid rgba(32,213,121,.34);border-radius:12px;background:rgba(32,213,121,.07)}
.identify-result-card h3,.identify-result-card p{margin:0}
.identify-result-card p{margin-top:6px;color:#a9c0d0}
.identify-result-fields{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-top:14px}
.identify-progress{display:flex;align-items:center;gap:10px;padding:13px;border:1px solid rgba(10,167,245,.3);border-radius:10px;color:#9fe4ff;background:rgba(10,167,245,.08)}
@media(max-width:700px){.tuya-hero-actions{justify-content:stretch}.tuya-hero-actions button{flex:1}.tuya-identity-grid,.identify-result-fields{grid-template-columns:1fr}.sticky-dialog-actions{flex-wrap:wrap}.action-spacer{display:none}.tuya-recommendation-box{align-items:stretch;flex-direction:column}}

/* V0.3.34 — import ponctuel des localKeys depuis le projet Tuya Cloud officiel */
.tuya-cloud-import{margin-top:14px;padding:14px;border:1px solid rgba(10,167,245,.34);border-radius:12px;background:rgba(10,167,245,.06)}
.tuya-cloud-import>summary{cursor:pointer;font-weight:800;color:#bdeaff}
.tuya-cloud-import[open]>summary{margin-bottom:12px}
.tuya-cloud-import .checkbox-row{display:flex;align-items:flex-start;gap:9px;padding:10px 12px;border:1px solid #274862;border-radius:10px;background:#081b2d;line-height:1.45}
.tuya-cloud-import .checkbox-row input{width:auto;margin-top:3px;flex:0 0 auto}
.cloud-import-actions{display:flex;justify-content:flex-start;margin-top:12px}
.tuya-cloud-result{margin-top:12px}
.tuya-cloud-success{display:grid;gap:7px;padding:12px;border:1px solid rgba(32,213,121,.34);border-radius:10px;background:rgba(32,213,121,.07)}
.tuya-cloud-success strong,.tuya-cloud-success p,.tuya-cloud-success small{margin:0}
.tuya-cloud-success small{color:var(--muted)}

/* V0.3.38 — filtres Tuya cliquables et validation manuelle distincte */
.summary-card-action {
  appearance: none;
  width: 100%;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}
.summary-card-action:hover,
.summary-card-action:focus-visible {
  border-color: var(--cyan);
  background: linear-gradient(145deg, rgba(15,48,73,.98), rgba(8,28,47,.98));
  box-shadow: 0 0 0 3px rgba(33,199,255,.12), 0 16px 36px rgba(0,0,0,.26);
  outline: none;
}
.summary-card-action[aria-pressed="true"] {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(32,213,121,.10), 0 16px 36px rgba(0,0,0,.24);
}
.summary-card-action span {
  color: var(--cyan);
  font-weight: 750;
}
.summary-card-action[aria-pressed="true"] span { color: #72efad; }


/* V0.3.38 — import global et chiffré des localKey Tuya */
.tuya-bulk-counts{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:9px;margin:6px 0}
.tuya-bulk-counts span{display:grid;gap:4px;padding:10px;border:1px solid #274862;border-radius:10px;background:#081b2d}
.tuya-bulk-counts small{color:var(--muted)}
.tuya-bulk-counts strong{font-size:1.25rem}
.tuya-cloud-pending-list{display:grid;gap:7px;margin-top:9px;max-height:260px;overflow:auto}
.tuya-cloud-pending-list span{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:8px 10px;border:1px solid #274862;border-radius:8px;background:#081b2d}
.tuya-cloud-pending-list code{overflow-wrap:anywhere;text-align:right}
@media (max-width:900px){.tuya-bulk-counts{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media (max-width:560px){.tuya-bulk-counts{grid-template-columns:1fr}.tuya-cloud-pending-list span{align-items:flex-start;flex-direction:column}}


/* V0.3.41 — cartographie et test explicite des commandes DPS booléennes */
.tuya-control-mapping{margin-top:16px;padding:14px;border:1px solid rgba(32,213,121,.34);border-radius:14px;background:rgba(5,34,44,.72)}
.tuya-control-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;margin-bottom:10px}
.tuya-control-heading h3,.tuya-control-heading p{margin:0}
.tuya-control-heading p{margin-top:4px;color:var(--muted)}
.tuya-control-list{display:grid;gap:10px;margin:12px 0}
.tuya-control-row{display:grid;grid-template-columns:minmax(92px,.55fr) minmax(180px,1.4fr) minmax(90px,.65fr) minmax(105px,.7fr) auto;align-items:end;gap:10px;padding:11px;border:1px solid #274862;border-radius:11px;background:#081b2d}
.tuya-control-select{display:flex;align-items:center;gap:8px;min-height:42px;font-weight:800}
.tuya-control-select input{width:auto;margin:0}
.tuya-control-label{display:grid;gap:5px}
.tuya-control-label input{min-width:0}
.tuya-control-state{display:grid;gap:5px;min-height:42px;align-content:center}
.tuya-control-state small{color:var(--muted)}
.tuya-control-state strong{font-size:.95rem}
.tuya-control-state .is-on{color:#72efad}
.tuya-control-state .is-off{color:#a9c0d0}
.tuya-control-verification{display:flex;align-items:center;min-height:42px}
.tuya-control-actions{display:flex;gap:7px;align-items:center;min-height:42px}
.tuya-command-result{margin-top:12px;padding:12px;border:1px solid #274862;border-radius:10px;background:#071827}
@media(max-width:1050px){.tuya-control-row{grid-template-columns:110px minmax(180px,1fr) 100px}.tuya-control-verification{grid-column:1/2}.tuya-control-actions{grid-column:2/4;justify-content:flex-end}}
@media(max-width:650px){.tuya-control-heading{flex-direction:column}.tuya-control-row{grid-template-columns:1fr}.tuya-control-verification,.tuya-control-actions{grid-column:auto}.tuya-control-actions{justify-content:stretch}.tuya-control-actions button{flex:1}}

/* V0.3.41 — fonctions compréhensibles et pilotage direct depuis la page Domotique */
.tuya-device-name{display:block;padding:0;border:0;background:transparent;color:inherit;text-align:left;cursor:pointer}
.tuya-device-name h3{margin:.2rem 0}
.tuya-device-name:hover h3,.tuya-device-name:focus-visible h3{color:var(--cyan);text-decoration:underline;text-underline-offset:4px}
.tuya-device-name:focus-visible{outline:2px solid var(--cyan);outline-offset:4px;border-radius:6px}
.tuya-live-panel{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:12px 0;padding:10px;border:1px solid rgba(33,199,255,.25);border-radius:12px;background:rgba(5,23,38,.72)}
.tuya-live-main,.tuya-live-options{display:flex;flex-wrap:wrap;gap:8px}
.tuya-live-options{padding-left:10px;border-left:1px solid #274862}
.tuya-live-toggle{display:flex;align-items:center;justify-content:space-between;gap:12px;min-width:112px;padding:9px 11px;border:1px solid #365a73;border-radius:10px;background:#0b2236;color:var(--ink);cursor:pointer}
.tuya-live-toggle strong{min-width:34px;text-align:center;padding:3px 6px;border-radius:999px;background:#293d4d;color:#b7c7d2;font-size:.74rem}
.tuya-live-toggle[aria-pressed="true"]{border-color:var(--green);box-shadow:0 0 0 2px rgba(32,213,121,.10)}
.tuya-live-toggle[aria-pressed="true"] strong{background:rgba(32,213,121,.18);color:#72efad}
.tuya-live-toggle:hover,.tuya-live-toggle:focus-visible{border-color:var(--cyan);outline:none}
.tuya-function-group{display:grid;gap:9px;margin:14px 0}
.tuya-function-group h4{margin:0;color:#bdeaff;font-size:1rem}
.tuya-function-row{display:grid;grid-template-columns:minmax(240px,1.7fr) minmax(130px,.7fr) minmax(230px,1fr);align-items:center;gap:14px;padding:12px;border:1px solid #274862;border-radius:11px;background:#081b2d}
.tuya-function-row.is-readonly{opacity:.88}
.tuya-function-description{display:grid;gap:3px}
.tuya-function-description p{margin:2px 0 0;color:var(--muted);font-size:.9rem}
.tuya-function-technical{color:#6f91a8;font-size:.72rem;font-weight:500}
.tuya-function-input{display:flex;align-items:end;gap:8px}
.tuya-function-input label{flex:1}
.tuya-function-input input,.tuya-function-input select{min-width:0}
@media(max-width:1100px){.tuya-live-panel{align-items:flex-start;flex-direction:column}.tuya-live-options{padding-left:0;border-left:0}.tuya-function-row{grid-template-columns:1fr 150px}.tuya-function-row>.tuya-control-actions,.tuya-function-row>.tuya-function-input,.tuya-function-row>.badge{grid-column:1/-1;justify-self:stretch}}
@media(max-width:650px){.tuya-function-row{grid-template-columns:1fr}.tuya-live-main,.tuya-live-options{width:100%}.tuya-live-toggle{flex:1}.tuya-function-input{flex-direction:column;align-items:stretch}}

/* V0.3.41 — capteurs et mesures issus de la spécification Tuya par appareil */
.tuya-live-status{display:flex;flex-wrap:wrap;gap:8px;flex:1}
.tuya-live-indicator{display:grid;gap:2px;min-width:118px;padding:8px 10px;border:1px solid #294a61;border-radius:10px;background:#071a2b}
.tuya-live-indicator small{color:var(--muted);font-size:.72rem}
.tuya-live-indicator strong{color:#d7f3ff;font-size:.88rem}
@media(max-width:650px){.tuya-live-status{width:100%}.tuya-live-indicator{flex:1;min-width:135px}}


/* V0.3.43 — liste domotique compacte, une ligne par appareil */
.tuya-device-list{display:grid;gap:8px}
.tuya-device-row{display:grid;grid-template-columns:minmax(220px,1fr) auto;align-items:center;gap:14px;min-height:62px;padding:9px 11px;border:1px solid #24445f;border-radius:12px;background:rgba(3,18,31,.58)}
.tuya-device-row:hover{border-color:#35627e;background:rgba(6,28,46,.76)}
.tuya-row-unconfirmed{opacity:.82;border-style:dashed}
.tuya-row-name{display:flex;align-items:center;gap:11px;min-width:0}
.tuya-row-name>span:last-child{display:grid;gap:3px;min-width:0}
.tuya-row-name strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:1rem}
.tuya-row-name small{color:var(--muted);font-size:.75rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.tuya-row-dot{width:10px;height:10px;border-radius:50%;background:#61798b;box-shadow:0 0 0 4px rgba(97,121,139,.1);flex:0 0 auto}
.tuya-row-dot.is-ready{background:var(--green);box-shadow:0 0 0 4px rgba(32,213,121,.12)}
.tuya-row-controls{display:flex;align-items:center;justify-content:flex-end;gap:8px;flex-wrap:wrap}
.tuya-row-controls .tuya-live-toggle{min-width:104px;margin:0;padding:7px 9px}
.tuya-row-controls .tuya-live-indicator{min-width:105px;padding:6px 8px}
.tuya-row-note{color:var(--muted);font-size:.8rem}
.tuya-technical-details{margin-top:10px;color:#89a4b7;font-size:.8rem}
.tuya-technical-details summary{cursor:pointer;color:#9bb7ca}
.tuya-technical-details ul{display:grid;gap:5px;margin:8px 0 0;padding-left:20px}
.tuya-technical-details li{display:flex;gap:10px;align-items:center}
.tuya-unidentified-group{border-top:1px solid #274862;padding-top:14px}
.tuya-unidentified-summary{display:grid;grid-template-columns:1fr auto;gap:12px;align-items:center;padding:13px;border:1px solid rgba(255,176,0,.32);border-radius:11px;background:rgba(255,176,0,.06)}
.tuya-unidentified-summary p{margin:4px 0 0;color:var(--muted)}
.tuya-unidentified-summary details{grid-column:1/-1}
@media(max-width:820px){.tuya-device-row{grid-template-columns:1fr}.tuya-row-controls{justify-content:flex-start;padding-left:21px}.tuya-unidentified-summary{grid-template-columns:1fr}.tuya-unidentified-summary details{grid-column:auto}}
@media(max-width:520px){.tuya-row-controls{padding-left:0}.tuya-row-controls .tuya-live-toggle,.tuya-row-controls .tuya-live-indicator{flex:1;min-width:130px}}

/* V0.3.43 — identité Tuya Cloud et protection des saisies manuelles */
.tuya-name-settings{display:grid;gap:10px;padding:13px;border:1px solid #284b64;border-radius:12px;background:rgba(7,27,44,.58)}
.tuya-name-actions{display:flex;align-items:center;gap:12px;flex-wrap:wrap}
.tuya-name-actions .checkbox-row{flex:1;min-width:280px;margin:0}
.tuya-name-settings>small{color:var(--muted)}
@media(max-width:650px){.tuya-name-actions{align-items:stretch;flex-direction:column}.tuya-name-actions .checkbox-row{min-width:0;width:100%}}


/* V0.3.44 — expert Tuya function definitions */
.tuya-manual-override-row{border:1px solid #27516c;border-radius:14px;padding:14px;margin:12px 0;background:rgba(8,31,49,.65)}
.tuya-manual-override-head{display:flex;align-items:center;gap:14px;flex-wrap:wrap;margin-bottom:12px}.tuya-manual-override-head code{color:#8fcff4}.tuya-manual-override-head span{color:#9fb8cc}
.tuya-manual-override-grid{display:grid;grid-template-columns:repeat(4,minmax(130px,1fr));gap:10px}.tuya-manual-override-grid label{display:flex;flex-direction:column;gap:5px;font-size:.84rem;color:#b8d0e1}.tuya-manual-override-grid input,.tuya-manual-override-grid select{width:100%}
.tuya-manual-override-options{display:flex;gap:24px;flex-wrap:wrap;margin-top:12px}.tuya-manual-override-options label{display:flex;gap:8px;align-items:center}
@media(max-width:900px){.tuya-manual-override-grid{grid-template-columns:1fr 1fr}}
@media(max-width:560px){.tuya-manual-override-grid{grid-template-columns:1fr}}

/* V0.3.46 — préparation automatique en lecture seule des commandes Tuya */
.tuya-auto-prepare-progress{margin:0 0 12px;padding:10px 12px;border:1px solid #28516d;border-radius:10px;background:rgba(8,34,52,.82);color:#b9d8ea;font-size:.92rem}
.tuya-auto-prepare-progress.success{border-color:rgba(31,210,132,.55);background:rgba(16,87,67,.24);color:#82f0c2}
.tuya-auto-prepare-progress.warning{border-color:rgba(240,176,69,.58);background:rgba(118,75,14,.24);color:#ffd482}
.tuya-auto-prepare-progress.info{border-color:rgba(55,181,239,.55);color:#9edfff}

/* V0.3.47 — variation locale de l’intensité lumineuse */
.tuya-live-dimmer{display:grid;grid-template-columns:auto minmax(120px,180px);align-items:center;gap:10px;min-width:245px;padding:7px 10px;border:1px solid #365a73;border-radius:10px;background:#0b2236;color:var(--ink)}
.tuya-live-dimmer>span{display:grid;gap:1px;min-width:78px}
.tuya-live-dimmer small{color:var(--muted);font-size:.72rem}
.tuya-live-dimmer strong{color:#d7f3ff;font-size:.86rem}
.tuya-live-dimmer input[type=range],.tuya-brightness-input input[type=range]{width:100%;accent-color:var(--cyan);cursor:pointer}
.tuya-live-dimmer:focus-within{border-color:var(--cyan);box-shadow:0 0 0 2px rgba(27,190,255,.10)}
.tuya-brightness-input{min-width:min(330px,100%)}
.tuya-brightness-input label{min-width:180px;flex:1}
.tuya-brightness-input output{min-width:48px;text-align:center;font-weight:800;color:#d7f3ff}
@media(max-width:820px){.tuya-live-dimmer{min-width:220px;grid-template-columns:auto minmax(100px,1fr)}}
@media(max-width:520px){.tuya-live-dimmer{width:100%;min-width:0}.tuya-row-controls .tuya-live-dimmer{flex:1 1 100%}}

/* V0.3.51 — récupération automatique des commandes Tuya */
.tuya-cover-command{display:flex;align-items:center;gap:5px;padding:4px;border:1px solid #365a73;border-radius:10px;background:#0b2236}
.tuya-cover-command button{min-width:auto;margin:0;padding:7px 9px}
.tuya-cover-command .tuya-cover-open{border-color:rgba(32,213,121,.48)}
.tuya-cover-command .tuya-cover-stop{border-color:rgba(240,176,69,.52)}
.tuya-cover-command .tuya-cover-close{border-color:rgba(91,173,231,.48)}
.tuya-live-cover-position{display:grid;grid-template-columns:auto minmax(135px,210px);align-items:center;gap:7px 10px;min-width:280px;padding:7px 10px;border:1px solid #365a73;border-radius:10px;background:#0b2236;color:var(--ink)}
.tuya-live-cover-position>span:first-child{display:grid;gap:1px;min-width:78px}
.tuya-live-cover-position small{color:var(--muted);font-size:.72rem}
.tuya-live-cover-position strong{color:#d7f3ff;font-size:.86rem}
.tuya-live-cover-position input[type=range],.tuya-position-input input[type=range]{width:100%;accent-color:var(--cyan);cursor:pointer}
.tuya-live-cover-position:focus-within{border-color:var(--cyan);box-shadow:0 0 0 2px rgba(27,190,255,.10)}
.tuya-live-cover-position .tuya-cover-scale{grid-column:2;display:flex;justify-content:space-between;margin-top:-5px}
.tuya-cover-scale{display:flex;justify-content:space-between;gap:20px;color:var(--muted);font-size:.72rem}
.tuya-position-input{min-width:min(360px,100%);display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.tuya-position-input label{min-width:200px;flex:1}
.tuya-position-input output{min-width:48px;text-align:center;font-weight:800;color:#d7f3ff}
.tuya-position-input .tuya-cover-scale{width:100%}
.tuya-cover-actions{align-items:center}
@media(max-width:900px){.tuya-live-cover-position{min-width:245px;grid-template-columns:auto minmax(110px,1fr)}}
@media(max-width:620px){.tuya-cover-command{width:100%;justify-content:stretch}.tuya-cover-command button{flex:1}.tuya-live-cover-position{width:100%;min-width:0}.tuya-row-controls .tuya-live-cover-position{flex:1 1 100%}}

/* V0.3.51 — préparation locale automatique et états explicites */
.tuya-auto-prepare-callout {
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 0 0 .85rem;
  padding: .8rem 1rem;
  border: 1px solid rgba(41, 186, 255, .42);
  border-radius: 12px;
  background: rgba(7, 40, 62, .96);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .2);
}
.tuya-auto-prepare-callout div { display: grid; gap: .2rem; }
.tuya-auto-prepare-callout span { color: var(--muted); font-size: .9rem; }
.tuya-offline-summary { margin: 0 0 .75rem; color: var(--muted); font-size: .9rem; }
.tuya-preparation-state {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: .35rem .65rem;
  border: 1px solid rgba(111, 151, 184, .32);
  border-radius: 9px;
  color: var(--muted);
  font-size: .82rem;
  white-space: nowrap;
}
.tuya-preparation-state.warning { border-color: rgba(255, 183, 77, .42); color: #ffd08a; }
.tuya-preparation-state.info { border-color: rgba(41, 186, 255, .4); color: #8bdcff; }
.tuya-preparation-state.neutral { opacity: .78; }
@media (max-width: 760px) {
  .tuya-auto-prepare-callout { position: static; align-items: stretch; flex-direction: column; }
  .tuya-auto-prepare-callout button { width: 100%; }
}
.tuya-cloud-credentials-status{display:grid;gap:4px;padding:12px 14px;margin:10px 0 14px;border:1px solid #274862;border-radius:10px;background:#081b2d}
.tuya-cloud-credentials-status strong{color:#e9f7ff}
.tuya-cloud-credentials-status span,.tuya-cloud-credentials-status small{color:var(--muted)}
.tuya-cloud-credentials-status.ready{border-color:rgba(32,213,121,.45);background:rgba(32,213,121,.07)}
.tuya-cloud-credentials-status.ready strong{color:#91f3c1}
.tuya-cloud-credentials-status.empty{border-color:rgba(255,188,66,.38);background:rgba(255,188,66,.06)}

/* V0.3.55 — coffre Tuya et liaisons réseau */
.section-title { margin: 4px 0 12px; color: #dceeff; font-size: 16px; }
.vault-other-title { margin-top: 24px; }
.tuya-cloud-vault-card { align-items: flex-start; }
.vault-secret-grid { display: grid; gap: 10px; min-width: min(700px, 100%); }
.vault-secret-grid h3 { margin: 0 0 2px; }
.vault-secret-row { display: grid; grid-template-columns: 210px minmax(180px, 1fr) auto auto; align-items: center; gap: 8px; }
.vault-secret-row > span { color: var(--muted); font-size: 12px; }
.vault-secret-row code { min-height: 36px; display: flex; align-items: center; padding: 8px 10px; border: 1px solid #29455f; border-radius: 8px; background: rgba(2,14,25,.42); color: #d9f4ff; overflow-wrap: anywhere; }
.wifi-networks-head { margin-top: 24px; }
.network-source-card small { display: block; margin-top: 5px; color: #7993a9; }
.device-link-settings { margin-top: 8px; }
.device-link-settings .form-grid { margin-top: 10px; }
@media (max-width: 760px) {
  .vault-secret-row { grid-template-columns: 1fr auto auto; }
  .vault-secret-row > span { grid-column: 1 / -1; }
  .vault-secret-row code { min-width: 0; }
}


/* V0.3.57 — Tuya Cloud credential test status */
.tuya-cloud-test{display:inline-flex;align-items:center;justify-content:center;border:1px solid rgba(128,164,195,.35);border-radius:10px;padding:.55rem .75rem;font-weight:750;background:rgba(24,55,79,.55);color:#cbe4f7}
button.tuya-cloud-test{cursor:pointer}
.tuya-cloud-test.success{color:#77f0ad;background:rgba(24,137,89,.18);border-color:rgba(46,226,143,.55)}
.tuya-cloud-test.failed{color:#ff9696;background:rgba(177,49,61,.18);border-color:rgba(255,91,104,.55)}
.tuya-cloud-test.untested{color:#9edcff;background:rgba(39,126,177,.16);border-color:rgba(71,184,244,.45)}
.tuya-cloud-test-result{display:flex;flex-direction:column;gap:.25rem;border:1px solid rgba(128,164,195,.35);border-radius:10px;padding:.75rem .9rem}
.tuya-cloud-test-result.success{color:#77f0ad;background:rgba(24,137,89,.16);border-color:rgba(46,226,143,.45)}
.tuya-cloud-test-result.failed{color:#ffabab;background:rgba(177,49,61,.16);border-color:rgba(255,91,104,.45)}

/* V0.3.58 — carte Tuya Cloud compacte et configuration regroupée */
.tuya-cloud-vault-compact { align-items: center; }
.tuya-cloud-card-main { display: grid; gap: 5px; min-width: 0; }
.tuya-cloud-card-main h3 { margin: 0; }
.tuya-cloud-card-main a { width: max-content; max-width: 100%; color: #69cfff; font-weight: 700; text-decoration: none; overflow-wrap: anywhere; }
.tuya-cloud-card-main a:hover { text-decoration: underline; }
.tuya-cloud-card-main small { color: var(--muted); line-height: 1.35; }
.tuya-cloud-card-actions { align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.tuya-cloud-config-form { width: 100%; min-width: 0; }
.tuya-cloud-config-section { display: grid; gap: 12px; border: 1px solid #264861; border-radius: 12px; padding: 15px; background: rgba(4, 23, 38, .34); }
.tuya-cloud-config-section + .tuya-cloud-config-section { margin-top: 14px; }
.config-section-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.config-section-head h3, .config-section-head p { margin: 0; }
.config-section-head p { color: var(--muted); font-size: 13px; margin-top: 4px; }
.config-section-head a { color: #69cfff; }
@media (max-width: 760px) {
  .tuya-cloud-vault-compact { grid-template-columns: 1fr; }
  .tuya-cloud-card-actions { justify-content: flex-start; }
}

/* V0.3.62 — fenêtre Tuya Cloud centrée et sans débordement horizontal */
#tuyaCloudVaultDialog {
  width: min(820px, calc(100vw - 32px));
  max-width: calc(100vw - 32px);
  max-height: min(94dvh, 960px);
  margin: auto;
  overflow: hidden;
}
#tuyaCloudVaultDialog .tuya-cloud-config-form {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  max-height: min(94dvh, 960px);
  padding: 22px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}
#tuyaCloudVaultDialog .tuya-cloud-config-section,
#tuyaCloudVaultDialog .config-section-head,
#tuyaCloudVaultDialog label,
#tuyaCloudVaultDialog input,
#tuyaCloudVaultDialog select,
#tuyaCloudVaultDialog .toolbar,
#tuyaCloudVaultDialog .dialog-actions {
  min-width: 0;
  max-width: 100%;
}
#tuyaCloudVaultDialog .toolbar,
#tuyaCloudVaultDialog .dialog-actions {
  flex-wrap: wrap;
}

@media (max-width: 760px) {
  #tuyaCloudVaultDialog {
    width: calc(100vw - 16px);
    max-width: calc(100vw - 16px);
    max-height: calc(100dvh - 16px);
  }
  #tuyaCloudVaultDialog .tuya-cloud-config-form {
    max-height: calc(100dvh - 16px);
    padding: 16px;
  }
  #tuyaCloudVaultDialog .tuya-cloud-config-section {
    padding: 12px;
  }
  #tuyaCloudVaultDialog .config-section-head {
    flex-direction: column;
  }
  #tuyaCloudVaultDialog .toolbar,
  #tuyaCloudVaultDialog .dialog-actions {
    display: grid;
    grid-template-columns: 1fr;
  }
  #tuyaCloudVaultDialog .toolbar button,
  #tuyaCloudVaultDialog .dialog-actions button {
    width: 100%;
  }
}


/* V0.3.62 — distinction visible Wi-Fi / Ethernet */
.device-link-help { display:flex; align-items:center; justify-content:space-between; gap:14px; margin:-2px 0 12px; padding:9px 12px; border:1px solid #1e4059; border-radius:9px; background:rgba(6,24,39,.42); color:#9db7c9; font-size:12px; }
.device-link-help .link-button { flex:0 0 auto; }
.device-link-cell { min-width:190px; }
.device-link-button { display:grid; grid-template-columns:auto 1fr; align-items:center; gap:5px 8px; width:100%; min-width:175px; padding:9px 10px; border-radius:9px; text-align:left; cursor:pointer; background:#0b2034; border:1px solid #29465e; color:#dcebf5; }
.device-link-button:hover { border-color:#2cbcf0; background:#0d2941; }
.device-link-button .device-link-title { font-weight:800; }
.device-link-button small { grid-column:1 / -1; display:block; color:#88a5b9; font-size:11px; line-height:1.3; overflow-wrap:anywhere; }
.device-link-button.wifi { border-color:rgba(0,190,255,.42); }
.device-link-button.ethernet { border-color:rgba(65,217,141,.42); }
.device-link-button.unknown { border-style:dashed; color:#b6c8d5; }
.link-quality { justify-self:end; padding:2px 6px; border-radius:999px; background:rgba(0,190,255,.13); color:#77dcff; font-size:10px; font-weight:800; }
@media (max-width:760px) { .device-link-help { align-items:flex-start; flex-direction:column; } .device-link-help .link-button { padding-left:0; } }

/* V0.3.63 — passerelles Tuya et sous-appareils Zigbee */
.tuya-gateway-section { margin-top: 18px; }
.tuya-gateway-list { display: grid; gap: 14px; }
.tuya-gateway-card { overflow: hidden; border: 1px solid #24475f; border-radius: 14px; background: rgba(4, 22, 36, .48); }
.tuya-gateway-card > header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 16px; border-bottom: 1px solid #24475f; background: rgba(12, 42, 63, .42); }
.tuya-gateway-card > header > div:first-child { display: grid; gap: 4px; min-width: 0; }
.tuya-gateway-card > header strong { font-size: 17px; }
.tuya-gateway-card > header small { color: var(--muted); overflow-wrap: anywhere; }
.tuya-gateway-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.gateway-status { display: inline-flex; align-items: center; min-height: 34px; padding: 6px 10px; border: 1px solid #36566d; border-radius: 9px; font-size: 12px; font-weight: 800; }
.gateway-status.ready { color: #6ff0aa; border-color: rgba(44, 219, 139, .55); background: rgba(16, 134, 82, .16); }
.gateway-status.warning { color: #ffd978; border-color: rgba(255, 190, 43, .55); background: rgba(155, 104, 9, .16); }
.gateway-status.failed { color: #ff9a9a; border-color: rgba(255, 87, 101, .52); background: rgba(163, 44, 56, .16); }
.gateway-status.neutral { color: #a7c8dd; background: rgba(35, 73, 98, .32); }
.gateway-association-needed { color: #ffd978; font-size: 12px; font-weight: 750; }
.zigbee-subdevice-list { display: grid; }
.zigbee-subdevice-row { display: grid; grid-template-columns: minmax(240px, .9fr) minmax(300px, 1.6fr); align-items: center; gap: 14px; padding: 12px 16px; border-top: 1px solid rgba(37, 72, 96, .72); }
.zigbee-subdevice-row:first-child { border-top: 0; }
.zigbee-subdevice-row.is-offline { opacity: .68; }
.zigbee-subdevice-identity { display: flex; align-items: center; gap: 10px; min-width: 0; }
.zigbee-subdevice-identity > div { display: grid; gap: 3px; min-width: 0; }
.zigbee-subdevice-identity strong { overflow-wrap: anywhere; }
.zigbee-subdevice-identity small { color: var(--muted); overflow-wrap: anywhere; }
.zigbee-subdevice-controls { display: flex; justify-content: flex-end; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.zigbee-command { display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 7px 10px; border: 1px solid #31526a; border-radius: 9px; background: #0b2135; color: #dcebf5; }
.zigbee-command strong { padding: 2px 7px; border-radius: 999px; background: rgba(120, 150, 170, .2); font-size: 11px; }
.zigbee-command.is-active { border-color: #24d88b; background: rgba(10, 116, 75, .18); }
.zigbee-command.is-active strong { color: #75f1b0; background: rgba(20, 181, 111, .2); }
.zigbee-command:disabled, .zigbee-range-control input:disabled, .zigbee-enum-control select:disabled { cursor: not-allowed; opacity: .55; }
.zigbee-readout { display: grid; gap: 2px; min-width: 88px; padding: 6px 9px; border: 1px solid #294a62; border-radius: 9px; background: rgba(7, 29, 46, .55); }
.zigbee-readout small, .zigbee-range-control small { color: #8dacbf; }
.zigbee-range-control { display: grid; grid-template-columns: minmax(90px, auto) minmax(130px, 220px); align-items: center; gap: 10px; padding: 6px 10px; border: 1px solid #294a62; border-radius: 9px; background: rgba(7, 29, 46, .55); }
.zigbee-range-control > span { display: grid; gap: 2px; }
.zigbee-range-control input { width: 100%; }
.zigbee-enum-control { display: flex; align-items: flex-end; gap: 6px; }
.zigbee-enum-control label { display: grid; gap: 4px; color: #8dacbf; font-size: 11px; }
.zigbee-enum-control select { min-width: 120px; }
.zigbee-no-functions { color: #91aec0; font-size: 12px; }
@media (max-width: 900px) {
  .tuya-gateway-card > header, .zigbee-subdevice-row { grid-template-columns: 1fr; flex-direction: column; align-items: stretch; }
  .tuya-gateway-actions, .zigbee-subdevice-controls { justify-content: flex-start; }
}
@media (max-width: 620px) {
  .zigbee-range-control { grid-template-columns: 1fr; width: 100%; }
  .zigbee-enum-control { align-items: stretch; flex-direction: column; width: 100%; }
  .zigbee-enum-control select, .zigbee-enum-control button { width: 100%; }
}

/* V0.3.68 — scénarios locaux Rézo */
.scenario-hero{display:flex;align-items:center;justify-content:space-between;gap:22px;border-color:rgba(33,199,255,.34);background:linear-gradient(135deg,rgba(11,41,64,.92),rgba(7,25,42,.9))}
.scenario-hero h2,.scenario-hero p,.scenario-engine-card h2,.scenario-engine-card p{margin:0}.scenario-hero h2{font-size:30px}.scenario-hero p,.scenario-engine-card p{margin-top:7px;color:var(--muted);line-height:1.5}.scenario-hero-actions{display:flex;align-items:center;justify-content:flex-end;gap:10px;flex-wrap:wrap}.eyebrow{display:block;margin-bottom:7px;color:var(--cyan);font-size:11px;font-weight:850;letter-spacing:.12em}
.scenario-engine-card{display:flex;align-items:center;justify-content:space-between;gap:20px}.scenario-engine-card>div{min-width:0;flex:1}.scenario-engine-metrics{display:grid;grid-template-columns:repeat(4,minmax(115px,1fr));gap:9px;margin-top:14px}.scenario-engine-metrics span,.scenario-summary-grid span{display:grid;gap:3px;padding:10px 12px;border:1px solid #27455e;border-radius:10px;background:rgba(4,20,34,.42)}.scenario-engine-metrics small,.scenario-summary-grid small{color:#87a4b8;font-size:11px}.scenario-engine-metrics strong,.scenario-summary-grid strong{overflow-wrap:anywhere}
.scenario-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}.scenario-card{display:grid;gap:14px;padding:18px;border:1px solid #24455e;border-radius:14px;background:linear-gradient(145deg,rgba(13,35,56,.94),rgba(7,24,40,.94));box-shadow:var(--glow)}.scenario-card.enabled{border-color:rgba(32,213,121,.42)}.scenario-card-head{display:flex;align-items:flex-start;justify-content:space-between;gap:15px}.scenario-card-head h3,.scenario-card-head p{margin:0}.scenario-card-head h3{margin-top:8px;font-size:19px}.scenario-card-head p{margin-top:5px;color:var(--muted);font-size:13px;line-height:1.4}.scenario-badges{display:flex;gap:6px;flex-wrap:wrap}.scenario-origin-rezo{color:#8de0ff;border-color:rgba(33,199,255,.36);background:rgba(33,199,255,.09)}.scenario-origin-tuya{color:#cbb3ff;border-color:rgba(166,108,255,.4);background:rgba(166,108,255,.1)}.scenario-switch{display:grid;justify-items:end;gap:5px;min-width:74px;color:var(--muted);font-size:11px}.scenario-switch input{width:42px;height:22px;accent-color:var(--green)}.scenario-summary-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.scenario-summary-grid strong{font-size:13px}.scenario-compatibility{margin:0;padding:9px 11px;border:1px solid #31516a;border-radius:9px;font-size:12px;line-height:1.45}.scenario-compatibility.local{color:#80edb4;border-color:rgba(32,213,121,.34);background:rgba(32,213,121,.07)}.scenario-compatibility.adapted{color:#ffdc80;border-color:rgba(255,176,0,.4);background:rgba(255,176,0,.07)}.scenario-compatibility.unsupported{color:#ff9c9c;border-color:rgba(255,91,91,.38);background:rgba(255,91,91,.07)}.scenario-actions-preview{border-top:1px solid #203d55;padding-top:10px;color:var(--muted)}.scenario-actions-preview summary{cursor:pointer;color:#bee7fb;font-weight:750}.scenario-actions-preview ol{margin:9px 0 0;padding-left:21px}.scenario-actions-preview li{margin:5px 0;font-size:12px}.scenario-card-actions{display:flex;align-items:center;gap:7px;flex-wrap:wrap}.scenario-run-list{display:grid;gap:8px}.scenario-run-row{display:grid;grid-template-columns:minmax(180px,1fr) auto;gap:5px 14px;padding:11px 13px;border:1px solid #28465d;border-radius:10px;background:rgba(5,22,36,.42)}.scenario-run-row>div{display:grid;gap:2px}.scenario-run-row>div:nth-child(2){justify-items:end}.scenario-run-row span,.scenario-run-row small,.scenario-run-row p{color:var(--muted);font-size:11px}.scenario-run-row p{grid-column:1/-1;margin:0}.scenario-run-row.success{border-color:rgba(32,213,121,.32)}.scenario-run-row.failed{border-color:rgba(255,91,91,.35)}.scenario-run-row.simulated{border-color:rgba(33,199,255,.34)}
.scenario-dialog{width:min(980px,calc(100vw - 28px));max-height:min(94dvh,980px);overflow:hidden}.scenario-dialog .dialog-form{padding:0;max-height:min(94dvh,980px);display:flex;flex-direction:column;overflow:hidden}.scenario-editor-section{display:grid;gap:12px;margin-top:15px;padding:15px;border:1px solid #294962;border-radius:12px;background:rgba(4,21,35,.42)}.scenario-editor-section h3,.scenario-editor-section p{margin:0}.scenario-actions-editor{display:grid;gap:9px}.scenario-action-row{display:grid;grid-template-columns:34px minmax(150px,1.15fr) minmax(130px,1fr) minmax(130px,.85fr) auto;align-items:end;gap:9px;padding:11px;border:1px solid #294962;border-radius:10px;background:rgba(8,30,48,.62)}.scenario-action-row.delay{grid-template-columns:34px minmax(180px,1fr) auto}.scenario-action-row label{margin:0}.scenario-action-order{align-self:center;display:grid;place-items:center;width:28px;height:28px;border-radius:999px;background:var(--primary-soft);color:var(--cyan);font-weight:850}.scenario-days{display:flex;gap:7px;flex-wrap:wrap;margin-top:9px}.scenario-days label{display:flex;align-items:center;gap:4px;margin:0;padding:7px 9px;border:1px solid #2a4a63;border-radius:8px;background:rgba(10,34,53,.62);font-size:12px}.scenario-days input{width:auto;margin:0;accent-color:var(--primary)}
@media(max-width:1100px){.scenario-list{grid-template-columns:1fr}.scenario-engine-metrics{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:760px){.scenario-hero,.scenario-engine-card,.scenario-card-head{align-items:stretch;flex-direction:column}.scenario-hero-actions,.scenario-card-actions{justify-content:stretch}.scenario-hero-actions button,.scenario-card-actions button,.scenario-engine-card>button{flex:1}.scenario-summary-grid,.scenario-engine-metrics{grid-template-columns:1fr 1fr}.scenario-action-row,.scenario-action-row.delay{grid-template-columns:1fr}.scenario-action-order{justify-self:start}.scenario-run-row{grid-template-columns:1fr}.scenario-run-row>div:nth-child(2){justify-items:start}.scenario-dialog{width:calc(100vw - 12px);max-height:calc(100dvh - 12px)}.scenario-dialog .dialog-form{max-height:calc(100dvh - 12px)}}
@media(max-width:480px){.scenario-summary-grid,.scenario-engine-metrics{grid-template-columns:1fr}.scenario-hero h2{font-size:25px}}

/* V0.3.86 — physical feedback freshness */
.tuya-live-stale { display:inline-flex; align-items:center; min-height:38px; padding:0 12px; border:1px solid #a97820; border-radius:10px; color:#ffd36a; background:rgba(169,120,32,.10); font-size:.82rem; font-weight:700; }

/* V0.3.86 — menu latéral toujours accessible */
.sidebar { box-sizing: border-box; overflow: hidden; }
.sidebar .brand, .sidebar-bottom { flex: 0 0 auto; }
.sidebar nav { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: rgba(70,145,195,.55) transparent; padding-right: 3px; }
.sidebar nav::-webkit-scrollbar { width: 6px; }
.sidebar nav::-webkit-scrollbar-track { background: transparent; }
.sidebar nav::-webkit-scrollbar-thumb { background: rgba(70,145,195,.45); border-radius: 999px; }
.sidebar nav button { flex: 0 0 auto; }

/* V0.3.86 — centre de diagnostic local */
.diagnostic-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(25, 183, 255, .10), rgba(12, 29, 48, .82));
}
.diagnostic-hero h2 { margin: 0 0 6px; }
.diagnostic-hero p { margin: 0; color: var(--muted); }
.diagnostic-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.diagnostic-summary-grid article {
  display: grid;
  gap: 6px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--panel);
}
.diagnostic-summary-grid small { color: var(--muted); }
.diagnostic-summary-grid strong { font-size: 28px; }
.diagnostic-test-form {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 180px auto;
  gap: 12px;
  align-items: end;
  margin: 16px 0;
}
.diagnostic-test-form label { display: grid; gap: 7px; }
.diagnostic-capture-card {
  margin-top: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(6, 22, 37, .54);
}
.diagnostic-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0;
}
.diagnostic-stats span {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--muted);
}
.diagnostic-stats strong { color: var(--text); }
.diagnostic-marker-actions { margin: 12px 0; }
.diagnostic-timeline {
  display: grid;
  max-height: 360px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.diagnostic-timeline > div {
  display: grid;
  grid-template-columns: 150px 130px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}
.diagnostic-timeline > div:last-child { border-bottom: 0; }
.diagnostic-timeline time, .diagnostic-timeline span { color: var(--muted); }
.diagnostic-event-list { display: grid; gap: 10px; }
.diagnostic-event {
  padding: 14px;
  border: 1px solid var(--line);
  border-left-width: 4px;
  border-radius: 12px;
  background: rgba(6, 22, 37, .54);
}
.diagnostic-event.error { border-left-color: #ff6677; }
.diagnostic-event.warning { border-left-color: #f1b64a; }
.diagnostic-event.info { border-left-color: #27c5ff; }
.diagnostic-event-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}
.diagnostic-event-head time, .diagnostic-event-meta { color: var(--muted); }
.diagnostic-event-meta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; font-size: .88rem; }
.diagnostic-event pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.badge.diag-error { background: rgba(255, 75, 95, .14); color: #ff9aa6; border-color: rgba(255, 75, 95, .35); }
.badge.diag-warning { background: rgba(241, 182, 74, .14); color: #ffd37f; border-color: rgba(241, 182, 74, .35); }
.badge.diag-info { background: rgba(39, 197, 255, .14); color: #87ddff; border-color: rgba(39, 197, 255, .35); }
.capture-summary-list { display: grid; gap: 9px; }
.capture-summary-list article {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.capture-summary-list article > div { display: grid; gap: 4px; }
.capture-summary-list span { color: var(--muted); }
@media (max-width: 900px) {
  .diagnostic-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .diagnostic-test-form { grid-template-columns: 1fr; }
  .diagnostic-hero { align-items: flex-start; flex-direction: column; }
  .diagnostic-stats { grid-template-columns: 1fr; }
  .diagnostic-timeline > div { grid-template-columns: 1fr; gap: 3px; }
  .diagnostic-event-head { grid-template-columns: auto 1fr; }
  .diagnostic-event-head time { grid-column: 2; }
}

/* V0.3.86 — retour Tuya événementiel ciblé */
.tuya-live-event{display:inline-flex;align-items:center;min-height:28px;padding:4px 9px;border:1px solid rgba(34,197,94,.55);border-radius:8px;background:rgba(16,185,129,.12);color:#7ef0b0;font-size:.72rem;font-weight:800;letter-spacing:.02em;white-space:nowrap}

/* V0.3.93 — opérateurs logiques ET / OU dans les scénarios */
.scenario-logic-connector{justify-self:center;display:inline-grid;place-items:center;min-width:42px;padding:4px 10px;border:1px solid rgba(33,199,255,.38);border-radius:999px;background:rgba(33,199,255,.08);color:#9fe8ff;font-size:11px;font-weight:900;letter-spacing:.06em}
.scenario-logic-connector.action-logic{margin:-2px auto;position:relative;z-index:1}
.scenario-inline-logic{display:inline-grid;place-items:center;min-width:26px;margin-right:5px;padding:2px 6px;border:1px solid rgba(33,199,255,.3);border-radius:999px;color:#9fe8ff;font-size:10px;font-weight:900}
.scenario-condition-builder{display:flex;align-items:center;gap:8px;flex-wrap:wrap;padding:12px;border:1px solid #294962;border-radius:11px;background:rgba(8,30,48,.56)}
.scenario-if-label,.scenario-logic-word{display:inline-grid;place-items:center;padding:5px 9px;border-radius:999px;font-size:11px;font-weight:900;letter-spacing:.05em}
.scenario-if-label{background:rgba(166,108,255,.12);border:1px solid rgba(166,108,255,.38);color:#d6c3ff}
.scenario-logic-word{background:rgba(33,199,255,.08);border:1px solid rgba(33,199,255,.35);color:#9fe8ff}
.scenario-condition-choice{display:flex;align-items:center;gap:7px;margin:0;padding:8px 10px;border:1px solid #2a4a63;border-radius:9px;background:rgba(10,34,53,.66);font-size:12px}
.scenario-condition-choice input{width:auto;margin:0;accent-color:var(--primary)}

/* V0.3.93 — capteurs Tuya intermittents sur piles */
.status-dot.sleeping::before{background:#f5b942;box-shadow:0 0 9px rgba(245,185,66,.48)}
.status-dot.warning::before{background:#ff9f43;box-shadow:0 0 9px rgba(255,159,67,.52)}
.status-dot.alarm::before{background:#ff4d5e;box-shadow:0 0 12px rgba(255,77,94,.75)}
.tuya-row-dot.is-sleeping{background:#f5b942;box-shadow:0 0 0 4px rgba(245,185,66,.13)}
.tuya-battery-state{display:inline-flex;align-items:center;min-height:28px;padding:4px 9px;border-radius:8px;font-size:.72rem;font-weight:800;white-space:nowrap;border:1px solid rgba(245,185,66,.55);background:rgba(245,185,66,.1);color:#ffd77d}
.tuya-battery-state.warning{border-color:rgba(255,159,67,.65);background:rgba(255,159,67,.12);color:#ffc178}
.tuya-battery-state.alarm{border-color:rgba(255,77,94,.75);background:rgba(255,77,94,.14);color:#ff9aa4}
.tuya-battery-reading.is-alarm{border-color:rgba(255,77,94,.78);background:rgba(255,77,94,.12)}
.tuya-battery-reading.is-alarm strong{color:#ff9aa4}

/* V0.3.93 — investigation réseau locale des capteurs sur piles */
.tuya-network-capture-state{display:inline-flex;align-items:center;min-height:34px;padding:0 10px;border:1px solid rgba(107,149,185,.42);border-radius:10px;background:rgba(13,43,66,.72);color:#a9c5d8;font-size:.78rem;font-weight:700;white-space:nowrap}
.tuya-network-capture-state.has-data{border-color:rgba(42,209,145,.52);color:#74e3b2;background:rgba(20,92,68,.18)}
.tuya-network-capture-state.is-active{border-color:rgba(38,196,255,.72);color:#7bdcff;background:rgba(17,105,142,.22);animation:rezo-capture-pulse 1.5s ease-in-out infinite}
@keyframes rezo-capture-pulse{0%,100%{box-shadow:0 0 0 0 rgba(38,196,255,.05)}50%{box-shadow:0 0 0 4px rgba(38,196,255,.12)}}

/* V0.3.95 — état de la domotique, lecture seule */
.status-badge.sleeping { color:#9edfff; background:rgba(41,186,255,.09); border-color:rgba(41,186,255,.28); }
.status-badge.alarm { color:#fff; background:rgba(255,67,67,.3); border-color:rgba(255,91,91,.72); box-shadow:0 0 16px rgba(255,60,60,.18); }
.domotic-health-hero { margin-top:0; display:flex; align-items:center; justify-content:space-between; gap:20px; border-color:rgba(41,186,255,.38); }
.domotic-health-hero h2 { margin:.25rem 0 .4rem; font-size:27px; }
.domotic-health-hero p { margin:0; color:var(--muted); max-width:850px; }
.domotic-health-actions { display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.domotic-health-summary { margin-top:18px; }
.domotic-health-summary .stat-card { min-height:120px; padding:18px; display:grid; align-content:center; gap:5px; }
.domotic-health-summary .stat-card>small,.domotic-health-summary .stat-card>span { color:var(--muted); }
.domotic-health-summary .stat-warning { border-color:rgba(255,176,0,.44); }
.domotic-health-table { min-width:1260px; }
.domotic-health-table td { vertical-align:top; }
.domotic-health-table td>small,.domotic-mode,.domotic-device-name small,.domotic-command-metrics small { display:block; margin-top:5px; color:var(--muted); line-height:1.35; }
.domotic-device-name,.domotic-command-metrics { display:grid; gap:2px; min-width:150px; }
.domotic-command-metrics span { color:#b6cede; font-size:.82rem; }
.domotic-command-metrics .ok,.domotic-health-table .ok { color:#70f0aa; }
.domotic-command-metrics .failed,.domotic-last-error { color:#ff9a9a; }
.queue-count { display:inline-grid; place-items:center; min-width:30px; height:30px; border:1px solid #31536b; border-radius:9px; font-weight:850; color:#9bb8ca; background:#071a2b; }
.queue-count.has-items { color:#ffd163; border-color:rgba(255,176,0,.5); background:rgba(255,176,0,.08); }
.tuya-battery-empty { display:inline-flex; align-items:center; padding:7px 10px; border:1px dashed rgba(255,176,0,.4); border-radius:9px; color:#ffd18a; background:rgba(255,176,0,.05); font-size:.78rem; font-weight:750; }
@media(max-width:760px){.domotic-health-hero{align-items:flex-start;flex-direction:column}.domotic-health-actions{width:100%;justify-content:space-between}.domotic-health-summary{grid-template-columns:1fr 1fr}}
@media(max-width:480px){.domotic-health-summary{grid-template-columns:1fr}}

/* V0.3.95 — navigation regroupée et page Maison */
.grouped-nav { align-content:start; }
.nav-group { border:1px solid rgba(42,82,116,.34); border-radius:11px; background:rgba(7,24,40,.34); overflow:hidden; }
.nav-group + .nav-group { margin-top:3px; }
.nav-group > summary { list-style:none; cursor:pointer; padding:10px 13px; color:#7895ad; font-size:11px; font-weight:850; letter-spacing:.09em; text-transform:uppercase; display:flex; align-items:center; justify-content:space-between; user-select:none; }
.nav-group > summary::-webkit-details-marker { display:none; }
.nav-group > summary::after { content:'⌄'; color:#5e829f; font-size:15px; transition:transform .16s ease; }
.nav-group:not([open]) > summary::after { transform:rotate(-90deg); }
.nav-group > summary:hover { color:#b9d5e8; background:rgba(20,58,87,.23); }
.nav-group-items { display:grid; gap:4px; padding:0 5px 6px; }
.sidebar nav .nav-group-items button { width:100%; min-height:43px; padding:9px 11px; }
.sidebar nav .nav-group-items button span { width:22px; height:22px; font-size:17px; }

.tuya-room-settings { align-items:center; margin-top:12px; }
.favorite-setting { min-height:48px; align-self:end; border:1px solid rgba(255,193,64,.22); background:rgba(255,176,0,.05); border-radius:9px; padding:10px 12px; }

.home-hero { margin-top:0; display:flex; align-items:center; justify-content:space-between; gap:22px; border-color:rgba(41,186,255,.42); background:radial-gradient(circle at 90% 20%,rgba(18,169,243,.16),transparent 34%),linear-gradient(145deg,rgba(16,36,58,.98),rgba(8,24,40,.98)); }
.home-hero h2 { margin:4px 0 6px; font-size:30px; }
.home-hero p { margin:0; max-width:800px; color:var(--muted); }
.home-hero-actions { display:flex; align-items:center; gap:10px; flex-wrap:wrap; justify-content:flex-end; }
.home-favorites { border-color:rgba(255,176,0,.35); }
.home-favorites-empty { display:flex; align-items:center; justify-content:space-between; gap:16px; color:var(--muted); }
.home-favorites-empty strong { color:#dcecff; }
.home-favorites-empty p { margin:0; }
.home-room-panel { scroll-margin-top:110px; }
.home-device-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:13px; }
.home-device-card { min-width:0; border:1px solid rgba(45,82,114,.75); background:linear-gradient(150deg,rgba(13,34,55,.98),rgba(7,23,39,.98)); border-radius:12px; padding:15px; display:grid; gap:14px; box-shadow:inset 0 1px 0 rgba(255,255,255,.02); }
.home-device-card.is-favorite { border-color:rgba(255,176,0,.42); box-shadow:inset 0 1px 0 rgba(255,255,255,.02),0 0 20px rgba(255,176,0,.05); }
.home-device-card > header { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; }
.home-device-title { display:flex; align-items:center; gap:10px; min-width:0; }
.home-device-title > div { min-width:0; }
.home-device-title strong { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.home-device-title small { display:block; margin-top:4px; color:var(--muted); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.home-device-glyph { width:38px; height:38px; flex:0 0 38px; border-radius:50%; display:grid; place-items:center; color:var(--cyan); border:1px solid rgba(33,199,255,.32); background:rgba(10,167,245,.08); }
.home-device-actions { display:flex; align-items:center; gap:7px; flex-wrap:wrap; justify-content:flex-end; }
.home-favorite-button { width:35px; height:35px; padding:0; display:grid; place-items:center; border:1px solid #34516d; background:#102238; color:#617d96; font-size:17px; }
.home-favorite-button.active { color:#ffc04d; border-color:rgba(255,176,0,.55); background:rgba(255,176,0,.09); box-shadow:0 0 14px rgba(255,176,0,.12); }
.home-device-controls { min-height:58px; display:flex; align-items:center; gap:9px; flex-wrap:wrap; }
.home-device-controls .tuya-live-toggle { min-width:112px; }
.home-device-controls .tuya-live-dimmer,.home-device-controls .tuya-live-cover-position { flex:1 1 210px; }
.home-device-card > footer { display:flex; align-items:center; justify-content:space-between; gap:10px; border-top:1px solid rgba(45,76,103,.45); padding-top:11px; color:#7891a8; }
.home-device-card > footer small:last-child { text-align:right; }
.home-room-off:disabled,#homeAllOffBtn:disabled { opacity:.48; cursor:not-allowed; transform:none; box-shadow:none; }

@media(max-width:1250px){.home-device-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:820px){.home-hero{align-items:flex-start;flex-direction:column}.home-hero-actions{width:100%;justify-content:flex-start}.home-device-grid{grid-template-columns:1fr}.home-device-card>header{flex-direction:column}.home-device-actions{justify-content:flex-start}.home-favorites-empty{align-items:flex-start;flex-direction:column}}
@media(max-width:520px){.home-hero-actions button{width:100%}.home-room-panel .panel-head{align-items:flex-start;flex-direction:column}.home-room-off{width:100%}.home-device-card>footer{align-items:flex-start;flex-direction:column}.home-device-card>footer small:last-child{text-align:left}}

/* V0.3.104 — groupes du menu non compressibles et défilement vertical fiable */
.sidebar nav.grouped-nav {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  align-content: normal;
  gap: 8px;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior-y: contain;
  touch-action: pan-y;
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
}
.sidebar nav.grouped-nav > .nav-group {
  flex: 0 0 auto;
  width: 100%;
}
.sidebar nav.grouped-nav > .nav-group[open] > .nav-group-items {
  min-height: max-content;
}


/* V0.3.116 — diagnostic actuel et santé mini-PC */
.no-top-margin { margin-top: 0 !important; }
.bottom-gap-14 { margin-bottom: 14px !important; }
.clipboard-helper { position: fixed; opacity: 0; pointer-events: none; width: 1px; height: 1px; }
.diagnostic-current-head { display:flex; align-items:center; justify-content:space-between; gap:16px; margin:18px 0 10px; }
.diagnostic-current-head h3, .diagnostic-current-head p { margin:0; }
.diagnostic-current-head p { color:var(--muted); margin-top:4px; }
.diagnostic-summary-grid-five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.diagnostic-history-summary { margin-top:12px; }
.diagnostic-history-chips { display:flex; flex-wrap:wrap; gap:10px; }
.diagnostic-history-chips span { border:1px solid var(--border); border-radius:12px; padding:9px 12px; color:var(--muted); }
.diagnostic-history-chips strong { color:var(--text); margin-left:6px; }
.system-health-hero { display:grid; grid-template-columns:auto 1fr auto; align-items:center; gap:18px; border:1px solid var(--border); border-radius:18px; padding:20px; margin-bottom:16px; background:var(--panel); }
.system-health-hero.healthy { border-color:rgba(36,204,124,.35); }
.system-health-hero.warning, .system-health-hero.critical { border-color:rgba(241,182,74,.45); }
.system-health-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:14px; margin-bottom:16px; }
.system-health-card { display:grid; gap:8px; }
.system-health-card small, .system-health-card span { color:var(--muted); }
.system-health-card strong { font-size:28px; }
.health-bar { height:8px; border-radius:999px; overflow:hidden; background:rgba(255,255,255,.08); }
.health-bar > span { display:block; height:100%; background:linear-gradient(90deg,#27c5ff,#2bdd83); border-radius:inherit; }
.health-bar > span[data-level="0"]{width:0}.health-bar > span[data-level="1"]{width:10%}.health-bar > span[data-level="2"]{width:20%}.health-bar > span[data-level="3"]{width:30%}.health-bar > span[data-level="4"]{width:40%}.health-bar > span[data-level="5"]{width:50%}.health-bar > span[data-level="6"]{width:60%}.health-bar > span[data-level="7"]{width:70%}.health-bar > span[data-level="8"]{width:80%}.health-bar > span[data-level="9"]{width:90%}.health-bar > span[data-level="10"]{width:100%}
.health-table { display:grid; gap:0; }
.health-table > div { display:flex; justify-content:space-between; gap:16px; padding:12px 4px; border-bottom:1px solid var(--border); }
.health-table > div:last-child { border-bottom:0; }
.health-table span { color:var(--muted); }
.health-table b, .health-table strong { color:var(--text); }
.health-alerts { margin-bottom:16px; }
@media(max-width:1050px){.system-health-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.diagnostic-summary-grid-five{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:700px){.system-health-grid{grid-template-columns:1fr}.system-health-hero{grid-template-columns:auto 1fr}.system-health-hero>button{grid-column:1/-1}.diagnostic-current-head{align-items:flex-start;flex-direction:column}.health-table>div{flex-direction:column;gap:5px}}

/* V0.3.116 — connectivité et commandes d’alimentation du mini-PC */
.system-power-panel { border-color: rgba(241,182,74,.28); }
.system-power-actions { display:flex; flex-wrap:wrap; gap:12px; margin:10px 0 14px; }
.system-power-actions button { min-width:230px; }
.power-restart { border-color:rgba(241,182,74,.55); color:#ffd47a; }
.health-table small { color:var(--muted); }
@media(max-width:700px){.system-power-actions{display:grid}.system-power-actions button{width:100%;min-width:0}}


/* V0.3.116 - Wi-Fi manager and Ethernet failover */
.wifi-manager-grid{display:grid;grid-template-columns:minmax(0,1.15fr) minmax(320px,.85fr);gap:18px;margin-top:16px}.wifi-manager-grid h3{margin:0 0 10px}.wifi-network-list{display:grid;gap:8px;max-height:360px;overflow:auto;padding-right:4px}.wifi-network-row{width:100%;display:flex;align-items:center;justify-content:space-between;gap:12px;text-align:left;padding:12px 14px;border:1px solid var(--border);border-radius:12px;background:var(--panel2);color:var(--text);cursor:pointer}.wifi-network-row:hover,.wifi-network-row.active{border-color:var(--accent);background:rgba(0,183,255,.08)}.wifi-network-row span{display:grid;gap:3px}.wifi-network-row small{color:var(--muted)}.wifi-current,.wifi-saved-row{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 4px}.wifi-current span{display:grid;gap:4px}.wifi-current small{color:var(--muted)}.wifi-actions{display:flex;flex-wrap:wrap;gap:10px;margin:12px 0 18px}.wifi-saved-row{border-top:1px solid var(--border)}.empty.compact{padding:10px 0}.wifi-manager-panel form{display:grid;gap:10px}.wifi-manager-panel form button{justify-self:start}@media(max-width:900px){.wifi-manager-grid{grid-template-columns:1fr}}@media(max-width:700px){.wifi-manager-panel .panel-head{align-items:flex-start;flex-direction:column}.wifi-manager-panel .panel-head>button{width:100%}.wifi-network-row,.wifi-current,.wifi-saved-row{align-items:flex-start;flex-direction:column}.wifi-actions{display:grid}.wifi-actions button{width:100%}}

.update-build-telemetry{display:flex;flex-wrap:wrap;gap:10px 18px;align-items:center;margin:12px 0;padding:11px 14px;border:1px solid rgba(47,191,255,.28);border-radius:12px;background:rgba(19,105,150,.10)}
.update-build-telemetry strong{color:#dff6ff}.update-build-telemetry span{color:#8fb4cc;font-size:.92rem;overflow-wrap:anywhere}
.wifi-setup-command{display:flex;gap:10px;align-items:center;margin-top:12px;flex-wrap:wrap}.wifi-setup-command code{padding:9px 11px;border-radius:8px;background:rgba(0,0,0,.25);user-select:all}

.vpn-adopt-btn { margin-top: 12px; }

/* V0.3.120 — alias DNS privé .rezo */
.rezo-alias-input{display:flex;align-items:center;border:1px solid var(--border);border-radius:10px;overflow:hidden;background:var(--surface-2)}
.rezo-alias-input input{border:0!important;border-radius:0!important;flex:1;min-width:0}
.rezo-alias-input span{padding:0 12px;color:var(--cyan);font-weight:700;border-left:1px solid var(--border)}
.rezo-fqdn{display:block;color:var(--cyan);font-family:ui-monospace,SFMono-Regular,Menlo,monospace;margin-top:3px}


/* V0.3.123 — bibliothèque commune, sélection Domotique et animations natives persistantes */
.device-icon-shell,.rezo-device-animation{position:relative;display:inline-block;flex:0 0 auto;width:46px;height:46px;border-radius:10px;overflow:hidden;background:#eef8ff;border:1px solid rgba(58,166,239,.42);box-shadow:0 3px 10px rgba(0,0,0,.16)}
.device-icon-image{display:block;width:100%;height:100%;object-fit:cover}
.rezo-native-animation{isolation:isolate;contain:layout paint style;transform:translateZ(0)}
.rezo-native-svg{display:block;width:100%;height:100%;overflow:hidden;shape-rendering:geometricPrecision;transform:translateZ(0)}
.rezo-native-panel,.rezo-native-gate-panel{will-change:transform}
.rezo-native-light-halo,.rezo-native-light-core,.rezo-native-light-rays{will-change:opacity,transform}
.rezo-native-slat{fill:#116cae;stroke:#063c69;stroke-width:2}
.rezo-native-fallback{display:none;position:absolute;inset:0;width:100%;height:100%;object-fit:cover}
.no-svg .rezo-native-svg{display:none}.no-svg .rezo-native-fallback{display:block}
@media(prefers-reduced-motion:reduce){.rezo-native-panel,.rezo-native-gate-panel,.rezo-native-light-halo,.rezo-native-light-core,.rezo-native-light-rays{will-change:auto}}
.network-device-icon{width:44px;height:44px;border-radius:9px}
.device-name-with-icon{display:grid;grid-template-columns:44px minmax(180px,1fr);align-items:center;gap:10px;min-width:280px}
.device-name-copy{min-width:0}.device-name-copy>small{display:block;margin-top:4px}
.home-device-icon{width:50px;height:50px;border-radius:11px}
.tuya-row-icon{width:42px;height:42px;border-radius:9px;margin-left:2px}
.tuya-device-name.tuya-row-name{grid-template-columns:auto 42px minmax(0,1fr);gap:9px}
.device-icon-picker{display:grid;gap:10px;padding:12px;border:1px solid #29465e;border-radius:11px;background:rgba(8,28,45,.48)}
.device-icon-picker-head{display:flex;align-items:center;justify-content:space-between;gap:14px}
.device-icon-current{display:flex;align-items:center;gap:11px;min-width:0}.device-icon-current>div{display:grid;gap:3px}.device-icon-current small{color:var(--muted)}
.picker-preview{width:58px;height:58px;border-radius:12px}
.device-icon-library>summary{cursor:pointer;color:#bfeaff;font-weight:750}
.device-icon-grid{display:grid;grid-template-columns:repeat(6,minmax(78px,1fr));gap:8px;max-height:360px;overflow:auto;padding:10px 3px 3px;margin-top:8px}
.device-icon-choice{display:grid;place-items:center;gap:5px;min-width:0;padding:7px 5px;border:1px solid #29465e;border-radius:9px;background:#0a2033;color:#cfe5f4;cursor:pointer}
.device-icon-choice:hover,.device-icon-choice.active{border-color:var(--cyan);background:#0d2b43;box-shadow:0 0 0 2px rgba(27,190,255,.10)}
.device-icon-choice img{width:54px;height:54px;object-fit:cover;border-radius:8px}.device-icon-choice span{width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:.68rem;text-align:center}
@media(max-width:900px){.device-icon-grid{grid-template-columns:repeat(4,minmax(72px,1fr))}}
@media(max-width:560px){.device-icon-grid{grid-template-columns:repeat(3,minmax(68px,1fr))}.device-name-with-icon{grid-template-columns:40px minmax(150px,1fr);min-width:230px}.network-device-icon{width:40px;height:40px}}

/* V0.3.123 */
.tuya-device-icon-picker{margin-top:14px}
.tuya-device-icon-picker>small{display:block;margin-top:8px;color:var(--muted)}

/* V0.3.124 — page Appareils compacte avec inspecteur latéral */
.device-browser-shell{display:grid;gap:12px;min-width:0}
.device-connect-warning{margin:0 0 12px}
.device-browser-toolbar{display:grid;grid-template-columns:minmax(300px,1fr) auto;gap:14px;align-items:center;padding:14px 16px;border:1px solid var(--border);border-radius:14px;background:linear-gradient(145deg,rgba(10,31,50,.98),rgba(7,24,40,.98))}
.device-search-wrap{position:relative;min-width:0}.device-search-wrap input{width:100%;padding-left:40px;height:44px}.device-search-icon{position:absolute;left:14px;top:50%;transform:translateY(-50%);font-size:25px;color:#9cb8cc;pointer-events:none}
.device-quick-filters{display:flex;align-items:center;gap:7px;flex-wrap:wrap;justify-content:flex-end}
.device-filter-chip{height:42px;padding:0 13px;border:1px solid #294b65;border-radius:9px;background:#0b2438;color:#d9e9f5;display:inline-flex;align-items:center;gap:7px;cursor:pointer;font-weight:700;white-space:nowrap}.device-filter-chip:hover,.device-filter-chip.active{border-color:var(--cyan);background:rgba(18,129,190,.17);color:#fff}.device-filter-chip>span{display:inline-grid;place-items:center;min-width:22px;height:22px;padding:0 6px;border-radius:999px;background:rgba(255,255,255,.08);color:#a9c0d2;font-size:.76rem}.filter-dot{width:8px;height:8px;border-radius:50%;background:#6d8192}.filter-dot.online{background:var(--green);box-shadow:0 0 8px rgba(32,213,121,.55)}.filter-dot.offline{background:#72889b}
.device-advanced-filters{display:grid;grid-template-columns:minmax(160px,220px) minmax(180px,240px) minmax(180px,240px) auto 1fr;gap:12px;align-items:end;padding:13px 16px;border:1px solid var(--border);border-radius:12px;background:rgba(8,27,44,.78)}.device-advanced-filters>label:not(.check-row){display:grid;gap:6px;color:var(--muted);font-size:.8rem}.device-advanced-filters select{height:39px}.device-watch-filter{align-self:center;margin-top:20px}.device-advanced-actions{display:flex;justify-content:flex-end;gap:8px;flex-wrap:wrap}
.device-bulk-toolbar{display:flex;align-items:center;justify-content:flex-end;gap:9px;padding:9px 12px;border:1px solid rgba(34,190,255,.28);border-radius:10px;background:rgba(9,64,94,.22)}.device-bulk-toolbar select{max-width:260px;height:36px}
.device-browser-layout{display:grid;grid-template-columns:minmax(0,1fr);gap:12px;min-width:0;align-items:start}.device-browser-layout.has-inspector{grid-template-columns:minmax(620px,1fr) 342px}.device-table-pane{min-width:0}
.device-compact-table-wrap{overflow:auto;border:1px solid var(--border);border-radius:12px 12px 0 0;background:#0a2134}.device-compact-table{min-width:910px;margin:0}.device-compact-table thead{position:sticky;top:0;z-index:4}.device-compact-table thead th{background:#091d2f;padding:11px 10px;font-size:.74rem;color:#8fabc0;letter-spacing:.035em}.device-compact-table td{padding:8px 10px;vertical-align:middle;border-bottom:1px solid rgba(47,78,101,.58)}.device-compact-table tbody tr:last-child td{border-bottom:0}.device-compact-row{cursor:pointer;transition:background .14s,border-color .14s}.device-compact-row:hover{background:rgba(18,89,127,.14)}.device-compact-row.selected{background:linear-gradient(90deg,rgba(8,125,183,.18),rgba(10,45,69,.52));box-shadow:inset 0 0 0 1px rgba(37,193,255,.76)}.device-compact-row.important-device td:first-child{box-shadow:inset 3px 0 0 #f4b928}.device-compact-row.watched-device:not(.important-device) td:first-child{box-shadow:inset 3px 0 0 #20b8f2}
.device-compact-table .device-name-with-icon{grid-template-columns:42px minmax(145px,1fr);min-width:190px;gap:9px}.device-compact-table .network-device-icon{width:42px;height:42px}.device-name-copy strong{display:block;font-size:.9rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.device-name-copy small,.compact-address small{display:block;margin-top:3px;color:#7797ad;font-size:.72rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.favorite-inline{margin-left:6px;color:#ffc23d;font-size:.88em}.compact-status{display:inline-flex;align-items:center;gap:7px;font-size:.82rem;white-space:nowrap}.compact-status .status-dot{font-size:0;gap:0}.compact-new{display:block;margin-top:4px;width:max-content}.compact-address{min-width:125px}.compact-address strong{font-size:.84rem}.compact-vendor{max-width:170px;font-size:.8rem;color:#bdd0dd}.compact-category-badge{display:inline-flex;align-items:center;max-width:155px;padding:6px 9px;border:1px solid #294a62;border-radius:8px;background:rgba(12,38,57,.75);font-size:.8rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.compact-link-badge{display:inline-flex;align-items:center;gap:6px;padding:6px 9px;border-radius:8px;background:#0b263b;border:1px solid #2d5068;color:#d7ebf7;cursor:pointer;font-size:.8rem;white-space:nowrap}.compact-link-badge.ethernet{border-color:rgba(53,210,137,.38);color:#baf4d4}.compact-link-badge.wifi{border-color:rgba(35,176,255,.44);color:#a9ddff}.compact-link-badge.unknown{border-style:dashed;color:#9cb0bf}.compact-row-actions{text-align:right;width:42px}.compact-row-actions .icon-button{width:32px;height:32px;font-size:20px}
.device-table-footer{display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:12px;padding:10px 12px;border:1px solid var(--border);border-top:0;border-radius:0 0 12px 12px;background:#091d30;color:#8faabe;font-size:.78rem}.device-table-footer>label{justify-self:end;display:flex;align-items:center;gap:7px}.device-table-footer select{height:34px;padding:0 28px 0 9px}.device-pagination{display:flex;gap:5px;justify-content:center}.device-page-button{min-width:34px;height:34px;border:1px solid #29485f;border-radius:8px;background:#0a253a;color:#c9dbe7;cursor:pointer}.device-page-button:hover:not(:disabled),.device-page-button.active{border-color:var(--cyan);background:#0c4465;color:#fff}.device-page-button:disabled{opacity:.38;cursor:default}.device-empty-state{min-height:220px;display:grid;place-content:center;gap:7px;text-align:center;border:1px solid var(--border);border-radius:12px}.device-empty-state span{color:var(--muted)}
.device-inspector{position:sticky;top:10px;max-height:calc(100vh - 150px);overflow:auto;border:1px solid #24465e;border-radius:13px;background:linear-gradient(180deg,#0b263b,#081d2f);box-shadow:0 12px 35px rgba(0,0,0,.22);padding:15px}.device-inspector-head{display:flex;justify-content:space-between;gap:10px;align-items:flex-start;padding-bottom:13px;border-bottom:1px solid #29485f}.device-inspector-title{display:grid;grid-template-columns:62px minmax(0,1fr);gap:11px;align-items:center;min-width:0}.inspector-device-icon{width:62px;height:62px;border-radius:12px}.device-inspector-title h3{font-size:1rem;margin:0 0 3px;line-height:1.25;overflow-wrap:anywhere}.device-inspector-title small{display:block;color:#8ba8ba;overflow-wrap:anywhere}.inspector-status{display:flex;align-items:center;gap:6px;margin-top:6px;color:#b8d6e8;font-size:.78rem}.inspector-status .status-dot{font-size:0;gap:0}.device-inspector-fields{display:grid;gap:0;padding:9px 0}.device-inspector-fields>div{display:grid;grid-template-columns:105px minmax(0,1fr);align-items:center;gap:10px;padding:8px 0;border-bottom:1px solid rgba(43,75,97,.5)}.device-inspector-fields>div>span{color:#84a4b9;font-size:.76rem}.device-inspector-fields strong{font-size:.79rem;overflow-wrap:anywhere}.device-inspector-fields select{height:34px;padding:0 30px 0 8px;font-size:.78rem}.inspector-inline-button{border:0;background:transparent;color:#bceaff;text-align:left;padding:0;cursor:pointer;font-weight:700;overflow-wrap:anywhere}.device-inspector-notes{display:grid;gap:7px;margin:8px 0 13px}.device-inspector-notes>span,.inspector-actions>strong,.inspector-icons strong{font-size:.79rem;color:#cfe1ec}.device-inspector-notes textarea{resize:vertical;min-height:78px}.device-inspector-notes button{justify-self:end}.inspector-section-head{display:flex;align-items:center;justify-content:space-between;gap:8px}.inspector-icon-strip{display:grid;grid-template-columns:repeat(5,1fr);gap:5px;margin:8px 0 5px}.inspector-icon-choice,.inspector-icon-more{aspect-ratio:1;border:1px solid #29495f;border-radius:8px;background:#0a2134;padding:3px;cursor:pointer;display:grid;place-items:center}.inspector-icon-choice:hover,.inspector-icon-choice.active,.inspector-icon-more:hover{border-color:var(--cyan);background:#0c3a56}.inspector-icon-choice img{display:block;width:100%;height:100%;object-fit:cover;border-radius:6px}.inspector-icon-more{color:#cfe8f6;font-size:21px}.inspector-icons>small{color:#7e9db1;font-size:.7rem}.device-inspector-primary-actions{margin:13px 0}.inspector-actions{padding-top:12px;border-top:1px solid #29485f}.inspector-actions>div{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px;margin-top:8px}.device-inspector-meta{display:grid;gap:4px;margin-top:14px;padding-top:11px;border-top:1px solid #29485f;color:#6f8fa4;font-size:.68rem}.switch.compact-switch{display:inline-flex;position:relative;width:38px;height:22px}.switch.compact-switch input{position:absolute;opacity:0;pointer-events:none}.switch.compact-switch span{position:absolute;inset:0;border-radius:999px;background:#355064;cursor:pointer;transition:.18s}.switch.compact-switch span:after{content:"";position:absolute;width:16px;height:16px;left:3px;top:3px;border-radius:50%;background:#eaf7ff;transition:.18s}.switch.compact-switch input:checked+span{background:#11a7e3}.switch.compact-switch input:checked+span:after{transform:translateX(16px)}
@media(max-width:1450px){.device-browser-toolbar{grid-template-columns:1fr}.device-quick-filters{justify-content:flex-start}.device-browser-layout.has-inspector{grid-template-columns:minmax(570px,1fr) 320px}.device-inspector{padding:12px}.device-compact-table{min-width:850px}.compact-vendor{max-width:135px}}
@media(max-width:1180px){.device-browser-layout.has-inspector{grid-template-columns:1fr}.device-inspector{position:fixed;right:14px;top:92px;bottom:14px;z-index:80;width:min(380px,calc(100vw - 28px));max-height:none;box-shadow:0 20px 55px rgba(0,0,0,.55)}body.device-inspector-open:after{content:"";position:fixed;inset:0;z-index:70;background:rgba(0,10,18,.52);backdrop-filter:blur(1px)}}
@media(max-width:760px){.device-browser-toolbar{padding:10px}.device-quick-filters{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));width:100%}.device-filter-chip{justify-content:center}.device-advanced-filters{grid-template-columns:1fr}.device-watch-filter{margin-top:0}.device-advanced-actions{justify-content:stretch;display:grid}.device-bulk-toolbar{align-items:stretch;flex-direction:column}.device-bulk-toolbar select{max-width:none}.device-table-footer{grid-template-columns:1fr;justify-items:center}.device-table-footer>label{justify-self:center}.device-compact-table{min-width:790px}.device-inspector{right:8px;top:72px;bottom:8px;width:calc(100vw - 16px)}}

/* V0.3.125 — accès direct à l’interface depuis le nom ou l’icône */
.device-direct-access, .device-inspector-direct-access {
  appearance: none; border: 0; background: transparent; color: inherit; box-shadow: none;
  padding: 0; margin: 0; text-align: left; font: inherit; cursor: pointer; width: 100%;
}
.device-direct-access:hover, .device-direct-access:focus-visible,
.device-inspector-direct-access:hover, .device-inspector-direct-access:focus-visible {
  transform: none; background: transparent; box-shadow: none; outline: none;
}
.device-direct-access:hover strong, .device-direct-access:focus-visible strong,
.device-inspector-direct-access:hover h3, .device-inspector-direct-access:focus-visible h3 { color: #46d7ff; text-decoration: underline; text-underline-offset: 3px; }
.device-direct-access:hover img, .device-direct-access:focus-visible img,
.device-inspector-direct-access:hover img, .device-inspector-direct-access:focus-visible img {
  box-shadow: 0 0 0 2px rgba(33,199,255,.45), 0 0 18px rgba(33,199,255,.20);
}

/* V0.3.127 — diagnostic DiO / Chacon Wi-Fi local intégré */
.dio-local-dialog{width:min(900px,calc(100vw - 28px));max-width:900px}.dio-local-dialog .dialog-form{min-height:0}.dio-diagnostic-result,.dio-learning-section,.dio-learning-status{display:grid;gap:12px}.dio-learning-section{margin-top:16px;padding-top:14px;border-top:1px solid #29485f}.dio-summary-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}.dio-summary-grid.compact{margin-top:8px}.dio-summary-grid>div{display:grid;gap:4px;padding:10px;border:1px solid #28485f;border-radius:10px;background:#0a2032}.dio-summary-grid span:first-child{font-size:.72rem;color:#83a5b9}.dio-summary-grid small{font-size:.68rem;color:#6f91a6}.dio-result-block{display:grid;gap:7px}.dio-port-pill,.dio-marker-pill,.dio-peer{display:inline-flex;align-items:center;margin:2px 4px 2px 0;padding:4px 7px;border-radius:999px;border:1px solid #31556d;background:#0b2639;font-size:.72rem}.dio-marker-pill{border-color:#346b84}.dio-peer.local{border-color:#297a67}.dio-peer.public{border-color:#8b5b36}.dio-learning-controls{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}.dio-learning-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}.dio-learning-head>strong{max-width:70%}.dio-learning-status{padding:12px;border:1px solid #28485f;border-radius:12px;background:#071c2d}@media(max-width:720px){.dio-summary-grid,.dio-learning-controls{grid-template-columns:1fr}.dio-learning-head{display:grid}.dio-learning-head>strong{max-width:none}}
