:root{color-scheme:dark;--bg:#080b1b;--bg-secondary:#0d1230;--bg-top:#050711;--bg-bottom:#090d21;--glow-a:rgba(79,109,255,.34);--glow-b:rgba(142,67,255,.22);--glow-c:rgba(79,109,255,.16);--surface:rgba(18,23,54,.76);--surface-strong:rgba(22,28,66,.92);--surface-soft:hsla(0,0%,100%,.04);--surface-soft-strong:hsla(0,0%,100%,.06);--surface-active:rgba(124,92,255,.12);--line:rgba(169,179,255,.16);--line-strong:rgba(182,171,255,.28);--ink:#f3f4ff;--muted:#a6add7;--muted-strong:#97a0cf;--accent-ink:#b7adff;--accent:#7c5cff;--accent-soft:#4f6dff;--accent-pink:#8e43ff;--hero-panel-top:rgba(16,20,44,.9);--hero-panel-bottom:rgba(11,15,35,.94);--hero-panel-glow:rgba(124,92,255,.4);--shadow:0 28px 90px rgba(5,8,24,.48);--danger-line:rgba(255,120,180,.28);--danger-bg:rgba(255,120,180,.08);--danger-ink:#ffd7ea;--radius-xl:36px;--radius-lg:24px;--radius-md:18px}[data-theme=light]{color-scheme:light;--bg:#eef2ff;--bg-secondary:#f5f7ff;--bg-top:#f9fbff;--bg-bottom:#e8edff;--glow-a:rgba(79,109,255,.16);--glow-b:rgba(142,67,255,.12);--glow-c:rgba(79,109,255,.1);--surface:hsla(0,0%,100%,.78);--surface-strong:hsla(0,0%,100%,.94);--surface-soft:rgba(30,41,90,.05);--surface-soft-strong:rgba(30,41,90,.08);--surface-active:rgba(79,109,255,.1);--line:rgba(58,76,143,.12);--line-strong:rgba(79,109,255,.2);--ink:#17203f;--muted:#5d688f;--muted-strong:#576283;--accent-ink:#4c5fc7;--hero-panel-top:hsla(0,0%,100%,.92);--hero-panel-bottom:rgba(240,244,255,.96);--hero-panel-glow:rgba(79,109,255,.14);--shadow:0 24px 70px rgba(73,94,168,.14);--danger-line:rgba(219,91,133,.24);--danger-bg:rgba(219,91,133,.08);--danger-ink:#a33662}*{box-sizing:border-box}html{scroll-behavior:smooth}body{margin:0;min-height:100vh;overflow-x:hidden;color:var(--ink);background:radial-gradient(circle at top left,var(--glow-a),transparent 28%),radial-gradient(circle at right 12% top 16%,var(--glow-b),transparent 22%),radial-gradient(circle at center bottom,var(--glow-c),transparent 30%),linear-gradient(180deg,var(--bg-top) 0,var(--bg) 42%,var(--bg-bottom) 100%);font-family:Trebuchet MS,Segoe UI,sans-serif}a{color:inherit;text-decoration:none}p{margin:0;color:var(--muted);line-height:1.65}h1,h2,h3{margin:0;line-height:1;letter-spacing:-.04em}button{font:inherit}.page-shell{width:min(1180px,calc(100% - 32px));margin:0 auto;padding:24px 0 72px}.app-shell-sidebar,.app-topbar,.chat-card,.landing-shell,.principle-card{border:1px solid var(--line);background:var(--surface);-webkit-backdrop-filter:blur(20px);backdrop-filter:blur(20px);box-shadow:var(--shadow)}.landing-shell{position:relative;overflow:hidden;padding:28px;border-radius:40px}.landing-shell:before{content:"";position:absolute;top:-120px;right:-80px;width:280px;height:280px;border-radius:999px;background:radial-gradient(circle,rgba(124,92,255,.34),transparent 68%);pointer-events:none}.app-topbar,.landing-topbar{display:flex;align-items:center;justify-content:space-between;gap:16px}.brand-mark{display:inline-flex;align-items:center;gap:12px}.brand-mark-icon{display:grid;place-items:center;width:52px;height:52px;border:1px solid rgba(138,158,255,.18);border-radius:18px;color:#5c7cff;background:radial-gradient(circle at top,rgba(104,130,255,.2),transparent 58%),hsla(0,0%,100%,.04);box-shadow:0 18px 38px rgba(9,13,34,.34)}.brand-mark-logo{width:31px;height:31px;filter:drop-shadow(0 10px 18px rgba(79,109,255,.24))}.brand-mark-title{font-size:1.08rem;font-weight:700;letter-spacing:-.03em}.brand-mark-copy{display:flex;align-items:center;gap:10px;flex-wrap:wrap}.brand-mark-beta{display:inline-flex;align-items:center;justify-content:center;min-height:28px;padding:0 10px;border:1px solid rgba(129,148,255,.3);border-radius:999px;color:#dfe5ff;background:linear-gradient(135deg,rgba(124,92,255,.3),rgba(79,109,255,.22)),hsla(0,0%,100%,.04);box-shadow:inset 0 1px 0 hsla(0,0%,100%,.08);font-size:.8rem;font-weight:700;letter-spacing:.08em;text-transform:uppercase}[data-theme=light] .brand-mark-beta{color:#4151a8;background:linear-gradient(135deg,rgba(124,92,255,.12),rgba(79,109,255,.12)),hsla(0,0%,100%,.82)}.topbar-tools{display:flex;align-items:center;gap:10px;flex-wrap:wrap;justify-content:flex-end}.language-switch{display:inline-flex;gap:8px;padding:6px;border:1px solid var(--line);border-radius:999px;background:var(--surface-soft)}.language-button{min-width:56px;min-height:38px;padding:0 14px;border:0;border-radius:999px;color:var(--muted);background:transparent;cursor:pointer;transition:background .14s ease,color .14s ease,transform .14s ease}.language-button:hover{transform:translateY(-1px)}.language-button-active{color:var(--ink);background:linear-gradient(135deg,rgba(124,92,255,.34),rgba(79,109,255,.34))}.theme-toggle{min-height:38px;padding:0 16px;border:1px solid var(--line);border-radius:999px;color:var(--ink);background:var(--surface-soft);cursor:pointer;transition:transform .14s ease,border-color .14s ease,background .14s ease}.theme-toggle:hover{transform:translateY(-1px);border-color:var(--line-strong)}.landing-hero{display:grid;grid-template-columns:1.05fr .95fr;grid-gap:24px;gap:24px;align-items:stretch;margin-top:52px}.hero-copy{display:flex;flex-direction:column;gap:18px;justify-content:center}.eyebrow,.panel-label{font-size:.76rem;letter-spacing:.2em;text-transform:uppercase;color:var(--accent-ink)}.hero-copy h1{font-size:clamp(3.5rem,10vw,6.6rem)}.hero-statement{max-width:18ch;color:var(--ink);font-size:clamp(1.5rem,3vw,2.4rem);line-height:1.08}.hero-text{max-width:58ch;font-size:1.04rem}.hero-actions{display:flex;flex-wrap:wrap;gap:14px;padding-top:8px}.button{display:inline-flex;align-items:center;justify-content:center;min-height:48px;padding:0 22px;border:1px solid transparent;border-radius:999px;transition:transform .14s ease,opacity .14s ease}.button:hover{transform:translateY(-1px)}.button-primary{color:#fff;background:linear-gradient(135deg,var(--accent-soft) 0,var(--accent-pink) 100%)}.hero-panel{position:relative;display:grid;min-height:340px;overflow:hidden;border:1px solid var(--line-strong);border-radius:30px;background:linear-gradient(180deg,var(--hero-panel-top),var(--hero-panel-bottom)),var(--surface-strong)}.hero-panel-glow{position:absolute;inset:auto auto -80px -40px;width:320px;height:320px;border-radius:999px;background:radial-gradient(circle,var(--hero-panel-glow),transparent 64%)}.hero-panel-content{position:relative;z-index:1;display:flex;flex-direction:column;justify-content:space-between;gap:16px;padding:28px}.hero-panel-content p{max-width:16ch;color:var(--ink);font-size:clamp(1.6rem,4vw,2.7rem);line-height:1.05}.principles-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));grid-gap:18px;gap:18px;margin-top:24px}.app-shell-sidebar,.app-topbar,.chat-card,.principle-card{border-radius:var(--radius-lg)}.principle-card{padding:24px}.principle-card h2{margin-bottom:12px;font-size:1.55rem}.auth-shell{display:grid;place-items:center;min-height:65vh}.auth-card{width:min(460px,100%);padding:28px;border:1px solid var(--line);border-radius:28px;background:var(--surface);-webkit-backdrop-filter:blur(20px);backdrop-filter:blur(20px);box-shadow:var(--shadow)}.auth-card h2{font-size:clamp(2rem,6vw,3rem)}.auth-card h2,.auth-copy{margin-top:10px}.auth-tab-row{display:inline-flex;gap:8px;margin-top:18px;padding:6px;border:1px solid var(--line);border-radius:999px;background:var(--surface-soft)}.auth-tab{min-width:110px;min-height:38px;padding:0 16px;border:0;border-radius:999px;color:var(--muted);background:transparent}.auth-tab-active{color:var(--ink);background:rgba(124,92,255,.2)}.auth-form{margin-top:18px}.app-page{display:flex;flex-direction:column;height:100dvh;min-height:100dvh;padding-top:8px;padding-bottom:max(28px,env(safe-area-inset-bottom));overflow:hidden}.app-topbar{padding:18px 20px}.topbar-actions{display:flex;align-items:center;gap:12px}.topbar-link{display:inline-flex;align-items:center;justify-content:center;min-height:38px;padding:0 16px;border:1px solid var(--line);border-radius:999px;color:var(--muted);background:var(--surface-soft)}.content-section{flex:1 1;gap:20px;min-height:0;margin-top:24px;overflow:hidden}.content-section,.section-head{display:flex;flex-direction:column}.section-head{gap:12px;margin-bottom:20px}.section-head-compact{max-width:34rem}.section-head h1{font-size:clamp(2rem,6vw,3.8rem)}.app-shell{display:grid;grid-template-columns:320px 1fr;grid-gap:18px;gap:18px;flex:1 1}.app-shell,.app-shell-sidebar{height:100%;min-height:0;overflow:hidden}.app-shell-sidebar{gap:22px;padding:20px}.app-shell-sidebar,.stack-form{display:flex;flex-direction:column}.stack-form{gap:12px;margin-top:12px}.message-input,.text-input{width:100%;border:1px solid var(--line);border-radius:var(--radius-md);outline:none;color:var(--ink);background:var(--surface-soft)}.text-input{min-height:46px;padding:0 14px}.message-input{min-height:52px;max-height:136px;padding:14px 16px;resize:none}.dialog-participants-input{min-height:84px}.message-input::placeholder,.text-input::placeholder{color:color-mix(in srgb,var(--muted) 82%,transparent)}.message-input:focus,.text-input:focus{border-color:rgba(162,149,255,.42);box-shadow:0 0 0 3px rgba(124,92,255,.12)}.secondary-button{min-height:42px;border:1px solid var(--line);border-radius:999px;color:var(--ink);background:var(--surface-soft-strong)}.auth-tab,.composer button,.secondary-button{cursor:pointer;transition:transform .14s ease,border-color .14s ease,background .14s ease}.auth-tab:hover,.composer button:hover,.secondary-button:hover{transform:translateY(-1px)}.button:disabled,.composer button:disabled,.secondary-button:disabled{cursor:not-allowed;opacity:.55;transform:none}.chat-description,.security-note{margin-top:10px;font-size:.96rem}.conversation-meta-line,.inline-note,.message-note{margin-top:8px;font-size:.84rem;color:var(--muted-strong)}.empty-state,.error-banner{padding:14px 16px;border:1px solid var(--line);border-radius:var(--radius-md);background:var(--surface-soft)}.error-banner{margin-top:14px;color:var(--danger-ink);border-color:var(--danger-line);background:var(--danger-bg)}.chat-thread,.conversation-list{display:flex;flex-direction:column;gap:12px;min-height:0}.conversation-list,.search-result-list{margin-top:16px}.app-shell-sidebar .sidebar-section:last-child{display:flex;flex:1 1;flex-direction:column;min-height:0}.sidebar-section-body{display:flex;flex-direction:column;gap:12px;margin-top:12px}.sidebar-section-body .search-result-list{margin-top:0}.search-result-list{display:flex;flex-direction:column;gap:10px}.conversation-list{flex:1 1}.chat-thread,.conversation-list{overflow:auto;padding-right:6px;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:rgba(124,92,255,.55) transparent}.chat-thread::-webkit-scrollbar,.conversation-list::-webkit-scrollbar{width:10px}.chat-thread::-webkit-scrollbar-thumb,.conversation-list::-webkit-scrollbar-thumb{border:2px solid transparent;border-radius:999px;background:rgba(124,92,255,.52);background-clip:padding-box}.chat-thread::-webkit-scrollbar-track,.conversation-list::-webkit-scrollbar-track{background:transparent}.user-card{display:flex;flex-direction:column;gap:14px;padding:16px;border:1px solid var(--line);border-radius:var(--radius-md);background:var(--surface-soft-strong)}.user-card strong{display:block;margin-top:6px;color:var(--ink);font-size:1.05rem}.status-row{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px}.status-pill{display:inline-flex;align-items:center;min-height:34px;padding:0 12px;border:1px solid var(--line);border-radius:999px;color:#c2c8ff;background:var(--surface-soft);font-size:.84rem}[data-theme=light] .status-pill{color:var(--muted-strong)}.status-pill-live{border-color:rgba(89,210,255,.28);color:#bfeeff}.status-pill-connecting,.status-pill-reconnecting{border-color:rgba(162,129,255,.28);color:#ddd3ff}.chat-card-header,.composer,.conversation-card,.message,.search-result-card{border:1px solid var(--line);border-radius:var(--radius-md);background:var(--surface-soft)}.conversation-card,.search-result-card{width:100%;padding:16px;cursor:pointer;text-align:left;transition:border-color .14s ease,background .14s ease,transform .14s ease}.conversation-card:hover,.search-result-card:hover{transform:translateY(-1px);border-color:rgba(162,149,255,.34)}.search-result-card{display:flex;align-items:center;justify-content:space-between;gap:14px}.search-result-card:disabled{cursor:not-allowed;opacity:.68;transform:none}.search-result-action,.search-result-meta{font-size:.84rem;color:var(--muted-strong)}.search-result-action{white-space:nowrap}.conversation-card-active{border-color:rgba(162,149,255,.42);background:var(--surface-active)}.chat-card-header,.conversation-title-row,.conversation-title-wrap{display:flex;align-items:center;gap:10px}.chat-card-header,.conversation-title-row{justify-content:space-between}.conversation-title-row{margin-bottom:10px}.presence{width:10px;height:10px;border-radius:999px}.presence-online{background:#59d2ff}.presence-away{background:#a081ff}.presence-offline{background:#606a97}.pill-count{display:inline-flex;align-items:center;justify-content:center;min-width:28px;height:28px;padding:0 8px;border-radius:999px;color:#fff;background:linear-gradient(135deg,var(--accent-soft),var(--accent-pink));font-size:.92rem}.chat-mini-meta{color:var(--muted-strong);font-size:.88rem}.chat-card{display:flex;flex-direction:column;height:100%;min-height:0;padding:20px;overflow:hidden}.chat-card-header{padding:16px;flex-shrink:0}.chat-card-title{display:flex;align-items:flex-start;gap:12px;min-width:0}.chat-card-heading{min-width:0}.mobile-back-button{display:none;align-items:center;justify-content:center;flex-shrink:0;width:40px;min-width:40px;min-height:40px;padding:0;border:1px solid var(--line);border-radius:999px;color:var(--ink);background:var(--surface-soft);transition:transform .14s ease,border-color .14s ease,background .14s ease}.mobile-back-button:hover{transform:translateY(-1px);border-color:var(--line-strong)}.mobile-back-icon{width:18px;height:18px}.chat-header-meta{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:8px}.chat-card-header h2{font-size:1.3rem}.chat-badge{padding:8px 12px;border:1px solid var(--line);border-radius:999px;color:var(--muted-strong);font-size:.84rem}.chat-thread{flex:1 1;min-height:280px;margin:16px 0}.message-meta{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:8px}.message{max-width:84%;padding:14px 16px}.message-left{align-self:flex-start}.message-right{align-self:flex-end;background:rgba(124,92,255,.16)}.message-error{border-color:rgba(255,120,180,.22);background:rgba(255,120,180,.06)}.message-author{color:var(--ink);font-size:.92rem;font-weight:700}.message-time{color:var(--muted-strong);font-size:.8rem}.composer{display:flex;align-items:center;gap:10px;padding:12px;flex-shrink:0}.composer .message-input{flex:1 1}.composer button{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;width:48px;min-width:48px;min-height:48px;padding:0;border:0;border-radius:16px;color:#fff;background:linear-gradient(135deg,var(--accent-soft),var(--accent-pink))}.composer-send-icon{width:20px;height:20px}@media (max-width:1040px){.app-shell,.landing-hero,.principles-grid{grid-template-columns:1fr}.hero-statement{max-width:none}}@media (max-width:860px){.app-shell{grid-template-columns:1fr;min-height:0}.content-section{overflow:auto;padding-bottom:max(8px,env(safe-area-inset-bottom))}.app-shell-has-active-dialog .app-shell-sidebar,.app-shell:not(.app-shell-has-active-dialog) .chat-card{display:none}.mobile-back-button{display:inline-flex}.app-shell-sidebar,.chat-card{min-height:0}.chat-card-header{flex-direction:column;align-items:flex-start}.chat-card-title{width:100%}.chat-header-meta{justify-content:flex-start}.chat-thread{min-height:0}}@media (max-width:720px){.page-shell{width:min(100% - 20px,1180px);padding-top:12px}.app-shell-sidebar,.app-topbar,.auth-card,.chat-card,.landing-shell,.principle-card{border-radius:24px}.landing-shell{padding:18px}.app-topbar,.landing-topbar{flex-direction:column;align-items:flex-start}.topbar-actions,.topbar-tools{width:100%;display:grid;grid-template-columns:1fr}.topbar-actions{grid-template-columns:repeat(2,minmax(0,1fr))}.landing-topbar,.topbar-actions,.topbar-tools{gap:10px}.brand-mark,.language-switch{width:100%}.language-switch{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}.language-button,.topbar-link{width:100%}.hero-copy h1{font-size:clamp(2.8rem,18vw,4rem)}.landing-hero{gap:18px;margin-top:28px}.hero-copy{gap:14px}.hero-panel{min-height:240px}.hero-panel-content{padding:20px}.principles-grid{gap:14px;margin-top:18px}.message{max-width:100%}.search-result-card{flex-direction:column;align-items:flex-start}.search-result-action{white-space:normal}.chat-header-meta{justify-content:flex-start}.app-shell-sidebar,.chat-card{padding:16px}.chat-card-header,.composer,.conversation-card,.search-result-card{padding:14px}.app-page{padding-bottom:max(18px,env(safe-area-inset-bottom))}.content-section{gap:16px}.section-head{gap:10px;margin-bottom:0}.section-head h1{font-size:clamp(1.9rem,9vw,2.7rem)}.auth-tab,.button,.secondary-button,.theme-toggle,.topbar-link{width:100%}.composer{align-items:flex-end}.composer button{width:48px;min-width:48px}.auth-tab-row{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));width:100%}.auth-tab{min-width:0}.app-shell-sidebar,.chat-card{min-height:0}.chat-thread,.conversation-list{padding-right:2px}}@media (max-width:540px){.page-shell{width:min(100% - 14px,1180px);padding-top:10px;padding-bottom:18px}.app-shell-sidebar,.app-topbar,.auth-card,.chat-card,.landing-shell,.principle-card{border-radius:20px}.app-shell-sidebar,.auth-card,.chat-card,.landing-shell{padding-left:14px;padding-right:14px}.app-topbar{padding:14px}.hero-copy h1{font-size:clamp(2.5rem,19vw,3.4rem)}.hero-statement{font-size:clamp(1.2rem,7vw,1.7rem)}.auth-copy,.chat-description,.hero-text,.principle-card p{font-size:.95rem}.principle-card{padding:18px}.principle-card h2{font-size:1.3rem}.chat-card-header,.composer,.conversation-card,.search-result-card{padding:12px}.button,.language-button,.mobile-back-button,.secondary-button,.theme-toggle,.topbar-link{min-height:42px}.mobile-back-button{width:42px;min-width:42px}.composer{gap:8px;padding:10px}.composer button{width:44px;min-width:44px;min-height:44px;border-radius:14px}.message{padding:12px 13px}.app-shell-sidebar,.chat-card{min-height:0}}