/* Vinem workspace. Layered neutrals, 8-14px radii, violet accent, soft depth. */
:root{
  --bg:#0A0A0C;
  --bg2:#0D0D0F;
  --sidebar:#101013;
  --surface:#131316;
  --elevated:#19191D;
  --hover:#1F1F24;
  --border:rgba(255,255,255,.07);
  --border-strong:rgba(255,255,255,.13);
  --text:#F4F4F5;
  --muted:#A1A1AA;
  --faint:#6E6E78;
  --accent:#2855FF;
  --accent-soft:rgba(40,85,255,.13);
  --accent-text:#91A3FF;
  --danger:#E5484D;
  --danger-soft:rgba(229,72,77,.12);
  --success:#7dd3a8;
  --warning:#e8c47a;
  --radius-s:8px;
  --radius-m:10px;
  --radius-l:12px;
  --radius-xl:14px;
  --font-size:14px;
  --shadow-pop:0 12px 36px rgba(0,0,0,.5);
  --shadow-dialog:0 16px 48px rgba(0,0,0,.5);
  --shadow-soft:0 2px 12px rgba(0,0,0,.25);
  --ease:cubic-bezier(.2,.8,.2,1);
}
[data-theme="light"]{
  --bg:#FAFAFA;
  --bg2:#F1F1F3;
  --sidebar:#F1F1F3;
  --surface:#FFFFFF;
  --elevated:#FFFFFF;
  --hover:#E9E9EC;
  --border:rgba(0,0,0,.08);
  --border-strong:rgba(0,0,0,.13);
  --text:#18181B;
  --muted:#52525B;
  --faint:#A1A1AA;
  --accent:#2855FF;
  --accent-soft:rgba(40,85,255,.1);
  --accent-text:#1933b7;
  --danger:#DC2626;
  --danger-soft:rgba(220,38,38,.08);
}
*{box-sizing:border-box}
*[hidden]{display:none!important}
*{scrollbar-width:thin;scrollbar-color:var(--border-strong) transparent}
*::-webkit-scrollbar{width:8px;height:8px}
*::-webkit-scrollbar-track{background:transparent}
*::-webkit-scrollbar-thumb{background:var(--border-strong);border:2px solid transparent;border-radius:8px;background-clip:padding-box}
html,body{height:100%}
body{margin:0;background:var(--bg);color:var(--text);font:400 var(--font-size)/1.55 'Space Grotesk',Inter,ui-sans-serif,system-ui,sans-serif;-webkit-font-smoothing:antialiased}
.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.skip-link{position:absolute;left:-9999px;top:0;background:var(--accent);color:#fff;padding:8px 12px;border-radius:var(--radius-s);z-index:99}
.skip-link:focus{left:8px;top:8px}
button{font-family:inherit}
:focus-visible{outline:2px solid var(--accent);outline-offset:2px;border-radius:var(--radius-s)}

/* ---------- App frame ---------- */
.app{display:flex;height:100dvh;overflow:hidden}

/* ---------- Sidebar ---------- */
.sidebar{width:268px;flex-shrink:0;background:var(--sidebar);border-right:1px solid var(--border);display:flex;flex-direction:column;padding:16px 12px 12px;gap:10px;z-index:30;transition:width .18s var(--ease),transform .18s ease}
.sidebar-header{display:flex;align-items:center;justify-content:space-between;min-height:38px;padding:0 6px 2px}
.brand{display:flex;align-items:center;gap:9px;min-width:0;min-height:30px}
.brand-logo{display:block;object-fit:contain}
.brand-logo.logo-full{height:26px;width:auto;max-width:158px}
.brand-logo.logo-mark{display:none;width:24px;height:24px}
.new-chat-btn{display:flex;align-items:center;gap:9px;width:100%;padding:9px 11px;border:1px solid var(--border);border-radius:10px;background:var(--surface);color:var(--text);font-size:13px;font-weight:550;cursor:pointer;transition:background .14s ease,border-color .14s ease;box-shadow:var(--shadow-soft)}
.new-chat-btn:hover{background:var(--hover);border-color:var(--border-strong)}
.new-chat-btn svg{width:15px;height:15px;color:var(--accent-text)}
.new-chat-btn kbd{margin-left:auto;font:10px 'DM Mono',monospace;color:var(--faint)}
.search-wrap{display:flex;align-items:center;gap:8px;padding:0 10px;border:1px solid var(--border);border-radius:8px;background:var(--bg2);color:var(--faint);transition:border-color .14s ease}
.search-wrap:focus-within{border-color:var(--border-strong)}
.search-wrap svg{width:14px;height:14px;flex:0 0 auto}
.search-wrap input{width:100%;min-width:0;padding:8px 0;border:0;outline:0;background:transparent;color:var(--text);font:inherit;font-size:13px}
.search-wrap kbd{font:10px 'DM Mono',monospace;color:var(--faint);white-space:nowrap}
.side-nav{display:flex;flex-direction:column;gap:2px;border-top:1px solid var(--border);padding-top:10px;margin-top:2px}
.nav-heading{margin:6px 6px 5px;color:var(--faint);font-size:10px;font-weight:600;letter-spacing:.09em;text-transform:uppercase}
.nav-item{display:flex;align-items:center;gap:9px;width:100%;min-height:36px;padding:7px 10px;border:1px solid transparent;border-radius:10px;background:transparent;color:var(--muted);font-size:13px;font-weight:500;cursor:default;text-align:left}
.nav-item svg{width:15px;height:15px;flex:0 0 auto}
.nav-item-label{flex:1}
.api-nav{cursor:pointer}
.api-nav:hover{background:var(--hover);color:var(--text)}
.soon-badge{font-size:9px;font-weight:600;letter-spacing:.06em;text-transform:uppercase;color:var(--faint);border:1px solid var(--border);border-radius:999px;padding:2px 7px;white-space:nowrap}
.history-head{padding:0 6px}
.chat-list{flex:1;overflow-y:auto;display:flex;flex-direction:column;gap:2px;padding:0;min-height:0}
.history-label{padding:10px 10px 4px;color:var(--faint);font-size:10px;font-weight:600;letter-spacing:.09em;text-transform:uppercase}
.chat-item{display:flex;align-items:center;gap:6px;min-height:37px;padding:7px 8px 7px 11px;border:1px solid transparent;border-radius:10px;cursor:pointer;text-align:left;background:transparent;color:var(--text);width:100%;font-size:13px;transition:background .13s ease,border-color .13s ease}
.chat-item:hover{background:var(--hover)}
.chat-item.active{background:var(--elevated);border-color:var(--border-strong);box-shadow:var(--shadow-soft)}
.chat-item .title{flex:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.chat-item .mini{background:transparent;border:none;color:var(--faint);cursor:pointer;padding:5px;border-radius:8px;display:none;place-items:center}
.chat-item:hover .mini,.chat-item:focus-within .mini{display:grid}
.chat-item .mini:hover{color:var(--text);background:var(--hover)}
.chat-item .mini svg{width:14px;height:14px}
.row-pop{position:absolute;z-index:60;width:180px;background:var(--elevated);border:1px solid var(--border-strong);border-radius:10px;box-shadow:var(--shadow-pop);padding:5px}
.row-pop-item{width:100%;display:flex;align-items:center;gap:9px;padding:8px 10px;border:none;border-radius:8px;background:transparent;color:var(--text);font-size:13px;text-align:left;cursor:pointer}
.row-pop-item:hover{background:var(--hover)}
.row-pop-item svg{width:14px;height:14px;color:var(--muted)}
.row-pop-item.danger{color:#f3b7bb}
.row-pop-item.danger svg{color:var(--danger)}
.row-pop-item.danger:hover{background:var(--danger-soft)}
.sidebar-footer{display:flex;flex-direction:column;gap:8px;padding:10px 4px 2px;border-top:1px solid var(--border)}
.profile-row{display:flex;align-items:center;gap:9px;min-width:0}
.profile-row>span:nth-child(2){display:flex;flex-direction:column;min-width:0;flex:1}
.profile-row strong{font-size:12px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.profile-row small{color:var(--faint);font-size:11px}
.profile-avatar{width:28px;height:28px;display:grid;place-items:center;border-radius:50%;background:var(--elevated);border:1px solid var(--border-strong);color:var(--muted);font-weight:600;font-size:11px;flex:0 0 auto}
.footer-actions{display:flex;align-items:center;gap:6px}
.footer-link{background:none;border:none;color:var(--faint);font-size:12px;cursor:pointer;padding:2px 0}
.footer-link:hover{color:var(--text)}
.footer-dot{color:var(--faint);font-size:12px}
.hint{font-size:12px;color:var(--muted);margin:8px 0 0}

/* Collapsed sidebar */
.sidebar.collapsed{width:66px;padding-left:10px;padding-right:10px;align-items:stretch}
.sidebar.collapsed .new-chat-btn kbd,.sidebar.collapsed .search-wrap input,.sidebar.collapsed .search-wrap kbd,.sidebar.collapsed .nav-heading,.sidebar.collapsed .nav-item-label,.sidebar.collapsed .soon-badge,.sidebar.collapsed .history-head,.sidebar.collapsed .chat-list,.sidebar.collapsed .profile-row>span:nth-child(2),.sidebar.collapsed .footer-actions,.sidebar.collapsed .new-chat-label,.sidebar.collapsed .logo-full{display:none}
.sidebar.collapsed .brand{justify-content:center}
.sidebar.collapsed .logo-mark{display:block}
.sidebar.collapsed .new-chat-btn{justify-content:center;padding:9px 0}
.sidebar.collapsed .search-wrap{justify-content:center;padding:8px 0}
.sidebar.collapsed .nav-item{justify-content:center;padding:8px 0;position:relative}
.sidebar.collapsed .nav-item::after{content:"";position:absolute;top:7px;right:7px;width:5px;height:5px;border-radius:50%;background:var(--faint)}

/* Generic buttons + icon buttons */
.btn{border:1px solid var(--border);background:var(--surface);color:var(--text);border-radius:8px;padding:8px 12px;cursor:pointer;font-size:13px;font-weight:500;display:inline-flex;align-items:center;justify-content:center;gap:7px;transition:background .13s ease,border-color .13s ease}
.btn:hover{background:var(--hover);border-color:var(--border-strong)}
.btn.primary{background:var(--accent);border-color:var(--accent);color:#fff;font-weight:600}
.btn.primary:hover{filter:brightness(1.06)}
.btn.secondary{background:transparent}
.btn.ghost{background:transparent;border-color:transparent;color:var(--muted)}
.btn.ghost:hover{color:var(--text);background:var(--hover)}
.btn.danger{background:var(--danger);border-color:var(--danger);color:#fff}
.btn.small{padding:6px 10px;font-size:12px}
.btn.full{width:100%}
.btn svg{width:14px;height:14px}
.icon-btn{display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;background:transparent;border:1px solid transparent;color:var(--muted);border-radius:8px;cursor:pointer;flex:0 0 auto;transition:background .13s ease,color .13s ease}
.icon-btn:hover{background:var(--hover);color:var(--text)}
.icon-btn svg{width:16px;height:16px}
.only-mobile{display:none}
.scrim{position:fixed;inset:0;background:rgba(0,0,0,.5);z-index:20}

/* ---------- Main + topbar ---------- */
.main{flex:1;display:flex;flex-direction:column;min-width:0;min-height:0}
.topbar{display:flex;align-items:center;gap:12px;height:60px;min-height:60px;padding:0 18px;border-bottom:1px solid var(--border);background:var(--bg);z-index:5;flex-wrap:nowrap}
.conversation-heading{display:flex;flex-direction:column;min-width:0;flex:0 1 auto;margin-right:2px}
.conversation-heading strong{font-size:14px;font-weight:600;letter-spacing:-.01em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.conversation-heading span{font-size:11px;color:var(--faint);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.model-picker{position:relative;display:flex;align-items:center;gap:8px;margin-left:auto;min-width:0}
.model-trigger{display:flex;align-items:center;gap:9px;height:38px;max-width:290px;padding:0 10px 0 6px;border:1px solid var(--border);border-radius:10px;background:var(--surface);color:var(--text);text-align:left;cursor:pointer;min-width:0;transition:border-color .14s ease,background .14s ease}
.model-trigger:hover{border-color:var(--border-strong);background:var(--hover)}
.mt-ic{width:26px;height:26px;border-radius:8px;background:var(--elevated);border:1px solid var(--border);display:grid;place-items:center;color:var(--accent-text);flex:0 0 auto}
.mt-ic svg{width:14px;height:14px}
.mt-tx{display:flex;flex-direction:column;gap:0;min-width:0;line-height:1.3}
.model-trigger strong{font-size:12.5px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.model-trigger small{color:var(--faint);font-size:10.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.mt-chev{width:14px !important;height:14px !important;color:var(--faint);flex:0 0 auto}
.status{font-size:11px;color:var(--faint);white-space:nowrap}
.status:empty{display:none}
.top-actions{margin-left:0;display:flex;gap:2px;flex:0 0 auto}
/* model popover */
.model-pop{position:absolute;top:calc(100% + 8px);right:0;width:400px;max-width:calc(100vw - 24px);max-height:min(480px,calc(100dvh - 140px));overflow:hidden;display:flex;flex-direction:column;border:1px solid var(--border-strong);border-radius:14px;background:var(--elevated);box-shadow:var(--shadow-pop);z-index:40}
.mp-search{display:flex;align-items:center;gap:9px;padding:12px 12px 8px}
.mp-search svg{width:15px;height:15px;color:var(--faint);flex:0 0 auto}
.mp-search input{flex:1;min-width:0;border:1px solid var(--border);border-radius:8px;background:var(--bg2);color:var(--text);padding:8px 10px;font-size:13px;outline:none}
.mp-search input:focus{border-color:var(--accent)}
.mp-tabs{display:flex;gap:4px;padding:2px 12px 8px;overflow-x:auto}
.mp-tab{border:1px solid transparent;background:transparent;color:var(--muted);font-size:12px;font-weight:550;padding:5px 10px;border-radius:8px;cursor:pointer;white-space:nowrap}
.mp-tab:hover{color:var(--text);background:var(--hover)}
.mp-tab.selected{background:var(--accent-soft);border-color:rgba(139,92,246,.35);color:var(--accent-text)}
.mp-list{overflow-y:auto;padding:0 6px 6px;min-height:120px}
.mp-group{padding:8px 10px 3px;color:var(--faint);font-size:10px;font-weight:600;letter-spacing:.08em;text-transform:uppercase}
.mp-item{width:100%;display:flex;align-items:center;gap:10px;padding:9px 10px;border:1px solid transparent;border-radius:10px;background:transparent;color:var(--text);text-align:left;cursor:pointer}
.mp-item:hover,.mp-item.active{background:var(--hover)}
.mp-item.selected{border-color:var(--border-strong);background:var(--hover)}
.mp-ic{width:30px;height:30px;border-radius:9px;background:var(--surface);border:1px solid var(--border);display:grid;place-items:center;color:var(--accent-text);flex:0 0 auto}
.mp-ic svg{width:15px;height:15px}
.mp-tx{display:flex;flex-direction:column;gap:1px;min-width:0;flex:1}
.mp-tx strong{font-size:13px;font-weight:550;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.mp-tx small{color:var(--faint);font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.mp-prem{color:var(--accent-text);font-weight:600}
.mp-check{width:15px !important;height:15px !important;color:var(--accent-text);opacity:0;flex:0 0 auto}
.mp-item.selected .mp-check{opacity:1}
.mp-empty{padding:22px;text-align:center;color:var(--faint);font-size:13px}
.healthdot{width:8px;height:8px;border-radius:50%;flex:0 0 auto}
.healthdot.ok{background:#7dd3a8}.healthdot.warn{background:#e8c47a}.healthdot.bad{background:#f3b7bb}.healthdot.mute{background:var(--faint)}

/* ---------- Chat ---------- */
.chat-scroll{position:relative;flex:1;overflow-y:auto;padding:30px 22px 36px;scroll-behavior:smooth}
.messages{max-width:780px;margin:0 auto;display:flex;flex-direction:column;gap:26px}
.empty-state{max-width:640px;margin:8vh auto 0;text-align:left;display:flex;flex-direction:column;gap:0}
.empty-logo{width:132px;max-width:46vw;height:auto;object-fit:contain;margin-bottom:18px}
.empty-state h1{color:var(--text);font-size:27px;font-weight:600;letter-spacing:-.025em;line-height:1.18;margin:0 0 10px}
.empty-state>p{margin:0 0 22px;color:var(--muted);font-size:14px;line-height:1.65;max-width:500px}
.suggestions{display:grid;grid-template-columns:1fr 1fr;gap:9px}
.chip{display:flex;flex-direction:column;align-items:flex-start;gap:3px;text-align:left;border:1px solid var(--border);background:var(--surface);color:var(--text);border-radius:12px;padding:12px 14px;cursor:pointer;transition:border-color .14s ease,background .14s ease,transform .14s ease}
.chip:hover{background:var(--hover);border-color:var(--border-strong);transform:translateY(-1px)}
.chip strong{font-size:13px;font-weight:600}
.chip small{color:var(--faint);font-size:12px}
.eyebrow{color:var(--accent-text);font-size:11px;font-weight:600;letter-spacing:.1em;text-transform:uppercase}

.msg{display:flex;gap:11px;min-width:0;max-width:100%}
.msg.user{justify-content:flex-end}
.avatar{width:27px;height:27px;border-radius:50%;flex-shrink:0;display:flex;align-items:center;justify-content:center;background:var(--surface);border:1px solid var(--border);color:var(--muted);margin-top:3px}
.avatar svg{width:13px;height:13px}
.msg.user .avatar{display:none}
.message-content{display:flex;flex-direction:column;width:fit-content;max-width:100%;min-width:0}
.msg.user .message-content{align-items:flex-end;max-width:78%}
.message-body{font-size:15px;line-height:1.7;overflow-wrap:anywhere;word-break:break-word;min-width:0;color:var(--text)}
.message-body>:first-child{margin-top:0}
.message-body>:last-child{margin-bottom:0}
.message-body p{margin:0 0 13px}
.message-body h1,.message-body h2,.message-body h3,.message-body h4{margin:22px 0 9px;line-height:1.32;letter-spacing:-.015em;font-weight:650}
.message-body h1{font-size:19px;padding-bottom:8px;border-bottom:1px solid var(--border)}
.message-body h2{font-size:17px}.message-body h3{font-size:15px}.message-body h4{font-size:14px}
.message-body ul,.message-body ol{margin:0 0 13px;padding-left:22px}
.message-body li{margin:4px 0}
.message-body li::marker{color:var(--accent-text)}
.message-body blockquote{margin:0 0 13px;padding:9px 15px;border-left:2px solid var(--accent);background:var(--surface);border-radius:0 8px 8px 0;color:var(--muted)}
.message-body a{color:var(--accent-text);text-decoration:none;border-bottom:1px solid transparent}
.message-body a:hover{border-bottom-color:var(--accent-text)}
.message-body code{font-family:ui-monospace,SFMono-Regular,Consolas,Menlo,monospace;font-size:.86em;background:var(--elevated);border:1px solid var(--border);border-radius:6px;padding:1px 6px}
.message-body pre{background:#0B0B0E;border:1px solid var(--border);border-radius:12px;padding:0;margin:0 0 13px;overflow:hidden}
.message-body pre code{display:block;background:none;border:none;padding:13px 15px;font-size:12.5px;line-height:1.65;overflow:auto}
.message-body table{border-collapse:separate;border-spacing:0;width:100%;margin:0 0 13px;font-size:13px;border:1px solid var(--border);border-radius:10px;overflow:hidden}
.message-body th,.message-body td{padding:8px 12px;text-align:left;border-bottom:1px solid var(--border)}
.message-body tr:last-child th,.message-body tr:last-child td{border-bottom:none}
.message-body th{background:var(--surface);font-weight:600;font-size:12px}
.message-body hr{border:none;border-top:1px solid var(--border);margin:18px 0}
/* Legacy bubble class kept for JS compat; assistant renders bubble-free via CSS */
.bubble{display:contents}
.msg.user .bubble{display:block;background:var(--elevated);border:1px solid var(--border-strong);border-radius:12px 12px 4px 12px;padding:10px 14px;max-width:100%;box-shadow:var(--shadow-soft)}
.msg.user .bubble .message-body{font-size:14px;line-height:1.62}
.loading-bubble{display:flex;align-items:center;min-height:32px}
.loading-dots{display:inline-flex;align-items:center;gap:5px;height:14px}
.loading-dots i{width:6px;height:6px;border-radius:50%;background:var(--faint);animation:dot-pulse 1.2s ease-in-out infinite}
.loading-dots i:nth-child(2){animation-delay:.2s}.loading-dots i:nth-child(3){animation-delay:.3s}
@keyframes dot-pulse{0%,100%{opacity:.35}50%{opacity:1}}
.msg-actions{display:flex;gap:1px;margin-top:6px;min-height:26px;opacity:0;transition:opacity .13s ease}
.msg:hover .msg-actions,.msg:focus-within .msg-actions{opacity:1}
.msg-actions button{position:relative;display:grid;place-items:center;width:28px;height:26px;background:transparent;border:0;color:var(--faint);border-radius:8px;padding:0;cursor:pointer}
.msg-actions button svg{width:13px;height:13px}
.msg-actions button:hover{color:var(--text);background:var(--hover)}
.msg-actions button::after{content:attr(data-tooltip);position:absolute;right:0;bottom:calc(100% + 6px);padding:4px 7px;border:1px solid var(--border);border-radius:6px;background:var(--elevated);color:var(--text);font:10px Inter,sans-serif;white-space:nowrap;opacity:0;pointer-events:none;transform:translateY(3px);transition:opacity .14s ease,transform .14s ease;z-index:20}
.msg-actions button:hover::after,.msg-actions button:focus-visible::after{opacity:1;transform:none}
@media (hover:none){.msg-actions{opacity:1}}
.thinking-details{margin-bottom:6px;color:var(--faint);font-size:12px}
.thinking-indicator{display:inline-flex;align-items:center;gap:6px;color:var(--faint);font-size:12px;font-weight:500}
.thinking-indicator small{font-size:11px;font-family:'DM Mono',monospace}
.thinking-indicator.is-active{animation:think-pulse 1.6s ease-in-out infinite}
@keyframes think-pulse{0%,100%{opacity:.55}50%{opacity:1}}
.generation-status{display:inline-flex;align-items:center;gap:7px;margin:0 0 9px;color:var(--muted);font-size:12px;font-weight:550}.generation-status i{width:6px;height:6px;border-radius:50%;background:var(--faint)}.generation-status.is-active i{background:var(--accent);box-shadow:0 0 0 3px var(--accent-soft);animation:think-pulse 1.35s ease-in-out infinite}.generation-complete{margin:0 0 8px;color:var(--faint);font-size:12px;font-weight:500}
.source-bubble{align-self:flex-start;display:inline-flex;align-items:center;gap:6px;margin-top:9px;padding:5px 10px;border:1px solid var(--border);border-radius:8px;background:var(--surface);color:var(--muted);font-size:11px;font-weight:550;cursor:pointer}
.source-bubble:hover{border-color:var(--border-strong);color:var(--text)}
.source-bubble svg{width:12px;height:12px}
.msg.user .source-bubble{align-self:flex-end}
.source-list{display:flex;flex-direction:column;gap:8px}
.source-item{display:flex;align-items:center;gap:10px;min-width:0;padding:10px 12px;border:1px solid var(--border);border-radius:10px;background:var(--surface);color:var(--text);text-decoration:none}
.source-item:hover{background:var(--hover);border-color:var(--border-strong)}
.source-item img{width:18px;height:18px;flex:0 0 auto;border-radius:4px;background:var(--bg)}
.source-item span{display:flex;flex-direction:column;min-width:0;gap:2px}
.source-item strong,.source-item small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.source-item strong{font-size:12px;font-weight:600}.source-item small{color:var(--faint);font-size:11px}
.msg.is-live .message-body:after{content:"";display:inline-block;width:7px;height:14px;margin-left:4px;vertical-align:-2px;background:var(--accent);animation:caret-blink 1s steps(2,end) infinite}
@keyframes caret-blink{50%{opacity:0}}

/* ---------- Composer ---------- */
.composer-wrap{border-top:1px solid var(--border);background:linear-gradient(180deg,transparent,var(--bg) 32%);padding:14px 22px 9px}
.composer{max-width:780px;margin:0 auto}
.composer-field{border:1px solid var(--border-strong);border-radius:14px;background:var(--surface);box-shadow:var(--shadow-soft);transition:border-color .15s ease,box-shadow .15s ease}
.composer-field:focus-within{border-color:var(--accent);box-shadow:0 0 0 3px var(--accent-soft),var(--shadow-soft)}
.composer-field textarea{display:block;width:100%;resize:none;min-height:54px;max-height:160px;padding:14px 16px 6px;border:0;outline:0;background:transparent;color:var(--text);font:inherit;font-size:14px;line-height:1.55}
.composer-field textarea::placeholder{color:var(--faint)}
.composer-toolbar{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:6px 10px 10px}
.toolbar-left,.toolbar-right{display:flex;align-items:center;gap:6px}
.toolbar-btn{display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;background:transparent;border:1px solid transparent;color:var(--faint);border-radius:8px;cursor:pointer}
.toolbar-btn:hover{background:var(--hover);color:var(--text)}
.toolbar-btn svg{width:15px;height:15px}
.web-search-btn{display:inline-flex;align-items:center;gap:6px;height:32px;padding:0 12px;border:1px solid var(--border);border-radius:8px;background:transparent;color:var(--muted);font-size:12px;font-weight:550;cursor:pointer}
.web-search-btn svg{width:13px;height:13px}
.web-search-btn:hover{border-color:var(--border-strong);color:var(--text)}
.web-search-btn.selected{border-color:rgba(139,92,246,.5);color:var(--accent-text);background:var(--accent-soft)}
.web-search-btn.selected svg{color:var(--accent-text)}
.send-btn,.stop-btn{width:34px;height:34px;display:grid;place-items:center;flex:0 0 auto;border:1px solid transparent;border-radius:10px;cursor:pointer}
.send-btn{background:var(--accent);border-color:var(--accent);color:#fff}
.send-btn:hover{filter:brightness(1.08)}
.send-btn:disabled{background:var(--elevated);border-color:var(--border);color:var(--faint);cursor:not-allowed;filter:none}
.send-btn svg{width:15px;height:15px}
.stop-btn{background:var(--danger-soft);border-color:rgba(229,72,77,.4);color:var(--danger)}
.stop-btn svg{width:13px;height:13px}
.disclaimer{text-align:center;color:var(--faint);font-size:11px;margin:8px 0 2px}
.attachment-tray{max-width:780px;margin:0 auto 8px;display:flex;gap:6px;flex-wrap:wrap}
.attachment-chip{display:flex;align-items:center;gap:7px;padding:6px 8px 6px 10px;border:1px solid var(--border);border-radius:8px;background:var(--surface);font-size:12px}
.attachment-chip svg{width:13px;color:var(--muted)}
.attachment-chip small{color:var(--faint);font-family:'DM Mono',monospace;font-size:10px}
.attachment-remove{display:grid;place-items:center;padding:3px;border:0;background:transparent;color:var(--faint);cursor:pointer;border-radius:4px}
.attachment-remove:hover{color:var(--text);background:var(--hover)}
.attachment-remove svg{width:12px}
.jump-btn{position:absolute;right:24px;bottom:150px;width:34px;height:34px;display:grid;place-items:center;border:1px solid var(--border-strong);border-radius:10px;background:var(--elevated);color:var(--muted);cursor:pointer;z-index:4;box-shadow:var(--shadow-pop)}
.jump-btn:hover{color:var(--text)}
.jump-btn svg{width:14px;height:14px}

/* ---------- Palette / toast / dialog ---------- */
.palette-backdrop{position:fixed;inset:0;z-index:70;display:flex;justify-content:center;align-items:flex-start;padding-top:12vh;background:rgba(0,0,0,.55)}
.palette{width:min(560px,calc(100% - 32px));overflow:hidden;border:1px solid var(--border-strong);border-radius:14px;background:var(--elevated);box-shadow:var(--shadow-dialog)}
.palette-search{display:flex;align-items:center;gap:10px;padding:13px 15px;border-bottom:1px solid var(--border)}
.palette-search svg{width:15px;color:var(--faint)}
.palette-search input{flex:1;border:0;outline:0;background:transparent;color:var(--text);font-size:14px}
.palette-search kbd,.search-wrap kbd,.new-chat-btn kbd{font:10px 'DM Mono',monospace;color:var(--faint);border:1px solid var(--border);border-radius:4px;padding:2px 5px}
.palette h2{margin:0;padding:11px 15px 6px;color:var(--faint);font-size:10px;font-weight:600;letter-spacing:.08em;text-transform:uppercase}
.palette-results{padding:0 6px 6px;max-height:320px;overflow:auto}
.palette-item{width:100%;display:flex;align-items:center;gap:10px;padding:9px 10px;border:0;border-radius:8px;background:transparent;color:var(--text);text-align:left;cursor:pointer}
.palette-item:hover{background:var(--hover)}
.palette-item>svg{width:15px;color:var(--muted);flex:0 0 auto}
.palette-item span{display:flex;flex-direction:column;gap:1px;flex:1;min-width:0}
.palette-item strong{font-size:13px;font-weight:500}
.palette-item small{color:var(--faint);font-size:11px}
.toast-region{position:fixed;right:20px;bottom:20px;z-index:90;display:flex;flex-direction:column;gap:8px}
.toast{display:flex;align-items:center;gap:8px;padding:9px 13px;border:1px solid var(--border);border-left:3px solid var(--accent);border-radius:10px;background:var(--elevated);color:var(--text);box-shadow:var(--shadow-pop);font-size:12px;max-width:320px}
.toast svg{width:14px;color:var(--accent-text);flex:0 0 auto}
.toast.leaving{opacity:0;transition:opacity .18s ease}
.dialog-backdrop{position:fixed;inset:0;z-index:60;display:grid;place-items:center;padding:20px;background:rgba(0,0,0,.6)}
.dialog{width:min(100%,440px);max-height:calc(100dvh - 40px);overflow:auto;background:var(--elevated);border:1px solid var(--border-strong);border-radius:14px;box-shadow:var(--shadow-dialog)}
.dialog-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;padding:18px 20px 12px;border-bottom:1px solid var(--border)}
.dialog-head .eyebrow{margin:0 0 4px}
.dialog-head h2{margin:0;color:var(--text);font-size:16px;font-weight:600;letter-spacing:-.01em}
.dialog-body{padding:16px 20px;color:var(--muted);font-size:13px;line-height:1.6}
.dialog-label{display:block;color:var(--text);font-size:13px;font-weight:600;margin-bottom:6px}
.dialog-input{width:100%;padding:9px 11px;border:1px solid var(--border);border-radius:8px;background:var(--surface);color:var(--text);font:inherit;font-size:13px}
.dialog-input:focus{border-color:var(--accent);outline:none}
.dialog-actions{display:flex;justify-content:flex-end;gap:8px;padding:12px 20px 18px}
select{font:inherit}
.plan-chip{font-size:10px;font-weight:500;letter-spacing:.04em;color:var(--faint);border:1px solid transparent;border-radius:999px;padding:3px 4px;white-space:nowrap}

/* ---------- Responsive ---------- */
@media (max-width:1020px){
  .model-trigger{max-width:230px}
  .status{display:none}
}
@media (max-width:860px){
  .sidebar{position:fixed;top:0;bottom:0;left:0;width:min(300px,84vw);transform:translateX(-105%);transition:transform .18s ease;padding:16px 12px}
  .sidebar.open{transform:none}
  .sidebar.collapsed{width:min(300px,84vw);padding:16px 12px;align-items:stretch}
  .sidebar.collapsed .new-chat-btn kbd{display:none}
  .sidebar.collapsed .search-wrap input,.sidebar.collapsed .search-wrap kbd,.sidebar.collapsed .nav-heading,.sidebar.collapsed .nav-item-label,.sidebar.collapsed .soon-badge,.sidebar.collapsed .history-head,.sidebar.collapsed .chat-list,.sidebar.collapsed .profile-row>span:nth-child(2),.sidebar.collapsed .footer-actions,.sidebar.collapsed .new-chat-label{display:flex}
  .sidebar.collapsed .logo-full{display:block}
  .sidebar.collapsed .logo-mark{display:none}
  .sidebar.collapsed .chat-item .mini{display:grid}
  .sidebar.collapsed .brand{justify-content:flex-start}
  .sidebar.collapsed .new-chat-btn{justify-content:flex-start;padding:9px 11px}
  .sidebar.collapsed .new-chat-btn .new-chat-label{display:inline}
  .sidebar.collapsed .search-wrap{justify-content:flex-start;padding:0 10px}
  .sidebar.collapsed .nav-item{justify-content:flex-start;padding:7px 10px}
  .sidebar.collapsed .nav-item::after{display:none}
  .only-mobile{display:inline-flex}
  .scrim:not([hidden]){display:block}
  .topbar{height:56px;min-height:56px;padding:0 12px;gap:8px}
  .conversation-heading{flex:1;min-width:0}
  .model-picker{margin-left:0;flex:0 1 auto}
  .model-trigger{max-width:180px}
  .chat-scroll{padding:22px 14px 28px}
  .messages{gap:22px}
  .msg.user .message-content{max-width:88%}
  .composer-wrap{padding:10px 12px 6px}
  .jump-btn{right:14px;bottom:150px}
}
@media (max-width:560px){
  .conversation-heading span{display:none}
  .top-actions .icon-btn:nth-child(2){display:none}
  .model-trigger{max-width:150px}
  .model-trigger .mt-tx small{display:none}
  .conversation-heading{flex:0 1 auto;min-width:0;max-width:34vw}
  .empty-state{margin-top:6vh}
  .empty-state h1{font-size:23px}
  .suggestions{grid-template-columns:1fr}
  .toast-region{right:12px;left:12px;bottom:12px}
  .toast{justify-content:flex-start;max-width:none}
  .composer-field textarea{font-size:16px}
  .chat-item .mini{display:grid}
  .msg-actions{opacity:1}
  .model-pop{position:fixed;left:12px;right:12px;bottom:12px;top:auto;width:auto;max-width:none;max-height:70dvh}
  .empty-logo{width:112px}
}
@media (prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important;scroll-behavior:auto!important}}

/* ---------- 2026 workspace redesign: quiet, capable, account-first ---------- */
:root{
  --sidebar-width:288px;
  --canvas:#0b0b0d;
  --glass:rgba(22,22,26,.82);
  --violet:#9b87f5;
  --violet-strong:#7c5cff;
}
html[data-contrast="high"]{--border:rgba(255,255,255,.16);--border-strong:rgba(255,255,255,.25);--muted:#c5c5cc;--faint:#9696a1}
html[data-theme="light"][data-contrast="high"]{--border:rgba(0,0,0,.17);--border-strong:rgba(0,0,0,.28);--muted:#3f3f46;--faint:#65656f}
html[data-text-size="small"]{--font-size:13px}
html[data-text-size="large"]{--font-size:15px}
html.overlay-open,html.overlay-open body{overflow:hidden;overscroll-behavior:none}
body{background:radial-gradient(900px 600px at 74% -12%,rgba(124,92,255,.07),transparent 58%),var(--bg)}
.sidebar{width:var(--sidebar-width);padding:14px 12px 12px;background:linear-gradient(180deg,var(--sidebar),color-mix(in srgb,var(--sidebar) 94%,#000));box-shadow:12px 0 40px rgba(0,0,0,.08)}
.sidebar-header{padding:2px 9px 5px;min-height:42px}
.brand-logo.logo-full{height:26px}
.new-chat-btn{min-height:44px;border:1px solid rgba(178,160,255,.32);background:linear-gradient(135deg,#7254de,#5133b8);color:#fff;border-radius:12px;padding:8px 10px;box-shadow:0 9px 24px rgba(72,45,172,.30)}
.new-chat-btn:hover{background:linear-gradient(135deg,#8265ee,#5c3ec8);border-color:rgba(205,194,255,.48);transform:translateY(-1px)}
.new-chat-btn svg{color:inherit}.new-chat-btn kbd{color:currentColor;opacity:.55;font-size:9px}
.model-picker-open .topbar{z-index:70}
.model-picker-open .model-pop{z-index:80}
.feedback-input{resize:vertical;min-height:96px}
.new-chat-icon{width:26px;height:26px;display:grid;place-items:center;border-radius:8px;background:color-mix(in srgb,var(--bg) 10%,transparent)}
.search-wrap{min-height:40px;border:0;background:transparent;border-radius:10px;padding:0 11px}
.search-wrap:hover,.search-wrap:focus-within{background:var(--hover);box-shadow:inset 0 0 0 1px var(--border)}
.chat-list{gap:1px}.history-label{padding:14px 10px 5px;letter-spacing:.06em;text-transform:none;font-size:11px}
.chat-item{min-height:38px;border:0;border-radius:9px;padding:8px 7px 8px 11px;color:var(--muted)}
.chat-item:hover{color:var(--text)}.chat-item.active{background:var(--hover);border:0;box-shadow:none;color:var(--text)}
.side-nav{border:0;margin:0;padding-top:3px}.nav-heading{display:none}.nav-item{min-height:38px;border-radius:9px;padding:8px 11px}
.sidebar-footer{border-top:0;padding:7px 2px 0;gap:7px}
.account-trigger{width:100%;border:0;background:transparent;color:var(--text);padding:8px;border-radius:11px;cursor:pointer;text-align:left}
.account-trigger:hover,.account-trigger[aria-expanded="true"]{background:var(--hover)}
.account-trigger>svg{width:15px;color:var(--faint)}.account-copy{display:flex;flex-direction:column;min-width:0;flex:1}
.profile-avatar{width:32px;height:32px;color:#fff;background:linear-gradient(145deg,#7957e8,#4338ca);border-color:rgba(255,255,255,.16)}
.footer-actions{padding:0 8px}.footer-link{font-size:11px}
.main{background:transparent}
.topbar{height:68px;padding:8px 20px;border-bottom:0;background:linear-gradient(180deg,var(--bg),rgba(10,10,12,.82));backdrop-filter:blur(16px)}
[data-theme="light"] .topbar{background:linear-gradient(180deg,var(--bg),rgba(250,250,250,.82))}
.conversation-heading{display:none}
.model-picker{margin:0 auto 0 8px}.model-trigger{min-width:260px;max-width:390px;border:0;background:transparent;border-radius:12px;padding:7px 10px}
.model-trigger:hover,.model-trigger[aria-expanded="true"]{background:var(--hover)}
.mt-ic{width:36px;height:36px;border-radius:11px;background:linear-gradient(145deg,rgba(155,135,245,.22),rgba(85,66,170,.09));border:1px solid rgba(155,135,245,.18)}
.mt-ic svg{width:17px}.mt-tx{display:grid;grid-template-columns:auto 1fr;column-gap:7px;align-items:baseline}.model-label{font-size:10px;color:var(--faint);text-transform:uppercase;letter-spacing:.08em;grid-column:1/-1}
.model-trigger strong{font-size:14px}.model-trigger small{font-size:11px}.plan-chip{background:var(--accent-soft);border:0;padding:4px 9px}
.model-pop{width:460px;border-radius:18px;padding:4px;border-color:var(--border-strong);box-shadow:0 24px 80px rgba(0,0,0,.48)}
.mp-head{padding:15px 14px 9px}.mp-search{min-height:39px}.mp-item{border-radius:12px;padding:11px 10px}.mp-item.selected{background:var(--accent-soft)}
.chat-scroll{padding:38px max(22px,calc((100% - 850px)/2)) 48px;scroll-padding-bottom:160px}
.messages{max-width:850px}.message{grid-template-columns:30px minmax(0,1fr);gap:16px;padding:13px 0 20px}.message.user{grid-template-columns:minmax(0,1fr);justify-items:end}
.message.user .msg-avatar{display:none}.message.user .message-main{max-width:min(82%,680px);background:var(--elevated);border:1px solid var(--border);border-radius:20px 20px 5px 20px;padding:12px 16px}
.msg-avatar{width:30px;height:30px;border:0;background:linear-gradient(145deg,rgba(155,135,245,.26),rgba(155,135,245,.06));color:var(--accent-text)}
.message-body{font-size:15.5px;line-height:1.72;letter-spacing:-.006em}.message-body p{margin:0 0 15px}.message-body h2{font-size:20px;margin:28px 0 11px}.message-body h3{font-size:16px;margin:23px 0 9px}
.empty-state{max-width:780px;padding-top:min(13vh,110px)}.empty-state .eyebrow{border:1px solid var(--border);border-radius:999px;padding:5px 10px;background:var(--surface)}
.empty-logo{display:none}.empty-state h1{font-size:clamp(31px,4vw,48px);line-height:1.08;letter-spacing:-.045em;max-width:680px;background:linear-gradient(100deg,var(--text) 35%,var(--muted));-webkit-background-clip:text;background-clip:text;color:transparent}
.empty-state>p:not(.eyebrow){font-size:15px;max-width:560px}.suggestions{grid-template-columns:repeat(2,minmax(0,1fr));gap:9px;width:min(100%,680px)}
.chip{min-height:76px;border-radius:15px;padding:14px 15px;background:color-mix(in srgb,var(--surface) 82%,transparent);text-align:left}.chip:hover{border-color:rgba(155,135,245,.35);background:var(--elevated);transform:translateY(-2px)}
.composer-wrap{padding:0 max(18px,calc((100% - 850px)/2)) 14px;background:linear-gradient(0deg,var(--bg) 55%,transparent)}
.composer{max-width:850px}.composer-field{border-radius:22px;padding:6px;background:var(--elevated);border-color:var(--border-strong);box-shadow:0 18px 55px rgba(0,0,0,.2)}
.composer-field:focus-within{border-color:rgba(155,135,245,.55);box-shadow:0 0 0 3px rgba(139,92,246,.09),0 22px 60px rgba(0,0,0,.25)}
.composer-field textarea{padding:12px 12px 7px;font-size:15px}.composer-toolbar{padding:4px 5px 4px 7px}.send-btn{width:34px;height:34px;border-radius:11px;background:var(--text);color:var(--bg)}
.disclaimer{font-size:10.5px;margin-top:7px}
html[data-model-details="hide"] #modelDescription,html[data-model-details="hide"] .model-label{display:none}

/* Account popover */
.account-menu{position:fixed;z-index:85;padding:8px;background:var(--elevated);border:1px solid var(--border-strong);border-radius:16px;box-shadow:0 24px 70px rgba(0,0,0,.5);animation:account-in .16s var(--ease)}
@keyframes account-in{from{opacity:0;transform:translateY(7px) scale(.98)}to{opacity:1;transform:none}}
.account-summary{display:grid;grid-template-columns:38px minmax(0,1fr) auto;gap:10px;align-items:center;padding:9px 9px 11px}
.account-avatar{width:38px;height:38px;border-radius:50%;display:grid;place-items:center;background:linear-gradient(145deg,#7957e8,#4338ca);color:white;font-weight:700}
.account-summary>div{min-width:0;display:flex;flex-direction:column}.account-summary strong,.account-summary small{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.account-summary strong{font-size:13px}.account-summary small{font-size:11px;color:var(--faint)}
.account-plan{font-size:10px;color:var(--accent-text);background:var(--accent-soft);padding:3px 7px;border-radius:999px}
.usage-preview{padding:11px 10px 12px;margin:0 2px 6px;border-radius:12px;background:var(--surface);border:1px solid var(--border)}
.usage-preview>div:first-child{display:flex;justify-content:space-between;font-size:11px;color:var(--muted)}.usage-preview strong{color:var(--text);font-weight:600}
.usage-track{height:5px;border-radius:999px;background:var(--hover);margin:9px 0 7px;overflow:hidden}.usage-track span{display:block;height:100%;border-radius:inherit;background:linear-gradient(90deg,#7c5cff,#a78bfa);transition:width .35s ease}
.usage-preview small{color:var(--faint);font-size:10.5px}.account-menu-items{border-top:1px solid var(--border);padding-top:5px}
.account-menu-items button,.account-menu-items a{display:flex;align-items:center;gap:10px;width:100%;border:0;background:transparent;color:var(--text);padding:9px 10px;border-radius:9px;text-decoration:none;font-size:13px;cursor:pointer;text-align:left}
.account-menu-items button:hover,.account-menu-items a:hover{background:var(--hover)}.account-menu-items svg{width:16px;color:var(--muted)}.account-menu-items span{flex:1}.account-menu-items kbd{font-size:9px;color:var(--faint)}.account-menu-items .danger-item{color:#f0a3a6}

/* In-workspace settings */
.settings-backdrop{position:fixed;inset:0;z-index:100;background:rgba(0,0,0,.62);backdrop-filter:blur(7px);display:grid;place-items:center;padding:24px;overscroll-behavior:contain}
.settings-shell{width:min(940px,100%);height:min(720px,calc(100dvh - 48px));display:flex;flex-direction:column;background:var(--elevated);border:1px solid var(--border-strong);border-radius:20px;box-shadow:0 30px 100px rgba(0,0,0,.55);overflow:hidden;animation:settings-in .18s var(--ease)}
@keyframes settings-in{from{opacity:0;transform:translateY(10px) scale(.985)}to{opacity:1;transform:none}}
.settings-head{height:75px;display:flex;align-items:center;gap:12px;padding:15px 20px 13px 25px;border-bottom:1px solid var(--border);flex:0 0 auto}.settings-head>div{flex:1}.settings-head .eyebrow{font-size:9px;margin:0 0 2px}.settings-head h2{font-size:21px;margin:0;letter-spacing:-.03em}
.settings-layout{display:grid;grid-template-columns:210px minmax(0,1fr);min-height:0;flex:1}.settings-nav{padding:15px 10px;border-right:1px solid var(--border);display:flex;flex-direction:column;gap:3px;background:color-mix(in srgb,var(--surface) 62%,transparent)}
.settings-nav button{display:flex;align-items:center;gap:10px;border:0;background:transparent;color:var(--muted);padding:9px 11px;border-radius:9px;font-size:13px;text-align:left;cursor:pointer}.settings-nav button:hover{background:var(--hover);color:var(--text)}.settings-nav button.active{background:var(--accent-soft);color:var(--text)}.settings-nav svg{width:16px;color:var(--faint)}.settings-nav button.active svg{color:var(--accent-text)}
.settings-content{overflow-y:auto;padding:30px 34px 50px;overscroll-behavior:contain}.settings-panel{display:none;max-width:650px}.settings-panel.active{display:block;animation:panel-in .14s ease}@keyframes panel-in{from{opacity:0;transform:translateY(3px)}to{opacity:1;transform:none}}
.settings-title{padding-bottom:18px;border-bottom:1px solid var(--border);margin-bottom:2px}.settings-title h3{margin:0 0 4px;font-size:19px;letter-spacing:-.025em}.settings-title p,.setting-row p,.setting-group>p,.sessions-head p{margin:0;color:var(--faint);font-size:12px}
.setting-row,.setting-switch,.sessions-head{min-height:74px;display:flex;align-items:center;justify-content:space-between;gap:20px;border-bottom:1px solid var(--border);padding:15px 0}.setting-row>div,.setting-switch>span,.sessions-head>div{flex:1}.setting-row strong,.setting-switch strong,.sessions-head strong{display:block;font-size:13px;margin-bottom:2px}.setting-row select{min-width:140px}
.settings-content select,.settings-content input{background:var(--surface);border:1px solid var(--border-strong);border-radius:9px;color:var(--text);padding:9px 11px;font:inherit;font-size:13px}.settings-content input:focus,.settings-content select:focus{border-color:var(--accent);outline:0}
.setting-switch{cursor:pointer}.setting-switch input{position:absolute;opacity:0;pointer-events:none}.setting-switch i{width:38px;height:22px;border-radius:999px;background:var(--hover);border:1px solid var(--border-strong);position:relative;flex:0 0 auto}.setting-switch i::after{content:"";position:absolute;width:16px;height:16px;border-radius:50%;left:2px;top:2px;background:var(--faint);transition:.16s ease}.setting-switch input:checked+i{background:var(--accent)}.setting-switch input:checked+i::after{transform:translateX(16px);background:#fff}
.setting-group{display:flex;flex-direction:column;gap:8px;padding:18px 0;border-bottom:1px solid var(--border)}.setting-group>label{font-size:13px;font-weight:600}.setting-inline{display:flex;gap:8px;margin-top:4px}.setting-inline input{flex:1}.setting-group>.btn{align-self:flex-start;margin-top:3px}.setting-value{color:var(--muted);font-size:12px}
.plan-hero{display:flex;align-items:center;justify-content:space-between;gap:25px;padding:24px 0;border-bottom:1px solid var(--border)}.plan-hero>div:first-child{display:flex;flex-direction:column}.plan-hero>div:first-child span{color:var(--accent-text);font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.08em}.plan-hero>div:first-child strong{font-size:22px;margin:5px 0 2px}.plan-hero>div:first-child small{color:var(--faint)}
.usage-ring{--usage:0%;width:76px;height:76px;border-radius:50%;display:grid;place-items:center;background:conic-gradient(var(--accent) var(--usage),var(--hover) 0);position:relative;flex:0 0 auto}.usage-ring::before{content:"";position:absolute;inset:7px;background:var(--elevated);border-radius:50%}.usage-ring span{position:relative;font-size:12px;font-weight:700}
.feature-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:9px;padding-top:18px}.feature-grid>div{border:1px solid var(--border);background:var(--surface);border-radius:12px;padding:13px}.feature-grid small{display:block;color:var(--faint);margin-bottom:3px}.feature-grid strong{font-size:13px}
.settings-sessions{display:flex;flex-direction:column}.settings-session{display:flex;align-items:center;gap:11px;padding:13px 0;border-bottom:1px solid var(--border)}.session-icon{width:34px;height:34px;border-radius:10px;background:var(--surface);border:1px solid var(--border);display:grid;place-items:center;color:var(--muted);flex:0 0 auto}.session-icon svg{width:16px}.session-copy{display:flex;flex-direction:column;min-width:0;flex:1}.session-copy strong{font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.session-copy small{font-size:10.5px;color:var(--faint);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.btn.compact{padding:6px 9px;font-size:11px}

@media(max-width:860px){
  .sidebar{width:min(315px,90vw)}.topbar{height:60px;padding:6px 12px}.model-picker{margin-left:2px}.model-trigger{min-width:0;max-width:min(58vw,310px)}.plan-chip,.model-status{display:none}.chat-scroll{padding:25px 16px 35px}.composer-wrap{padding:0 12px 9px}.empty-state{padding-top:7vh}.empty-state h1{font-size:34px}.suggestions{grid-template-columns:1fr 1fr}
  .settings-backdrop{padding:0}.settings-shell{height:100dvh;width:100%;border:0;border-radius:0}.settings-layout{grid-template-columns:1fr}.settings-nav{border:0;border-bottom:1px solid var(--border);flex-direction:row;overflow-x:auto;padding:8px 10px}.settings-nav button{white-space:nowrap}.settings-content{padding:22px 20px 40px}
}
@media(max-width:560px){
  .model-trigger{max-width:66vw}.mt-ic{display:none}.mt-tx{display:block}.model-label,.model-trigger small{display:none}.model-trigger strong{font-size:14px}.top-actions{gap:0}.top-actions #shareBtn{display:none}
  .empty-state{align-items:flex-start;text-align:left;padding-top:5vh}.empty-state h1{font-size:31px}.empty-state>p:not(.eyebrow){font-size:14px}.suggestions{display:flex;overflow-x:auto;width:calc(100vw - 32px);scroll-snap-type:x mandatory}.chip{min-width:235px;scroll-snap-align:start}.message.user .message-main{max-width:91%}
  .settings-head{height:65px;padding:11px 14px 10px 18px}.settings-nav button{padding:8px}.settings-nav button svg{display:none}.settings-content{padding:20px 16px 36px}.setting-row{align-items:flex-start;flex-direction:column;gap:9px}.setting-row select{width:100%}.setting-inline{flex-direction:column}.setting-inline .btn{align-self:flex-start}.feature-grid{grid-template-columns:1fr}.plan-hero>div:first-child strong{font-size:18px}.settings-session{align-items:flex-start}.settings-session .btn{margin-top:2px}.sessions-head{align-items:flex-start}.account-menu{left:12px!important;right:12px;width:auto!important}
}

/* Compact model control and uninterrupted composer surface. */
.topbar{height:60px;padding:7px max(26px,calc((100% - 900px)/2));border-bottom:0}
.topbar .model-picker{width:auto;max-width:min(100%,440px)}
.model-trigger{width:auto;max-width:100%;min-width:0;height:34px;display:inline-flex;align-items:center;gap:6px;padding:4px 6px 4px 8px;border:0;border-radius:8px;background:transparent;box-shadow:none;text-align:left}
.model-trigger:hover,.model-trigger[aria-expanded="true"]{background:rgba(255,255,255,.07);border-color:transparent;box-shadow:none}
.model-trigger strong{font-size:13px;line-height:1.25;font-weight:600;color:#e8eaf2;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.model-trigger .mt-chev{width:15px;height:15px;flex:0 0 auto;color:#969daf;transition:transform .18s ease}
.model-trigger[aria-expanded="true"] .mt-chev{transform:rotate(180deg)}
.model-pop{left:50%;right:auto;top:calc(100% + 8px);width:min(390px,calc(100vw - 24px));max-width:none;max-height:min(590px,calc(100dvh - 96px));transform:translateX(-50%);border-radius:16px;box-shadow:0 28px 80px rgba(0,0,0,.68)}
.composer-wrap{border-top:0}
@media(max-width:860px){.topbar{height:56px;padding:7px 14px}.topbar .model-picker{width:auto;max-width:calc(100vw - 76px)}}
@media(max-width:560px){.topbar{height:52px;padding:7px 12px 7px 55px}.model-trigger{height:32px;padding:4px 5px 4px 7px;border-radius:8px}.model-trigger strong{font-size:12px}.model-trigger .mt-chev{width:14px;height:14px}}

/* Definitive phone control: retained after all legacy redesign overrides. */
@media(max-width:860px){
  .topbar{display:flex!important;align-items:center!important;justify-content:center!important}
  .topbar .model-picker{display:block!important;position:relative!important;visibility:visible!important;opacity:1!important;width:min(100%,330px)!important;max-width:calc(100vw - 76px)!important;z-index:90!important}
  .topbar .model-trigger{display:inline-flex!important;visibility:visible!important;opacity:1!important;max-width:100%!important;pointer-events:auto!important}
  .model-picker-open .model-pop{z-index:110!important}
}
@media(max-width:560px){.topbar .model-picker{width:min(100%,300px)!important;max-width:calc(100vw - 68px)!important}}

/* Keep this after every historical redesign layer: phones must always expose
   the model trigger, and an opened picker must sit above the app shell. */
@media(max-width:860px){
  .topbar{display:flex!important;align-items:center!important;justify-content:center!important}
  .topbar .model-picker{display:block!important;position:relative!important;visibility:visible!important;opacity:1!important;width:min(100%,330px)!important;max-width:calc(100vw - 76px)!important;z-index:90!important}
  .topbar .model-trigger{display:inline-flex!important;visibility:visible!important;opacity:1!important;max-width:100%!important;pointer-events:auto!important}
  .model-picker-open .model-pop{z-index:110!important}
}
@media(max-width:560px){
  .topbar .model-picker{width:min(100%,300px)!important;max-width:calc(100vw - 68px)!important}
}

/* Mobile must retain a reachable model control. Earlier redesign layers set
   competing topbar grids and widths; this final rule is intentionally narrow
   and wins only at the phone breakpoint. */
@media(max-width:860px){
  .topbar{display:flex!important;align-items:center!important;justify-content:center!important}
  .topbar .model-picker{display:block!important;position:relative!important;visibility:visible!important;opacity:1!important;width:min(100%,330px)!important;max-width:calc(100vw - 76px)!important;z-index:90!important}
  .topbar .model-trigger{display:inline-flex!important;visibility:visible!important;opacity:1!important;max-width:100%!important;pointer-events:auto!important}
  .model-picker-open .model-pop{z-index:110!important}
}
@media(max-width:560px){
  .topbar .model-picker{width:min(100%,300px)!important;max-width:calc(100vw - 68px)!important}
}

/* Center the empty-state brand beneath the compact Uncensored AI badge. */
.empty-state{align-items:center;text-align:center}
.msg.user .bubble{padding:8px 13px}
.msg.user .bubble .message-body{line-height:1.5}

/* ---------- Venarm product surface: editorial workbench ---------- */
:root{--venarm-blue:#3158ff;--venarm-blue-soft:rgba(49,88,255,.14);--venarm-orange:#ff6347;--venarm-paper:#f4f1e9;--sidebar-width:304px}
body{background:radial-gradient(860px 580px at 94% -18%,rgba(49,88,255,.16),transparent 61%),radial-gradient(620px 440px at 34% 112%,rgba(255,99,71,.08),transparent 72%),#0a0b0f;font-family:'Space Grotesk',Inter,ui-sans-serif,system-ui,sans-serif}
.app{background:linear-gradient(90deg,rgba(255,255,255,.012),transparent 20%)}
.sidebar{width:var(--sidebar-width);padding:18px 14px 13px;background:linear-gradient(180deg,#101116 0%,#0d0e12 100%);border-right:1px solid rgba(255,255,255,.075);box-shadow:none;gap:12px}
.sidebar-header{min-height:48px;padding:3px 8px 8px}.brand{gap:0}.brand-lockup,.empty-wordmark{display:inline-flex;align-items:center;gap:5px;min-width:0}.brand-symbol{width:31px;height:31px;object-fit:contain;flex:0 0 auto}.brand-word{display:inline-block;color:var(--venarm-paper);font:700 18px/.88 'Space Grotesk',sans-serif;letter-spacing:.07em;transform:scaleX(1.08);transform-origin:left}.brand-sup{align-self:flex-start;margin:2px 0 0 1px;color:var(--venarm-orange);font:700 7px/1 'DM Mono',monospace;letter-spacing:.02em}
.new-chat-btn{min-height:47px;justify-content:flex-start;border:1px solid rgba(87,119,255,.44);border-radius:14px;background:linear-gradient(130deg,#3158ff,#2440bd);box-shadow:0 12px 30px rgba(20,48,166,.25);font-size:13px;font-weight:600}.new-chat-btn:hover{background:linear-gradient(130deg,#4267ff,#2b47c9);border-color:#7792ff;transform:translateY(-1px)}.new-chat-icon{width:27px;height:27px;border-radius:9px;background:rgba(255,255,255,.12)}.new-chat-btn kbd{border:0;background:transparent;color:#dce4ff;font-size:9px}
.search-wrap{min-height:42px;margin:1px 0 2px;border:1px solid rgba(255,255,255,.075);border-radius:12px;background:#14151c;box-shadow:none}.search-wrap:hover,.search-wrap:focus-within{background:#181a23;box-shadow:0 0 0 1px rgba(81,112,255,.2)}.search-wrap input{font-size:12px}.history-head{padding:8px 8px 0}.nav-heading{display:block;margin:0;color:#6f7381;font:600 9px/1 'DM Mono',monospace;letter-spacing:.12em;text-transform:uppercase}.chat-list{margin-top:3px}.chat-item{min-height:40px;border-radius:10px;padding:9px 8px 9px 10px;font-size:12.5px;color:#afb2bf}.chat-item.active{background:linear-gradient(90deg,rgba(49,88,255,.16),rgba(49,88,255,.04));box-shadow:inset 2px 0 var(--venarm-blue);color:#fff}.chat-item:hover{background:rgba(255,255,255,.055);color:#fff}.side-nav{margin-top:auto;padding-top:9px;border-top:1px solid rgba(255,255,255,.055)}.side-nav .nav-heading{margin:0 0 6px 8px}.nav-item{min-height:40px;border-radius:10px;color:var(--muted)}.nav-item:hover{background:rgba(255,255,255,.05)}
.sidebar-footer{padding:8px 2px 0;border-top:1px solid rgba(255,255,255,.055)}.account-trigger{padding:9px 8px;border-radius:12px}.account-trigger:hover,.account-trigger[aria-expanded="true"]{background:#181a22}.profile-avatar{width:34px;height:34px;background:linear-gradient(145deg,#ff704f,#d74831);box-shadow:0 5px 14px rgba(255,86,60,.2)}.footer-actions{padding:0 9px}.footer-link{font-size:10.5px;color:#818593}
.main{background:linear-gradient(180deg,rgba(14,15,20,.65),rgba(10,11,15,.72))}.topbar{height:76px;padding:10px 26px;border-bottom:1px solid rgba(255,255,255,.055);background:rgba(10,11,15,.72);backdrop-filter:blur(20px)}.topbar::after{content:"";position:absolute;left:0;right:0;bottom:-1px;height:1px;background:linear-gradient(90deg,transparent,rgba(49,88,255,.5),transparent);opacity:.45}.conversation-heading{display:flex;flex-direction:column;min-width:165px}.conversation-heading strong{font-size:13px;font-weight:600}.conversation-heading span{font-size:10px;color:var(--faint);margin-top:2px}.model-picker{margin:0 auto}.model-trigger{min-width:310px;max-width:430px;padding:8px 13px 8px 8px;border:1px solid rgba(255,255,255,.07);border-radius:15px;background:rgba(22,24,33,.76)}.model-trigger:hover,.model-trigger[aria-expanded="true"]{background:#1a1d29;border-color:rgba(98,127,255,.3)}.mt-ic{width:38px;height:38px;border-color:rgba(88,117,255,.28);background:linear-gradient(145deg,rgba(49,88,255,.28),rgba(255,99,71,.1));color:#b8c5ff}.model-label{color:#777e92}.model-trigger strong{font-size:13px}.model-trigger small{font-size:10.5px}.plan-chip{color:#dce4ff;background:rgba(49,88,255,.15);border:1px solid rgba(84,117,255,.22);padding:4px 8px}.top-actions{gap:5px}.top-actions .icon-btn{border-radius:10px}
.model-pop{border-color:rgba(125,145,255,.24);background:#161821;box-shadow:0 30px 100px rgba(0,0,0,.6)}.mp-item{border-radius:11px}.mp-item.selected{background:rgba(49,88,255,.14)}.mp-tab.selected{background:rgba(49,88,255,.15);border-color:rgba(101,128,255,.32);color:#b7c4ff}
.chat-scroll{padding:45px max(28px,calc((100% - 920px)/2)) 54px}.messages{max-width:880px;gap:31px}.msg{gap:14px}.avatar{width:31px;height:31px;background:linear-gradient(145deg,rgba(49,88,255,.27),rgba(49,88,255,.07));border-color:rgba(104,130,255,.18);color:#b9c6ff}.message-content{max-width:790px}.message-body{font-size:15.5px;line-height:1.76}.msg.user .message-content{max-width:74%}.msg.user .bubble{border-color:rgba(103,128,255,.26);border-radius:19px 19px 5px 19px;background:linear-gradient(145deg,#1b244d,#171d3d);box-shadow:0 12px 32px rgba(0,0,0,.15);padding:12px 15px}.msg.user .bubble .message-body{font-size:14px}.message-body h1,.message-body h2,.message-body h3{letter-spacing:-.03em}.message-body blockquote{border-left-color:var(--venarm-orange);background:rgba(255,99,71,.055)}.message-body li::marker{color:#8fa4ff}.msg-actions button:hover{background:rgba(49,88,255,.13);color:#c4d0ff}
.empty-state{max-width:820px;margin:0 auto;padding-top:min(14vh,122px)}.empty-state .eyebrow{display:inline-flex;width:max-content;border:1px solid rgba(100,124,255,.24);background:rgba(49,88,255,.08);color:#aebeff;border-radius:999px;padding:6px 10px;font:600 9px 'DM Mono',monospace;letter-spacing:.11em}.empty-wordmark{margin:27px 0 18px}.empty-wordmark .brand-symbol{width:53px;height:53px}.empty-wordmark .brand-word{font-size:34px;letter-spacing:.07em}.empty-wordmark .brand-sup{font-size:10px;margin-top:4px}.empty-state h1{max-width:760px;margin-bottom:16px;font-size:clamp(42px,5.1vw,64px);font-weight:600;letter-spacing:-.065em;line-height:.96;color:#f5f4ef;background:none;-webkit-text-fill-color:initial}.empty-state>p:not(.eyebrow){max-width:570px;font-size:15px;line-height:1.72;color:#a4a8b6}.suggestions{grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;width:100%;max-width:820px}.chip{min-height:128px;padding:17px 15px;border:1px solid rgba(255,255,255,.075);border-radius:16px;background:linear-gradient(145deg,rgba(255,255,255,.035),rgba(255,255,255,.012));box-shadow:none}.chip::before{content:"";width:8px;height:8px;margin-bottom:auto;border-radius:50%;background:var(--venarm-blue);box-shadow:0 0 0 5px rgba(49,88,255,.1)}.chip:nth-child(2)::before{background:var(--venarm-orange);box-shadow:0 0 0 5px rgba(255,99,71,.1)}.chip:nth-child(3)::before{background:#a4b4ff}.chip:nth-child(4)::before{background:#d4c6ff}.chip:hover{border-color:rgba(98,125,255,.38);background:rgba(49,88,255,.09);transform:translateY(-3px)}.chip strong{font-size:13px}.chip small{font-size:11.5px;line-height:1.45}
.composer-wrap{padding:0 max(24px,calc((100% - 920px)/2)) 15px;background:linear-gradient(0deg,#0a0b0f 55%,rgba(10,11,15,.86) 78%,transparent)}.composer{max-width:880px}.composer-field{border:1px solid rgba(255,255,255,.12);border-radius:19px;background:rgba(23,25,34,.9);box-shadow:0 20px 55px rgba(0,0,0,.28)}.composer-field:focus-within{border-color:rgba(102,130,255,.7);box-shadow:0 0 0 4px rgba(49,88,255,.1),0 20px 55px rgba(0,0,0,.3)}.composer-field textarea{min-height:62px;padding:15px 16px 7px;font-size:15px}.composer-toolbar{padding:6px 8px 8px 9px}.web-search-btn{height:33px;border-radius:9px}.web-search-btn.selected{border-color:rgba(104,131,255,.42);background:rgba(49,88,255,.14);color:#b9c7ff}.send-btn{width:38px;height:38px;border-radius:12px;background:var(--venarm-orange);border-color:var(--venarm-orange);color:#130b09;box-shadow:0 7px 16px rgba(255,99,71,.2)}.send-btn:hover{background:#ff7b61}.send-btn:disabled{background:#252832;border-color:rgba(255,255,255,.07);color:#696e7d;box-shadow:none}.disclaimer{color:#767b8c}
.account-menu{border-color:rgba(105,130,255,.25);background:#171922;box-shadow:0 28px 80px rgba(0,0,0,.58)}.account-avatar{background:linear-gradient(145deg,#ff704f,#d74831)}.account-plan{color:#c7d2ff;background:rgba(49,88,255,.15)}.usage-preview{border-color:rgba(255,255,255,.07);background:#11131a}.usage-track span{background:linear-gradient(90deg,#3158ff,#ff6347)}.account-menu-items button:hover,.account-menu-items a:hover{background:rgba(49,88,255,.1)}
@media(max-width:1020px){.conversation-heading{min-width:120px}.model-trigger{min-width:250px}.suggestions{grid-template-columns:1fr 1fr;max-width:610px}.chip{min-height:102px}.empty-state{max-width:660px}}
@media(max-width:860px){.sidebar{width:min(318px,89vw);padding:16px 12px}.sidebar.collapsed .brand-lockup{justify-content:flex-start}.topbar{height:64px;padding:8px 12px}.conversation-heading{display:none}.model-picker{margin-left:0}.model-trigger{min-width:0;max-width:min(68vw,330px)}.chat-scroll{padding:32px 17px 38px}.empty-state{padding-top:9vh}.empty-state h1{font-size:clamp(39px,9vw,56px)}.composer-wrap{padding:0 12px 10px}.suggestions{max-width:none}.chip{min-height:94px}}
@media(max-width:560px){.brand-word{font-size:17px}.brand-symbol{width:29px;height:29px}.topbar{height:59px}.model-trigger{max-width:72vw}.empty-state{padding-top:6vh}.empty-wordmark{margin-top:21px}.empty-wordmark .brand-symbol{width:45px;height:45px}.empty-wordmark .brand-word{font-size:29px}.empty-state h1{font-size:38px;line-height:.98}.empty-state>p:not(.eyebrow){font-size:14px}.suggestions{display:flex;overflow-x:auto;width:calc(100vw - 34px);scroll-snap-type:x mandatory;padding-bottom:3px}.chip{min-width:228px;min-height:116px;scroll-snap-align:start}.msg.user .message-content{max-width:90%}.composer-field{border-radius:16px}.composer-field textarea{font-size:16px}.web-search-btn span{display:none}.web-search-btn{width:33px;padding:0;justify-content:center}}

/* User-selected Venarm lockup: retain its native pixels rather than blending away the edge detail. */
.brand-lockup .brand-image,.empty-wordmark .brand-image{display:block;object-fit:contain;image-rendering:auto;mix-blend-mode:normal;filter:contrast(1.06) saturate(1.04);transform:translateZ(0)}.brand-lockup .brand-image{width:141px;height:47px}.empty-wordmark .brand-image{width:258px;height:86px}.empty-wordmark{display:flex;align-items:center;margin:27px 0 18px}@media(max-width:560px){.brand-lockup .brand-image{width:130px;height:43px}.empty-wordmark .brand-image{width:214px;height:71px}}

/* ---------- Model deck + sidebar rail redesign ---------- */
.sidebar{position:relative}
.sidebar-header{position:relative;justify-content:flex-start;padding-right:4px}
.brand{min-width:0;overflow:hidden}
.brand-lockup{display:flex;align-items:center;width:154px;height:48px;overflow:hidden;background:transparent;border-radius:9px}
.brand-lockup .brand-image{width:154px;height:51px;max-width:none;flex:0 0 auto}
.sidebar-toggle{position:absolute;right:7px;top:7px;width:34px;height:34px;display:grid;place-items:center;padding:0;border:1px solid rgba(255,255,255,.1);border-radius:10px;background:#12141c;color:#dce4ff;cursor:pointer;overflow:hidden;transition:border-color .16s ease,background .16s ease,transform .16s ease;z-index:2}
.sidebar-toggle:hover{border-color:rgba(120,145,255,.65);background:#1b2134}
.sidebar-toggle:active{transform:scale(.94)}
.sidebar-toggle-mark{display:block;width:24px;height:24px;object-fit:contain;filter:contrast(1.09) saturate(1.08);transition:opacity .12s ease,transform .16s ease}
.sidebar-toggle-menu{position:absolute;width:18px;height:18px;opacity:0;transform:scale(.76);transition:opacity .12s ease,transform .16s ease}
.sidebar-toggle:hover .sidebar-toggle-mark,.sidebar-toggle:focus-visible .sidebar-toggle-mark{opacity:0;transform:scale(.76)}
.sidebar-toggle:hover .sidebar-toggle-menu,.sidebar-toggle:focus-visible .sidebar-toggle-menu{opacity:1;transform:scale(1)}
.sidebar:not(.collapsed) .sidebar-toggle-mark{opacity:0;transform:scale(.76)}
.sidebar:not(.collapsed) .sidebar-toggle-menu{opacity:1;transform:scale(1)}
.sidebar.collapsed{width:64px;padding:14px 9px;background:#0e0f14;align-items:stretch}
.sidebar.collapsed .sidebar-header{min-height:43px;padding:0;justify-content:center}
.sidebar.collapsed .brand-lockup{display:none}
.sidebar.collapsed .sidebar-toggle{position:relative;right:auto;top:auto;width:42px;height:42px;border-radius:13px;margin:auto;background:#0f1118;border-color:rgba(89,118,255,.28)}
.sidebar.collapsed .sidebar-toggle-mark{width:28px;height:28px}
.sidebar.collapsed .search-wrap,.sidebar.collapsed .history-head,.sidebar.collapsed .chat-list{display:none!important}
.sidebar.collapsed .new-chat-btn{display:flex!important;width:42px;min-height:42px;height:42px;margin:3px auto 0;padding:0;justify-content:center;border-radius:13px}
.sidebar.collapsed .new-chat-btn .new-chat-label,.sidebar.collapsed .new-chat-btn kbd{display:none!important}
.sidebar.collapsed .new-chat-icon{width:28px;height:28px;border-radius:9px;background:rgba(255,255,255,.12)}
.sidebar.collapsed .side-nav{display:block!important;margin-top:auto;padding-top:8px;border-top:1px solid rgba(255,255,255,.06)}
.sidebar.collapsed .side-nav .nav-heading{display:none!important}
.sidebar.collapsed .nav-item{display:flex!important;width:42px;min-height:42px;height:42px;margin:auto;padding:0;justify-content:center;border-radius:13px}
.sidebar.collapsed .nav-item::after{display:none!important}
.sidebar.collapsed .sidebar-footer{display:block!important;padding:8px 0 0;border-top:1px solid rgba(255,255,255,.06)}
.sidebar.collapsed .account-trigger{display:flex!important;width:42px;height:42px;margin:auto;padding:4px;justify-content:center;border-radius:13px}
.sidebar.collapsed .account-trigger .account-copy,.sidebar.collapsed .account-trigger>i,.sidebar.collapsed .footer-actions{display:none!important}
.sidebar.collapsed + .scrim{display:none!important}
.mobile-sidebar-open{display:none!important}

.topbar{display:grid;grid-template-columns:minmax(0,1fr);place-items:center;height:88px;padding:12px max(26px,calc((100% - 900px)/2));background:linear-gradient(180deg,rgba(12,13,19,.94),rgba(10,11,15,.75));border-bottom:1px solid rgba(255,255,255,.06)}
.conversation-heading{display:none!important}
.topbar .model-picker{position:relative;width:min(100%,720px);margin:0;display:block}
.model-trigger{width:100%;max-width:none;min-width:0;height:62px;display:grid;grid-template-columns:45px minmax(0,1fr) auto;gap:12px;padding:7px 10px 7px 8px;border:1px solid rgba(124,149,255,.24);border-radius:18px;background:linear-gradient(110deg,rgba(26,31,51,.96),rgba(18,20,29,.96));box-shadow:0 13px 38px rgba(0,0,0,.22);text-align:left}
.model-trigger::before{content:"";position:absolute;inset:0;border-radius:inherit;background:linear-gradient(100deg,rgba(65,101,255,.14),transparent 38%,rgba(255,99,71,.06));opacity:0;transition:opacity .16s ease;pointer-events:none}
.model-trigger:hover,.model-trigger[aria-expanded="true"]{background:linear-gradient(110deg,#202842,#171a28);border-color:rgba(127,153,255,.58);box-shadow:0 15px 44px rgba(0,0,0,.3)}
.model-trigger:hover::before,.model-trigger[aria-expanded="true"]::before{opacity:1}
.mt-ic{position:relative;width:45px;height:45px;border-radius:13px;border-color:rgba(126,150,255,.32);background:linear-gradient(145deg,rgba(62,95,255,.36),rgba(255,99,71,.13));color:#d5ddff}
.mt-tx{position:relative;display:grid;grid-template-columns:minmax(0,1fr);gap:1px;min-width:0}
.model-label{font:600 9px/1.3 'DM Mono',monospace;letter-spacing:.1em;text-transform:uppercase;color:#95a5d6}
.model-trigger strong{font-size:14px;line-height:1.3;color:#f5f6ff;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.model-trigger small{font-size:11px;line-height:1.25;color:#a3a8ba;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.model-trigger-action{position:relative;display:inline-flex;align-items:center;gap:7px;color:#aebcff;font:600 10px/1 'DM Mono',monospace;letter-spacing:.04em;text-transform:uppercase;padding:0 5px 0 11px;border-left:1px solid rgba(255,255,255,.09)}
.model-trigger-action .mt-chev{width:16px;height:16px;transition:transform .18s ease}
.model-trigger[aria-expanded="true"] .mt-chev{transform:rotate(180deg)}
.model-pop{left:0;right:auto;top:calc(100% + 11px);width:100%;max-width:none;max-height:min(590px,calc(100dvh - 138px));border:1px solid rgba(128,153,255,.3);border-radius:20px;padding:9px;background:linear-gradient(145deg,#171b2b,#11131b);box-shadow:0 36px 110px rgba(0,0,0,.68);z-index:100}
.model-pop::before{content:"Choose a model";display:block;padding:7px 10px 4px;color:#e9ecff;font-size:13px;font-weight:600;letter-spacing:-.01em}
.mp-search{padding:7px 8px 11px;gap:8px}.mp-search input{height:39px;border-color:rgba(255,255,255,.09);border-radius:11px;background:#0e1017;padding:8px 11px}.mp-search input:focus{border-color:rgba(118,146,255,.65);box-shadow:0 0 0 3px rgba(69,102,255,.13)}
.mp-tabs{gap:6px;padding:1px 8px 10px;border-bottom:1px solid rgba(255,255,255,.07)}.mp-tab{padding:7px 10px;border-radius:9px;font-size:11px}.mp-tab.selected{background:rgba(67,99,255,.2);border-color:rgba(126,151,255,.36);color:#d7dfff}
.mp-list{padding:5px 2px 2px}.mp-group{padding:12px 10px 5px;color:#8991aa;font:600 9px/1 'DM Mono',monospace;letter-spacing:.11em}.mp-item{min-height:59px;padding:9px 10px;border-radius:13px}.mp-item:hover,.mp-item.active{background:rgba(255,255,255,.055)}.mp-item.selected{border-color:rgba(110,141,255,.43);background:linear-gradient(90deg,rgba(63,96,255,.2),rgba(63,96,255,.06))}.mp-ic{width:35px;height:35px;border-radius:11px;background:#20243a;border-color:rgba(126,150,255,.22)}.mp-tx strong{font-size:12.5px}.mp-tx small{font-size:10.5px}.mp-check{color:#aebdff}
.empty-state{max-width:760px;padding-top:min(19vh,172px);align-items:center;text-align:center}
.empty-state .eyebrow{border-color:rgba(255,107,80,.38);background:rgba(255,99,71,.09);color:#ffb5a4}
.empty-wordmark{display:flex;align-items:center;justify-content:center;margin:26px 0 0;background:transparent}
.empty-wordmark .brand-image{width:270px;height:90px}
.empty-state h1{max-width:720px;margin:0;font-size:clamp(46px,5.8vw,76px);line-height:.9;letter-spacing:-.078em;color:#fbfbf6}

@media(max-width:860px){
  .sidebar{position:fixed;top:0;bottom:0;left:0;width:min(318px,89vw);padding:16px 12px;transform:translateX(-105%);z-index:30}
  .sidebar.open{transform:translateX(0)}
  .sidebar-header{justify-content:flex-start;padding-right:46px}
  .brand-lockup{width:154px}
  .sidebar-toggle{right:7px;top:7px}
  .sidebar.collapsed{width:min(318px,89vw);padding:16px 12px;align-items:stretch}
  .sidebar.collapsed .sidebar-header{min-height:48px;padding-right:46px;justify-content:flex-start}
  .sidebar.collapsed .brand-lockup{display:flex}
  .sidebar.collapsed .sidebar-toggle{position:absolute;right:7px;top:7px;width:34px;height:34px;margin:0}
  .sidebar.collapsed .sidebar-toggle-mark{width:24px;height:24px}
  .sidebar.collapsed .new-chat-btn{display:flex!important;width:auto;height:auto;margin:0;padding:8px 10px;justify-content:flex-start}
  .sidebar.collapsed .new-chat-btn .new-chat-label{display:inline!important}
  .sidebar.collapsed .new-chat-btn kbd{display:inline!important}
  .sidebar.collapsed .search-wrap,.sidebar.collapsed .history-head{display:flex!important}
  .sidebar.collapsed .chat-list{display:block!important}
  .sidebar.collapsed .side-nav{display:block!important;margin-top:auto;padding-top:9px}
  .sidebar.collapsed .side-nav .nav-heading{display:block!important}
  .sidebar.collapsed .nav-item{display:flex!important;width:auto;height:auto;margin:0;padding:7px 10px;justify-content:flex-start}
  .sidebar.collapsed .sidebar-footer{display:block!important;padding:8px 2px 0}
  .sidebar.collapsed .account-trigger{display:flex!important;width:auto;height:auto;margin:0;padding:9px 8px;justify-content:flex-start}
  .sidebar.collapsed .account-trigger .account-copy,.sidebar.collapsed .account-trigger>i,.sidebar.collapsed .footer-actions{display:flex!important}
  #sidebarClose{display:none!important}
  .mobile-sidebar-open{display:inline-flex!important;position:absolute;left:12px;top:50%;transform:translateY(-50%);z-index:2}
  .topbar{height:78px;padding:8px 14px;grid-template-columns:minmax(0,1fr);backdrop-filter:none}
  .topbar .model-picker{width:min(100%,620px)}
  .model-pop{position:fixed;left:12px;right:12px;bottom:12px;top:auto;width:auto;max-height:min(72dvh,620px);border-radius:20px}
  .model-pop::before{padding-left:10px}
  .empty-state{padding-top:13vh;max-width:610px}.empty-state h1{font-size:clamp(44px,10vw,64px)}
}

/* In the compact desktop rail the account control must remain anchored to the
   bottom, regardless of whether there are any history or navigation rows. */
@media(min-width:861px){.sidebar.collapsed .sidebar-footer{margin-top:auto!important}}
@media(max-width:560px){
  .topbar{height:72px;padding:7px 12px 7px 55px}
  .model-trigger{height:54px;grid-template-columns:39px minmax(0,1fr) 27px;gap:9px;border-radius:15px;padding:6px 8px 6px 6px}
  .mt-ic{display:grid;width:39px;height:39px;border-radius:11px}.model-trigger strong{font-size:12.5px}.model-trigger small{font-size:10px}.model-trigger-action{width:27px;font-size:0;padding-left:8px}.model-trigger-action .mt-chev{display:block;width:17px;height:17px}
  .empty-state{padding-top:11vh}.empty-wordmark{margin:19px 0 16px}.empty-wordmark .brand-image{width:235px;height:78px}.empty-state h1{font-size:clamp(42px,12vw,58px)}
}

/* ---------- Definitive mobile model control (keep last: wins all earlier layers) ----------
   Earlier layers define the desktop popover as left:50% + translateX(-50%)
   AFTER the phone bottom-sheet rule, so on phones the sheet lost its
   full-width geometry (equal specificity, later source wins). These rules use
   higher specificity so the phone layout always wins at phone widths. */
@media(max-width:860px){
  .topbar{display:flex!important;align-items:center!important;justify-content:flex-start!important;gap:8px!important;height:56px!important;padding:7px 12px!important}
  .topbar .mobile-sidebar-open{display:inline-flex!important;position:static!important;transform:none!important;flex:0 0 auto!important}
  .topbar .model-picker{display:flex!important;position:relative!important;visibility:visible!important;opacity:1!important;flex:1 1 auto!important;min-width:0!important;width:auto!important;max-width:none!important;margin:0!important;z-index:90!important}
  .topbar .model-trigger{display:inline-flex!important;visibility:visible!important;opacity:1!important;flex:1 1 auto!important;min-width:0!important;width:100%!important;max-width:100%!important;min-height:44px!important;height:44px!important;pointer-events:auto!important;align-items:center!important}
  .topbar .model-trigger strong{flex:1 1 auto!important;min-width:0!important}
  .topbar .model-pop{position:fixed!important;left:12px!important;right:12px!important;top:auto!important;bottom:12px!important;width:auto!important;max-width:none!important;max-height:min(72dvh,620px)!important;transform:none!important;border-radius:20px!important;z-index:120!important}
  .model-picker-open .model-pop{z-index:130!important}
}
@media(max-width:560px){
  .topbar{height:54px!important;padding:7px 10px!important}
  .topbar .model-trigger{min-height:42px!important;height:42px!important}
}

/* Final compact model control: a label and chevron, not a second header card. */
.topbar{height:60px;padding:7px max(26px,calc((100% - 900px)/2));border-bottom:0}
.topbar .model-picker{width:auto;max-width:min(100%,440px)}
.model-trigger{width:auto;max-width:100%;min-width:0;height:34px;display:inline-flex;align-items:center;gap:6px;padding:4px 6px 4px 8px;border:0;border-radius:8px;background:transparent;box-shadow:none;text-align:left}
.model-trigger:hover,.model-trigger[aria-expanded="true"]{background:rgba(255,255,255,.07);border-color:transparent;box-shadow:none}
.model-trigger strong{font-size:13px;line-height:1.25;font-weight:600;color:#e8eaf2;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.model-trigger .mt-chev{width:15px;height:15px;flex:0 0 auto;color:#969daf;transition:transform .18s ease}
.model-trigger[aria-expanded="true"] .mt-chev{transform:rotate(180deg)}
.model-pop{left:50%;right:auto;top:calc(100% + 8px);width:min(390px,calc(100vw - 24px));max-width:none;max-height:min(590px,calc(100dvh - 96px));transform:translateX(-50%);border-radius:16px;box-shadow:0 28px 80px rgba(0,0,0,.68)}
.composer-wrap{border-top:0}
@media(max-width:860px){.topbar{height:56px;padding:7px 14px}.topbar .model-picker{width:auto;max-width:calc(100vw - 76px)}}
@media(max-width:560px){.topbar{height:52px;padding:7px 12px 7px 55px}.model-trigger{height:32px;padding:4px 5px 4px 7px;border-radius:8px}.model-trigger strong{font-size:12px}.model-trigger .mt-chev{width:14px;height:14px}}

/* This is deliberately last: every phone always gets a visible model picker. */
@media(max-width:860px){
  .topbar{display:flex!important;align-items:center!important;justify-content:flex-start!important;gap:8px!important;height:56px!important;padding:7px 12px!important}
  .topbar .mobile-sidebar-open{display:inline-flex!important;position:static!important;transform:none!important;flex:0 0 auto!important}
  .topbar .model-picker{display:flex!important;position:relative!important;visibility:visible!important;opacity:1!important;flex:1 1 auto!important;min-width:0!important;width:auto!important;max-width:none!important;margin:0!important;z-index:90!important}
  .topbar .model-trigger{display:inline-flex!important;visibility:visible!important;opacity:1!important;flex:1 1 auto!important;min-width:0!important;width:100%!important;max-width:100%!important;min-height:44px!important;height:44px!important;pointer-events:auto!important}
  .topbar .model-trigger strong{flex:1 1 auto!important;min-width:0!important}
  .topbar .model-pop{position:fixed!important;left:12px!important;right:12px!important;top:auto!important;bottom:12px!important;width:auto!important;max-width:none!important;max-height:min(72dvh,620px)!important;transform:none!important;border-radius:20px!important;z-index:130!important}
}
@media(max-width:560px){.topbar{height:54px!important;padding:7px 10px!important}.topbar .model-trigger{min-height:42px!important;height:42px!important}}

/* Phone picker is a proper bottom sheet: it sits above an intentional backdrop,
   rather than appearing halfway down the chat while the rest stays interactive. */
@media(max-width:860px){
  body.model-picker-open::before{content:"";position:fixed;inset:0;background:rgba(3,5,11,.64);backdrop-filter:blur(2px);z-index:120;pointer-events:auto}
  .model-picker-open .topbar{position:relative;z-index:131}
  .model-picker-open .model-pop{z-index:132!important}
}

/* Compact logical-model menu: no provider catalogue, tabs, or search field. */
.model-pop::before{display:none!important}.model-pop{padding:6px!important;width:min(270px,calc(100vw - 24px))!important;background:#151720!important;border:1px solid rgba(255,255,255,.12)!important;border-radius:14px!important}.mp-list{padding:0!important}.mp-item{display:flex;align-items:center;min-height:48px!important;padding:8px 10px!important;border:0!important;border-radius:10px!important;background:transparent!important;box-shadow:none!important;text-align:left}.mp-item:hover,.mp-item.active{background:rgba(255,255,255,.07)!important}.mp-item.selected{background:rgba(49,87,238,.17)!important}.mp-item.unavailable{opacity:.42;cursor:not-allowed}.mp-tx{display:flex;flex-direction:column;gap:1px;min-width:0;flex:1}.mp-tx strong{font-size:13px!important;color:#f2f4ff}.mp-tx small{font-size:10px!important;color:#9da5bb}.mp-check{width:16px;height:16px;color:#afc0ff;opacity:0}.mp-item.selected .mp-check{opacity:1}.mp-item.unavailable .mp-check{display:none}
@media(max-width:860px){.topbar .model-pop{width:auto!important;padding:7px!important;max-height:none!important}.mp-item{min-height:50px!important}}

/* Final phone geometry: a small model label next to the menu button and a
   compact menu directly beneath the top bar, never a bottom sheet. */
@media(max-width:860px){
  .topbar{justify-content:flex-start!important}
  .topbar .model-picker{display:block!important;position:relative!important;z-index:140!important;flex:0 1 auto!important;width:auto!important;max-width:calc(100vw - 72px)!important}
  .topbar .model-trigger{display:inline-flex!important;flex:0 1 auto!important;width:auto!important;max-width:100%!important;min-height:34px!important;height:34px!important;padding:4px 6px!important}
  .topbar .model-trigger strong{max-width:calc(100vw - 122px)!important;flex:0 1 auto!important}
  .topbar .model-pop{position:absolute!important;top:calc(100% + 6px)!important;bottom:auto!important;left:0!important;right:auto!important;transform:none!important;width:min(250px,calc(100vw - 24px))!important;max-height:calc(100dvh - 76px)!important;border-radius:13px!important;z-index:142!important}
}

/* Keep message bubbles slim rather than leaving a large lower gutter. */
.msg.user .bubble{padding:7px 11px!important}.msg.user .bubble .message-body{line-height:1.42!important}

/* Mobile settings tabs are one consistent-height horizontal strip. */
@media(max-width:860px){
  /* The two children are navigation + content.  Without explicit rows CSS Grid
     stretches both implicit rows, leaving a large dead band below the tabs. */
  .settings-layout{grid-template-rows:auto minmax(0,1fr)!important}
  .settings-nav{display:grid!important;grid-template-columns:repeat(5,minmax(0,1fr))!important;align-items:center!important;gap:4px!important;min-height:55px!important;overflow:hidden!important;scrollbar-width:none!important}
  .settings-nav::-webkit-scrollbar{display:none}
  .settings-nav button{display:inline-flex!important;align-items:center!important;justify-content:center!important;box-sizing:border-box!important;min-width:0!important;width:100%!important;height:38px!important;min-height:38px!important;margin:0!important;padding:0 4px!important;border:1px solid transparent!important;outline:0!important;box-shadow:none!important;font-size:11px!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}
  .settings-nav button.active{border-color:rgba(91,122,255,.38)!important}
}

/* No empty lower gutter below the final model choice. */
.model-pop,.topbar .model-pop{padding:0!important}.mp-list{min-height:0!important;padding:0!important}.mp-item{min-height:44px!important;height:44px!important;padding:6px 10px!important}.mp-item:last-child{margin:0!important}

/* The selected conversation is framed as one complete item, not marked by a
   distracting blue line down its left edge. */
.chat-item.active{background:rgba(49,88,255,.11)!important;border:1px solid rgba(92,121,255,.52)!important;box-shadow:0 0 0 1px rgba(49,88,255,.10)!important;color:#fff!important}
