:root{--ink:#263d40;--sage:#86ab9c;--mint:#dff6e9;--coral:#e7a08e;--cream:#faf9f6;--line:#dce5e1;--shadow:0 14px 40px #263d4020;--vh:100dvh;color-scheme:light}
*{box-sizing:border-box}html,body{margin:0;height:100%;overflow:hidden}body{background:#e9efed;color:var(--ink);font-family:system-ui,-apple-system,"Noto Sans Thai",sans-serif;display:flex;flex-direction:column}
button,input,select{font:inherit}button{cursor:pointer}button:focus-visible,input:focus-visible,select:focus-visible{outline:3px solid #f5a971;outline-offset:2px}
[hidden]{display:none!important}
.toolbar{z-index:10;min-height:60px;display:flex;align-items:center;gap:12px;background:#fff;border-bottom:1px solid var(--line);padding:8px max(12px,env(safe-area-inset-right)) 8px max(12px,env(safe-area-inset-left));box-shadow:0 2px 12px #263d4010}
.brand{display:flex;align-items:center;gap:7px;white-space:nowrap}.brand-mark{font-size:22px;letter-spacing:-11px;width:44px;transform:translateY(-3px)}.brand strong{display:block;font-size:14px;letter-spacing:.6px}.brand small{display:block;font-size:10px;color:#647e78}
.screen-title{font-size:14px;font-weight:700;margin-left:auto;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;max-width:30vw}.toolbar-actions{display:flex;align-items:center;gap:8px;margin-left:auto}
.tool-button{border:1px solid var(--line);background:#fff;color:var(--ink);border-radius:10px;min-height:40px;padding:7px 11px;font-size:13px;white-space:nowrap}.tool-button:hover{background:#f1f9f5}.menu-icon{font-size:20px;font-weight:700;min-width:42px}.device-select{display:flex;align-items:center;gap:6px;font-size:12px;color:#5b746d}.device-select select{border:1px solid var(--line);color:var(--ink);background:#fff;border-radius:10px;min-height:40px;padding:0 26px 0 8px}
.main{min-height:0;flex:1;position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;overflow:hidden;padding:8px 12px}
.stage{width:100%;min-height:0;flex:1;display:flex;align-items:center;justify-content:center;position:relative;overflow:hidden}
.canvas{position:relative;width:100px;height:100px;max-width:100%;overflow:hidden;box-shadow:var(--shadow);border-radius:5px;touch-action:manipulation;background:#fff}
.canvas img{position:absolute;inset:0;width:100%;height:100%;display:block;user-select:none;-webkit-user-select:none;pointer-events:none}
.hotspot-layer{position:absolute;inset:0;overflow:hidden}
.hotspot{position:absolute;border:0;padding:0;background:transparent;border-radius:8px;color:transparent;display:flex;align-items:center;justify-content:center;touch-action:manipulation;appearance:none;-webkit-tap-highlight-color:#1b7f6733}
.hotspot:hover,.hotspot:focus-visible{background:#229c7940;outline:2px solid #229c79;outline-offset:-2px;color:#194d40}
.hotspot .spot-label{pointer-events:none;background:#fffdf3d9;border-radius:7px;color:#165947;font-size:clamp(7px,1.25vw,12px);padding:2px 4px;font-weight:700;box-shadow:0 1px 3px #0002;white-space:nowrap;max-width:100%;overflow:hidden;text-overflow:ellipsis;opacity:0}
body.show-hints .hotspot{outline:2px dashed #ff8c42;outline-offset:-2px;background:#ffeab255;color:var(--ink)}body.show-hints .hotspot .spot-label,.hotspot:hover .spot-label,.hotspot:focus-visible .spot-label{opacity:1}
body.show-hints .hotspot::after{content:"";width:5px;height:5px;border-radius:50%;background:#c76b35;position:absolute;top:3px;right:3px}
.missing-image{padding:16px;background:#fff4dc;border-radius:10px}
.statusbar{z-index:8;display:flex;justify-content:space-between;gap:12px;align-items:center;min-height:35px;background:#fff;border-top:1px solid var(--line);padding:7px 16px;font-size:11px;color:#657a73}
.statusbar strong{color:var(--ink);margin-right:10px}.status-right{display:flex;gap:12px;align-items:center}.demo-label{color:#71857f}
.floating-tools{display:none;position:absolute;left:max(8px,env(safe-area-inset-left));top:max(8px,env(safe-area-inset-top));z-index:12;gap:6px}
.floating-tools button{width:38px;height:38px;border:1px solid #ffffffa6;border-radius:11px;background:#263d40dd;color:#fff;box-shadow:0 2px 8px #0002;font-size:22px}
body.immersive .toolbar,body.immersive .statusbar{display:none}body.immersive .main{padding:0}body.immersive .floating-tools{display:flex}body.immersive .canvas{border-radius:0;box-shadow:none}
.tourbar{position:absolute;bottom:12px;z-index:9;left:50%;transform:translateX(-50%);display:flex;align-items:center;gap:9px;background:#263d40f1;color:#fff;border-radius:15px;padding:9px 12px;max-width:min(96vw,800px);box-shadow:var(--shadow)}
.tour-left{display:flex;gap:8px;align-items:center;min-width:0;white-space:nowrap}.tour-left strong{font-size:13px}.tour-left span{font-size:11px;color:#d5e7dc}
.tourbar button{border:0;border-radius:10px;padding:8px 11px;font-size:12px;min-height:38px;white-space:nowrap}
.tour-next{background:#9fe7bf;color:#183e34;font-weight:800}.tour-stop{background:#ffffff29;color:#fff}
.drawer-backdrop,.dialog-backdrop{position:fixed;inset:0;background:#0c222c80;z-index:29}
.drawer{z-index:30;position:fixed;inset:0 auto 0 0;background:#fafcfb;width:min(390px,92vw);box-shadow:15px 0 40px #0003;transform:translateX(-105%);transition:transform .22s ease;display:flex;flex-direction:column;overflow:hidden;visibility:hidden}
.drawer.open{transform:translateX(0);visibility:visible}
.drawer-top{display:flex;align-items:flex-start;justify-content:space-between;background:var(--ink);color:#fff;padding:24px 20px 17px}.drawer-top h2{margin:4px 0;font-size:21px}.drawer-top p{font-size:13px;opacity:.8;margin:0}.drawer-eyebrow,.dialog-eyebrow{font-weight:800;font-size:11px;letter-spacing:1px;color:#a9ebc9}
.icon-close{background:#ffffff24;border:0;border-radius:10px;color:#fff;width:38px;height:38px;font-size:26px;line-height:1}
.drawer-body{overflow-y:auto;overscroll-behavior:contain;padding:16px 18px calc(24px + env(safe-area-inset-bottom))}
.drawer-block{display:flex;flex-direction:column;gap:9px;margin-bottom:15px}.drawer-block>strong{font-size:13px}.drawer-block select,.drawer-block input{width:100%;min-height:44px;border:1px solid #d3e1d9;background:#fff;border-radius:11px;padding:9px 11px;color:var(--ink)}
.hint{font-size:11px;color:#799089;margin:0}.scenario-buttons{display:grid;grid-template-columns:1fr 1fr;gap:8px}.scenario-buttons button{background:#eff8f2;color:#1e5146;border:1px solid #cde4d6;border-radius:11px;padding:10px 8px;min-height:44px;font-size:12px;font-weight:700}
.group-head{font-size:12px;text-transform:none;color:#7d9189;padding:15px 7px 5px;border-bottom:1px solid #e2ece6;font-weight:800}
.screen-link{width:100%;background:transparent;border:0;border-radius:10px;padding:10px 9px;text-align:left;display:flex;align-items:center;gap:9px;font-size:13px;min-height:43px;color:#304b48}
.screen-link:hover{background:#eaf5ef}.screen-link.current{background:#d6f2e1;font-weight:800;color:#125a40}.screen-id{font-size:11px;background:#e8eeeb;padding:4px 5px;border-radius:6px;min-width:27px;text-align:center}.screen-link.locked{opacity:.45}.drawer-end{font-size:12px;color:#82928a;line-height:1.6}
.dialog-backdrop{z-index:39}.demo-dialog{z-index:40;position:fixed;left:50%;top:50%;transform:translate(-50%,-50%);width:min(540px,calc(100vw - 24px));max-height:min(86vh,750px);display:flex;flex-direction:column;background:#fff;border:1px solid #e1eee6;box-shadow:0 18px 65px #0003;border-radius:20px;overflow:hidden}
.dialog-head{padding:19px 20px 13px;display:flex;justify-content:space-between;gap:16px;background:#f7fbf8;border-bottom:1px solid #e9f1ec}.dialog-eyebrow{color:#4c9d78}.dialog-head h2{font-size:20px;margin:5px 0}.dialog-head .icon-close{color:#35554a;background:#e6f2eb}
.dialog-body{padding:18px 20px;overflow:auto;font-size:14px}.dialog-body p{line-height:1.7}.dialog-body label{display:block;font-weight:700;margin:10px 0 6px}.dialog-body input,.dialog-body select,.dialog-body textarea{width:100%;border:1px solid #d1e2d8;border-radius:10px;min-height:44px;padding:10px;color:#24483a;background:#fff}
.dialog-body .chipset{display:flex;flex-wrap:wrap;gap:8px}.dialog-body .chipset button{border:1px solid #bfd8c9;background:#f8fcf9;border-radius:11px;min-height:43px;padding:8px 13px}.dialog-body .chipset button.active{border-color:#19875b;background:#d8f3e4;color:#166043;font-weight:800}
.dialog-body .summary-box{background:#f5faf7;border-radius:12px;padding:13px;margin:12px 0;border:1px solid #dfede5}.dialog-body .muted{color:#74867f;font-size:12px}.dialog-body .row{display:flex;justify-content:space-between;align-items:center;gap:8px;margin:7px 0}.dialog-body .row strong{font-variant-numeric:tabular-nums}.dialog-body .warning{padding:10px;background:#fff6e3;border:1px solid #f3d8a0;border-radius:10px;font-size:12px}
.dialog-foot{display:flex;justify-content:flex-end;gap:8px;padding:13px 20px;background:#f9fcfa;border-top:1px solid #e5f0e9}.dialog-foot button{min-height:43px;padding:9px 14px;border-radius:10px;border:1px solid #d4e4da;background:#fff;color:var(--ink);font-weight:700}.dialog-foot button.primary{background:#1d865b;color:#fff;border-color:#1d865b}
.toast{position:fixed;bottom:55px;left:50%;transform:translateX(-50%);background:#263d40;color:#fff;padding:12px 16px;border-radius:13px;z-index:50;box-shadow:var(--shadow);font-size:13px;max-width:90vw}
.noscript{position:fixed;inset:0;background:#fff;padding:24px;z-index:100}
@media(max-width:900px){.toolbar{min-height:53px;padding:5px 9px;gap:5px}.screen-title{display:none}.brand strong{font-size:11px}.brand small{font-size:9px}.toolbar-actions{gap:5px}.device-select>span{display:none}.device-select select{max-width:115px;padding:0 17px 0 6px;font-size:11px}.tool-button{font-size:11px;min-height:40px;padding:6px 7px}.wide-label{display:none}.statusbar{font-size:10px}.demo-label{display:none}.main{padding:5px}.tourbar{bottom:5px}}
@media(max-width:480px){.brand-mark{font-size:18px;width:34px;letter-spacing:-9px}.brand small{display:none}.brand strong{font-size:11px}.tool-button{padding:5px 6px}.toolbar-actions{gap:3px}.device-select select{max-width:88px}.tour-left{display:flex;flex-direction:column;align-items:flex-start;gap:1px}.tourbar{gap:5px;padding:5px 7px}.tourbar button{padding:6px 7px}.dialog-head h2{font-size:18px}.dialog-body{padding:14px}}
@media(prefers-reduced-motion:reduce){.drawer{transition:none}}

.canvas.loading::before{content:'กำลังเปิดหน้าจอ…';position:absolute;inset:0;z-index:1;display:flex;align-items:center;justify-content:center;color:#52716b;background:#f6fbf8;font-size:14px;font-weight:700}

/* Small, targeted permission addition (original approved UI palette retained). */
.privacy-layer{position:absolute;inset:0;z-index:1;pointer-events:none;overflow:hidden;font-family:system-ui,-apple-system,"Noto Sans Thai",sans-serif}
.hotspot-layer{z-index:2}
.cost-redaction{position:absolute;display:flex;align-items:center;justify-content:center;background:#fff;color:#53786d;font-size:clamp(7px,1.1vw,13px);font-weight:700;border-radius:2px;white-space:nowrap;overflow:hidden}
.cost-hidden-hint{position:absolute;right:2%;top:13%;color:#215d49;background:#e7f6ed;border:1px solid #bfe2ce;border-radius:7px;padding:.4% .7%;font-weight:700;font-size:clamp(7px,1.2vw,14px)}
.cost-hidden-hint.phone{top:47%;left:20%;right:auto;font-size:clamp(7px,1.5vw,11px);padding:1% 2%}
.cost-restricted-shield{position:absolute;left:14%;top:22%;width:85%;height:70%;border:1px solid #d5e6da;border-radius:2%;background:#faf9f6;box-shadow:0 3px 14px #263d400c;padding:3% 4%;display:flex;flex-direction:column;gap:4%;color:#263d40;font-size:clamp(10px,1.5vw,18px)}
.cost-restricted-shield.ipad{top:27%;left:2%;width:96%;height:62%}
.cost-restricted-shield.iphone{top:42%;left:2%;width:96%;height:48%;font-size:clamp(9px,2.4vw,13px);gap:3%}
.cost-restricted-shield strong{color:#194c3b;font-size:1.2em}.cost-restricted-shield>span{color:#ae6b45;font-weight:800}
.cost-restricted-shield small{font-size:.82em;color:#718d81}
.safe-data-grid{display:grid;grid-template-columns:2fr .7fr .9fr;gap:6px;background:#fff;border:1px solid #e1e9e3;border-radius:8px;padding:2% 3%;font-size:.88em}
.safe-data-grid:first-of-type{font-weight:800;background:#e9f6ee}
.permission-demo-note{position:absolute;left:17%;right:2%;bottom:1%;background:#e7f6ed;color:#214f40;border:1px solid #bde0c9;border-radius:7px;font-weight:800;font-size:clamp(7px,1.25vw,13px);padding:.8%}
body[data-device="iphone"] .permission-demo-note{bottom:11%;left:3%;right:3%;padding:1.3%;font-size:clamp(7px,2vw,10px)}
body[data-device="ipad"] .permission-demo-note{bottom:12%;left:2%;right:2%;padding:.7%}
.cost-role-status{font-size:12px;line-height:1.45;border:1px solid #d0e4d8;background:#eff9f3;border-radius:10px;margin:0;padding:9px 11px;font-weight:700;color:#1f6549}
.cost-role-matrix{display:flex;flex-direction:column;gap:8px;margin-top:10px}
.cost-role-row{display:flex!important;justify-content:space-between;align-items:center;gap:10px;margin:0!important;border:1px solid #e1eae5;border-radius:12px;background:#fff;padding:11px 12px;min-height:58px;cursor:pointer}
.cost-role-row span{display:flex;flex-direction:column;gap:4px}
.cost-role-row strong{font-size:14px;color:#263d40}
.cost-role-row small{color:#71877c;font-size:11px;font-weight:400}
.cost-role-row input[type="checkbox"]{appearance:none;-webkit-appearance:none;width:46px!important;min-width:46px;max-width:46px;height:27px!important;min-height:27px!important;margin:0!important;padding:0!important;border:0!important;border-radius:20px!important;background:#c9d3cf;position:relative;transition:background .12s;cursor:pointer}
.cost-role-row input[type="checkbox"]::after{content:"";position:absolute;top:3px;left:3px;width:21px;height:21px;background:#fff;border-radius:50%;box-shadow:0 1px 3px #0003;transition:left .12s}
.cost-role-row input[type="checkbox"]:checked{background:#278967}
.cost-role-row input[type="checkbox"]:checked::after{left:22px}
.cost-role-row input[type="checkbox"]:disabled{opacity:.65;cursor:not-allowed}
@media(max-width:480px){.cost-role-row{padding:10px;min-height:56px}.cost-role-row strong{font-size:13px}.cost-role-row small{font-size:10px}}

.cost-inventory-phone-safe{position:absolute;left:1.5%;top:48.5%;width:97%;height:43%;padding:2%;display:flex;flex-direction:column;gap:1.3%;background:#faf9f6;color:#263d40;overflow:hidden}
.cost-inventory-phone-safe h3{font-size:clamp(8px,2.7vw,13px);margin:0 0 1%;color:#22553f;display:flex;justify-content:space-between;align-items:center}
.cost-inventory-phone-safe h3 small{font-size:.8em;font-weight:600;color:#936c4b}
.safe-product-card{flex:1;min-height:0;background:#fff;border:1px solid #e7eee8;border-radius:7px;padding:1.4% 2%;display:grid;grid-template-columns:1.75fr 1fr .35fr;align-items:center;gap:2%;box-shadow:0 1px 3px #263d400a}
.safe-product-card span{display:flex;flex-direction:column;gap:2px;min-width:0}
.safe-product-card b{font-size:clamp(8px,2.25vw,12px);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.safe-product-card small{font-size:clamp(7px,1.75vw,10px);color:#82928a}
.safe-product-card strong{text-align:center;color:#267950;font-size:clamp(11px,2.8vw,15px);background:#e3f5e7;border-radius:7px;padding:6px 1px}
.safe-product-add{height:8%;min-height:15px;background:linear-gradient(120deg,#32976e,#197f5b);border-radius:6px;color:#fff;text-align:center;font-size:clamp(8px,2.1vw,12px);font-weight:800;display:flex;align-items:center;justify-content:center}
