:root{font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:#eef8f8;background:#07171c;line-height:1.45;--glass:rgba(5,32,39,.42);--line:rgba(255,255,255,.19);--muted:#a8bec1;--accent:#69e8e6;--ok:#62d9a0;--warn:#efc466;--bad:#ff8a8a}
*{box-sizing:border-box}html,body{min-height:100%}body{margin:0;min-height:100vh;color:#eef8f8;background:radial-gradient(circle at 15% 7%,rgba(54,138,144,.30),transparent 34%),radial-gradient(circle at 90% 19%,rgba(78,87,172,.19),transparent 35%),radial-gradient(circle at 64% 89%,rgba(21,105,102,.14),transparent 47%),linear-gradient(150deg,#0b2430 0%,#091720 45%,#071419 100%);background-attachment:fixed}
a{color:inherit;text-decoration:none}button,input,select{font:inherit}button{cursor:pointer}button:disabled{opacity:.45;cursor:not-allowed}
/* Shared EKMIO form foundation. Applies to Core, Backbone, engine editors and feature pages.
   Low-specificity :where() rules intentionally let component-specific controls override defaults. */
:root{color-scheme:dark}
:where(input:not([type]),input:is([type="text"],[type="number"],[type="search"],[type="password"],[type="email"],[type="url"],[type="tel"],[type="date"],[type="time"],[type="datetime-local"],[type="month"],[type="week"]),select,textarea){
  box-sizing:border-box;
  min-width:0;max-width:100%;min-height:42px;
  padding:10px 12px;
  border:1px solid rgba(255,255,255,.19);
  border-radius:10px;
  background:rgba(7,33,41,.90);
  color:#edfafa;
  color-scheme:dark;
  outline:none;
  transition:border-color .15s ease,box-shadow .15s ease;
}
:where(input:not([type]),input:is([type="text"],[type="number"],[type="search"],[type="password"],[type="email"],[type="url"],[type="tel"],[type="date"],[type="time"],[type="datetime-local"],[type="month"],[type="week"]),select,textarea):focus{
  border-color:var(--accent);
  box-shadow:0 0 0 3px rgba(105,232,230,.13);
}
:where(input,textarea)::placeholder{color:#95b2b5}
:where(select option,select optgroup){background:#102b35;color:#edfafa}
:where(textarea){resize:vertical;font:inherit;line-height:1.5}
:where(input[type="checkbox"],input[type="radio"],input[type="range"]){accent-color:var(--accent);color-scheme:dark}
:where(input[type="color"],input[type="file"]){color-scheme:dark}
:where(input[type="file"]){color:#edfafa;max-width:100%}
:where(input[type="file"]::file-selector-button){
  padding:9px 12px;margin-right:10px;border-radius:9px;
  color:#edfafa;background:rgba(255,255,255,.085);border:1px solid rgba(255,255,255,.20);
  font:inherit;cursor:pointer;
}
:where(.field-grid > label:not(:has(> input:is([type="checkbox"],[type="radio"])))){
  display:flex;flex-direction:column;gap:7px;min-width:0;color:#cbdfe0;
}
:where(.field-grid > label:has(> input[type="checkbox"]),.field-grid > label:has(> input[type="radio"])){
  display:flex;flex-direction:row;align-items:center;gap:9px;
}

.topbar{display:flex;justify-content:space-between;align-items:center;gap:24px;width:min(calc(100% - 32px),1190px);margin:16px auto 0;padding:16px 22px;min-height:70px;border:1.5px solid var(--line);border-radius:17px;background:rgba(5,32,39,.33);backdrop-filter:blur(18px) saturate(120%);box-shadow:inset 0 1px rgba(255,255,255,.08),0 16px 40px rgba(0,0,0,.12)}
.brand{font-size:21px;font-weight:800;letter-spacing:-.035em;white-space:nowrap}.brand span{font-weight:450;color:#b7d0d2}.mainnav{display:flex;gap:8px;align-items:center;flex:1;margin-left:34px}.mainnav a{padding:9px 13px;border-radius:10px;font-size:14px;color:#c0d1d3;transition:.14s}.mainnav a.active,.mainnav a:hover{background:rgba(255,255,255,.10);color:#fff}.userbar{font-size:13px;color:#c2d9de;display:flex;gap:12px;align-items:center}.logout{background:transparent;border:0;color:#c6e5e8;font-size:13px}
.page{width:min(100%,1180px);margin:0 auto;padding:45px 28px 70px}.hero{display:flex;align-items:center;justify-content:space-between;gap:22px;margin:0 0 29px}.hero h1{font-size:clamp(28px,3.8vw,37px);letter-spacing:-.045em;margin:5px 0}.hero p{color:var(--muted);margin:7px 0;max-width:660px}.eyebrow{font-size:11px;font-weight:800;letter-spacing:.14em;text-transform:uppercase;color:#81dcd9}.muted{color:var(--muted)}.small{font-size:13px}.lead{font-size:15px;line-height:1.6}
.glass,.card,.statbar{border:1.5px solid var(--line);background:var(--glass);backdrop-filter:blur(20px) saturate(118%);box-shadow:inset 0 1px 0 rgba(255,255,255,.07),0 20px 45px rgba(0,0,0,.12);border-radius:18px}.card{padding:23px;min-width:0;display:flex;flex-direction:column;gap:13px}.cardhead{display:flex;align-items:center;gap:14px}.card-title{font-size:17px;font-weight:750;color:#fbffff;margin:2px 0 0}.iconbox{width:42px;height:42px;border-radius:13px;border:1px solid rgba(255,255,255,.12);background:rgba(111,234,223,.10);color:#a6f1ea;display:grid;place-items:center;font-size:21px;flex:0 0 auto}.cardhead .dot{margin-left:auto}.dot{height:10px;width:10px;flex:0 0 auto;border-radius:50%;background:#83939a;box-shadow:0 0 13px rgba(255,255,255,.1)}.dot.ok{background:var(--ok);box-shadow:0 0 14px rgba(98,217,160,.42)}.dot.pending{background:var(--warn);box-shadow:0 0 14px rgba(239,196,102,.3)}.dot.bad{background:var(--bad);box-shadow:0 0 14px rgba(255,138,138,.28)}.card-sub{font-size:12px;color:#9db7bb;margin:0}.card-desc{color:#bacace;font-size:13px;line-height:1.58;margin:0;min-height:42px}.grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px}.integration-stats{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:2px 0 0}.integration-stats>div{border-top:1px solid rgba(255,255,255,.10);padding:12px 0 2px}.integration-stats span{display:block;font-size:10px;font-weight:800;color:#84afb5;text-transform:uppercase;letter-spacing:.08em}.integration-stats strong{display:block;font-size:20px;letter-spacing:-.02em;margin-top:7px;color:#fff;font-weight:740}.statusline{display:flex;align-items:center;gap:7px;color:#c7dfe0;font-size:12px}.card-actions{display:flex;gap:10px;margin-top:auto;padding-top:5px;flex-wrap:wrap}
.primary,.secondary,.danger{border-radius:11px;padding:11px 16px;font-weight:750;font-size:13px;display:inline-flex;gap:8px;align-items:center;justify-content:center;border:1px solid rgba(255,255,255,.18);transition:.16s ease}
.primary{background:linear-gradient(145deg,rgba(52,157,159,.85),rgba(26,112,119,.88));border-color:rgba(117,242,239,.55);color:#fff}.secondary{background:rgba(255,255,255,.07);color:#eaf5f5}.primary:hover,.secondary:hover{filter:brightness(1.12);transform:translateY(-1px)}
.badge{border:1px solid rgba(255,255,255,.15);padding:5px 9px;color:#c2d7d9;background:rgba(255,255,255,.065);font-size:11px;border-radius:999px;white-space:nowrap}.badge.warn{color:#eacb89;border-color:rgba(239,196,102,.25);background:rgba(239,196,102,.08)}.badge.ok{color:#98edc1;border-color:rgba(98,217,160,.25);background:rgba(98,217,160,.08)}
.overview{display:flex;flex-wrap:wrap;align-items:center;gap:13px;padding:15px 19px;margin-bottom:25px}.section-heading{font-size:18px;font-weight:760;margin:27px 0 16px}.overview>span:not(:first-child){font-size:13px;color:#bed1d3}.spacer{flex:1}.detail-layout{display:grid;grid-template-columns:minmax(0,1.3fr) minmax(260px,.7fr);gap:18px;align-items:start}.detail-panel{padding:25px}.detail-panel h2{font-size:16px;margin:0 0 10px}.field-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}.formfield{display:flex;flex-direction:column;gap:7px;min-width:0}.formfield label{font-size:13px;color:#d0e2e3;font-weight:700}.control-wrap{position:relative}.control-wrap input,.control-wrap select{width:100%;background:rgba(255,255,255,.075);border:1px solid rgba(255,255,255,.19);color:#fff;border-radius:11px;padding:12px 13px;outline:0;min-width:0}.control-wrap select option{background:#102631;color:white}.control-wrap input:focus,.control-wrap select:focus{border-color:#74e9e4;box-shadow:0 0 0 3px rgba(105,232,230,.10)}.control-wrap input::placeholder{color:#a4b8ba}.control-wrap.has-unit input{padding-right:62px}.unit{position:absolute;right:13px;top:50%;transform:translateY(-50%);color:#91c2c4;font-size:12px;pointer-events:none}.fieldhelp{color:#91a9ac;font-size:11px}.form-section{margin:23px 0 18px;padding-bottom:10px;border-bottom:1px solid rgba(255,255,255,.11)}.form-footer{display:flex;align-items:center;justify-content:flex-end;gap:12px;margin-top:22px;flex-wrap:wrap}.credential{margin-bottom:14px}.credential-input{display:flex;gap:8px}.credential-input .control-wrap{flex:1}.credential-row{display:flex;gap:10px;align-items:center;justify-content:space-between}.remove-credential{font-size:12px;color:#edaaaa;display:flex;align-items:center;gap:6px}.info{border-radius:12px;padding:12px 14px;background:rgba(77,173,183,.09);border:1px solid rgba(100,210,209,.18);color:#c3dfe1;font-size:13px;line-height:1.58}.alert{color:#ffd5d5;background:rgba(185,47,47,.13);border:1px solid rgba(255,138,138,.29);border-radius:12px;padding:12px 14px;font-size:13px}.success{color:#aaf0ce;background:rgba(45,158,105,.12);border:1px solid rgba(98,217,160,.27);border-radius:12px;padding:12px 14px;font-size:13px}
.kpi-list{display:grid;gap:10px;margin-top:12px}.kpi-row{display:flex;align-items:center;justify-content:space-between;gap:12px;font-size:13px;color:#afc3c7;padding:10px 0;border-bottom:1px solid rgba(255,255,255,.1)}.kpi-row b{color:#e7f4f4}.kpi-row:last-child{border:0}.debug-panel{padding:22px}.debug-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:12px}.debug-stat{border-radius:14px;border:1px solid rgba(255,255,255,.14);background:rgba(255,255,255,.045);padding:16px}.debug-stat span{display:block;color:#a9c0c1;font-size:11px}.debug-stat strong{display:block;font-size:26px;margin-top:5px}.controls{display:flex;flex-wrap:wrap;gap:9px;margin:12px 0 18px}.controls button{min-width:50px}.control-group{margin-top:23px;border-top:1px solid rgba(255,255,255,.11);padding-top:19px}.control-group h3{font-size:14px;margin:0 0 10px;color:#eaf6f6}.sim-banner{padding:15px 17px;border-radius:13px;border:1px solid rgba(239,196,102,.26);background:rgba(185,142,53,.12);color:#f2d7a0;display:flex;align-items:center;gap:12px;font-size:13px}.events{display:grid;gap:10px;margin-top:12px}.event{padding:12px;border:1px solid rgba(255,255,255,.09);border-radius:11px;background:rgba(255,255,255,.04);font-size:12px;display:flex;justify-content:space-between;gap:15px;color:#bed2d3}
.login{width:min(100% - 32px,465px);margin:72px auto;padding:35px}.login h1{font-size:28px;margin:10px 0}.login form{display:grid;gap:16px;margin-top:23px}.login label{font-size:13px;font-weight:750}.login input{width:100%;margin-top:8px;padding:13px 14px;background:rgba(255,255,255,.085);border:1px solid var(--line);border-radius:11px;color:#fff}.login input:focus{outline:2px solid rgba(105,232,230,.5)}.login .primary{width:100%}.login .muted{line-height:1.6}
.footer{text-align:center;color:#819d9f;font-size:12px;padding:10px 0 35px}.loading{text-align:center;padding:100px 12px;color:#bdd1d1}.hidden{display:none!important}
@media(max-width:900px){.detail-layout{grid-template-columns:1fr}.mainnav{margin-left:0}.grid{grid-template-columns:1fr 1fr}}
@media(max-width:660px){.topbar{margin:10px auto 0;width:calc(100% - 20px);padding:13px 15px;flex-wrap:wrap;gap:10px}.brand{font-size:18px}.mainnav{order:3;width:100%}.mainnav a{padding:6px 12px}.userbar{margin-left:auto}.page{padding:30px 16px 40px}.hero{align-items:flex-start;flex-direction:column;gap:10px}.grid{grid-template-columns:1fr}.field-grid{grid-template-columns:1fr}.debug-grid{grid-template-columns:1fr 1fr}.card{padding:19px}.login{margin:40px auto}}
\n.stat-small{font-size:15px!important}.info-margined{margin-top:20px}.full-action{margin-top:18px;display:flex}.notice-gap{margin-top:15px}.panel-gap{margin-top:20px}.sim-icon{font-size:22px}.debug-status{font-size:20px!important}.credential-label{font-size:13px;font-weight:750}\n
.maintenance-inline{display:flex;align-items:center;gap:9px;border:1px solid rgba(239,196,102,.21);background:rgba(239,196,102,.075);border-radius:12px;padding:11px 13px;color:#e9e0c2;font-size:12px;flex-wrap:wrap}
.maintenance-inline .dot{margin-right:2px}
.maintenance-inline b{font-weight:750}
.maintenance-panel{margin:25px 0 0;padding:19px;border-radius:14px;border:1px solid rgba(105,232,230,.18);background:rgba(255,255,255,.035);display:flex;flex-direction:column;gap:10px}
.maintenance-panel .section-heading{margin:3px 0 5px}
.maintenance-panel p{margin:2px 0}
.maintenance-metric{font-size:26px;font-weight:750;letter-spacing:-.02em}
.maintenance-metric small{font-size:13px;font-weight:500}
.filter-track{width:100%;height:8px;border-radius:99px;background:rgba(255,255,255,.1);overflow:hidden}
.filter-bar{height:100%;background:linear-gradient(90deg,#4dc9bf,#e7c374);border-radius:99px}

/* MELCloud debug: compact persistent event journal */
.log-panel{margin-top:28px;padding-top:22px}
.log-heading{display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;gap:14px}
.log-heading h3{font-size:17px;margin:0 0 5px}
.log-toolbar{display:flex;gap:12px;flex-wrap:wrap;align-items:flex-end;margin:17px 0 16px}
.log-toolbar label{font-size:11px;font-weight:650;color:#afc5c6;display:flex;flex-direction:column;gap:6px}
.log-toolbar select{min-width:135px;background:rgba(7,28,35,.92);color:#e8f5f6;border:1px solid rgba(255,255,255,.17);border-radius:10px;padding:10px 12px;font:inherit;font-size:12px}
.log-toolbar button{min-height:38px}
.log-items{display:grid;gap:8px;max-height:600px;overflow-y:auto;padding-right:3px}
.log-entry{border:1px solid rgba(255,255,255,.1);background:rgba(255,255,255,.035);border-radius:11px;padding:12px 14px}
.log-entry.log-error{border-color:rgba(247,145,125,.27);background:rgba(172,63,47,.09)}
.log-entry-head{display:flex;align-items:center;gap:8px;font-size:12px;flex-wrap:wrap}
.log-entry-head strong{color:#eaf6f6}
.log-entry-head time{color:#90aeb0;margin-left:auto;font-variant-numeric:tabular-nums;font-size:11px}
.log-symbol{color:#7bded5}
.log-error .log-symbol{color:#ffa78a}
.log-changes{margin:9px 0 0;display:grid;gap:4px}
.log-change{display:grid;grid-template-columns:minmax(120px,1fr) minmax(130px,2fr);gap:12px;font-size:12px;line-height:1.5;color:#c0d5d6}
.log-change span:first-child{color:#9ebec0}
.log-change span:nth-child(2){overflow-wrap:anywhere}
.log-arrow{color:#73dacf}
.log-footer{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap;margin-top:14px}
.log-pages{display:flex;gap:8px}
.log-pages button:disabled{opacity:.4;cursor:not-allowed}
@media(max-width:660px){.log-change{grid-template-columns:1fr;gap:0}.log-entry-head time{width:100%;margin-left:22px}.log-toolbar label{flex:1}}

/* MELCloud debug: refresh button and reading timestamp */
.debug-panel .row-actions{display:flex;align-items:center;justify-content:flex-start;gap:14px;flex-wrap:wrap;margin-bottom:18px}
.debug-panel .row-actions .small{white-space:nowrap}
@media(max-width:520px){.debug-panel .row-actions{align-items:stretch;gap:9px}.debug-panel .row-actions #refresh-heatpump{width:100%}.debug-panel .row-actions .small{display:block}}

.bus-heading{display:flex;align-items:center;justify-content:space-between;gap:12px}
.bus-heading .section-heading{margin:0 0 16px}
.bus-stats{margin:5px 0 24px}
.bus-members{display:grid;gap:9px;margin-top:12px}
.bus-member{display:flex;align-items:center;gap:12px;padding:13px 15px;border:1px solid rgba(255,255,255,.12);border-radius:12px;background:rgba(255,255,255,.035);font-size:13px}
.bus-member b{color:#eaf6f6}
@media(max-width:650px){.bus-member{flex-wrap:wrap}.bus-member>.muted{margin-left:21px}}

/* Bus engine identities, approvals, and per-target grants */
.bus-acl-list{display:grid;gap:13px;margin-top:18px}
.bus-acl-engine{border:1px solid rgba(255,255,255,.13);border-radius:14px;overflow:hidden;background:rgba(255,255,255,.025)}
.bus-acl-head{padding:15px 17px;display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap;background:rgba(255,255,255,.035)}
.bus-acl-head b,.bus-acl-row b{color:#eaf6f6;font-size:13px}
.bus-acl-head button{font-size:12px}
.bus-acl-rows{padding:5px 17px 10px}
.bus-acl-row{display:grid;grid-template-columns:minmax(125px,1fr) 95px 105px;gap:10px;align-items:center;padding:12px 0;border-bottom:1px solid rgba(255,255,255,.08)}
.bus-acl-row:last-child{border-bottom:0}
.bus-acl-row label{display:flex;align-items:center;gap:8px;color:#c2d5d7;font-size:12px;cursor:pointer}
.bus-acl-row input{accent-color:#5bcac4;width:16px;height:16px;cursor:pointer}
@media(max-width:530px){.bus-acl-row{grid-template-columns:minmax(90px,1fr) 65px 80px;gap:5px}.bus-acl-rows{padding-left:11px;padding-right:11px}.bus-acl-row label{gap:3px;font-size:11px}}


/* Motor-published cards: only presentation differences live in the UI. */
.grid .engine-card.card-wide{grid-column:span 2}
.grid .engine-card.card-highlight{border-color:rgba(105,232,230,.7);box-shadow:0 0 0 1px rgba(105,232,230,.16),0 16px 40px rgba(0,0,0,.14)}
.engine-card .integration-stats{grid-template-columns:repeat(2,minmax(0,1fr))}
.engine-card .integration-stats strong{overflow-wrap:anywhere}
#card-layout-form input[type="checkbox"]{width:17px;height:17px;accent-color:#69e8e6}
#card-layout-form p{margin:19px 0}
@media(max-width:760px){.grid .engine-card.card-wide{grid-column:auto}}


/* Shelly: one responsive card per physical device; raw MQTT never widens the layout. */
.shelly-toolbar{padding:20px;min-width:0;max-width:100%}
.shelly-overview{display:flex;gap:12px 22px;flex-wrap:wrap;color:#aec8ca;font-size:13px;padding-bottom:16px}
.shelly-overview strong{color:#f5ffff;font-size:18px;font-variant-numeric:tabular-nums;margin-right:4px}
.shelly-filters{display:flex;flex-wrap:wrap;align-items:center;gap:9px}
.shelly-filters input,.shelly-filters select{
  color:#eaf4f6;background:rgba(6,31,38,.93);border:1px solid rgba(255,255,255,.20);
  border-radius:10px;min-height:42px;padding:10px 12px;font:inherit;font-size:13px;min-width:0
}
.shelly-filters input{flex:1 1 230px;max-width:480px}
.shelly-filters select{flex:0 1 200px}
.shelly-toolbar>.small{margin:15px 0 0;line-height:1.5}
.shelly-count{margin:19px 0 10px}
.shelly-device-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,320px),1fr));gap:16px;align-items:start;min-width:0;max-width:100%}
.shelly-device-card{
  border-radius:16px;padding:18px;display:flex;flex-direction:column;gap:14px;
  min-width:0;max-width:100%;overflow:hidden
}
.shelly-device-card *{min-width:0;max-width:100%;box-sizing:border-box}
.shelly-device-head{display:flex;justify-content:space-between;align-items:flex-start;flex-wrap:wrap;gap:9px}
.shelly-device-heading{flex:1 1 165px}
.shelly-device-heading h2{
  font-size:15px;font-weight:760;line-height:1.4;color:#f6fefe;margin:0 0 3px;
  overflow-wrap:anywhere
}
.shelly-device-heading>span{display:block;font-size:11px;color:#91b4b9}
.shelly-state{
  display:inline-block;max-width:100%;flex:0 1 auto;padding:5px 9px;
  font-size:10px;line-height:1.4;border:1px solid rgba(255,255,255,.17);
  border-radius:24px;color:#b4c8cb;background:rgba(255,255,255,.045);overflow-wrap:anywhere
}
.shelly-state.is-fresh{color:#a7ebd0;border-color:rgba(100,212,165,.30);background:rgba(85,202,144,.10)}
.shelly-state.is-stale{color:#f1d6a8;border-color:rgba(234,194,121,.24);background:rgba(190,144,56,.1)}
.shelly-device-readings{
  display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;min-width:0
}
.shelly-reading{padding:10px 11px;background:rgba(255,255,255,.04);border:1px solid rgba(255,255,255,.09);border-radius:10px;min-width:0}
.shelly-reading span{font-size:10px;color:#a3bfc1;display:block;overflow-wrap:anywhere}
.shelly-reading strong{display:block;color:#f7ffff;font-size:16px;margin-top:4px;overflow-wrap:anywhere;font-variant-numeric:tabular-nums}
.shelly-device-readings>p{grid-column:1/-1;margin:4px 0}
.shelly-device-foot{display:flex;gap:8px 18px;flex-wrap:wrap;font-size:11px;color:#9bb8bc;overflow-wrap:anywhere}
.shelly-raw{border-top:1px solid rgba(255,255,255,.12);padding-top:11px;width:100%;min-width:0}
.shelly-raw summary{font-size:12px;font-weight:650;color:#a9e3df;cursor:pointer;user-select:none;overflow-wrap:anywhere}
.shelly-raw-inner{display:grid;gap:9px;padding-top:13px;min-width:0}
.shelly-raw-inner p{margin:0;font-size:11px;line-height:1.5}
.shelly-device-id{overflow-wrap:anywhere;word-break:break-word}
.shelly-component{border:1px solid rgba(255,255,255,.1);border-radius:10px;background:rgba(0,0,0,.11);padding:10px;min-width:0;overflow:hidden}
.shelly-component>b{display:block;color:#bfd9db;font-size:11px;overflow-wrap:anywhere}
.shelly-component pre{
  display:block;font-size:10px;line-height:1.5;color:#c5d9db;margin:6px 0 0;
  white-space:pre-wrap;overflow-wrap:anywhere;word-break:break-word;
  min-width:0;max-width:100%;max-height:260px;overflow:auto
}
.shelly-control-group{padding:12px 0 4px;display:grid;gap:8px}
.shelly-control-group>b{font-size:12px;color:#d4edef;overflow-wrap:anywhere}
.shelly-actions{display:flex;flex-wrap:wrap;gap:7px}
.shelly-actions button{font-size:11px;min-height:32px}
@media(max-width:540px){
 .shelly-toolbar{padding:15px}
 .shelly-device-card{padding:14px}
 .shelly-filters input,.shelly-filters select,.shelly-filters button{width:100%;max-width:none;flex:1 1 100%}
 .shelly-device-readings{grid-template-columns:repeat(2,minmax(0,1fr))}
}


/* Shelly per-device typed controls: compact enough for 320px cards. */
.shelly-device-controls{
  min-width:0;width:100%;border-top:1px solid rgba(255,255,255,.13);
  padding-top:13px;display:grid;gap:12px
}
.shelly-device-controls>h3{font-size:13px;font-weight:760;margin:0;color:#effbfb}
.shelly-control-group{display:grid;gap:8px;min-width:0}
.shelly-control-group>label{display:block;font-size:12px;font-weight:670;color:#c2dfe0;overflow-wrap:anywhere}
.shelly-range-output{font-variant-numeric:tabular-nums;font-weight:760;color:#f4ffff;margin-left:7px}
.shelly-range{display:flex;align-items:center;gap:9px;min-width:0}
.shelly-range input[type=range]{flex:1 1 auto;width:100%;min-width:0;accent-color:#64d9d1}
.shelly-range>button{flex:0 0 auto;font-size:11px;padding:9px 13px}
.shelly-device-controls .shelly-actions{margin:0}
.shelly-device-controls .shelly-actions button{flex:1 1 65px;min-width:0;padding:9px 11px;max-width:100%}
.shelly-rgbw-fields{display:grid;grid-template-columns:minmax(0,.8fr) repeat(2,minmax(0,1fr));gap:7px;align-items:end}
.shelly-rgbw-fields label{font-size:10px;color:#a6c6c8;display:grid;gap:5px;min-width:0}
.shelly-rgbw-fields input{background:rgba(10,37,45,.80);color:#eaf7f7;border:1px solid rgba(255,255,255,.19);border-radius:8px;padding:7px;min-width:0;width:100%;font-size:12px}
.shelly-rgbw-fields input[type=color]{height:36px;padding:3px}
.shelly-rgbw-fields button{grid-column:1/-1;width:100%;font-size:12px;padding:9px 13px}
.shelly-control-status{display:flex;justify-content:space-between;gap:12px;font-size:12px;color:#afc6c9;overflow-wrap:anywhere}
.shelly-control-status b{font-weight:700;color:#effafa;flex:0 0 auto}
.shelly-control-notice{margin:0;font-size:11px;line-height:1.55;color:#e7d1a6;overflow-wrap:anywhere}
.shelly-control-locked{margin:0;padding:9px 10px;background:rgba(255,255,255,.035);border-radius:9px;line-height:1.5}
.shelly-device-controls button:disabled,.shelly-device-controls input:disabled{opacity:.46;cursor:not-allowed}


/* Shelly Opple calibration editor: compact, scroll-safe inside each light card. */
.shelly-calibration{margin-top:3px}
.shelly-cal-editor{padding-top:13px;display:grid;gap:14px;min-width:0}
.shelly-cal-editor>p{margin:0;line-height:1.5}
.shelly-cal-settings{display:grid;grid-template-columns:1fr;gap:9px;min-width:0}
.shelly-cal-settings>label,.shelly-cal-measure>label,.shelly-cal-payload>label{
  display:flex;flex-direction:column;gap:5px;font-size:10px;color:#b8d1d3;min-width:0
}
.shelly-cal-settings .shelly-cal-check{display:flex;align-items:center;flex-direction:row;gap:7px;font-size:11px}
.shelly-cal-settings input[type=checkbox]{accent-color:#65d8d1;width:16px;height:16px;flex:0 0 16px}
.shelly-cal-editor input[type=number]{
  width:100%;max-width:100%;min-width:0;color:#eaf6f6;
  background:rgba(8,32,41,.9);border:1px solid rgba(255,255,255,.18);border-radius:8px;
  padding:8px 6px;font-size:12px;box-sizing:border-box
}
.shelly-cal-settings input[type=number]{max-width:130px}
.shelly-cal-points{display:grid;gap:10px;min-width:0}
.shelly-cal-row{
  min-width:0;max-width:100%;display:grid;gap:10px;
  border:1px solid rgba(255,255,255,.13);border-radius:11px;padding:11px;
  background:rgba(255,255,255,.03)
}
.shelly-cal-measure{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.shelly-cal-measure>label:first-child{grid-column:1}
.shelly-cal-payload{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.shelly-cal-remove{font-size:11px;justify-self:start;padding:8px 10px}
.shelly-cal-toolbar{display:flex;gap:8px;flex-wrap:wrap}
.shelly-cal-toolbar button{flex:1 1 115px;min-width:0;font-size:11px;padding:10px}
.shelly-cal-notice{min-height:18px;overflow-wrap:anywhere}
.shelly-calibrated-control input[type=range]{width:100%;min-width:0;accent-color:#63d7d0}
.shelly-calibrated-control button{font-size:11px;min-height:36px}

/* Backbone module catalog */
.backbone-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.backbone-item{border:1px solid var(--line);border-radius:12px;padding:13px;display:flex;align-items:flex-start;gap:12px;min-width:0;cursor:pointer;background:rgba(255,255,255,.035)}
.backbone-item input{margin-top:4px;flex-shrink:0;accent-color:var(--accent)}
.backbone-item span{min-width:0;overflow-wrap:anywhere}
.backbone-item strong,.backbone-item small{display:block}
.backbone-item small{font-size:12px;margin-top:4px;color:var(--muted)}
.backbone-channel{border-bottom:1px solid var(--line);padding:10px 0}
.backbone-channel small{display:block;color:var(--muted);margin-top:5px}
.mainnav{flex-wrap:wrap;min-width:0}
@media(max-width:700px){.backbone-grid{grid-template-columns:1fr}.topbar{flex-wrap:wrap}.mainnav{order:3;width:100%;margin-left:0;overflow-x:auto;flex-wrap:nowrap}}

/* Ekmio categories: system overview, feature cards and engine cards */
.feature-section-heading{margin-top:28px}
.feature-light-card .feature-caps{font-size:13px;overflow-wrap:anywhere}
.feature-light-card .integration-stats{grid-template-columns:1fr 2fr}
.feature-light-card .card-sub{min-height:0}

/* Keep site names readable, even on compact devices */
.topbar .brand{max-width:min(40vw,340px);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.login input{display:block;max-width:100%;box-sizing:border-box}

/* EKMIO Core updater: keep actions aligned, readable and responsive. */
.row-actions{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}
.row-actions>div{min-width:0;flex:1 1 230px}
.row-actions button{flex:0 0 auto}
#ekmio-core-progress:empty{display:none}
#ekmio-core-section .backbone-channel strong{font-variant-numeric:tabular-nums}
@media(max-width:660px){#ekmio-core-section .row-actions>button{max-width:100%;width:100%}}


/* EKMIO Dashboard: modular cards and editor */
.dashboard-grid{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:16px;align-items:stretch}
.dashboard-tile{padding:18px;min-width:0;min-height:155px;display:flex;flex-direction:column;gap:14px;order:var(--dash-order)}
.dashboard-tile.size-S{grid-column:span 2}.dashboard-tile.size-M{grid-column:span 3}.dashboard-tile.size-L{grid-column:span 6}
.dashboard-tile-header{display:flex;align-items:center;gap:12px;min-width:0}
.dashboard-tile-header>div{min-width:0;flex:1}.dashboard-tile-header h2{font-size:15px;font-weight:750;margin:0 0 2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.dashboard-tile-header .small{font-size:11px}.dashboard-tile-icon{color:var(--dash-color);border:1px solid rgba(255,255,255,.15);background:rgba(255,255,255,.05);border-radius:12px;display:grid;place-items:center;width:39px;height:39px;font-size:23px;flex:0 0 auto}
.dashboard-size{border:1px solid var(--line);border-radius:8px;padding:2px 8px;color:var(--muted);font-size:11px}
.dashboard-tile-body{flex:1;display:flex;flex-direction:column;justify-content:center;min-width:0}
.dashboard-reading{display:flex;align-items:center;gap:14px;min-width:0}.dashboard-symbol{font-size:30px;flex:0 0 auto}
.dashboard-number{font-size:clamp(26px,3vw,39px);font-weight:760;line-height:1.2;letter-spacing:-.045em;font-variant-numeric:tabular-nums;min-width:0;overflow-wrap:anywhere}
.dashboard-number small{font-size:14px;font-weight:500;letter-spacing:0;color:var(--muted);margin-left:7px}
.dashboard-secondary{font-size:12px;color:var(--muted);margin-top:9px}
.dashboard-values{display:grid;grid-template-columns:repeat(auto-fit,minmax(170px,1fr));gap:10px}
.dashboard-value-row{display:flex;align-items:center;justify-content:space-between;gap:12px;border-bottom:1px solid rgba(255,255,255,.1);padding:9px 2px;font-size:13px}
.dashboard-value-row>span{color:var(--muted);min-width:0}.dashboard-value-row strong{font-variant-numeric:tabular-nums;text-align:right}
.dashboard-value-row small{font-size:11px;color:var(--muted)}
.dashboard-chart{height:205px;min-width:0;width:100%}.dashboard-tile.size-S .dashboard-chart{height:130px}.dashboard-tile.size-L .dashboard-chart{height:250px}
.dashboard-chart-note{font-size:12px;color:var(--muted);min-height:0}
.dashboard-control{display:flex;gap:14px;align-items:center;flex-wrap:wrap}
.dashboard-control-form{display:flex;gap:8px;align-items:center}.dashboard-control-form input{max-width:105px}
.dashboard-toolbar{display:flex;align-items:center;gap:16px;flex-wrap:wrap;margin:0 0 22px}
.dashboard-tools{display:flex;gap:5px;flex-wrap:wrap;border-top:1px solid rgba(255,255,255,.1);padding-top:10px}
.dashboard-tools button{font-size:11px;padding:5px 9px;min-height:29px}
.dashboard-footer{margin:20px 0 0}
.dashboard-editor{margin-bottom:22px}
.dashboard-editor-grid{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:25px;margin:18px 0}
.dashboard-editor-main,.dashboard-editor-points{min-width:0;display:flex;flex-direction:column;gap:14px}
.dashboard-editor label{display:flex;flex-direction:column;gap:6px;font-size:13px;color:var(--muted)}
.dashboard-editor input,.dashboard-editor select{width:100%;padding:10px 12px;border:1px solid var(--line);background:rgba(4,24,29,.75);color:#efffff;border-radius:10px;min-height:43px}
.dashboard-form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.dashboard-point-list{max-height:380px;overflow:auto;display:flex;flex-direction:column;gap:8px;padding:2px 8px 2px 0}
.dashboard-point-group{border:1px solid var(--line);border-radius:12px;padding:10px;min-width:0}
.dashboard-point-group legend{font-size:13px;color:#b7e9e8;font-weight:700;padding:0 7px}
.dashboard-point-option{display:flex!important;flex-direction:row!important;align-items:center;gap:9px;padding:6px 3px;cursor:pointer;color:#e4f3f3!important}
.dashboard-point-option[hidden]{display:none!important}
.dashboard-point-option input{width:17px;height:17px;min-height:0;accent-color:var(--accent)}
.dashboard-point-option span{display:flex;flex-direction:column;min-width:0}
.dashboard-point-option small{font-size:11px;color:var(--muted)}
@media(max-width:860px){
 .dashboard-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
 .dashboard-tile{order:var(--dash-mobile-order)}
 .dashboard-tile.size-S{grid-column:span 1}.dashboard-tile.size-M,.dashboard-tile.size-L{grid-column:span 2}
 .dashboard-editor-grid{grid-template-columns:1fr}
}
@media(max-width:520px){
 .dashboard-tile{padding:13px;min-height:140px;gap:10px}
 .dashboard-tile.size-S .dashboard-tile-icon{width:30px;height:30px;font-size:17px}
 .dashboard-tile.size-S .dashboard-tile-header h2{font-size:12px}
 .dashboard-tile.size-S .dashboard-reading{gap:7px}
 .dashboard-tile.size-S .dashboard-number{font-size:23px}
 .dashboard-tile.size-S .dashboard-number small{font-size:11px;margin-left:3px}
 .dashboard-tile.size-S .dashboard-symbol{font-size:18px}
 .dashboard-form-grid{grid-template-columns:1fr}
 .dashboard-values{grid-template-columns:1fr}
}

/* Heating optimizer v3: engine-independent, responsive visualizations */
.heating-chart{width:100%;height:300px;min-width:0;display:block}
.heating-chart-small{height:260px}
.heating-check{flex-direction:row!important;align-items:center;gap:8px}
.heating-check input{flex:0 0 auto;width:18px;height:18px;min-height:0}
@media(max-width:620px){.heating-chart{height:240px}.heating-chart-small{height:220px}}


/* EKMIO Dashboard / engine-supplied hydronic circuit presentation */
.dp-pipe,.dp-gauges,.dp-flow{width:100%;min-width:0;border-radius:11px;
 background:linear-gradient(145deg,#112e42,#172e40);border:1px solid #365773}
.dp-pipe{padding:8px 13px}
.dp-pipe svg{display:block;width:100%;height:auto;max-height:370px;overflow:visible}
.dp-hot,.dp-cold{fill:none;stroke-width:15;stroke-linecap:round;stroke-linejoin:round}
.dp-cold{stroke:#3989bd}
.dp-valve-body{fill:#1e465b;stroke:#78bed9;stroke-width:4}
.dp-valve-track{fill:none;stroke:#31566b;stroke-width:5}
.dp-valve-arc{fill:none;stroke:#f8ba86;stroke-width:5;stroke-linecap:round}
.dp-valve-glyph{fill:#ecb67f;stroke:#f7d7b4;stroke-width:2}
.dp-valve-stem{stroke:#aacbd8;stroke-width:5;stroke-linecap:round}
.dp-valve-act{fill:#36708e;stroke:#acd3e3;stroke-width:3}
.dp-valve-reading{fill:#ffd3a9;font-size:23px;font-weight:800;font-variant-numeric:tabular-nums}
.dp-target{fill:#bad9e9;font-size:12px;font-variant-numeric:tabular-nums}
.dp-load{fill:#23475a;stroke:#82bac9;stroke-width:3}
.dp-load-icon{font-size:55px;fill:#e0f6ff}
.dp-load-label{fill:#cee5f2;font-size:12px;font-weight:700;letter-spacing:.4px}
.dp-note{fill:#a7c3d2;font-size:13px;font-weight:700;letter-spacing:1px}
.dp-sensor{fill:#fac083;stroke:#fff1dc;stroke-width:3}
.dp-temperature{fill:#fbd2ab;font-size:15px;font-weight:700}
.dp-gauges{padding:18px 14px;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}
.dp-gauge{min-width:0;position:relative;text-align:center;display:flex;align-items:center;flex-direction:column;gap:6px}
.dp-gauge svg{max-width:100%;width:120px;display:block}
.dp-gauge-track{stroke:#365268;stroke-width:9;fill:none}
.dp-gauge-value{stroke:#eab178;stroke-width:9;fill:none;stroke-linecap:round}
.dp-gauge strong{font-size:15px;font-variant-numeric:tabular-nums;white-space:nowrap;color:#ffd4a8}
.dp-gauge span{font-size:11px;color:#b4d2e0}
.dp-flow{display:flex;align-items:stretch;padding:17px 12px;gap:9px}
.dp-flow-node{flex:1;min-width:0;min-height:150px;padding:12px 8px;border:1px solid #4e7589;
 background:#203e50;border-radius:9px;display:flex;flex-direction:column;justify-content:space-evenly;
 align-items:center;text-align:center;gap:9px}
.dp-flow-node span{font-size:10px;letter-spacing:.7px;color:#9ac6dc;font-weight:700}
.dp-flow-node strong{font-size:clamp(17px,2.4vw,28px);color:#f3c597;white-space:nowrap}
.dp-flow-node small{font-size:12px;color:#c3d8e4}
.dp-flow-arrow{align-self:center;font-size:30px;color:#83bbda}
@media(max-width:660px){
 .dp-pipe{padding:2px 4px}
 .dp-gauges{grid-template-columns:repeat(2,minmax(0,1fr))}
 .dp-flow{flex-wrap:wrap}.dp-flow-node{min-width:45%}.dp-flow-arrow{display:none}
}


/* EKMIO Building: compact text tree and restrained two-row drawing toolbar */
.building-editor-shell{display:grid;gap:14px;min-width:0}
.bt-editor-tabs{display:flex;align-items:center;gap:9px;flex-wrap:wrap}
.bt-editor-tabs .muted{margin-left:auto}
.bt-editor-layout{display:grid;grid-template-columns:minmax(210px,255px) minmax(0,1fr);gap:16px;align-items:start;min-width:0}
.bt-editor-main{display:grid;gap:10px;min-width:0}
.bt-editor-title{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap}
.bt-tree-panel{border:1px solid rgba(178,206,215,.19);border-radius:12px;padding:12px 9px 15px;background:rgba(3,21,31,.42);min-width:0;max-height:750px;overflow:auto}
.bt-tree-heading{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:2px 7px 10px;margin-bottom:6px;border-bottom:1px solid rgba(255,255,255,.10);font-size:12px;letter-spacing:.01em}
.bt-tree-add{font-size:11px;color:var(--accent);background:transparent;border:0;padding:3px 4px;border-radius:4px}
.bt-tree-add:hover{background:rgba(105,232,230,.12)}
.bt-tree-list{display:grid;gap:1px}
.bt-tree-row{display:flex;align-items:center;min-width:0;min-height:29px;gap:3px;padding:1px 4px 1px calc(4px + var(--bt-depth)*15px);border-radius:6px}
.bt-tree-row:hover{background:rgba(255,255,255,.055)}
.bt-tree-row.is-selected{background:rgba(105,232,230,.13)}
.bt-tree-name,.bt-tree-toggle,.bt-tree-action{border:0;background:none;box-shadow:none;min-height:0;line-height:1.3;border-radius:4px}
.bt-tree-name{flex:1;min-width:0;padding:4px 3px;color:#d2e4e6;font-size:12px;text-align:left;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.bt-tree-row.is-selected .bt-tree-name{color:#aaf4f0;font-weight:650}
.bt-tree-toggle,.bt-tree-indent{display:grid;place-items:center;flex:0 0 15px;width:15px;height:23px}
.bt-tree-toggle{font:600 12px/1 ui-monospace,SFMono-Regular,Consolas,monospace;color:#9bbac0;padding:0}
.bt-tree-toggle:hover{color:#fff;background:rgba(255,255,255,.09)}
.bt-tree-actions{display:flex;align-items:center;flex:0 0 auto;gap:1px;opacity:.55}
.bt-tree-row:hover .bt-tree-actions,.bt-tree-row.is-selected .bt-tree-actions,.bt-tree-row:focus-within .bt-tree-actions{opacity:1}
.bt-tree-action{padding:3px 4px;font-size:11px;color:#a7c1c5;min-width:18px;height:21px}
.bt-tree-action:hover{background:rgba(255,255,255,.10);color:white}
.bt-tree-action[data-tree-action="delete"]:hover{color:#ffacac;background:rgba(255,125,125,.12)}
.bt-tree-panel button:focus-visible,.bt-editor-main button:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.bt-toolbar-row{display:grid;grid-template-columns:94px minmax(0,1fr);align-items:center;gap:12px;padding:7px 9px;background:rgba(255,255,255,.035);border-radius:9px;border:1px solid rgba(255,255,255,.075)}
.bt-toolbar-label{color:#bfd3d7;font-size:12px;font-weight:650}
.bt-toolbar-options{display:flex;align-items:center;flex-wrap:wrap;gap:5px}
.bt-toolbar-options button{padding:6px 10px;font-size:12px;line-height:1.35;border-radius:6px;border:1px solid transparent;background:transparent;color:#b8cdd2;box-shadow:none}
.bt-toolbar-options button:hover{background:rgba(255,255,255,.09);color:#fff}
.bt-toolbar-options button.bt-tool-active{color:#d7fcf7;background:rgba(105,232,230,.12);border-color:rgba(105,232,230,.32)}
.bt-editor-options{display:flex;align-items:center;flex-wrap:wrap;gap:10px;margin:0;padding:2px 0}
.bt-editor-options label{display:flex;align-items:center;gap:6px;font-size:12px;color:#bfd3d7}
.bt-editor-options input[type="checkbox"]{margin:0}
.bt-editor-options input[type="color"]{width:32px;height:26px;padding:2px;border-radius:5px}
.bt-editor-options button{font-size:12px;padding:6px 10px}
.bt-source-tools{display:flex;gap:8px;flex-wrap:wrap}
.bt-source-tools input{flex:1;min-width:120px}
.bt-source-label{display:grid;gap:5px;font-size:12px}
.bt-source-label select{max-width:100%}
.bt-canvas-wrap{overflow:auto;padding:6px;border-radius:12px;background:rgba(110,120,130,.06)}
.bt-editor-properties{padding:12px;border:1px solid rgba(140,150,160,.3);border-radius:12px;display:grid;gap:8px}
.bt-editor-footer{display:flex;align-items:center;gap:12px;flex-wrap:wrap}
@media(max-width:760px){
 .bt-editor-layout{grid-template-columns:minmax(0,1fr)}
 .bt-tree-panel{max-height:280px}
 .bt-editor-tabs .muted{margin-left:0}
}
@media(max-width:480px){
 .bt-toolbar-row{grid-template-columns:minmax(0,1fr);gap:4px}
 .bt-tree-heading{gap:5px}
 .bt-editor-tabs button{font-size:12px;padding:8px 10px}
}

/* Engine-owned visual logic editor */
.logic-toolbar{display:flex;gap:16px;align-items:center;flex-wrap:wrap;padding:15px 19px;margin-bottom:14px}
.logic-toolbar label{display:flex;gap:9px;align-items:center;white-space:nowrap}
.logic-toolbar .primary{margin-left:auto}
.logic-shell{display:grid;grid-template-columns:minmax(195px,255px) minmax(0,1fr);align-items:start;gap:16px}
.logic-sidebar{padding:16px;display:flex;flex-direction:column;gap:8px;position:sticky;top:14px}
.logic-sidebar h2{font-size:1.1rem;margin:0}
.logic-rule-tab{background:transparent;border:1px solid var(--line);border-radius:12px;text-align:left;padding:12px;color:inherit;cursor:pointer;display:flex;flex-direction:column;gap:5px;width:100%}
.logic-rule-tab.active{border-color:var(--accent,#53b5bc);background:rgba(80,165,169,.11)}
.logic-rule-tab span{font-size:.8rem;opacity:.7}
.logic-workspace{min-width:0}
.logic-workspace .detail-panel{padding:20px}
.logic-workspace h3{margin:18px 0 10px}
.logic-tree,.logic-actions{display:flex;flex-direction:column;gap:10px;margin:14px 0}
.logic-branch{padding:14px;border:1px solid var(--line);border-radius:14px;background:rgba(122,140,155,.06)}
.logic-node-head{display:flex;flex-wrap:wrap;align-items:center;gap:9px;margin-bottom:12px}
.logic-node-head select{width:auto;min-width:175px}
.logic-children{border-left:2px solid var(--line);padding-left:15px;display:flex;flex-direction:column;gap:10px}
.logic-condition,.logic-action{padding:12px;display:flex;align-items:end;flex-wrap:wrap;gap:10px;border:1px solid var(--line);border-radius:12px}
.logic-condition label,.logic-action label{min-width:155px;flex:1 1 150px;font-size:.88rem}
.logic-condition select,.logic-condition input,.logic-action select,.logic-action input{width:100%}
.logic-node-tag{font-size:.74rem;letter-spacing:.05em;font-weight:750;align-self:center;color:var(--muted,#9cb3bb);white-space:nowrap}
.logic-action-advanced{display:contents}
.logic-divider{height:1px;background:var(--line);margin:24px 0}
.logic-test-inputs{display:grid;grid-template-columns:repeat(auto-fit,minmax(165px,1fr));gap:10px;margin:10px 0}
.logic-test-inputs label{display:flex;flex-direction:column}
@media(max-width:830px){.logic-shell{grid-template-columns:1fr}.logic-sidebar{position:static}.logic-children{padding-left:9px}}


/* EKMIO Dashboard - Building room/floor/building telemetry table */
.dashboard-building-table-wrap{max-width:100%;overflow-x:auto;overflow-y:auto;max-height:500px;
 border:1px solid rgba(255,255,255,.10);border-radius:9px;background:rgba(9,31,40,.35)}
.dashboard-building-table{border-collapse:separate;border-spacing:0;width:100%;min-width:360px;
 font-size:12px;font-variant-numeric:tabular-nums}
.dashboard-building-table th,.dashboard-building-table td{padding:9px 11px;white-space:nowrap;
 border-bottom:1px solid rgba(255,255,255,.09);text-align:right;vertical-align:middle}
.dashboard-building-table th:first-child,.dashboard-building-table td:first-child{text-align:left}
.dashboard-building-table thead th{position:sticky;top:0;z-index:1;
 background:#17323d;color:#c9e3e5;font-weight:650;font-size:11px}
.dashboard-building-table tbody th{font-weight:580;color:#d2e9e9;max-width:280px;white-space:normal}
.dashboard-building-table tbody tr:last-child th,.dashboard-building-table tbody tr:last-child td{border-bottom:0}
.dashboard-building-table tbody tr:hover{background:rgba(105,232,230,.055)}
.dashboard-building-table td{color:#f1fafa;font-weight:580}
.dashboard-building-table td small{font-weight:400;color:#aac7cd;font-size:10px}
@media(max-width:600px){.dashboard-building-table th,.dashboard-building-table td{padding:8px 7px}}

/* Shelly i4 configurable four-key diagram */
.shelly-i4-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;max-width:490px;margin:14px 0}
.shelly-i4-key{display:flex;flex-direction:column;gap:7px;min-width:0;background:rgba(105,232,230,.055);border:1px solid rgba(105,232,230,.21);padding:13px;border-radius:12px}
.shelly-i4-key strong{font-size:12px;color:#d9eeee}
.shelly-i4-key select,.shelly-i4-key input{min-width:0;width:100%;background:#14313b;color:#e9fafa;border:1px solid rgba(255,255,255,.2);border-radius:8px;padding:8px;font:inherit;font-size:12px}
.shelly-i4-key select option{background:#14313b}
@media(max-width:420px){.shelly-i4-key{padding:8px}.shelly-i4-key select,.shelly-i4-key input{font-size:11px;padding:7px 5px}}

/* Logic rule editor: use the same dark, accessible form controls as the EKMIO settings pages. */
.logic-shell .field-grid > label,
.logic-shell .logic-condition > label,
.logic-shell .logic-action > label,
.logic-shell .logic-action-advanced > label,
.logic-shell .logic-test-inputs > label {
  display:flex;
  flex-direction:column;
  align-items:stretch;
  gap:7px;
  min-width:0;
  color:#cbdfe0;
  font-size:13px;
  font-weight:650;
}
.logic-shell input:not([type="checkbox"]),
.logic-shell select,
.logic-shell textarea,
.logic-node-head select {
  box-sizing:border-box;
  min-width:0;
  width:100%;
  min-height:43px;
  padding:10px 12px;
  border:1px solid rgba(255,255,255,.19);
  border-radius:11px;
  background:rgba(7,33,41,.9);
  color:#effafa;
  font:inherit;
  font-size:13px;
  line-height:1.4;
  color-scheme:dark;
  outline:none;
  transition:border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.logic-shell select option,
.logic-node-head select option {
  color:#effafa;
  background:#102b35;
}
.logic-shell input:not([type="checkbox"]):focus,
.logic-shell select:focus,
.logic-shell textarea:focus,
.logic-node-head select:focus {
  border-color:var(--accent);
  box-shadow:0 0 0 3px rgba(105,232,230,.13);
  background:rgba(8,42,50,.96);
}
.logic-shell input::placeholder { color:#95b2b5; }
.logic-shell input[type="checkbox"],
.logic-toolbar input[type="checkbox"] {
  width:18px;
  height:18px;
  min-width:18px;
  margin:0;
  accent-color:var(--accent);
  cursor:pointer;
}
.logic-shell .field-grid > label:has(> input[type="checkbox"]) {
  flex-direction:row;
  align-items:center;
  align-self:end;
  min-height:43px;
  gap:10px;
}
.logic-shell .logic-condition > label,
.logic-shell .logic-action > label { min-width:min(100%,155px); }
.logic-shell .logic-node-head select { width:auto; min-width:175px; }
@media(max-width:660px) {
  .logic-shell .logic-condition > label,
  .logic-shell .logic-action > label,
  .logic-shell .logic-action-advanced > label { flex-basis:100%; min-width:0; }
  .logic-shell .field-grid > label:has(> input[type="checkbox"]) { align-self:start; }
}
