*{margin:0;padding:0;box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html,body{height:100%;background:#000;color:#fff;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif;overscroll-behavior:none}
button{font-family:inherit;border:none;cursor:pointer;color:inherit;background:none}
[hidden]{display:none!important}

/* calculator cover */
#calc{height:100%;display:flex;flex-direction:column;justify-content:flex-end;max-width:440px;margin:0 auto;padding:16px 16px calc(20px + env(safe-area-inset-bottom));user-select:none;-webkit-user-select:none}
#disp{font-size:72px;font-weight:300;text-align:right;padding:0 10px 14px;white-space:nowrap;overflow:hidden}
#keys{display:grid;grid-template-columns:repeat(4,1fr);gap:12px}
#keys button{aspect-ratio:1;border-radius:50%;background:#333;font-size:30px;touch-action:manipulation}
#keys button:active{filter:brightness(1.5)}
#keys .fn{background:#a5a5a5;color:#000;font-size:24px}
#keys .op{background:#ff9f0a;font-size:34px}
#keys .wide{grid-column:span 2;aspect-ratio:auto;border-radius:60px;text-align:left;padding-left:30px}

/* space */
#chat{height:100%;display:flex;flex-direction:column;background:#0b0d12;max-width:760px;margin:0 auto}
#chat header{display:flex;align-items:center;gap:4px;padding:calc(8px + env(safe-area-inset-top)) 8px 8px;background:#12151c;border-bottom:1px solid #1e2330}
#title{flex:1;min-width:0;padding:0 6px}
#title b{display:block;font-size:16px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#title small{font-size:12px;color:#8a93a6}
.ico{min-width:42px;height:42px;border-radius:21px;font-size:19px}
.ico:active{background:#232836}
#list{flex:1;overflow-y:auto;padding:12px;display:flex;flex-direction:column;gap:6px}
.m{max-width:78%;padding:8px 12px;border-radius:16px;font-size:15.5px;line-height:1.35;white-space:pre-wrap;overflow-wrap:anywhere;background:#1c2130;align-self:flex-start}
.m.me{background:#3b5bdb;align-self:flex-end}
.m.sys{align-self:center;background:none;color:#8a93a6;font-size:12.5px}
.m small{display:block;font-size:10.5px;opacity:.6;margin-top:3px;text-align:right}
.m img{display:block;max-width:100%;max-height:300px;border-radius:10px}
.m .tap{display:block;padding:14px 18px;border:1px dashed #6b7690;border-radius:10px;font-size:14px}
#chat footer{display:flex;align-items:flex-end;gap:4px;padding:8px 8px calc(8px + env(safe-area-inset-bottom));background:#12151c;border-top:1px solid #1e2330}
#inp{flex:1;resize:none;max-height:120px;font:inherit;font-size:16px;color:#fff;background:#1c2130;border:none;outline:none;border-radius:20px;padding:10px 14px}
#onceL{font-size:11px;color:#8a93a6;align-self:center;white-space:nowrap}
.send{background:#3b5bdb}

/* sheets */
#sheet{position:fixed;inset:0;background:rgba(0,0,0,.6);display:flex;align-items:flex-end;justify-content:center;z-index:20}
#sheetBox{width:100%;max-width:520px;max-height:92%;overflow-y:auto;background:#171a22;border-radius:18px 18px 0 0;padding:20px 18px calc(22px + env(safe-area-inset-bottom))}
#sheetBox h2{font-size:19px;margin-bottom:6px}
#sheetBox p{font-size:14px;color:#a3abbd;line-height:1.45;margin:6px 0 12px}
#sheetBox label{display:block;font-size:12.5px;color:#8a93a6;margin:12px 0 5px}
#sheetBox input[type=text],#sheetBox input[type=tel],#sheetBox select,#sheetBox textarea{width:100%;font:inherit;font-size:16px;color:#fff;background:#0f1218;border:1px solid #2a3040;border-radius:10px;padding:11px 12px;outline:none}
#sheetBox textarea{font-family:ui-monospace,Menlo,Consolas,monospace;font-size:13px;resize:none}
#sheetBox .chk{display:flex;gap:9px;align-items:flex-start;font-size:13.5px;color:#c8cedb}
#sheetBox .chk input{margin-top:3px}
#sheetBox a{color:#8fa6ff}
.tabs{display:flex;gap:6px;margin:10px 0 2px}
.tabs button{flex:1;padding:9px 4px;border-radius:10px;background:#0f1218;font-size:14px;color:#a3abbd}
.tabs button.on{background:#3b5bdb;color:#fff}
.btn{display:block;width:100%;margin-top:16px;padding:13px;border-radius:12px;background:#3b5bdb;font-size:16px;font-weight:600}
.btn.alt{background:#262b38}
.btn.bad{background:#7a1f2a}
.err{color:#ff8b8b;font-size:13.5px;margin-top:10px;min-height:18px}
.bar{height:8px;border-radius:4px;background:#0f1218;overflow:hidden;margin:6px 0}
.bar i{display:block;height:100%;background:#3b5bdb}

/* call */
#call{position:fixed;inset:0;background:#000;z-index:30}
#vRemote{width:100%;height:100%;object-fit:cover}
#vLocal{position:absolute;right:14px;top:calc(14px + env(safe-area-inset-top));width:110px;height:150px;object-fit:cover;border-radius:12px;background:#111}
#callInfo{position:absolute;left:0;right:0;top:38%;text-align:center;font-size:20px;text-shadow:0 1px 4px #000}
#callBtns{position:absolute;left:0;right:0;bottom:calc(34px + env(safe-area-inset-bottom));display:flex;justify-content:center;gap:14px}
.pill{padding:14px 26px;border-radius:30px;background:#2b3040;font-size:16px;font-weight:600}
.pill.ok{background:#1f9d55}.pill.bad{background:#d63a3a}

#viewer{position:fixed;inset:0;background:#000;z-index:40;display:flex;align-items:center;justify-content:center}
#viewer img{max-width:100%;max-height:100%}
