/* ======================= Cảm giác ứng dụng iPhone, nền TRẮNG chủ đạo. Nạp SAU style.css; chỉ giao diện "Đơn giản" (body.ui-simple).
   Chế độ tối vẫn theo cài đặt của máy (như ứng dụng gốc). Giao diện kỹ thuật (pro) không đổi. ======================= */
body.ui-simple{--bg:#fff;--card:#fff;--fg:#000;--mut:#6c6c70;--acc:#007aff;--accbg:#007aff14;--hair:#3c3c4333;--line:#3c3c431f;--fill:#f2f2f7;--r:16px;
  --ios-card:0 0 0 .5px #3c3c4326,0 2px 12px #0000000d;
  font-family:-apple-system,BlinkMacSystemFont,"SF Pro Text","SF Pro Display","Segoe UI Variable Text","Segoe UI",system-ui,Roboto,sans-serif;
  background:var(--bg);-webkit-font-smoothing:antialiased;font-size:17px;letter-spacing:-.01em}
html{-webkit-text-size-adjust:100%;text-size-adjust:100%}
body.ui-simple{overscroll-behavior-y:none;-webkit-tap-highlight-color:transparent}
body.ui-simple button,body.ui-simple a,body.ui-simple summary,body.ui-simple label{touch-action:manipulation;-webkit-touch-callout:none}

/* thanh trên: trắng mờ, tiêu đề lớn */
body.ui-simple .content>header{background:#ffffffe6;border-bottom:.5px solid var(--hair);min-height:60px}
body.ui-simple h1{font-size:32px;font-weight:700;letter-spacing:-.025em;line-height:1.15}

/* thẻ: trắng, viền tóc + bóng rất nhẹ */
body.ui-simple .panel,body.ui-simple .dev-card,body.ui-simple .gw-head,body.ui-simple .plan-row{background:var(--card);box-shadow:var(--ios-card);border:0;border-radius:var(--r)}
body.ui-simple #dev-panel.phone-flush{box-shadow:none}
body.ui-simple .panel{margin-bottom:2px}
body.ui-simple .plan-row{padding:14px 16px;margin-bottom:12px}
body.ui-simple .plan-row.cur{box-shadow:0 0 0 1.5px var(--acc)}
body.ui-simple .panel>h2,body.ui-simple .panel h2{color:var(--mut);text-transform:uppercase;font-size:13px}
body.ui-simple .gw-tabs button{background:var(--fill);box-shadow:none}
body.ui-simple .gw-tabs button.on{background:var(--acc)}

/* nút, ô nhập: cao tối thiểu 44pt như HIG; nhấn thì lún nhẹ */
body.ui-simple button{min-height:36px;transition:transform .12s ease,opacity .12s ease}
body.ui-simple button:active:not(:disabled){transform:scale(.97);opacity:.7}
body.ui-simple button.primary,body.ui-simple .row>button{min-height:48px;border-radius:14px}
body.ui-simple button.primary{font-size:17px}
body.ui-simple input:not([type=checkbox]):not([type=radio]):not([type=range]),body.ui-simple select{min-height:46px;font-size:17px;background:var(--fill)}


/* thanh tab dưới đáy */
body.ui-simple nav{background:#ffffffeb;border-top:.5px solid var(--hair);padding-top:7px}
body.ui-simple nav button{color:#8e8e93;min-height:46px}
body.ui-simple nav button.on{color:var(--acc)}
body.ui-simple nav button.on svg{fill:var(--accbg);stroke-width:2.1}

/* chuyển tab mượt */
@keyframes ios-page{from{opacity:0;transform:translateY(8px)}}
body.ui-simple .tab:not([hidden]){animation:ios-page .24s cubic-bezier(.2,.8,.2,1)}

/* trang đăng nhập: toàn màn hình trắng, không khung hộp trên điện thoại */
body.ui-simple .login-wrap{padding-top:calc(24px + env(safe-area-inset-top));padding-bottom:calc(24px + env(safe-area-inset-bottom))}
@media (max-width:560px){body.ui-simple .login-wrap .panel{box-shadow:none;padding-left:4px;padding-right:4px}}

/* gợi ý đưa ra màn hình chính (Safari trên iPhone) */
#a2hs{position:fixed;left:12px;right:12px;bottom:calc(76px + env(safe-area-inset-bottom));z-index:30;display:flex;gap:10px;align-items:center;padding:12px 14px;border-radius:16px;background:#1c1c1ef2;color:#fff;font-size:14px;line-height:1.35;box-shadow:0 8px 30px #0004}
#a2hs button{flex:none;min-height:36px;background:#ffffff26;color:#fff;border:0;border-radius:10px;padding:0 12px}

@media (min-width:900px){body.ui-simple nav{background:#fafafc;border-right:.5px solid var(--hair)}body.ui-simple .content>header{background:none;border-bottom:0}}

@media (prefers-color-scheme:dark){
  body.ui-simple{--bg:#000;--card:#1c1c1e;--fg:#fff;--mut:#98989f;--acc:#0a84ff;--accbg:#0a84ff26;--hair:#54545899;--line:#54545866;--fill:#2c2c2e;--ios-card:none}
  body.ui-simple .content>header{background:#000000e0}
  body.ui-simple nav{background:#121214eb}
}
@media (prefers-reduced-motion:reduce){body.ui-simple .tab:not([hidden]){animation:none}body.ui-simple button{transition:none}}

/* thanh chọn mục trong Cài đặt: nhãn dài xuống dòng, không đè nhau */
body.ui-simple .set-tabs button{white-space:normal;line-height:1.2;min-width:0;min-height:40px;padding:4px 3px;font-size:12.5px;letter-spacing:-.02em}

/* cài đặt cảnh báo gọi / SMS (alert-settings.js) */
#alert-call-panel[hidden]{display:none}
#alert-call-panel .al-gw{border-top:.5px solid var(--hair,#8884);padding:12px 0}
#alert-call-panel .al-check{display:flex;align-items:center;gap:12px}
#alert-call-panel .al-go{display:block;text-align:center;padding:14px;margin:8px 0;border-radius:12px;background:#007aff;color:#fff;font-weight:600;text-decoration:none}
#alert-call-panel .al-warn{color:#ff3b30;font-weight:600;margin:4px 0}
#alert-call-panel .al-level{width:100%;margin:2px 0 10px}
#alert-call-panel .al-open{display:flex;gap:10px;align-items:center;justify-content:space-between;padding:10px 12px;border-radius:12px;background:#ff3b301a;margin:8px 0}
#alert-call-panel .al-open button{flex:none}
#alert-call-panel .al-who{display:flex;flex-wrap:wrap;gap:8px;align-items:center;justify-content:space-between;padding:10px 12px;border-radius:12px;background:#8881;margin:8px 0}
#alert-call-panel .al-who .row{margin:0}
#alert-call-panel .al-who .row button{white-space:nowrap;flex:0 0 auto;width:auto}
#alert-call-panel .al-perms{display:flex;flex-wrap:wrap;gap:14px;flex:1 1 100%}
#alert-call-panel .al-perms label{display:flex;align-items:center;gap:6px;margin:0}
#alert-invite-bar{position:fixed;left:12px;right:12px;top:calc(env(safe-area-inset-top,0px) + 8px);z-index:60;max-width:520px;margin:0 auto;padding:12px 16px;border:0;border-radius:14px;background:#007aff;color:#fff;font:600 15px system-ui,sans-serif;box-shadow:0 6px 24px #0004;cursor:pointer}
#alert-call-panel .row{flex-wrap:wrap;gap:8px;margin:8px 0}

/* ======================= Trang Thiết bị kiểu iPhone: thanh chọn gọn, một dòng trạng thái, danh sách nhóm, công tắc gạt ======================= */
/* thanh chọn gateway: chỉ tên + chấm trạng thái */
body.ui-simple .gw-row{gap:6px;overflow-x:auto}
body.ui-simple .gw-tabs button{flex:0 0 auto;flex-direction:row;gap:7px;min-height:34px;padding:6px 14px;border-radius:17px;font-size:15px}
body.ui-simple .gw-tabs button small{display:none}
body.ui-simple .gw-tabs button b{font-weight:600}
body.ui-simple .gw-tabs button::before{content:"";width:8px;height:8px;border-radius:50%;background:#c7c7cc;flex:none}
body.ui-simple .gw-tabs button.gw-on::before{background:#34c759}
/* một dòng trạng thái thay khối cảnh báo lớn (cảnh báo thật vẫn hiện ở thanh trên) */
body.ui-simple .alarm-bar.comm{display:none}
body.ui-simple .dev-head h2.gw-line{display:flex;align-items:center;gap:7px;text-transform:none;letter-spacing:0;font-size:15px;font-weight:500;color:var(--mut)}
body.ui-simple .dev-head h2.gw-line::before{content:"";width:8px;height:8px;border-radius:50%;background:#c7c7cc}
body.ui-simple .dev-head h2.gw-line.on::before{background:#34c759}
body.ui-simple .dev-head h2.gw-line.warn::before{background:#ff9f0a}
body.ui-simple .dev-add-btn{background:transparent;color:var(--acc);padding:0 4px;min-height:34px;font-size:17px;box-shadow:none}
body.ui-simple .gw-head,body.ui-simple .lic-tag.free{display:none}
body.ui-simple .pill{font-size:12px}
body.ui-simple .chat-fab{background:transparent;color:var(--acc);display:inline-flex;align-items:center;justify-content:center}

/* thẻ thiết bị = một nhóm; mỗi giá trị / điều khiển là một hàng ngăn bằng đường mảnh */
body.ui-simple .gw-cards{gap:20px}
body.ui-simple .dev-card.dev-card{padding:0;border-radius:14px;background:var(--card);box-shadow:var(--ios-card);overflow:hidden;opacity:1}
body.ui-simple .dev-card header{gap:10px;padding:12px 16px 10px;margin:0}
body.ui-simple .dev-card header h3{font-size:17px;font-weight:600}
body.ui-simple .dev-card .dev-ic{width:30px;height:30px;min-width:30px;background:none;box-shadow:none;border:0;border-radius:0;color:var(--acc);filter:none;display:grid;place-items:center}
body.ui-simple .dev-card .dev-ic .ic{width:28px;height:28px;filter:none}
body.ui-simple .dev-card.is-off .dev-ic{color:#8e8e93}
body.ui-simple .dev-card .dev-widgets{display:block}
body.ui-simple .dev-card .dev-widgets .dw{background:transparent;border-radius:0;border-top:.5px solid var(--hair);margin-left:16px;padding:12px 16px 12px 0;box-shadow:none;outline:0}
body.ui-simple .dev-card .wic{display:none}
body.ui-simple .dev-card .dev-widgets .dw .k{font-size:17px;color:var(--fg);font-weight:400;margin:0}
/* số đo: nhãn trái, giá trị phải */
body.ui-simple .dev-card .dev-widgets .dw:not(.ctlw):not(.gauge):not(.tankw):not(.ringw):not(.locked){display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}
body.ui-simple .dev-card .dev-widgets .dw:not(.ctlw):not(.gauge):not(.tankw) .v{font-size:17px;font-weight:400;color:var(--mut);letter-spacing:0}
body.ui-simple .dev-card .dev-widgets .dw:not(.ctlw) .d{display:none}
body.ui-simple .dev-card .dev-widgets .chip{border:0;background:transparent;padding:0;font-size:17px;font-weight:400;color:var(--mut)}
/* bật / tắt = công tắc iOS: nhãn trái, công tắc phải, dòng phản hồi nhỏ bên dưới */
body.ui-simple .dev-card .dw.ctlw:has(.dw-toggle){display:grid;grid-template-columns:1fr auto;column-gap:12px;align-items:center}
body.ui-simple .dev-card .dw.ctlw:has(.dw-toggle)>.k{grid-column:1;display:flex;flex-wrap:wrap;align-items:center;gap:4px 8px}
body.ui-simple .dev-card .dw.ctlw:has(.dw-toggle)>.dw-status,body.ui-simple .dev-card .dw.ctlw:has(.dw-toggle)>.dw-info{grid-column:1/-1}
body.ui-simple .dev-card .dev-widgets .dw-toggle{grid-column:2;grid-row:1;position:relative;width:51px;min-width:51px;height:31px;min-height:31px;padding:0;border:0;border-radius:31px;background:#e9e9ea;font-size:0;color:transparent;box-shadow:none;transition:background .2s}
body.ui-simple .dev-card .dev-widgets .dw-toggle small{display:none}
body.ui-simple .dev-card .dev-widgets .dw-toggle::after{content:"";position:absolute;top:2px;left:2px;width:27px;height:27px;border-radius:50%;background:#fff;box-shadow:0 3px 8px #00000026,0 1px 1px #0000001a;transition:transform .2s}
body.ui-simple .dev-card .dev-widgets .dw-toggle.on{background:#34c759}
body.ui-simple .dev-card .dev-widgets .dw-toggle.on::after{transform:translateX(20px)}
body.ui-simple .dev-card .dev-widgets .dw-toggle.cool,body.ui-simple .dev-card .dev-widgets .dw-toggle:disabled{opacity:.45}
body.ui-simple.stale .dev-card .dev-widgets .dw-toggle{opacity:.5}
body.ui-simple .dev-card .dw-trust{float:none;margin:0;padding:0;background:transparent;font-size:0}
body.ui-simple .dev-card .dw-trust svg{width:16px;height:16px}
body.ui-simple .dev-card .dw-star{font-size:17px;min-height:28px;background:transparent;color:#c7c7cc}
body.ui-simple .dev-card .dw-star.on{color:#ff9f0a}
body.ui-simple .dev-card .dw-timer{min-height:26px;border:0;background:var(--fill);font-size:13px}
body.ui-simple .dev-card .dw-fb,body.ui-simple .dev-card .dw-fb.ok{background:transparent;padding:0;font-size:13px;color:var(--mut);margin-top:4px}
body.ui-simple .dev-card .dw-info{font-size:13px;margin-top:4px}
@media (min-width:900px){body.ui-simple .gw-cards{grid-template-columns:repeat(auto-fill,minmax(340px,1fr));align-items:start}}
@media (prefers-color-scheme:dark){body.ui-simple .dev-card .dev-widgets .dw-toggle:not(.on){background:#39393d}}

/* ======================= Nút bấm và chuyển động kiểu iPhone ======================= */
body.ui-simple{--spring:cubic-bezier(.32,.72,0,1);--bounce:cubic-bezier(.34,1.4,.5,1)}
/* nút: chính = tô đặc; phụ = nền xanh nhạt chữ xanh (tinted); nguy hiểm = chữ đỏ */
body.ui-simple .panel button:not(.primary):not(.danger):not(.dw-toggle):not(.dw-star):not(.dw-timer):not(.dw-step):not(.ic-choice):not([data-sub]):not(.chat-fab):not([data-mode]):not([data-form]),
body.ui-simple .ctl-box button.fit:not(.primary):not(.danger){background:var(--accbg);color:var(--acc);font-weight:600;min-height:44px;border-radius:12px}
body.ui-simple button.primary{background:var(--acc);color:#fff;border-radius:14px;min-height:50px}
body.ui-simple button.danger{background:#ff3b301a;color:#ff3b30;font-weight:600;min-height:44px}
body.ui-simple button.primary.danger{background:#ff3b30;color:#fff}
body.ui-simple button{transition:transform .35s var(--bounce),opacity .25s ease,background-color .25s ease,filter .2s ease}
body.ui-simple button:active:not(:disabled){transform:scale(.97);opacity:1;filter:brightness(.9);transition-duration:.06s}
body.ui-simple .chat-fab:active:not(:disabled),body.ui-simple .dev-add-btn:active:not(:disabled),body.ui-simple .hdr-back:active{filter:none;opacity:.35}
body.ui-simple button:disabled{opacity:.4}
/* hàng trong danh sách: nhấn thì sáng xám như UITableView */
body.ui-simple .sec>summary,body.ui-simple .sec-card>summary{border-radius:8px;transition:background-color .3s}
body.ui-simple .sec>summary:active,body.ui-simple .sec-card>summary:active{background:var(--fill);transition-duration:0s}
/* công tắc: núm giãn khi giữ, trượt theo lò xo */
body.ui-simple .dev-card .dev-widgets .dw-toggle{transition:background-color .35s var(--spring)}
body.ui-simple .dev-card .dev-widgets .dw-toggle::after{transition:transform .38s var(--bounce),width .2s var(--spring)}
body.ui-simple .dev-card .dev-widgets .dw-toggle:active:not(:disabled){transform:none;filter:none}
body.ui-simple .dev-card .dev-widgets .dw-toggle:active:not(:disabled)::after{width:33px}
body.ui-simple .dev-card .dev-widgets .dw-toggle.on:active:not(:disabled)::after{transform:translateX(14px)}
/* thanh chọn phân đoạn: miếng nền trượt (ios-app.js) */
body.ui-simple .set-tabs.has-thumb,body.ui-simple .auth-tabs.has-thumb{position:relative;isolation:isolate}
body.ui-simple .has-thumb>button{background:transparent!important;box-shadow:none!important}
body.ui-simple .seg-thumb{position:absolute;z-index:-1;left:0;top:0;border-radius:8px;background:var(--card);box-shadow:0 3px 8px #0000001f,0 0 0 .5px #0000000a;transition:transform .38s var(--spring),width .38s var(--spring);pointer-events:none}
@media (prefers-color-scheme:dark){body.ui-simple .seg-thumb{background:#636366}}
/* chuyển trang: sang tab bên phải thì trượt từ phải, về trái thì trượt từ trái */
@keyframes ios-from-right{from{opacity:0;transform:translateX(28px)}}
@keyframes ios-from-left{from{opacity:0;transform:translateX(-28px)}}
body.ui-simple .tab:not([hidden]),body.ui-simple .set-pane:not([hidden]){animation:ios-page .32s var(--spring)}
body.ui-simple[data-dir=fwd] .tab:not([hidden]),body.ui-simple[data-sdir=fwd] .set-pane:not([hidden]){animation-name:ios-from-right}
body.ui-simple[data-dir=back] .tab:not([hidden]),body.ui-simple[data-sdir=back] .set-pane:not([hidden]){animation-name:ios-from-left}
/* mục mở ra, bảng trượt từ đáy, thông báo thả từ trên xuống như banner */
@keyframes ios-reveal{from{opacity:0;transform:translateY(-6px)}}
body.ui-simple details[open]>*:not(summary){animation:ios-reveal .32s var(--spring)}
@keyframes ios-sheet{from{transform:translateY(100%)}}
@keyframes ios-dim{from{background-color:transparent}}
body.ui-simple .cam-help{animation:ios-dim .3s ease;backdrop-filter:blur(4px);-webkit-backdrop-filter:blur(4px)}
body.ui-simple .cam-help .sheet{background:var(--card);color:var(--fg);border-radius:22px 22px 0 0;animation:ios-sheet .45s var(--spring)}
body.ui-simple .cam-help .sheet::before{content:"";display:block;width:36px;height:5px;border-radius:3px;background:#c7c7cc;margin:-8px auto 14px}
body.ui-simple .cam-help .row{flex-direction:column}
body.ui-simple .cam-help .row button{flex:none;width:100%;min-height:50px}
body.ui-simple .mq:not([hidden]),body.ui-simple .chat-view:not([hidden]){animation:ios-sheet .45s var(--spring)}
body.ui-simple #toast{top:calc(8px + env(safe-area-inset-top));bottom:auto;transform:translate(-50%,-140%);opacity:0;border-radius:18px;background:#ffffffeb;color:#000;backdrop-filter:saturate(180%) blur(20px);-webkit-backdrop-filter:saturate(180%) blur(20px);box-shadow:0 8px 32px #00000030;transition:transform .5s var(--spring),opacity .3s}
body.ui-simple #toast.show{transform:translate(-50%,0);opacity:1}
body.ui-simple #toast.err{background:#ff3b30f2;color:#fff}
@media (prefers-color-scheme:dark){body.ui-simple #toast{background:#2c2c2eee;color:#fff}}
/* biểu tượng thanh tab nảy nhẹ khi chọn */
@keyframes ios-tab{40%{transform:scale(.86)}70%{transform:scale(1.08)}}
body.ui-simple nav button.on svg{animation:ios-tab .42s ease}
body.ui-simple nav button:active:not(:disabled){transform:none;filter:none}
/* thẻ thiết bị hiện lần lượt khi mở / đổi gateway */
@keyframes ios-rise{from{opacity:0;transform:translateY(12px)}}
body.ui-simple .gw-group .dev-card{animation:ios-rise .45s var(--spring) both}
body.ui-simple .gw-group .dev-card:nth-child(2){animation-delay:.04s}
body.ui-simple .gw-group .dev-card:nth-child(3){animation-delay:.08s}
body.ui-simple .gw-group .dev-card:nth-child(n+4){animation-delay:.12s}
@media (prefers-reduced-motion:reduce){body.ui-simple *,body.ui-simple *::before,body.ui-simple *::after{animation:none!important;transition-duration:.01s!important}}

/* ======================= Dấu ấn app iPhone: tiêu đề lớn thu gọn khi cuộn; Cài đặt kiểu danh sách nhóm có ô biểu tượng màu ======================= */
body.ui-simple .content>header{transition:min-height .25s var(--spring),padding .25s var(--spring),border-color .25s;border-bottom-color:transparent}
body.ui-simple .content>header h1{transition:font-size .25s var(--spring)}
@media (max-width:899px){
  body.ui-simple.scrolled .content>header{min-height:44px;padding-top:calc(4px + env(safe-area-inset-top));padding-bottom:4px;border-bottom-color:var(--hair)}
  body.ui-simple.scrolled .content>header h1{font-size:17px;font-weight:600;text-align:center;letter-spacing:-.01em}
  body.ui-simple.scrolled .content>header .pill{display:none}
}
/* Cài đặt: nền xám nhóm của iOS, nhóm trắng, tiêu đề nhóm chữ nhỏ */
body.ui-simple:has(#tab-set:not([hidden])){background:#f2f2f7}
body.ui-simple:has(#tab-set:not([hidden])) .content>header{background:#f2f2f7e6}
body.ui-simple #tab-set .panel{box-shadow:none;border-radius:12px;padding:6px 16px 12px;margin-top:0!important;margin-bottom:22px}
body.ui-simple #tab-set .panel>h2{margin:10px 0 8px;font-weight:500;font-size:13px}
body.ui-simple #tab-set details.sec-card{padding:2px 16px}
body.ui-simple #tab-set details.sec-card>summary{min-height:44px;padding:4px 0;font-weight:400;font-size:17px}
body.ui-simple #tab-set .sec>summary{min-height:48px;font-weight:400;font-size:17px}
body.ui-simple .sec>summary::after,body.ui-simple .sec-card>summary::after{color:#c7c7cc;font-size:24px}
/* ô biểu tượng vuông bo góc đầu hàng, như app Cài đặt */
body.ui-simple #tab-set .sec>summary,body.ui-simple #tab-set details.sec-card>summary{justify-content:flex-start}
body.ui-simple #tab-set .sec>summary::after,body.ui-simple #tab-set details.sec-card>summary::after{margin-left:auto}
body.ui-simple #tab-set .sec>summary::before,body.ui-simple #tab-set details.sec-card>summary::before{content:"";width:29px;height:29px;flex:none;margin-right:6px;border-radius:7px;background:#8e8e93 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3l7 3v6c0 4.5-3 7.5-7 9-4-1.5-7-4.5-7-9V6z'/%3E%3C/svg%3E") center/19px no-repeat}
body.ui-simple #tab-set details#export-panel>summary::before{background-color:#34c759;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 4v11M7 11l5 5 5-5M5 20h14'/%3E%3C/svg%3E")}
body.ui-simple #tab-set details#ic-panel>summary::before{background-color:#af52de;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2'%3E%3Crect x='4' y='4' width='7' height='7' rx='2'/%3E%3Crect x='13' y='4' width='7' height='7' rx='2'/%3E%3Crect x='4' y='13' width='7' height='7' rx='2'/%3E%3Ccircle cx='16.5' cy='16.5' r='3.5'/%3E%3C/svg%3E")}
body.ui-simple #tab-set .sec:nth-of-type(1)>summary::before{background-color:#007aff}
body.ui-simple #tab-set .sec:nth-of-type(2)>summary::before{background-color:#ff9500}
/* đăng xuất: một hàng chữ đỏ ở giữa nhóm riêng */
body.ui-simple #tab-set .panel:has(#logout){padding:0}
body.ui-simple #tab-set #logout.fit,body.ui-simple #tab-set #logout{width:100%;min-height:48px;background:transparent;color:#ff3b30;font-weight:400;font-size:17px;border-radius:12px}
body.ui-simple #tab-set .panel:has(#logout) .row{margin:0}
@media (prefers-color-scheme:dark){body.ui-simple:has(#tab-set:not([hidden])){background:#000}body.ui-simple:has(#tab-set:not([hidden])) .content>header{background:#000000e0}}

body.ui-simple button.primary.dev-add-btn{background:transparent;color:var(--acc);min-height:34px;padding:0 4px;box-shadow:none}
body.ui-simple .dev-head{align-items:center}

/* ======================= Icon và chữ trên thẻ TRẮNG: các kiểu thẻ nền tối (3D, Grafana, Material, Carbon) vẽ sáng màu → trên nền mới bị chìm ======================= */
body.ui-simple .dev-card.dev-card{--fg:inherit;--mut:inherit;color:var(--fg);color-scheme:inherit;border:0}
html[data-ic-style=grafana][data-ic-color=auto] body.ui-simple .dev-card.dev-card,html[data-ic-style=material][data-ic-color=auto] body.ui-simple .dev-card.dev-card,html[data-ic-style=carbon][data-ic-color=auto] body.ui-simple .dev-card.dev-card{--acc:inherit}
body.ui-simple .dev-card.dev-card header h3{color:var(--fg)}
body.ui-simple .dev-card.dev-card .bg-bar{background:var(--fill)}
/* hình thực tế / 3D có mảng trắng và xám nhạt: đặt trên ô xám + viền bóng mảnh để không lẫn vào thẻ */
html body.ui-simple .dev-card.dev-card .dev-ic:has(.icr),html body.ui-simple .dev-card.dev-card .dev-ic:has(.ic3){width:44px;height:44px;min-width:44px;border-radius:11px;background:#e3e3e9}
html body.ui-simple .dev-card.dev-card .dev-ic .icr,html body.ui-simple .dev-card.dev-card .dev-ic .ic3{width:38px;height:38px;filter:drop-shadow(0 0 .7px #000c) drop-shadow(0 1px 1px #0004)}
html body.ui-simple .dev-card.dev-card.is-off .dev-ic:has(.icr),html body.ui-simple .dev-card.dev-card.is-off .dev-ic:has(.ic3){filter:grayscale(.85)}
@media (prefers-color-scheme:dark){html body.ui-simple .dev-card.dev-card .dev-ic:has(.icr),html body.ui-simple .dev-card.dev-card .dev-ic:has(.ic3){background:#2c2c2e}}
/* thanh chọn Chế độ màu / Hình thiết bị: mục đang chọn là miếng nền nổi */
body.ui-simple .panel .seg button{background:transparent;color:var(--fg);min-height:36px;box-shadow:none}
body.ui-simple .panel .seg button.sel{background:var(--card);color:var(--fg);font-weight:600;box-shadow:0 3px 8px #0000001f,0 0 0 .5px #0000000a}
@media (prefers-color-scheme:dark){body.ui-simple .panel .seg button.sel{background:#636366}}
/* chữ trong đồng hồ / bồn theo màu nền (kiểu ThingsBoard đặt cứng chữ đậm → chìm trên nền đen) */
body.ui-simple .dev-card.dev-card :is(.rg-wrap,.tank3d){color:var(--fg)}
body.ui-simple .dev-card.dev-card .dw:not(.low):not(.high) .rg-val b{color:var(--fg)}
body.ui-simple .dev-card.dev-card .dw-star:not(.on){color:#8e8e93}
/* bồn 3D vẽ bằng nét trắng trong suốt (cho thẻ tối) → trên thẻ trắng mất thân bồn: tô lại cho chế độ sáng */
@media (prefers-color-scheme:light){
  body.ui-simple .dev-card.dev-card .t3-svg [stroke^="rgba(255"]{stroke:#8e8e93}
  body.ui-simple .dev-card.dev-card .t3-svg>ellipse:first-of-type{fill:#c7c7cc}
  body.ui-simple .dev-card.dev-card .t3-svg>path[fill^="rgba(255"]{fill:#f2f2f7}
  body.ui-simple .dev-card.dev-card .t3-svg>ellipse[fill^="rgba(255"]{fill:#e5e5ea}
}
/* ThingsBoard trên nền đen: chữ widget theo màu nền, bỏ ô trắng quanh icon, nét khoét theo màu thẻ */
body.ui-simple .dev-card.dev-card .dev-widgets .dw{color:var(--fg)}
html[data-ic-style=thingsboard] body.ui-simple .dev-card.dev-card .dev-ic:not(:has(.icr)):not(:has(.ic3)){background:none}
html[data-ic-style=thingsboard] body.ui-simple .dev-card.dev-card .dev-ic .ic:not(.ic3):not(.pid):not(.icx) :is(circle,rect,ellipse,polygon,path[d$="z"],path[d$="Z"]){stroke:var(--card)}
html[data-ic-style=thingsboard] body.ui-simple .dev-card.dev-card .rg-track{stroke:var(--fill)}
@media (prefers-color-scheme:dark){body.ui-simple #auth-tabs button.on{color:#fff!important}}

/* thanh "Có bản mới" (update.js) */
#update-bar{position:fixed;left:12px;right:12px;bottom:calc(76px + env(safe-area-inset-bottom));z-index:40;max-width:480px;margin:0 auto;display:flex;gap:8px;align-items:center;padding:10px 10px 10px 16px;border-radius:16px;background:#1c1c1ef7;color:#fff;box-shadow:0 8px 30px #0006,0 0 0 .5px #ffffff26}
#update-bar span{flex:1;min-width:0;display:grid;font-size:15px;line-height:1.3}
#update-bar small{font-size:12.5px;opacity:.75}
#update-bar button,body.ui-simple #update-bar button{flex:none;border:0;min-height:40px;border-radius:12px;font-weight:600;cursor:pointer}
#update-bar .go,body.ui-simple #update-bar .go{background:#0a84ff;color:#fff;padding:0 16px}
#update-bar .later,body.ui-simple #update-bar .later{background:transparent;color:#fff;opacity:.65;padding:0 10px}
body.has-a2hs main{padding-bottom:96px}   /* cuộn được nút cuối trang ra khỏi khung gợi ý */
/* mục Thông báo trên đỉnh (notif.js) */
.nt-btn{position:relative}
.nt-btn[hidden]{display:none!important}
.nt-badge{position:absolute;top:-3px;right:-3px;min-width:18px;height:18px;padding:0 4px;box-sizing:border-box;border-radius:9px;background:#ff3b30;color:#fff;font-size:11px;font-weight:700;line-height:18px;text-align:center}
.nt-badge[hidden]{display:none}
#notif-view .nt-list{flex:1;min-height:0;overflow-y:auto;padding:12px 14px calc(12px + env(safe-area-inset-bottom,0px))}
#notif-view .nt-item{display:flex;flex-direction:column;gap:4px;background:var(--card);border-radius:14px;padding:12px 14px;margin-bottom:10px;border:1px solid var(--line)}
#notif-view .nt-item.new{border-color:#007aff}
#notif-view .nt-item.open{border-color:#ff3b30}
#notif-view .nt-item p{margin:2px 0;font-size:16px;font-weight:600;overflow-wrap:anywhere}
#notif-view .nt-item small{color:var(--mut)}
/* cảnh báo dưới cảm biến (notif.js) + khung nháy khi nhảy tới */
.dev-widgets .dw.has-warn{flex-wrap:wrap}
.dw .pt-warn{flex-basis:100%;width:100%;grid-column:1/-1;box-sizing:border-box;display:flex;flex-direction:column;gap:8px;margin-top:10px;padding:10px 12px;border-radius:12px;background:rgba(255,59,48,.12);border:1px solid #ff3b30;text-align:left}
.dw .pt-warn b{display:block;color:#ff3b30;font-size:15px}
.dw .pt-warn span{display:block;font-size:15px;overflow-wrap:anywhere}
.dw .pt-warn small{display:block;color:var(--mut)}
.dw .pt-warn button{align-self:flex-end;min-height:36px;padding:6px 14px}
.pt-flash{animation:pt-flash 1s ease-in-out 4}
@keyframes pt-flash{50%{box-shadow:0 0 0 4px #ff9500}}
/* trong app Android (inapp.js): không bán, không dẫn tới mua */
html.in-android-app [data-ch="upgrade"],html.in-android-app #ch-upgrade,html.in-android-app #upgrade-card,html.in-android-app #support-plan,html.in-android-app #plan-copy,html.in-android-app #ps-copy,html.in-android-app #plan-days-box,html.in-android-app .web-only{display:none!important}
