:root{font-family:system-ui,-apple-system,"Noto Sans Thai","Segoe UI",sans-serif;font-synthesis:none;color:#172b4d;background:#f3f7ff;color-scheme:light}*{box-sizing:border-box}html,body{margin:0;min-height:100%;overflow-x:hidden}body{background:radial-gradient(ellipse at 15% -5%,#dfebff 0%,#f3f7ff 52%,#f9fbff 100%);min-height:100dvh}button,input{font:inherit}button{cursor:pointer}button:focus-visible,input:focus-visible,summary:focus-visible{outline:3px solid #237dcd;outline-offset:2px}button:disabled{opacity:.48;cursor:not-allowed}.shell{width:min(820px,100%);height:100dvh;height:100svh;min-height:440px;margin:0 auto;padding:max(10px,env(safe-area-inset-top)) 12px max(10px,env(safe-area-inset-bottom));display:flex;flex-direction:column;gap:10px}.topbar{display:flex;align-items:center;gap:10px;flex:0 0 auto}.brandmark{height:41px;width:41px;display:grid;place-items:center;border-radius:14px;background:linear-gradient(145deg,#7bd1ff,#477fee 70%,#6859d9);font-size:28px;color:white;box-shadow:0 8px 20px #527cec2a}.brand{min-width:0}.brand-kicker,.eyebrow{color:#6583ad;letter-spacing:1.3px;font-weight:800;font-size:10px}.brand h1{font-size:20px;line-height:1.25;margin:2px 0 0;letter-spacing:-.3px;color:#173767}.connection{margin-left:auto;display:flex;gap:6px;align-items:center;color:#516c8f;font-size:11px;white-space:nowrap}.dot{height:9px;width:9px;border-radius:50%;background:#94a8c5}.connection.ok .dot{background:#12aa86;box-shadow:0 0 0 4px #d7f8ed}.connection.bad .dot{background:#e46662}.voice-card{padding:11px 13px;border-radius:19px;background:#fff;border:1px solid #d9e6fa;box-shadow:0 6px 24px #174b8a0d;flex:0 0 auto}.voice-identity{display:flex;align-items:center;gap:11px}.orb{flex:0 0 auto;width:54px;height:54px;border-radius:50%;display:grid;place-items:center;background:radial-gradient(circle at 25% 15%,#a7e9ff,#6e92f8 44%,#5854db 100%);box-shadow:inset -4px -5px 12px #29459a32,0 4px 15px #5a8cdb35}.orb span{font-size:31px;color:#f8fbff}.orb.listening{animation:breathe 1s infinite alternate}.orb.talking{animation:breathe .45s infinite alternate}.orb.thinking{animation:glow 1.2s infinite alternate}.voice-title{min-width:0}.voice-title h2{font-size:17px;margin:2px 0 0;line-height:1.3;color:#1c3760}.voice-title p{font-size:12px;color:#6380a7;line-height:1.35;margin:2px 0 0}.signal{height:4px;background:#e9effa;border-radius:99px;margin:10px 1px;overflow:hidden}.signal span{display:block;width:0;height:100%;transition:width .25s;background:linear-gradient(90deg,#6e69f4,#3caadf);border-radius:99px}.voice-actions{display:grid;grid-template-columns:1.6fr 1fr;gap:9px}.voice-actions button{border:0;border-radius:12px;padding:10px;font-weight:800;font-size:15px;min-height:46px}.start-btn{background:linear-gradient(115deg,#675ef4,#3dabe8);color:white}.stop-btn{background:#e6eefb;color:#214472}.stop-btn:not(:disabled){background:#fff0f0;color:#bd3c48;border:1px solid #f1c4c8}.voice-notice{color:#54739c;font-size:12px;margin-top:8px;text-align:center;min-height:15px}.conversation{flex:1 1 auto;min-height:0;display:flex;flex-direction:column;border:1px solid #d7e4f6;border-radius:20px;background:#fff;padding:12px;box-shadow:0 10px 32px #174b8a0d}.conversation-head{display:flex;align-items:center;justify-content:space-between;flex:0 0 auto;padding:2px 2px 10px;border-bottom:1px solid #e8eff8}.conversation-head h2{font-size:20px;line-height:1.2;margin:3px 0 0;color:#18345f}.conversation-tools{display:flex;align-items:center;gap:7px}.iconbtn,.clear-btn{border:1px solid #d1def1;background:#f2f6ff;color:#345d94;border-radius:10px;min-height:36px;padding:7px 11px;font-size:12px}.iconbtn{font-size:17px}.chat{min-height:0;flex:1 1 auto;overflow-y:auto;display:flex;flex-direction:column;gap:12px;padding:16px 3px;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#b3c6e5 transparent}.empty-chat{margin:auto;text-align:center;display:grid;justify-items:center;gap:10px;color:#607da5;line-height:1.7;font-size:14px}.empty-chat strong{color:#234677;font-size:18px}.empty-symbol{font-size:43px;color:#808ef1}.bubble{max-width:91%;padding:12px 15px;border-radius:17px;white-space:pre-wrap;overflow-wrap:anywhere;font-size:17px;line-height:1.65;box-shadow:0 3px 10px #102d550b}.bubble.mine{background:linear-gradient(145deg,#596df4,#4c93ec);color:#fff;align-self:flex-end;border-bottom-right-radius:5px}.bubble.bot{background:#edf4ff;color:#18345d;align-self:flex-start;border:1px solid #d9e9ff;border-bottom-left-radius:5px}.composer{border:1px solid #ccdff7;background:#f7faff;border-radius:15px;display:flex;gap:7px;align-items:center;flex:0 0 auto;padding:5px}.composer input{background:transparent;border:0;outline:none;color:#1c375b;flex:1;min-width:0;min-height:40px;font-size:16px;padding:8px 11px}.composer input::placeholder{color:#8199b9}.composer button{border:0;background:linear-gradient(135deg,#7066ed,#4d98ef);color:#fff;font-size:20px;font-weight:700;border-radius:11px;width:46px;height:43px}.advanced{flex:0 0 auto;border:1px solid #d7e3f5;border-radius:13px;background:#fff;color:#496c99;padding:0 12px;font-size:12px}.advanced summary{cursor:pointer;padding:10px 3px}.advanced-content{display:grid;gap:9px;padding:0 0 12px}.advanced p{margin:0;line-height:1.5}.advanced audio{width:100%;height:38px}.advanced a{color:#176cc3}.advanced a[hidden]{display:none}.test-btn{background:#eaf2ff;border:1px solid #d4e3f9;border-radius:9px;color:#24588e;padding:10px}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}@keyframes breathe{to{transform:scale(1.055);filter:brightness(1.13)}}@keyframes glow{to{filter:hue-rotate(40deg)}}@media(max-width:400px){.connection span:last-child{display:none}.brand h1{font-size:18px}.voice-card{padding:10px}.conversation{padding:10px}.bubble{font-size:16px}}@media(min-width:700px){.shell{padding:18px;gap:12px}.conversation{min-height:350px}.chat{padding:20px 14px}.bubble{max-width:74%}}@media(max-height:700px){.voice-card{padding:9px 11px}.orb{height:43px;width:43px}.orb span{font-size:26px}.voice-notice{display:none}.voice-actions button{min-height:40px;padding:7px}.conversation{min-height:0}}

/* 4.2 accessibility and conversation-first refinements */
.start-btn:disabled{opacity:.55}.voice-notice{line-height:1.5}.chat{scroll-behavior:smooth}.bubble{font-size:17px}.voice-actions button{touch-action:manipulation}.start-btn:focus-visible,.stop-btn:focus-visible{outline:3px solid #1e6ad9;outline-offset:3px}

/* Vision attachment controls, mobile-first and keyboard-accessible */
.attachment-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap;padding:8px 2px 5px;}
.attach-btn{display:inline-flex;align-items:center;justify-content:center;gap:5px;background:#edf1ff;color:#244a85;border-radius:11px;padding:10px 12px;font-weight:700;font-size:13px;cursor:pointer;min-height:43px;touch-action:manipulation;}
.attach-btn:focus-within{outline:3px solid #237dcd;outline-offset:2px;}
#image-hint{font-size:11px;color:#607da5;flex:1;min-width:145px;}
.image-preview{display:flex;gap:11px;align-items:center;padding:10px;background:#eef2ff;border:1px solid #dce5fa;border-radius:15px;margin-top:8px;}
.image-preview[hidden]{display:none;}
.image-preview img{width:75px;height:75px;object-fit:cover;border-radius:11px;background:#dfeafa;}
.image-meta{display:grid;gap:4px;min-width:0;flex:1;font-size:13px;color:#193b69;}
.image-meta span{font-size:11px;color:#6582aa;overflow-wrap:anywhere;}
#remove-image{border:0;border-radius:50%;width:36px;height:36px;background:#fff;color:#2c497b;font-size:18px;}
.image-bubble img{display:block;width:min(250px,100%);max-height:220px;object-fit:contain;border-radius:10px;margin-bottom:6px;}
@media(max-width:410px){.attach-btn{font-size:12px;padding:9px 10px;}#image-hint{flex-basis:100%;}}

/* Global search controls and source citations */
.web-search-toggle[aria-pressed="true"]{background:linear-gradient(120deg,#e6f4ff,#e9e7ff);border:1px solid #8daaf0;color:#263f91;}
.source-list{font-size:13px;} .source-list strong{display:block;margin-bottom:5px;} .source-item{margin-top:5px;overflow-wrap:anywhere;} .source-item a{color:#225eaa;text-decoration:underline;} .source-item small{color:#6681a5;}
/* 4.7.1 camera re-apply */
.image-preview img{background:#fff;border:1px solid #ccdcf5;box-shadow:0 2px 10px rgba(36,74,133,.08);}
.camera-panel{margin-top:8px;border:1px solid #cfe0f6;border-radius:14px;background:#0f1d2e;padding:8px;}
.camera-panel[hidden]{display:none}
.camera-panel video{display:block;width:100%;max-height:300px;border-radius:10px;background:#000;}
.camera-head{display:flex;align-items:center;gap:8px;color:#dceaff;font-size:13px;padding:2px 4px 8px;}
.camera-dot{width:8px;height:8px;border-radius:50%;background:#ff5d6c;}
.camera-flip{margin-left:auto;border:1px solid #45638e;background:#1b3451;color:#dceaff;border-radius:9px;min-height:34px;padding:5px 10px;font-size:12px;cursor:pointer;}
.camera-tip{margin:8px 2px 0;color:#b9d0ef;font-size:12px;text-align:center;}
.camera-actions{display:grid;grid-template-columns:2fr 1fr;gap:10px;margin-top:8px;}
.camera-shutter{border:0;border-radius:11px;min-height:52px;font-size:17px;background:linear-gradient(135deg,#675ef4,#3dabe8);color:#fff;font-weight:800;}
.camera-cancel{border:1px solid #45638e;background:#1b3451;color:#e6f0ff;border-radius:11px;min-height:52px;font-size:14px;font-weight:700;cursor:pointer;}
