@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Space+Grotesk:wght@400;500;600;700&display=swap');
:root{color-scheme:dark;--bg:#0b1020;--sidebar:#0a0e1b;--surface:#141b30;--line:rgba(176,190,230,.12);--text:#f3f5ff;--muted:#929bb7;--muted2:#68728e;--accent:#9b8cff;--green:#63d9b1;--shadow:0 24px 70px rgba(0,0,0,.22)}
*{box-sizing:border-box}html,body{margin:0;min-height:100%;background:var(--bg);color:var(--text);font-family:'DM Sans',sans-serif}body{min-height:100vh}button,textarea{font:inherit}button{color:inherit;cursor:pointer}.app-shell{display:flex;min-height:100vh}.sidebar{width:264px;flex-shrink:0;background:var(--sidebar);border-right:1px solid var(--line);padding:25px 15px 14px;display:flex;flex-direction:column;z-index:10}.brand{display:flex;align-items:center;gap:11px;padding:0 7px 27px}.brand-mark{width:37px;height:37px;border-radius:12px;display:grid;place-items:center;position:relative;background:linear-gradient(145deg,#b6a8ff,#657dff);box-shadow:0 5px 24px #7b70ff38;color:#0c1023;font:700 22px 'Space Grotesk';overflow:hidden}.brand-mark i,.hero-mark i{position:absolute;width:4px;height:24px;background:#fff;border-radius:4px;right:8px;top:7px;transform:rotate(34deg);opacity:.85}.brand-name{font:700 17px 'Space Grotesk';letter-spacing:2.6px}.brand-caption{font-size:8px;letter-spacing:1.65px;color:var(--muted2);margin-top:3px}.icon-btn{border:1px solid transparent;background:transparent;border-radius:9px;width:35px;height:35px;color:var(--muted);font-size:18px;display:grid;place-items:center}.icon-btn:hover{background:var(--surface);border-color:var(--line);color:var(--text)}.sidebar-close{display:none;margin-left:auto}.new-chat{height:43px;width:100%;border:1px solid rgba(155,140,255,.27);background:linear-gradient(100deg,rgba(128,112,255,.15),rgba(96,129,255,.08));border-radius:11px;display:flex;align-items:center;gap:9px;padding:0 11px;font-size:12px;font-weight:600;text-align:left}.plus{font-size:19px;color:#b6a9ff}.shortcut{margin-left:auto;font-size:10px;color:var(--muted2);border:1px solid var(--line);border-radius:5px;padding:3px 5px}.side-label,.section-caption{font-size:9px;letter-spacing:1.9px;color:var(--muted2);font-weight:700}.side-label{margin:31px 10px 11px}.nav-list{display:grid;gap:5px}.nav-item{width:100%;display:flex;align-items:center;gap:12px;padding:11px 10px;background:transparent;border:1px solid transparent;border-radius:9px;text-align:left;font-size:12px;color:#a4acc4}.nav-item:hover{background:#151b2c}.nav-item.active{background:linear-gradient(90deg,rgba(144,126,255,.14),rgba(105,128,255,.05));border-color:rgba(155,140,255,.15);color:#e3deff}.nav-icon{font-size:18px;width:18px;text-align:center;color:#9690ff}.soon{margin-left:auto;font-size:8px;letter-spacing:.6px;color:#7b84a1;background:#1a2032;border-radius:4px;padding:4px 5px}.side-bottom{margin-top:auto}.status-card{display:flex;gap:10px;align-items:flex-start;padding:13px 10px;border:1px solid var(--line);border-radius:10px;background:rgba(255,255,255,.018);margin-bottom:13px}.status-dot{width:7px;height:7px;border-radius:50%;background:#e6b56d;box-shadow:0 0 12px #e6b56d45;margin-top:5px;flex-shrink:0}.status-card strong,.profile strong{display:block;font-size:11px;font-weight:600}.status-card small,.profile small{display:block;font-size:10px;color:var(--muted2);margin-top:5px}.profile{display:flex;align-items:center;gap:10px;padding:13px 5px 3px;border-top:1px solid var(--line)}.avatar{width:31px;height:31px;border-radius:10px;display:grid;place-items:center;background:linear-gradient(135deg,#4b5b88,#252e4b);font-weight:700;font-size:12px}.profile-copy{min-width:0}.profile-menu{margin-left:auto;color:var(--muted2);letter-spacing:1px}.main-panel{min-width:0;flex:1;display:flex;flex-direction:column}.topbar{height:67px;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;padding:0 34px;gap:12px}.breadcrumb{display:flex;align-items:center;gap:10px;font-size:11px;color:var(--muted2)}.breadcrumb span{letter-spacing:1.5px;font-weight:700;color:#aab1cb}.breadcrumb b{font-weight:400;color:#454d68}.breadcrumb strong{font-weight:500;color:#dfe3f4}.top-actions{display:flex;align-items:center;gap:12px}.private-pill{font-size:8px;letter-spacing:1.15px;color:#9ca7c5;border:1px solid var(--line);border-radius:6px;padding:7px 9px}.private-pill span{color:var(--green);font-size:8px;margin-right:4px}.content{width:min(100%,900px);margin:0 auto;padding:50px 30px 22px;display:flex;flex-direction:column;flex:1}.welcome{max-width:680px;width:100%;margin:0 auto}.eyebrow{display:flex;align-items:center;gap:9px;font-size:9px;letter-spacing:2px;font-weight:700;color:#a99cff}.eyebrow-line{height:1px;width:23px;background:#8e81ff}.hero-mark{width:47px;height:47px;margin-top:28px;border-radius:15px;display:grid;place-items:center;position:relative;background:linear-gradient(145deg,#b8a9ff,#7485ff);box-shadow:0 9px 35px #7c73ff30;color:#10142a;font:700 29px 'Space Grotesk';overflow:hidden}.hero-mark i{width:5px;height:30px;right:9px;top:8px}h1{font:600 clamp(37px,5vw,57px)/1.09 'Space Grotesk',sans-serif;letter-spacing:-2.3px;margin:21px 0 15px}h1 span{color:#a59aff}.intro{max-width:515px;color:#9ca5bf;font-size:13px;line-height:1.8;margin:0}.setup-note{display:flex;align-items:flex-start;gap:12px;padding:15px;margin-top:25px;border:1px solid rgba(155,140,255,.2);background:linear-gradient(105deg,rgba(132,116,255,.09),rgba(97,129,255,.035));border-radius:12px}.setup-icon{font-size:19px;color:#b6a8ff}.setup-note strong{font-size:11px}.setup-note p{font-size:11px;line-height:1.65;color:#98a2bf;margin:5px 0 0}.setup-state{font-size:8px;letter-spacing:.8px;color:#e7c17c;background:rgba(231,193,124,.09);border:1px solid rgba(231,193,124,.16);border-radius:5px;padding:5px 6px;white-space:nowrap;margin-left:auto}.section-caption{margin:29px 0 12px}.suggestions{display:grid;grid-template-columns:1fr 1fr;gap:10px}.suggestion{min-width:0;display:flex;align-items:center;gap:11px;text-align:left;padding:13px 12px;background:rgba(255,255,255,.018);border:1px solid var(--line);border-radius:11px;transition:transform .18s,border-color .18s,background .18s}.suggestion:hover{transform:translateY(-2px);border-color:rgba(155,140,255,.34);background:rgba(155,140,255,.05)}.suggestion-icon{width:34px;height:34px;display:grid;place-items:center;flex-shrink:0;border-radius:10px;font-size:19px}.violet{background:#30274b;color:#b7a6ff}.blue{background:#1e2d4c;color:#8eb8ff}.amber{background:#3b3023;color:#f0c17e}.green{background:#1c3835;color:#7de0c2}.suggestion strong{display:block;font-size:11px;font-weight:600}.suggestion small{display:block;font-size:10px;color:var(--muted2);margin-top:5px;line-height:1.4}.arrow{margin-left:auto;color:#68728e;font-size:15px;align-self:flex-start}.composer-wrap{width:100%;max-width:680px;margin:auto auto 0;padding-top:30px}.composer{border:1px solid rgba(157,169,209,.2);border-radius:15px;background:#11182a;box-shadow:var(--shadow);padding:14px 14px 10px;transition:border-color .2s}.composer:focus-within{border-color:rgba(155,140,255,.55)}textarea{display:block;width:100%;resize:none;max-height:160px;background:transparent;border:0;outline:0;color:var(--text);font-size:13px;line-height:1.65;min-height:31px}textarea::placeholder{color:#737e9c}.composer-bottom{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-top:7px}.composer-tools{display:flex;align-items:center;gap:10px;flex-wrap:wrap}.model-chip{display:flex;align-items:center;gap:6px;color:#b3bbd3;font-size:9px;border:1px solid var(--line);border-radius:6px;padding:6px 8px}.model-dot{width:6px;height:6px;border-radius:50%;background:#a59aff}.composer-hint{font-size:9px;color:#6e7894}.send-btn{width:32px;height:32px;border:0;border-radius:9px;background:linear-gradient(140deg,#b7a8ff,#7787ff);color:#101329;font-size:22px;font-weight:600;display:grid;place-items:center}.send-btn:hover{filter:brightness(1.1)}.disclaimer{text-align:center;font-size:9px;line-height:1.6;color:#626d89;margin:11px 0 0}.conversation{width:100%;max-width:680px;margin:0 auto 24px;display:flex;flex-direction:column;gap:16px;max-height:44vh;overflow:auto}.message{max-width:90%;padding:13px 15px;border-radius:13px;font-size:12px;line-height:1.75;white-space:pre-wrap;overflow-wrap:anywhere}.message.user{align-self:flex-end;background:#282546;border:1px solid #49406f}.message.assistant{align-self:flex-start;background:#131a2c;border:1px solid var(--line);color:#bfc7dc}.message-label{font-size:9px;letter-spacing:1px;color:#a69aff;font-weight:700;display:block;margin-bottom:6px}.hidden{display:none!important}.menu-toggle{display:none}.mobile-scrim{display:none}
body.light{color-scheme:light;--bg:#f4f6fc;--sidebar:#fff;--surface:#f1f3fa;--line:rgba(42,53,87,.13);--text:#172039;--muted:#626d89;--muted2:#7d86a0;--shadow:0 24px 70px rgba(28,41,78,.1)}body.light .composer{background:#fff}body.light .suggestion{background:#fff}body.light .message.assistant{background:#fff;color:#303a54}body.light .message.user{background:#efedff;color:#282044}body.light .setup-note{background:#f1efff}body.light .private-pill{color:#56617d}
@media(min-height:850px){.content{padding-top:66px}.composer-wrap{padding-bottom:9px}}
@media(max-width:760px){.sidebar{position:fixed;left:0;top:0;bottom:0;width:min(285px,84vw);transform:translateX(-105%);transition:transform .22s ease;box-shadow:var(--shadow)}.sidebar.open{transform:translateX(0)}.sidebar-close,.menu-toggle{display:grid}.mobile-scrim.visible{display:block;position:fixed;inset:0;background:rgba(0,0,0,.55);z-index:9}.topbar{height:59px;padding:0 15px}.breadcrumb{margin-right:auto}.private-pill{display:none}.content{padding:35px 18px 16px}.hero-mark{margin-top:24px}.intro{font-size:12px}.setup-note{padding:12px;gap:9px}.setup-note p{font-size:10px}.setup-state{font-size:7px;padding:4px}.suggestions{gap:8px}.suggestion{gap:8px;padding:11px 9px}.suggestion-icon{width:30px;height:30px}.suggestion strong{font-size:10px}.suggestion small{font-size:9px}.composer-wrap{padding-top:24px}.composer{padding:12px 11px 9px}.composer-hint{font-size:8px}.conversation{max-height:38vh}.disclaimer{font-size:8px}}
@media(max-width:380px){.content{padding-left:13px;padding-right:13px}.suggestions{grid-template-columns:1fr}.suggestion{padding:11px}.setup-state{display:none}h1{font-size:39px}.top-actions{gap:2px}}
@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important;transition:none!important}}

.memory-panel{margin-top:24px;border:1px solid var(--line);background:rgba(255,255,255,.025);border-radius:14px;padding:18px}
.memory-form{display:grid;gap:10px}.memory-form label{font-size:12px;font-weight:700;color:var(--text)}.memory-form textarea{border:1px solid var(--line);background:rgba(0,0,0,.12);border-radius:9px;padding:11px;min-height:78px}.memory-save{width:max-content;padding:0 14px;font-size:11px}.memory-list-title{display:flex;justify-content:space-between;align-items:center;margin:22px 0 10px;font-size:12px}.memory-list-title span{color:var(--muted2);font-size:10px}.memory-item{display:flex;align-items:flex-start;gap:12px;border-top:1px solid var(--line);padding:12px 0}.memory-item p{margin:0;flex:1;font-size:12px;line-height:1.65;white-space:pre-wrap;overflow-wrap:anywhere;color:var(--muted)}.memory-delete{background:rgba(255,100,120,.08);border:1px solid rgba(255,100,120,.2);color:#ff9eaa;border-radius:7px;padding:6px 9px;font-size:10px;flex-shrink:0}.memory-empty,.memory-privacy{font-size:10px;line-height:1.7;color:var(--muted2)}.memory-privacy{margin:17px 0 0}


/* Contrast and readability fixes for both themes */
:root { --focus-ring: rgba(125, 145, 255, .65); }
button:focus-visible, textarea:focus-visible, a:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 3px; }
body.light .brand-caption,
body.light .side-label,
body.light .section-caption,
body.light .breadcrumb,
body.light .breadcrumb span,
body.light .breadcrumb strong,
body.light .status-card small,
body.light .profile small,
body.light .suggestion small,
body.light .arrow,
body.light .composer-hint,
body.light .disclaimer,
body.light .memory-list-title span,
body.light .memory-empty,
body.light .memory-privacy { color: #59647d; }
body.light .nav-item { color: #38445f; }
body.light .nav-item:hover { background: #edf0fa; }
body.light .nav-item.active { color: #30265f; background: #efedff; border-color: #d8d1ff; }
body.light .nav-icon { color: #5145b5; }
body.light .soon { color: #4d5872; background: #e8ecf5; }
body.light .private-pill { color: #46516a; background: #fff; }
body.light .brand-name { color: #172039; }
body.light .breadcrumb b { color: #7b849a; }
body.light .intro { color: #4f5b75; }
body.light .setup-note { background: #f0efff; border-color: #d9d3ff; }
body.light .setup-note strong { color: #272044; }
body.light .setup-note p { color: #4c5670; }
body.light .setup-icon { color: #5548b7; }
body.light .setup-state { color: #735016; background: #fff4d9; border-color: #ead39a; }
body.light .suggestion { color: #202944; background: #fff; border-color: #dfe4f0; }
body.light .suggestion:hover { background: #f6f5ff; border-color: #bdb4ff; }
body.light .suggestion strong { color: #202944; }
body.light .composer { background: #fff; border-color: #cbd3e4; }
body.light textarea { color: #172039; }
body.light textarea::placeholder { color: #59647d; opacity: 1; }
body.light .model-chip { color: #34405b; background: #f5f7fc; border-color: #dbe1ef; }
body.light .model-dot { background: #6556d9; }
body.light .message { color: #202944; }
body.light .message.assistant { background: #fff; border-color: #d8deeb; color: #202944; }
body.light .message.user { background: #eae7ff; border-color: #c8c0ff; color: #241d4b; }
body.light .message-label { color: #4c3bb0; }
body.light .memory-panel { background: #fff; border-color: #d8deeb; }
body.light .memory-form label,
body.light .memory-list-title strong { color: #202944; }
body.light .memory-form textarea { color: #172039; background: #f8f9fd; border-color: #cbd3e4; }
body.light .memory-form textarea::placeholder { color: #59647d; }
body.light .memory-item { border-color: #dce2ee; }
body.light .memory-item p { color: #39455f; }
body.light .memory-delete { color: #a32443; background: #fff0f2; border-color: #f1c5ce; }
body.light .avatar { color: #fff; }
body.light .profile-menu { color: #59647d; }
body.light .composer-wrap { color: #202944; }
body.light .eyebrow { color: #5145b5; }
body.light h1 span { color: #5145b5; }
body.light .hero-mark { background: linear-gradient(145deg,#8c7af2,#596fe6); color: #fff; }
body.light .brand-mark { background: linear-gradient(145deg,#8c7af2,#596fe6); color: #fff; }

/* DHRUVA readability, settings and voice controls */
:root{--chat-font-size:17px}
.message{font-size:var(--chat-font-size);line-height:1.8;padding:16px 18px;max-width:94%;color:var(--text)}
.message-label{font-size:12px;letter-spacing:.7px}
textarea{font-size:16px;line-height:1.7}
.nav-item{font-size:14px;padding:13px 11px}
.status-card strong,.profile strong{font-size:12px}
.status-card small,.profile small{font-size:11px}
.suggestion strong{font-size:13px}.suggestion small{font-size:11px}
.intro{font-size:15px;line-height:1.85}
.setup-note strong{font-size:13px}.setup-note p{font-size:12px;line-height:1.75}
.disclaimer{font-size:10px}
.top-actions{gap:7px}
.composer-actions{display:flex;align-items:center;gap:8px}
.tool-btn{width:36px;height:36px;border-radius:10px;border:1px solid var(--line);background:var(--surface);color:var(--text);font-size:17px}
.tool-btn:hover,.tool-btn.recording{background:#fee2e2;border-color:#f87171;color:#991b1b}
.settings-panel{display:grid;gap:14px;margin-top:25px}
.settings-section{border:1px solid var(--line);border-radius:14px;padding:18px;background:rgba(255,255,255,.025)}
.settings-section h2{font-size:18px;margin:0 0 8px;color:var(--text)}
.settings-section p{font-size:14px;line-height:1.75;color:var(--muted);margin:7px 0 12px}
.settings-section textarea{width:100%;border:1px solid var(--line);border-radius:10px;padding:12px;background:var(--surface);color:var(--text);font-size:15px;min-height:120px}
.settings-section label{display:flex;align-items:center;gap:10px;font-size:14px;color:var(--text);margin:12px 0}
.settings-section input[type=range]{width:100%;accent-color:#7667e8}
.setting-check{display:flex!important;align-items:center}
.setting-check input{width:18px;height:18px;accent-color:#7667e8}
.primary-action,.secondary-action{border:1px solid #7667e8;border-radius:9px;padding:11px 15px;font-size:14px;font-weight:700}
.primary-action{background:#7667e8;color:white}.secondary-action{background:transparent;color:var(--text)}
.settings-status{display:inline-block;margin:10px 0 0;font-size:13px;color:var(--green)}
body.light .settings-section{background:#fff;border-color:#d8deeb}
body.light .settings-section h2,body.light .settings-section label{color:#172039}
body.light .settings-section p{color:#46516a}
body.light .settings-section textarea{background:#f8f9fd;color:#172039;border-color:#cbd3e4}
body.light .secondary-action{color:#27324d;background:#fff}
body.light .tool-btn{color:#27324d;background:#f5f7fc;border-color:#cbd3e4}
body.light .tool-btn.recording{background:#fee2e2;color:#991b1b}
body.light .message-label{color:#5145b5}
@media(max-width:760px){.message{font-size:var(--chat-font-size);max-width:100%;padding:13px 14px}.settings-section{padding:14px}.settings-section h2{font-size:17px}.settings-section p{font-size:14px}.nav-item{font-size:14px}.intro{font-size:14px}.composer-actions{gap:6px}.tool-btn{width:34px;height:34px}}


/* High contrast: darker, bolder text, especially in the light theme */
.side-label,.section-caption{font-size:11px;font-weight:800;letter-spacing:1.6px}
.nav-item{font-weight:700;color:#d0d7ed}
.status-card strong,.profile strong{font-size:13px;font-weight:800}
.status-card small,.profile small{font-size:12px;color:#aeb8d2}
.brand-name{font-size:19px;font-weight:800}
.brand-caption{font-size:10px;font-weight:700;color:#aeb8d2}
.breadcrumb{font-size:13px}
.private-pill{font-size:10px;font-weight:800}
body.light .side-label,body.light .section-caption{color:#26334f;font-weight:800}
body.light .nav-item{color:#172039;font-weight:700}
body.light .status-card strong,body.light .profile strong{color:#172039;font-weight:800}
body.light .status-card small,body.light .profile small{color:#36435f;font-weight:600}
body.light .brand-caption{color:#3c4863;font-weight:800}
body.light .breadcrumb,body.light .breadcrumb span,body.light .breadcrumb strong{color:#202944;font-weight:700}
body.light .private-pill{color:#26334f;font-weight:800}
body.light .icon-btn{color:#26334f}
body.light .settings-section p{color:#303c57;font-weight:500}
body.light .intro{color:#303c57;font-weight:500}
body.light .setup-note p{color:#303c57}
body.light .suggestion small{color:#3f4b66;font-weight:500}
body.light .disclaimer{color:#46516a;font-weight:600}
body.light .composer-hint{color:#36435f;font-weight:600}
body.light .memory-empty,body.light .memory-privacy{color:#46516a}
body.light .nav-item.active{color:#21184f;font-weight:800}
@media(max-width:760px){.brand-name{font-size:18px}.brand-caption{font-size:10px}.nav-item{font-size:15px}}


/* Sticky top navigation and account views */
.topbar{position:sticky;top:0;z-index:8;background:var(--sidebar);backdrop-filter:blur(14px)}
.top-actions{flex-shrink:0}
.language-toggle{border:1px solid var(--line);border-radius:9px;background:var(--surface);color:var(--text);padding:8px 11px;font-size:13px;font-weight:800;min-width:66px}
body.light .language-toggle{background:#fff;color:#172039;border-color:#cbd3e4}
.profile-button{width:100%;text-align:left;background:transparent;color:inherit;border-left:0;border-right:0;border-bottom:0;cursor:pointer;font:inherit}
.profile-button:hover{background:rgba(125,145,255,.08);border-radius:9px}
.account-panel{max-width:620px;margin-top:24px;border:1px solid var(--line);border-radius:16px;padding:24px;background:rgba(255,255,255,.03)}
.account-avatar,.login-lock{width:58px;height:58px;border-radius:18px;display:grid;place-items:center;background:linear-gradient(145deg,#9f91ff,#627cff);color:#fff;font-size:26px;font-weight:800}
.account-panel h2{font-size:23px;margin:16px 0 5px;color:var(--text)}
.account-panel>p{font-size:14px;line-height:1.7;color:var(--muted);margin:5px 0 18px}
.account-facts{display:grid;gap:0;margin:18px 0;border-top:1px solid var(--line)}
.account-facts>div{display:grid;gap:5px;padding:13px 0;border-bottom:1px solid var(--line)}
.account-facts strong{font-size:14px;color:var(--text)}
.account-facts span{font-size:13px;line-height:1.6;color:var(--muted)}
.login-status{display:grid;gap:6px;border:1px solid #e5b85d55;background:#e5b85d10;padding:14px;border-radius:10px}
.login-status strong{font-size:14px;color:#d7a94f}.login-status span{font-size:13px;line-height:1.65;color:var(--muted)}
.login-panel ol{padding-left:22px;display:grid;gap:11px;color:var(--text);font-size:14px;line-height:1.65}
.login-warning{padding:13px;border-radius:9px;background:#e5b85d10;border:1px solid #e5b85d44;color:var(--text)!important}
body.light .account-panel{background:#fff;border-color:#d8deeb}
body.light .account-panel h2,body.light .account-facts strong,body.light .login-panel ol{color:#172039}
body.light .account-panel>p,body.light .account-facts span,body.light .login-status span{color:#36435f}
@media(max-width:760px){.topbar{padding:0 10px;gap:6px}.top-actions{gap:5px}.language-toggle{font-size:12px;padding:7px 8px;min-width:58px}.account-panel{padding:18px}}

/* Firebase authentication form */
.auth-form{display:grid;gap:9px;margin:18px 0}
.auth-form label{font-size:14px;font-weight:700;color:var(--text);margin-top:5px}
.auth-form input{width:100%;min-width:0;border:1px solid var(--line);border-radius:10px;padding:12px 13px;background:var(--surface);color:var(--text);font:inherit;font-size:16px;outline-offset:2px}
.auth-form input:focus{border-color:#9b8cff;outline:2px solid #9b8cff35}
.auth-actions{display:flex;flex-wrap:wrap;gap:10px;margin-top:8px}
.auth-actions button:disabled{opacity:.6;cursor:wait}
body.light .auth-form label{color:#172039}
body.light .auth-form input{background:#f8f9fd;color:#172039;border-color:#cbd3e4}


/* Premium, responsive DHRUVA sign-in experience */
.auth-screen{display:grid;grid-template-columns:minmax(280px,1fr) minmax(340px,.9fr);min-height:calc(100vh - 90px);margin:0 auto;max-width:1100px;overflow:hidden;border:1px solid rgba(154,164,255,.16);border-radius:26px;background:linear-gradient(135deg,rgba(18,24,48,.98),rgba(12,17,34,.98));box-shadow:0 28px 90px rgba(0,0,0,.28)}
.auth-visual{position:relative;display:flex;align-items:center;overflow:hidden;padding:clamp(28px,5vw,64px);background:radial-gradient(ellipse at 20% 10%,rgba(104,93,255,.32),transparent 42%),radial-gradient(ellipse at 90% 85%,rgba(22,191,222,.16),transparent 36%),linear-gradient(145deg,#171d3b,#11162c 65%,#101a30)}
.auth-visual:after{content:"";position:absolute;inset:0;background-image:linear-gradient(rgba(255,255,255,.035) 1px,transparent 1px),linear-gradient(90deg,rgba(255,255,255,.035) 1px,transparent 1px);background-size:34px 34px;mask-image:linear-gradient(to bottom,black,transparent 85%);pointer-events:none}
.auth-visual-copy{position:relative;z-index:1;max-width:440px}
.auth-visual .eyebrow,.auth-card-kicker{font-size:10px;letter-spacing:2px;font-weight:800;color:#a8a1ff}
.auth-visual h1{font-size:clamp(32px,4vw,49px);line-height:1.13;letter-spacing:-1.8px;margin:24px 0 15px;color:#fff}
.auth-visual h1 span{background:linear-gradient(90deg,#a69cff,#6fe0f2);-webkit-background-clip:text;background-clip:text;color:transparent}
.auth-visual-copy>p{color:#b8c2de;font-size:15px;line-height:1.8;max-width:330px}
.auth-benefits{display:grid;gap:15px;margin-top:42px;color:#d5dcf2;font-size:13px}
.auth-benefits span{display:flex;align-items:center;gap:11px}
.auth-benefits i{font-style:normal;display:grid;place-items:center;width:28px;height:28px;border:1px solid #8584e65c;border-radius:9px;color:#a9a0ff;background:#8176ff12}
.auth-orbit{position:absolute;border:1px solid rgba(143,151,255,.17);border-radius:50%;pointer-events:none}
.auth-orbit-one{width:380px;height:380px;right:-190px;top:-150px}
.auth-orbit-two{width:270px;height:270px;right:-135px;top:-95px}
.auth-brand-mark{position:absolute;top:28px;left:clamp(28px,5vw,64px);font-size:28px;font-weight:900;letter-spacing:-2px;color:#fff;z-index:1}
.auth-brand-mark span{color:#74dced}
.auth-main{display:flex;flex-direction:column;justify-content:center;padding:clamp(24px,4vw,54px);background:linear-gradient(160deg,rgba(19,25,46,.96),rgba(13,18,34,.98))}
.auth-main-top{display:flex;align-items:center;gap:10px;margin-bottom:clamp(24px,5vh,54px);font-size:13px;letter-spacing:2px;font-weight:900;color:#fff}
.auth-mini-mark{display:grid;place-items:center;width:34px;height:34px;border-radius:11px;background:linear-gradient(135deg,#8c7bff,#41cde5);color:#fff;font-size:18px;letter-spacing:-1px}
.auth-main-top small{display:block;margin-top:3px;font-size:8px;letter-spacing:2px;color:#8f9bb9;font-weight:700}
.auth-card{width:100%;max-width:430px;margin:0 auto}
.auth-card h2{font-size:clamp(26px,3vw,34px);line-height:1.2;letter-spacing:-.8px;margin:12px 0 8px;color:#f8f9ff}
.auth-subtitle{font-size:14px;line-height:1.7;color:#aeb8d2;margin:0 0 24px}
.auth-mode-switch{display:grid;grid-template-columns:1fr 1fr;gap:5px;padding:5px;border:1px solid #ffffff13;background:#080d1d;border-radius:12px;margin:0 0 24px}
.auth-mode{border:0;border-radius:8px;background:transparent;padding:11px 8px;color:#9ca8c6;font-size:13px;font-weight:750;cursor:pointer}
.auth-mode.active{background:linear-gradient(135deg,#7568e9,#5b7ce8);color:#fff;box-shadow:0 5px 18px #675ce944}
.auth-form{display:grid;gap:9px;margin:0}
.auth-form label{font-size:12px;font-weight:750;color:#dce2f4;margin:5px 0 1px}
.auth-password-label{display:flex;justify-content:space-between;align-items:center;margin-top:7px}
.auth-password-label span{font-size:10px;color:#7f8aa8}
.auth-form input{width:100%;min-width:0;border:1px solid #323b5b;border-radius:10px;padding:13px 14px;background:#0a1021;color:#f8f9ff;font:inherit;font-size:14px;outline:none;transition:border-color .18s,box-shadow .18s}
.auth-form input::placeholder{color:#65718e}
.auth-form input:focus{border-color:#8c82ff;box-shadow:0 0 0 3px #8c82ff20}
.auth-name-wrap{display:none;gap:9px}
.auth-name-wrap.visible{display:grid}
.auth-submit{display:flex;align-items:center;justify-content:center;gap:12px;width:100%;margin-top:15px;padding:14px 18px;border:0;border-radius:10px;background:linear-gradient(100deg,#8070f5,#567de9 60%,#43bddd);box-shadow:0 10px 26px rgba(91,105,228,.22);color:white;font-size:14px;font-weight:800;cursor:pointer;transition:transform .18s,filter .18s}
.auth-submit:hover{filter:brightness(1.08);transform:translateY(-1px)}
.auth-submit span{font-size:19px;line-height:12px}
.auth-submit:disabled{opacity:.6;cursor:wait;transform:none}
.auth-feedback{font-size:12px;line-height:1.6;color:#a9b4d1;min-height:0;margin:0}
.auth-privacy{display:flex;align-items:center;gap:9px;margin:24px 0 0;color:#8d99b7;font-size:11px;line-height:1.7}
.auth-privacy span{color:#8e85ff}
.auth-footer{text-align:center;color:#65718f;font-size:10px;letter-spacing:.7px;margin:30px 0 0}
.auth-footer span{color:#6a72a0;padding:0 6px}
.auth-signed-in{display:grid;gap:12px}
.auth-user-icon{display:grid;place-items:center;width:46px;height:46px;border-radius:15px;background:#5e5be526;color:#9f9aff;font-size:22px}
.auth-signed-in p{color:#8f9bb9;font-size:12px;margin:7px 0 0}
.auth-signed-in>strong{color:#f8f9ff;overflow-wrap:anywhere;font-size:14px}
.auth-text-button{border:0;background:transparent;color:#9fafff;font-size:12px;padding:8px;cursor:pointer}
body.light .auth-screen{background:#fff;border-color:#e0e5f3;box-shadow:0 24px 70px rgba(39,48,86,.12)}
body.light .auth-visual{background:radial-gradient(ellipse at 20% 10%,rgba(104,93,255,.34),transparent 42%),linear-gradient(145deg,#22274e,#18264b)}
body.light .auth-main{background:#fff}
body.light .auth-main-top{color:#172039}
body.light .auth-card h2{color:#172039}
body.light .auth-subtitle{color:#53617e}
body.light .auth-mode-switch{background:#f0f2fa;border-color:#e0e5f3}
body.light .auth-mode{color:#586582}
body.light .auth-mode.active{color:#fff}
body.light .auth-form label{color:#273451}
body.light .auth-password-label span{color:#687592}
body.light .auth-form input{background:#f8f9fd;color:#172039;border-color:#d6dced}
body.light .auth-form input::placeholder{color:#8490a9}
body.light .auth-privacy{color:#586582}
body.light .auth-footer{color:#7a849b}
body.light .auth-signed-in>strong{color:#172039}
@media(max-width:820px){.auth-screen{grid-template-columns:1fr;max-width:540px;min-height:0;border-radius:20px}.auth-visual{display:none}.auth-main{padding:clamp(22px,6vw,38px)}.auth-main-top{margin-bottom:30px}.auth-card h2{font-size:28px}.auth-footer{margin-top:24px}}
@media(max-width:420px){.auth-main{padding:20px 17px}.auth-card h2{font-size:26px}.auth-subtitle{font-size:13px}.auth-form input{padding:12px}}


/* Full-screen public welcome/login experience and public information links */
body.auth-view .app-shell{min-height:100vh}
body.auth-view .sidebar,body.auth-view .topbar{display:none!important}
body.auth-view .main-panel{min-height:100vh;width:100%}
body.auth-view .content{width:100%;max-width:none;min-height:100vh;padding:0;display:flex;align-items:stretch;justify-content:center}
body.auth-view #welcome{max-width:1180px;width:100%;margin:auto;padding:26px}
body.auth-view .auth-screen{width:100%;max-width:1120px;min-height:min(780px,calc(100vh - 52px));margin:auto}
.auth-visual-copy>p{font-size:16px;max-width:370px}
.auth-benefits{margin-top:38px}
.auth-footer{margin-top:30px;text-align:center}
.auth-footer-links{display:flex;justify-content:center;gap:22px;flex-wrap:wrap}
.auth-footer-links a{font-size:12px;font-weight:650;color:#aeb9da;text-decoration:none;border-bottom:1px solid transparent;padding:4px 0}
.auth-footer-links a:hover{color:#fff;border-color:#8d85ff}
.auth-footer>p{margin:15px 0 0;font-size:10px;letter-spacing:.5px;color:#7582a3}
.public-info-panel{margin:18px auto 0;padding:14px 16px;text-align:left;max-width:420px;border:1px solid #454d70;border-radius:12px;background:#0b1122;color:#dfe5f8}
.public-info-panel strong{font-size:13px;color:#fff}
.public-info-panel p{font-size:12px;line-height:1.75;color:#b3bfdc;margin:8px 0 0}
body.light .auth-footer-links a{color:#4e5a78}
body.light .auth-footer-links a:hover{color:#332a83}
body.light .public-info-panel{background:#f7f8fe;border-color:#d8deef;color:#26324e}
body.light .public-info-panel strong{color:#172039}
body.light .public-info-panel p{color:#3d4a67}
@media(max-width:820px){body.auth-view #welcome{padding:12px}body.auth-view .auth-screen{min-height:calc(100vh - 24px)}.auth-footer-links{gap:18px}}


/* Start in the public login view immediately, preventing workspace flash before Firebase resolves */
body.auth-view .sidebar,body.auth-view .topbar{display:none!important}
.auth-password-label .auth-forgot-link{border:0;background:transparent;padding:3px 0;color:#a8a1ff;font:inherit;font-size:11px;font-weight:700;cursor:pointer}
.auth-password-label .auth-forgot-link:hover{text-decoration:underline;color:#d0cbff}
body.light .auth-password-label .auth-forgot-link{color:#5d50c8}


/* Premium light theme: soft pearl canvas, layered cards and clear contrast */
body.light{--bg:#eef1f8;--sidebar:#e7ebf5;--surface:#e2e7f2;--line:rgba(38,49,82,.16);--text:#172039;--muted:#4f5b75;--muted2:#596681;background:linear-gradient(135deg,#eef1f8 0%,#e8edf7 50%,#f1eefb 100%)}
body.light .sidebar{background:linear-gradient(180deg,#e7ebf5,#e2e7f2);border-right-color:#cbd3e3}
body.light .main-panel{background:linear-gradient(135deg,rgba(255,255,255,.22),rgba(222,229,243,.38))}
body.light .content{background:transparent}
body.light .settings-section,body.light .account-panel,body.light .memory-panel{background:rgba(255,255,255,.72);box-shadow:0 12px 35px rgba(35,48,84,.06);border-color:#d0d8e8}
body.light .nav-item{border-color:transparent}
body.light .nav-item.active{background:linear-gradient(100deg,#e0ddff,#e9edff);border-color:#c8c5ee;box-shadow:inset 3px 0 #6659d7}
body.light .status-card{background:rgba(255,255,255,.48);border-color:#d0d8e8}
body.light .profile:hover{background:#dfe5f2}
body.light .composer{background:#f8f9fd;box-shadow:0 14px 35px rgba(35,48,84,.09)}
body.light .message.assistant{background:#f8f9fd;border-color:#d2daea}
body.light .suggestion{background:rgba(255,255,255,.72)}
body.light .auth-screen{background:#eef1f8}
body.light .account-panel{background:linear-gradient(145deg,#f8f9fd,#e9edf7)}
.profile-avatar-large{width:92px;height:92px;border-radius:50%;overflow:hidden;display:grid;place-items:center;background:linear-gradient(135deg,#3f80e8,#8b75ee);color:white;margin-bottom:15px;font-size:30px}
.profile-avatar-letter{font-size:30px}
.profile-photo-preview{width:100%;height:100%;object-fit:cover;border-radius:inherit;display:block}
.profile-upload-label{display:inline-flex;align-items:center;justify-content:center;margin:5px 0 18px;padding:9px 13px;border-radius:9px;border:1px solid var(--line);background:var(--surface);font-size:12px;font-weight:700;cursor:pointer}
.profile-file-input{display:none}
.profile-edit-input,.settings-section input[type=password]{display:block;width:100%;max-width:460px;margin:7px 0 14px;padding:12px 13px;border:1px solid var(--line);border-radius:10px;background:var(--surface);color:var(--text);font:inherit;font-size:13px}
.profile-email{color:var(--muted);overflow-wrap:anywhere}
.sidebar-avatar-photo{width:100%;height:100%;object-fit:cover;border-radius:10px}
.sidebar-signout{display:flex;align-items:center;gap:11px;width:100%;margin-top:8px;padding:10px 13px;border:1px solid transparent;border-radius:9px;background:transparent;color:var(--muted);font-size:12px;text-align:left}
.sidebar-signout:hover{background:rgba(200,65,95,.09);color:#c3425b;border-color:rgba(200,65,95,.2)}
.auth-password-label .auth-forgot-link{border:0;background:transparent;padding:3px 0;color:#a8a1ff;font:inherit;font-size:11px;font-weight:700;cursor:pointer}


/* Full-viewport authentication pages: no card frame or exposed app background */
body.auth-view .app-shell,body.auth-view .main-panel{min-height:100vh;min-height:100dvh}
body.auth-view #welcome{max-width:none!important;width:100%;min-height:100vh;min-height:100dvh;margin:0!important;padding:0!important}
body.auth-view .auth-screen{display:grid;grid-template-columns:minmax(0,1fr) minmax(390px,.9fr);width:100%;max-width:none;min-height:100vh;min-height:100dvh;margin:0;border:0;border-radius:0;box-shadow:none;overflow:hidden;background:linear-gradient(130deg,#111936,#0c1328 52%,#101a34)}
body.auth-view .auth-visual,body.auth-view .auth-main{min-height:100vh;min-height:100dvh}
.auth-brand-mark{display:none!important}
.auth-visual{background:radial-gradient(ellipse at 20% 10%,rgba(104,93,255,.38),transparent 42%),radial-gradient(ellipse at 90% 85%,rgba(22,191,222,.2),transparent 36%),linear-gradient(145deg,#17224b,#111a36 65%,#102138)}
.auth-main{background:radial-gradient(ellipse at 80% 10%,rgba(79,111,225,.16),transparent 45%),linear-gradient(160deg,#101831,#0b1227)}
.forgot-screen{min-height:100vh;min-height:100dvh;width:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:32px 20px;background:radial-gradient(ellipse at 15% 15%,rgba(95,108,242,.26),transparent 45%),radial-gradient(ellipse at 85% 85%,rgba(31,189,218,.15),transparent 40%),linear-gradient(135deg,#0b1020,#121b38 55%,#10172e);color:#f5f7ff}
.forgot-brand{display:flex;align-items:center;gap:10px;margin-bottom:32px;font-size:13px;letter-spacing:2px;font-weight:900}
.forgot-brand small{display:block;font-size:8px;letter-spacing:2px;color:#8f9bb9;margin-top:3px}
.forgot-card{width:min(100%,470px);padding:clamp(24px,5vw,42px);border:1px solid rgba(161,174,235,.18);border-radius:22px;background:linear-gradient(145deg,rgba(26,36,67,.94),rgba(15,23,45,.97));box-shadow:0 28px 90px rgba(0,0,0,.28)}
.forgot-icon{display:grid;place-items:center;width:48px;height:48px;border-radius:15px;background:linear-gradient(135deg,#8b7cf7,#42cbe4);font-size:25px;color:white;margin-bottom:24px}
.forgot-card h1{font-size:clamp(34px,5vw,46px);margin:14px 0}
.forgot-card h1 span{background:linear-gradient(90deg,#aaa0ff,#6fe0f2);-webkit-background-clip:text;background-clip:text;color:transparent}
.forgot-card .auth-subtitle{margin-bottom:25px}
.forgot-back{margin-top:20px}
.forgot-footer{margin-top:28px;color:#8895b5;font-size:10px;letter-spacing:1px}
.auth-text-button{border:0;background:transparent;color:#a9a2ff;font-size:12px;font-weight:700;cursor:pointer;padding:9px 0}
.auth-text-button:hover{text-decoration:underline}
@media(max-width:820px){
 body.auth-view .auth-screen{grid-template-columns:1fr;min-height:100dvh}
 body.auth-view .auth-visual{display:none}
 body.auth-view .auth-main{min-height:100dvh;padding:28px 22px}
 body.auth-view .auth-main-top{margin-bottom:28px}
 .forgot-card{border-radius:18px}
}


/* Separate, full-height chat viewport and independently scrolling sidebar */
.app-shell{height:100vh;height:100dvh;min-height:0;overflow:hidden}
.sidebar{height:100vh;height:100dvh;min-height:0;overflow:hidden}
.nav-list{flex:0 0 auto}
.recent-chats{flex:1 1 auto;min-height:90px;overflow-y:auto;overscroll-behavior:contain;margin:20px -2px 14px;padding:0 2px}
.recent-heading{position:sticky;top:0;z-index:2;display:flex;justify-content:space-between;align-items:center;padding:7px 7px 10px;background:var(--sidebar);font-size:9px;letter-spacing:1.3px;color:var(--muted2);font-weight:800}
.recent-heading button{border:0;background:transparent;color:var(--muted2);font-size:10px;cursor:pointer}
.recent-chat-list{display:grid;gap:5px}
.recent-empty{font-size:11px;line-height:1.6;color:var(--muted2);padding:7px}
.recent-chat-row{display:flex;align-items:center;gap:3px;min-width:0;border:1px solid transparent;border-radius:9px}
.recent-chat-row.active{background:var(--surface);border-color:var(--line)}
.recent-chat-open{min-width:0;flex:1;border:0;background:transparent;text-align:left;color:var(--muted);font-size:11px;padding:10px 8px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;cursor:pointer}
.recent-chat-actions{display:flex;gap:1px;padding-right:3px}
.recent-chat-actions button{width:25px;height:27px;border:0;border-radius:6px;background:transparent;color:var(--muted2);font-size:15px;cursor:pointer}
.recent-chat-actions button:hover{background:var(--line);color:var(--text)}
.sidebar-signout{min-height:44px;padding:12px 14px;font-size:14px;font-weight:700;border:1px solid var(--line);background:rgba(255,255,255,.035);border-radius:11px}
.sidebar-signout span{font-size:14px}
.main-panel{height:100vh;height:100dvh;min-height:0;overflow:hidden}
.content{width:100%;max-width:none;min-height:0;height:calc(100vh - 67px);height:calc(100dvh - 67px);padding:20px clamp(16px,4vw,58px) 14px;overflow:hidden;gap:0}
.content:has(.conversation:not(.hidden)){display:flex}
.conversation{flex:1 1 auto;min-height:0;height:auto;max-height:none;width:min(100%,900px);margin:0 auto;padding:8px 4px 24px;overflow-y:auto;overscroll-behavior:contain;scrollbar-gutter:stable;gap:20px}
.message{font-size:15px;line-height:1.85;max-width:min(88%,780px);padding:17px 20px;border-radius:17px}
.message-label{font-size:11px;margin-bottom:8px}
.composer-wrap{flex:0 0 auto;width:min(100%,900px);margin:0 auto;padding-top:12px}
.composer textarea{font-size:16px;min-height:42px}
.composer{padding:16px 17px 12px}
.composer .send-btn,.composer .tool-btn{width:44px;height:44px;min-width:44px;font-size:21px;border-radius:13px}
.composer-actions{gap:9px}
.voice-status{display:none;font-size:12px;color:#a69aff;align-items:center;gap:9px;padding:8px 5px}
.voice-status.visible{display:flex}
.voice-status:before{content:"";width:8px;height:8px;border-radius:50%;background:#ff657e;box-shadow:0 0 0 0 rgba(255,101,126,.5);animation:voicePulse 1.2s infinite}
.recording{position:relative!important;background:rgba(255,91,119,.18)!important;color:#ff7890!important;animation:voiceButtonPulse 1.1s infinite}
@keyframes voicePulse{70%{box-shadow:0 0 0 9px rgba(255,101,126,0)}100%{box-shadow:0 0 0 0 rgba(255,101,126,0)}}
@keyframes voiceButtonPulse{50%{box-shadow:0 0 0 5px rgba(255,101,126,.12)}}
.typing-indicator{display:flex;gap:5px;align-items:center;height:20px;margin:4px 0 8px}
.typing-indicator i{display:block;width:7px;height:7px;border-radius:50%;background:#9e91ff;animation:typingDot .9s infinite ease-in-out}
.typing-indicator i:nth-child(2){animation-delay:.15s}.typing-indicator i:nth-child(3){animation-delay:.3s}
@keyframes typingDot{0%,60%,100%{transform:translateY(0);opacity:.45}30%{transform:translateY(-5px);opacity:1}}
.thinking-text{font-size:12px;color:var(--muted2)}
@media(max-width:760px){
 .app-shell{height:100dvh}
 .sidebar{height:100dvh;max-height:100dvh}
 .main-panel{height:100dvh}
 .content{height:calc(100dvh - 60px);padding:12px 10px 9px}
 .conversation{padding:6px 4px 18px;gap:14px}
 .message{max-width:94%;font-size:15px;padding:14px 15px}
 .composer-wrap{padding-top:8px}
 .composer{padding:12px}
 .composer textarea{font-size:16px}
 .recent-chats{min-height:90px}
}


/* Fix sidebar scrolling: the whole menu must scroll independently of chat */
.sidebar{
  overflow-y:auto!important;
  overflow-x:hidden!important;
  overscroll-behavior:contain;
  scrollbar-gutter:stable;
  min-height:0;
  -webkit-overflow-scrolling:touch;
}
.sidebar > .brand,
.sidebar > .new-chat,
.sidebar > .side-label,
.sidebar > .nav-list,
.sidebar > .side-bottom{flex-shrink:0}
.sidebar > .recent-chats{
  flex:0 0 auto!important;
  min-height:0!important;
  max-height:34vh;
  overflow-y:auto!important;
  overscroll-behavior:contain;
  scrollbar-gutter:stable;
}
.sidebar > .side-bottom{margin-top:14px!important}
@media(max-width:760px){
  .sidebar{height:100dvh;max-height:100dvh;overflow-y:auto!important}
  .sidebar > .recent-chats{max-height:28vh}
}


/* DHRUVA conversation workspace: use the screen, keep chat scroll independent */
.content:has(#conversation:not(.hidden)){
  width:100%;
  max-width:none;
  min-height:0;
  height:calc(100dvh - 68px);
  padding:18px clamp(12px,3vw,38px) 12px;
  gap:0;
}
.content:has(#conversation:not(.hidden)) .conversation{
  width:100%;
  max-width:none;
  flex:1 1 auto;
  min-height:0;
  max-height:none;
  margin:0 auto 12px;
  padding:8px clamp(0px,1vw,12px) 22px;
  overscroll-behavior:contain;
  scrollbar-gutter:stable;
  -webkit-overflow-scrolling:touch;
}
.content:has(#conversation:not(.hidden)) .message{
  max-width:min(92%,1000px);
  padding:16px 19px;
  font-size:14px;
  line-height:1.8;
  border-radius:16px;
}
.content:has(#conversation:not(.hidden)) .composer-wrap{
  width:100%;
  max-width:1100px;
  flex:0 0 auto;
  margin:0 auto;
  padding-top:0;
}
.sidebar-signout{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  width:100%;
  min-height:44px;
  margin-top:10px;
  padding:12px 16px;
  border:1px solid var(--line);
  border-radius:10px;
  background:rgba(255,255,255,.045);
  color:var(--text);
  font-size:13px;
  font-weight:600;
  cursor:pointer;
}
.sidebar-signout:hover{background:rgba(255,255,255,.09);border-color:rgba(155,140,255,.35)}
.thinking-message{position:relative}
.thinking-message::after{content:"";display:inline-block;width:22px;height:6px;margin-left:8px;background:radial-gradient(circle,currentColor 2px,transparent 3px) 0 50%/8px 6px repeat-x;animation:dhruva-thinking 1s linear infinite;opacity:.8}
@keyframes dhruva-thinking{from{background-position:0 50%}to{background-position:8px 50%}}
@media(max-width:760px){
 .content:has(#conversation:not(.hidden)){height:calc(100dvh - 59px);padding:10px 10px 10px}
 .content:has(#conversation:not(.hidden)) .message{max-width:96%;padding:13px 14px;font-size:14px}
 .content:has(#conversation:not(.hidden)) .conversation{margin-bottom:8px}
}


/* Image attachments and voice playback controls */
.visually-hidden{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;border:0!important}
.composer-tools{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.attach-btn{font-size:24px!important;font-weight:500}
.attachment-preview{display:flex;align-items:center;gap:12px;padding:10px 12px;margin:0 0 10px;border:1px solid var(--line);border-radius:12px;background:rgba(130,130,160,.08)}
.attachment-preview.hidden{display:none}
.attachment-preview img{width:58px;height:58px;object-fit:cover;border-radius:8px;background:var(--surface)}
.attachment-meta{display:flex;flex-direction:column;gap:4px;min-width:0;flex:1}
.attachment-meta strong{font-size:13px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.attachment-meta small{font-size:11px;color:var(--muted)}
.attachment-remove{width:36px;height:36px;border:1px solid var(--line);border-radius:9px;background:var(--surface);color:var(--text);font-size:22px;cursor:pointer}
.message-attachment{display:block;width:min(100%,420px);max-height:320px;object-fit:contain;margin-top:10px;border:1px solid var(--line);border-radius:12px;background:rgba(0,0,0,.12)}
#stopSpeakingBtn{font-size:16px!important;color:#ff8296!important}
.voice-status.speaking{color:#69d8f3}
.voice-status.speaking:before{background:#69d8f3;animation:voicePulse 1.2s infinite}
@media(max-width:760px){.composer-tools{gap:7px}.attachment-preview img{width:48px;height:48px}.attachment-meta strong{max-width:190px}}


/* Research source list */
.research-sources{display:flex;flex-direction:column;align-items:flex-start;gap:7px;margin-top:16px;padding-top:12px;border-top:1px solid var(--line);font-size:12px}
.research-sources strong{color:var(--muted);font-size:11px;text-transform:uppercase;letter-spacing:.8px;margin-bottom:2px}
.research-sources a{color:#9d96ff;text-decoration:underline;text-underline-offset:3px;overflow-wrap:anywhere;line-height:1.5}
.research-sources a:hover{color:#72d8ef}


/* Scroll long workspace pages independently from the sidebar and chat. */
.main-panel{min-height:0;min-width:0}
.content:has(.welcome:not(.hidden)){overflow-y:auto!important;overflow-x:hidden!important;overscroll-behavior:contain;scrollbar-gutter:stable;-webkit-overflow-scrolling:touch;align-items:stretch}
.content:has(.welcome:not(.hidden)) .welcome{flex:0 0 auto;width:min(100%,900px);max-width:900px;margin:0 auto 28px;padding-bottom:28px}
.content:has(.welcome:not(.hidden)) .composer-wrap.hidden{display:none!important}
.content:has(.welcome:not(.hidden)) .welcome .settings-panel,.content:has(.welcome:not(.hidden)) .welcome .memory-panel,.content:has(.welcome:not(.hidden)) .welcome .account-panel{margin-bottom:28px}
.content:has(.welcome:not(.hidden)) .welcome h1{overflow-wrap:anywhere}
@media(max-width:760px){.content:has(.welcome:not(.hidden)){height:calc(100dvh - 59px);padding:16px 14px 24px}.content:has(.welcome:not(.hidden)) .welcome{padding-bottom:24px}}


/* Keep every message above the composer; only the transcript scrolls. */
.content:has(#conversation:not(.hidden)){display:flex;flex-direction:column;min-height:0;overflow:hidden}
.content:has(#conversation:not(.hidden)) #welcome{display:none!important}
.content:has(#conversation:not(.hidden)) .conversation{display:flex;flex:1 1 0;min-height:0;height:0;max-height:none;overflow-y:auto;overflow-x:hidden;padding:10px 10px 34px;scroll-padding-bottom:34px;margin:0 auto 10px}
.content:has(#conversation:not(.hidden)) .composer-wrap{position:relative;z-index:2;flex:0 0 auto;background:var(--bg);padding:10px 0 max(8px,env(safe-area-inset-bottom))}
.voice-language-select{max-width:108px;height:40px;border:1px solid var(--line);border-radius:10px;background:var(--surface);color:var(--text);font-size:11px;padding:0 5px}
@media(max-width:760px){.voice-language-select{max-width:82px;height:38px;font-size:10px}.content:has(#conversation:not(.hidden)){padding-bottom:0}.content:has(#conversation:not(.hidden)) .conversation{padding-bottom:38px}.content:has(#conversation:not(.hidden)) .composer-wrap{padding-bottom:max(8px,env(safe-area-inset-bottom))}}

/* Immersive full-screen voice conversation */
.voice-mode{position:fixed;inset:0;z-index:1000;display:flex;flex-direction:column;justify-content:space-between;overflow:hidden;background:radial-gradient(ellipse at 50% 48%,#f4fffc 0%,#fbfcfd 46%,#f4f5f7 100%);color:#161a1d;padding:calc(22px + env(safe-area-inset-top)) 24px calc(22px + env(safe-area-inset-bottom))}
.voice-mode.hidden{display:none!important}.voice-mode-top{display:flex;align-items:center;justify-content:space-between;position:relative;z-index:2}
.voice-mode-brand{display:flex;align-items:center;gap:10px;font-size:15px;font-weight:750;letter-spacing:.08em}.voice-mode-brand small{display:block;margin-top:3px;font-size:9px;letter-spacing:.2em;color:#6b7778}
.voice-brand-mark{display:grid;place-items:center;width:37px;height:37px;border-radius:50%;background:linear-gradient(145deg,#08c9ac,#8de6dc);color:#073f3b;font-size:19px}
.voice-mode-close,.voice-mode-end{display:grid;place-items:center;border:0;border-radius:50%;background:#fff;color:#171a1b;box-shadow:0 5px 25px #1b39320c;cursor:pointer;font-size:34px;line-height:1;width:54px;height:54px}
.voice-mode-center{display:flex;flex-direction:column;align-items:center;justify-content:center;flex:1;text-align:center;min-height:0;padding:20px 0}.voice-orb-wrap{position:relative;width:min(62vw,390px);aspect-ratio:1;display:grid;place-items:center;margin-bottom:48px;isolation:isolate}
.voice-orb-halo{position:absolute;inset:-10%;border-radius:50%;background:radial-gradient(circle,#56e6d426 0%,#7ce5dc0c 55%,transparent 72%);filter:blur(12px);animation:voiceHalo 3.2s ease-in-out infinite}
.voice-orb{position:relative;width:100%;height:100%;overflow:hidden;border-radius:50%;background:linear-gradient(150deg,#00bfa9 0%,#08c8b3 35%,#baf3e9 72%,#85ddd3 100%);box-shadow:inset -18px -25px 48px #168e8b1c,inset 14px 12px 40px #ffffff36,0 18px 65px #0ab8a322;animation:voiceOrbFloat 4s ease-in-out infinite}
.voice-orb:before{content:"";position:absolute;inset:-35% -25%;border-radius:45%;background:linear-gradient(155deg,transparent 37%,#eaffff00 44%,#f2ffffe8 52%,#e5fffbab 60%,transparent 70%);transform:rotate(-18deg);animation:voiceOrbShimmer 5s ease-in-out infinite}
.voice-orb:after{content:"";position:absolute;inset:0;border-radius:50%;background:radial-gradient(ellipse at 30% 18%,#ffffff2e,transparent 42%),radial-gradient(ellipse at 72% 80%,#008e8a16,transparent 50%)}
.voice-orb-glow{position:absolute;inset:15% 5% 8%;border-radius:50%;background:linear-gradient(155deg,transparent 25%,#eaffff75 51%,transparent 76%);filter:blur(18px);animation:voiceGlow 2.8s ease-in-out infinite}
.voice-mode h2{margin:0 0 12px;font-size:clamp(23px,5vw,32px);font-weight:650;letter-spacing:-.035em}.voice-mode-center p{margin:0;color:#7b8587;font-size:14px}
.voice-mode-bottom{display:flex;align-items:center;justify-content:center;gap:16px;position:relative;min-height:64px;color:#7c8587;font-size:12px}.voice-mode-mic{display:grid;place-items:center;width:58px;height:58px;border:0;border-radius:50%;background:#e9edee;color:#202729;font-size:24px;cursor:pointer;transition:background .2s,color .2s}.voice-mode-mic.muted{background:#f9e8e8;color:#bd3434}.voice-mode-end{position:absolute;right:0;width:58px;height:58px;background:#111;color:#fff;font-size:36px;box-shadow:none}
.voice-mode[data-state="listening"] .voice-orb{animation:voiceOrbFloat 3.2s ease-in-out infinite,voiceListenPulse 1.6s ease-in-out infinite}.voice-mode[data-state="thinking"] .voice-orb{animation:voiceOrbFloat 2.2s ease-in-out infinite,voiceThinkPulse .8s ease-in-out infinite}.voice-mode[data-state="speaking"] .voice-orb{animation:voiceOrbFloat 2.8s ease-in-out infinite,voiceSpeakPulse 1s ease-in-out infinite}.voice-mode[data-state="muted"] .voice-orb{animation:voiceOrbFloat 5s ease-in-out infinite;filter:saturate(.6);opacity:.8}
@keyframes voiceOrbFloat{0%,100%{transform:translateY(0) scale(1)}50%{transform:translateY(-9px) scale(1.018)}}@keyframes voiceOrbShimmer{0%,100%{transform:translateX(-8%) rotate(-18deg)}50%{transform:translateX(10%) rotate(-18deg)}}@keyframes voiceGlow{0%,100%{opacity:.45;transform:scale(.94)}50%{opacity:.9;transform:scale(1.06)}}@keyframes voiceHalo{0%,100%{transform:scale(.94);opacity:.55}50%{transform:scale(1.1);opacity:1}}@keyframes voiceListenPulse{0%,100%{box-shadow:inset -18px -25px 48px #168e8b1c,0 18px 65px #0ab8a322}50%{box-shadow:inset -18px -25px 48px #168e8b1c,0 18px 90px #0ab8a34d}}@keyframes voiceThinkPulse{0%,100%{transform:scale(.98)}50%{transform:scale(1.035)}}@keyframes voiceSpeakPulse{0%,100%{transform:scale(1)}25%{transform:scale(1.025,.985)}65%{transform:scale(.99,1.025)}}
body.voice-mode-open{overflow:hidden}@media(max-width:600px){.voice-mode{padding-left:22px;padding-right:22px}.voice-mode-close{width:48px;height:48px}.voice-orb-wrap{width:min(58vw,330px);margin-bottom:42px}.voice-mode-center p{font-size:13px}.voice-mode-end{right:0;width:54px;height:54px}}@media(prefers-reduced-motion:reduce){.voice-orb,.voice-orb:before,.voice-orb-glow,.voice-orb-halo{animation:none!important}}