:root{
  --bg:#0d0e10;
  --bg-soft:#111214;
  --sidebar-top:#1d191d;
  --sidebar-mid:#161316;
  --sidebar-bottom:#0d0e10;
  --panel:#151619;
  --panel-2:#1b1c20;
  --panel-3:#212329;
  --hover:#232127;
  --active:#29262d;
  --border:rgba(255,255,255,.075);
  --border-strong:rgba(255,255,255,.13);
  --text:#f4f4f5;
  --text-2:#c7c9ce;
  --muted:#8d9098;
  --dim:#62656d;
  --blue:#5b8cff;
  --blue-strong:#3e72f4;
  --violet:#9a7cff;
  --green:#48d597;
  --red:#ff6b7a;
  --shadow-lg:0 28px 80px rgba(0,0,0,.42);
  --shadow-md:0 18px 46px rgba(0,0,0,.28);
}
html[data-theme="light"]{
  --bg:#f5f6f8;
  --bg-soft:#f1f2f4;
  --sidebar-top:#ffffff;
  --sidebar-mid:#f7f7f8;
  --sidebar-bottom:#f0f1f3;
  --panel:#ffffff;
  --panel-2:#f7f7f8;
  --panel-3:#eff1f4;
  --hover:#eceef2;
  --active:#e5e7ec;
  --border:rgba(17,24,39,.08);
  --border-strong:rgba(17,24,39,.14);
  --text:#17191f;
  --text-2:#444955;
  --muted:#737985;
  --dim:#9aa0aa;
  --shadow-lg:0 28px 80px rgba(27,33,44,.16);
  --shadow-md:0 18px 46px rgba(27,33,44,.11);
}
*{box-sizing:border-box}
html,body{margin:0;height:100%;overflow:hidden}
body{
  background:var(--bg);
  color:var(--text);
  font-family:Inter,"Segoe UI",Tahoma,Arial,sans-serif;
  -webkit-font-smoothing:antialiased;
  text-rendering:optimizeLegibility;
}
button,input,textarea{font:inherit;color:inherit}
button{appearance:none}
svg{fill:none;stroke:currentColor;stroke-linecap:round;stroke-linejoin:round;stroke-width:1.7}
.hidden{display:none!important}
.app-shell{height:100%;display:flex;background:var(--bg)}

.sidebar{
  width:332px;min-width:332px;height:100%;
  display:flex;flex-direction:column;
  background:linear-gradient(180deg,var(--sidebar-top) 0%,var(--sidebar-mid) 56%,var(--sidebar-bottom) 100%);
  border-right:1px solid rgba(255,255,255,.025);
  position:relative;z-index:40;
  transition:width .24s cubic-bezier(.2,.7,.2,1),min-width .24s cubic-bezier(.2,.7,.2,1),transform .24s ease;
}
body.compact .sidebar{width:276px;min-width:276px}
.sidebar-brand{height:58px;display:flex;align-items:center;justify-content:space-between;padding:0 12px 0 16px}
.brand-lockup{display:flex;align-items:center;gap:11px;min-width:0}
.brand-logo{width:34px;height:34px;object-fit:contain;display:block;filter:drop-shadow(0 5px 12px rgba(0,0,0,.22))}
.brand-copy{display:flex;flex-direction:column;min-width:0}
.brand-copy strong{font-size:13px;line-height:1.15;letter-spacing:-.01em}
.brand-copy span{font-size:9.5px;color:var(--dim);margin-top:3px;white-space:nowrap}
.icon-button{
  width:34px;height:34px;border:0;border-radius:9px;background:transparent;color:var(--muted);
  display:grid;place-items:center;cursor:pointer;transition:background .16s ease,color .16s ease,transform .16s ease;
}
.icon-button:hover{background:var(--hover);color:var(--text)}
.icon-button:active{transform:scale(.96)}
.icon-button svg{width:16px;height:16px}
.icon-button.subtle{width:30px;height:30px}

.sidebar-actions{padding:4px 10px 10px}
.new-chat-button{
  width:100%;height:42px;border:1px solid var(--border);border-radius:11px;
  background:rgba(255,255,255,.025);color:var(--text-2);
  display:grid;grid-template-columns:26px minmax(0,1fr) auto;align-items:center;gap:8px;
  padding:0 10px;cursor:pointer;text-align:left;transition:.16s ease;
}
html[data-theme="light"] .new-chat-button{background:rgba(17,24,39,.025)}
.new-chat-button:hover{background:var(--hover);border-color:var(--border-strong);color:var(--text)}
.button-icon{width:24px;height:24px;border-radius:7px;display:grid;place-items:center;background:var(--panel-3);color:var(--text)}
.button-icon svg{width:14px;height:14px}
.new-chat-button span:nth-child(2){font-size:12px;font-weight:650}
.new-chat-button kbd{font-size:9px;font-family:inherit;color:var(--dim);background:transparent}
.search-box{
  height:37px;margin-top:8px;border:1px solid transparent;border-radius:10px;
  display:grid;grid-template-columns:17px minmax(0,1fr) auto;align-items:center;gap:8px;
  padding:0 10px;color:var(--dim);background:transparent;
}
.search-box:hover,.search-box:focus-within{background:rgba(255,255,255,.025);border-color:var(--border)}
html[data-theme="light"] .search-box:hover,html[data-theme="light"] .search-box:focus-within{background:rgba(17,24,39,.03)}
.search-box svg{width:14px;height:14px}
.search-box input{width:100%;border:0;outline:0;background:transparent;color:var(--text);font-size:11.5px}
.search-box input::placeholder{color:var(--dim)}
.search-shortcut{font-size:9px;color:var(--dim)}

.sidebar-scroll{flex:1;min-height:0;overflow:auto;padding:2px 8px 16px}
.history-group{margin-top:5px}
.group-heading{
  height:28px;padding:0 8px;display:flex;align-items:center;justify-content:space-between;
  color:var(--dim);font-size:9.5px;font-weight:700;text-transform:uppercase;letter-spacing:.06em;
}
.group-action{border:0;background:transparent;color:var(--dim);cursor:pointer;font-size:10px;opacity:.65}
.conversation{
  min-height:48px;border-radius:10px;display:grid;grid-template-columns:minmax(0,1fr) 30px;
  align-items:center;position:relative;color:var(--muted);margin:2px 0;
}
.conversation:hover,.conversation.active{background:var(--hover);color:var(--text)}
.conversation.active:before{
  content:"";position:absolute;left:0;top:12px;bottom:12px;width:2px;border-radius:4px;background:var(--blue);
}
.conversation-main{
  border:0;background:transparent;color:inherit;display:grid;grid-template-columns:24px minmax(0,1fr);gap:8px;
  align-items:center;min-width:0;padding:7px 4px 7px 10px;text-align:left;cursor:pointer;
}
.conversation-symbol{width:22px;height:22px;border-radius:7px;display:grid;place-items:center;color:var(--dim)}
.conversation.active .conversation-symbol{color:var(--blue);background:rgba(91,140,255,.09)}
.conversation-symbol svg{width:14px;height:14px}
.conversation-copy{min-width:0;display:flex;flex-direction:column}
.conversation-copy strong{font-size:11.6px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.conversation-copy small{font-size:9.5px;color:var(--dim);margin-top:3px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.conversation-more{
  width:28px;height:28px;border:0;border-radius:8px;background:transparent;color:var(--dim);
  display:grid;place-items:center;cursor:pointer;opacity:0;transition:.15s ease;
}
.conversation:hover .conversation-more,.conversation.menu-open .conversation-more{opacity:1}
.conversation-more:hover{background:var(--active);color:var(--text)}
.conversation-more svg{width:14px;height:14px}
.context-menu{
  display:none;position:absolute;right:4px;top:42px;z-index:90;min-width:168px;
  padding:5px;border:1px solid var(--border-strong);border-radius:11px;background:var(--panel);
  box-shadow:var(--shadow-md);backdrop-filter:blur(18px);
}
.conversation.menu-open .context-menu{display:block}
.context-menu button{
  width:100%;height:32px;border:0;border-radius:7px;background:transparent;color:var(--text-2);
  display:grid;grid-template-columns:18px 1fr;align-items:center;gap:8px;padding:0 8px;text-align:left;cursor:pointer;font-size:11px;
}
.context-menu button:hover{background:var(--hover);color:var(--text)}
.context-menu button.danger{color:var(--red)}
.context-menu svg{width:14px;height:14px}
.menu-separator{height:1px;background:var(--border);margin:4px}

.sidebar-footer{height:58px;padding:8px 10px;display:flex;align-items:center;gap:6px;border-top:1px solid rgba(255,255,255,.035)}
.profile-button{
  flex:1;height:40px;border:0;border-radius:10px;background:transparent;color:var(--text-2);
  display:grid;grid-template-columns:30px minmax(0,1fr) 16px;align-items:center;gap:8px;padding:0 8px;text-align:left;cursor:pointer;
}
.profile-button:hover{background:var(--hover)}
.avatar{width:28px;height:28px;border-radius:9px;background:linear-gradient(135deg,#527fff,#7a5cff);display:grid;place-items:center;color:#fff;font-size:9px;font-weight:800;box-shadow:0 6px 18px rgba(91,140,255,.24)}
.profile-copy{min-width:0;display:flex;flex-direction:column}
.profile-copy strong{font-size:11.5px}.profile-copy small{font-size:9px;color:var(--dim);margin-top:2px}
.profile-button>svg{width:13px;height:13px;color:var(--dim)}

.workspace{flex:1;min-width:0;height:100%;display:flex;flex-direction:column;background:var(--bg)}
.workspace-toolbar{
  height:50px;min-height:50px;display:flex;align-items:center;justify-content:space-between;padding:0 14px 0 16px;
  border-bottom:1px solid var(--border);background:color-mix(in srgb,var(--bg) 90%,transparent);
  backdrop-filter:blur(14px);position:relative;z-index:30;
}
.toolbar-left,.toolbar-actions{display:flex;align-items:center;gap:7px}
.workspace-title{display:flex;align-items:center;gap:8px;min-width:0}
.status-dot{width:7px;height:7px;border-radius:50%;background:var(--green);box-shadow:0 0 0 4px rgba(72,213,151,.08)}
.workspace-title strong{font-size:11.5px;font-weight:650}
.status-text{font-size:10px;color:var(--dim)}
.toolbar-separator{width:1px;height:14px;background:var(--border)}
.toolbar-button{
  height:32px;border:1px solid var(--border);border-radius:9px;background:transparent;color:var(--muted);
  display:flex;align-items:center;gap:7px;padding:0 10px;cursor:pointer;font-size:10.5px;
}
.toolbar-button:hover{background:var(--hover);color:var(--text);border-color:var(--border-strong)}
.toolbar-button svg{width:14px;height:14px}

.chat-surface{flex:1;min-height:0;position:relative;overflow:hidden;background:
  radial-gradient(circle at 50% 38%,rgba(85,95,115,.055),transparent 32%),
  var(--bg);
}
.empty-state{height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:54px 28px 34px;overflow:auto}
.hero-content{display:flex;flex-direction:column;align-items:center;text-align:center}
.bot-face{
  width:94px;height:94px;border:0;border-radius:50%;background:#fff;display:grid;place-items:center;position:relative;cursor:pointer;
  box-shadow:0 10px 28px rgba(0,0,0,.2),0 0 42px rgba(255,255,255,.11);transition:transform .2s cubic-bezier(.2,.8,.2,1),box-shadow .2s ease;
}
.bot-face:hover{transform:translateY(-2px) scale(1.025);box-shadow:0 16px 38px rgba(0,0,0,.24),0 0 54px rgba(255,255,255,.15)}
.bot-face:active{transform:scale(.97)}
.bot-glow{position:absolute;inset:-12px;border-radius:50%;border:1px solid rgba(255,255,255,.035);pointer-events:none}
.bot-eyes{display:flex;gap:13px;align-items:center;transition:transform .075s linear}
.bot-eyes i{width:14px;height:22px;border-radius:999px;background:#090909;display:block;transition:height .12s ease}
.hero-copy{margin-top:24px}
.eyebrow{display:block;font-size:8.5px;font-weight:800;letter-spacing:.16em;color:var(--dim);text-transform:uppercase}
.hero-copy h1{margin:8px 0 8px;font-size:clamp(28px,3vw,42px);font-weight:680;letter-spacing:-.042em;line-height:1.08}
.hero-copy p{margin:0 auto;max-width:610px;color:var(--muted);font-size:12.5px;line-height:1.65}

.starter-grid{width:min(760px,100%);display:grid;grid-template-columns:repeat(3,1fr);gap:9px;margin-top:28px}
.starter-card{
  min-height:86px;border:1px solid var(--border);border-radius:14px;background:rgba(255,255,255,.018);color:var(--text-2);
  display:grid;grid-template-columns:32px minmax(0,1fr);gap:10px;align-items:start;padding:13px;text-align:left;cursor:pointer;transition:.16s ease;
}
html[data-theme="light"] .starter-card{background:rgba(17,24,39,.015)}
.starter-card:hover{background:var(--hover);border-color:var(--border-strong);transform:translateY(-1px)}
.starter-icon,.analysis-row-icon{width:29px;height:29px;border-radius:9px;display:grid;place-items:center}
.starter-icon svg,.analysis-row-icon svg{width:15px;height:15px}
.accent-blue{background:rgba(91,140,255,.12);color:var(--blue)}
.accent-violet{background:rgba(154,124,255,.12);color:var(--violet)}
.accent-green{background:rgba(72,213,151,.12);color:var(--green)}
.starter-card strong{display:block;font-size:11.5px;font-weight:650}
.starter-card small{display:block;color:var(--dim);font-size:9.7px;line-height:1.45;margin-top:4px}

.composer-wrap{width:min(780px,100%);margin-left:auto;margin-right:auto}
.composer-empty{margin-top:14px}
.composer-shell{
  border:1px solid var(--border-strong);border-radius:17px;background:var(--panel-2);box-shadow:var(--shadow-lg);
  padding:13px 13px 10px;transition:border-color .16s ease,box-shadow .16s ease;
}
.composer-shell:focus-within{border-color:rgba(91,140,255,.34);box-shadow:0 28px 80px rgba(0,0,0,.44),0 0 0 3px rgba(91,140,255,.045)}
html[data-theme="light"] .composer-shell:focus-within{box-shadow:var(--shadow-lg),0 0 0 3px rgba(91,140,255,.05)}
.composer-shell textarea{
  width:100%;min-height:54px;max-height:170px;border:0;outline:0;resize:none;background:transparent;color:var(--text);
  font-size:13.5px;line-height:1.5;padding:3px 3px 8px;
}
.composer-shell textarea::placeholder{color:var(--dim)}
.composer-footer{display:flex;align-items:center;justify-content:space-between}
.composer-tools{display:flex;align-items:center;gap:6px}
.composer-tool{
  width:30px;height:30px;border:0;border-radius:8px;background:transparent;color:var(--muted);display:grid;place-items:center;cursor:pointer
}
.composer-tool:hover{background:var(--hover);color:var(--text)}
.composer-tool svg{width:15px;height:15px}
.mode-chip{
  height:30px;border:0;border-radius:8px;background:transparent;color:var(--muted);display:flex;align-items:center;gap:7px;padding:0 8px;cursor:pointer;font-size:10px
}
.mode-chip:hover{background:var(--hover);color:var(--text)}
.mode-chip svg{width:12px;height:12px}
.mode-pulse{width:6px;height:6px;border-radius:50%;background:var(--green);box-shadow:0 0 0 3px rgba(72,213,151,.08)}
.send-button{
  width:32px;height:32px;border:0;border-radius:9px;background:var(--blue-strong);color:#fff;display:grid;place-items:center;cursor:pointer;box-shadow:0 7px 18px rgba(62,114,244,.24);transition:.15s ease
}
.send-button:hover{background:#4a7df8;transform:translateY(-1px)}
.send-button:active{transform:translateY(0) scale(.97)}
.send-button svg{width:16px;height:16px;stroke-width:2}
.composer-note{text-align:center;color:var(--dim);font-size:8.7px;margin:8px 0 0}

.conversation-view{height:100%;display:flex;flex-direction:column}
.conversation-header{min-height:77px;padding:16px 24px;border-bottom:1px solid var(--border);display:flex;align-items:center;justify-content:space-between;gap:16px}
.conversation-header h2{margin:5px 0 0;font-size:17px;font-weight:670;letter-spacing:-.02em}
.conversation-meta{display:flex;align-items:center;gap:6px}
.meta-pill{height:28px;border:1px solid var(--border);border-radius:999px;display:flex;align-items:center;gap:6px;padding:0 9px;color:var(--muted);font-size:9.5px}
.meta-pill i{width:6px;height:6px;border-radius:50%;background:var(--green)}
.message-thread{flex:1;min-height:0;overflow:auto;padding:28px max(24px,calc((100% - 820px)/2));display:flex;flex-direction:column;gap:22px}
.message{display:grid;grid-template-columns:30px minmax(0,1fr);gap:12px}
.message-avatar{width:30px;height:30px;border-radius:10px;background:var(--panel-2);border:1px solid var(--border);display:grid;place-items:center}
.message-avatar img{width:21px;height:21px;object-fit:contain}
.message-content{max-width:760px}
.message-label{font-size:10px;font-weight:700;color:var(--muted);margin-bottom:7px}
.message-content p{margin:0;color:var(--text-2);font-size:12.7px;line-height:1.7}
.message.user{grid-template-columns:minmax(0,1fr)}
.message.user .message-content{justify-self:end;background:var(--panel-2);border:1px solid var(--border);border-radius:13px;padding:10px 12px}
.message.user .message-label{display:none}
.evidence-strip{display:flex;gap:14px;align-items:center;margin-top:11px;color:var(--dim);font-size:9.5px}
.green-dot{width:6px;height:6px;border-radius:50%;background:var(--green);display:inline-block;margin-right:4px}
.composer-docked{padding:10px 24px 20px}

.drawer{
  position:absolute;top:0;right:0;width:360px;height:100%;z-index:70;
  background:color-mix(in srgb,var(--panel) 96%,transparent);backdrop-filter:blur(20px);
  border-left:1px solid var(--border);box-shadow:-24px 0 70px rgba(0,0,0,.34);display:flex;flex-direction:column;
}
.drawer-header{height:70px;display:flex;align-items:center;justify-content:space-between;padding:0 14px 0 18px;border-bottom:1px solid var(--border)}
.drawer-header h3{margin:5px 0 0;font-size:16px;font-weight:680}
.drawer-scroll{flex:1;overflow:auto;padding:14px}
.analysis-card{border:1px solid var(--border);border-radius:14px;background:var(--panel-2);padding:14px;margin-bottom:10px}
.analysis-card-header{display:flex;align-items:center;justify-content:space-between;font-size:10px;color:var(--muted)}
.analysis-card-header strong{font-size:13px;color:var(--text)}
.progress-track{height:5px;border-radius:999px;background:var(--panel-3);overflow:hidden;margin:11px 0 9px}
.progress-track i{display:block;height:100%;border-radius:999px;background:linear-gradient(90deg,var(--blue),var(--violet))}
.analysis-card p{margin:0;color:var(--dim);font-size:9.8px;line-height:1.55}
.analysis-row{
  width:100%;min-height:56px;border:0;border-radius:11px;background:transparent;color:var(--muted);
  display:grid;grid-template-columns:30px minmax(0,1fr) 14px;gap:10px;align-items:center;padding:7px 8px;text-align:left;cursor:pointer;margin-bottom:3px
}
.analysis-row:hover,.analysis-row.active{background:var(--hover);color:var(--text)}
.analysis-row strong{display:block;font-size:11.2px}.analysis-row small{display:block;color:var(--dim);font-size:9px;margin-top:3px}
.row-chevron{width:13px;height:13px;color:var(--dim)}
.drawer-section-label{margin:18px 8px 7px;color:var(--dim);font-size:8.5px;font-weight:800;letter-spacing:.12em}
.source-row{display:grid;grid-template-columns:31px minmax(0,1fr) auto;gap:9px;align-items:center;padding:9px 8px;border-radius:10px}
.source-row:hover{background:var(--hover)}
.source-icon{width:29px;height:29px;border-radius:8px;background:var(--panel-3);display:grid;place-items:center;color:var(--text-2);font-size:8px;font-weight:800}
.source-row strong{display:block;font-size:10.5px}.source-row small{display:block;color:var(--dim);font-size:8.8px;margin-top:3px}
.source-state{font-size:8.5px;color:var(--green);background:rgba(72,213,151,.08);border:1px solid rgba(72,213,151,.14);padding:4px 6px;border-radius:999px}

.settings-section{padding:4px 2px 18px;border-bottom:1px solid var(--border);margin-bottom:17px}
.settings-title{display:flex;flex-direction:column;margin-bottom:11px}
.settings-title strong{font-size:11.5px}.settings-title span{color:var(--dim);font-size:9.5px;margin-top:3px}
.theme-picker{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.theme-option{
  border:1px solid var(--border);border-radius:12px;background:transparent;color:var(--muted);padding:8px;cursor:pointer;
  display:grid;grid-template-columns:1fr auto;gap:7px;align-items:center;text-align:left
}
.theme-option:hover,.theme-option.selected{background:var(--hover);border-color:var(--border-strong);color:var(--text)}
.theme-option>span:last-of-type{font-size:9.8px}
.checkmark{width:13px;height:13px;opacity:0}.theme-option.selected .checkmark{opacity:1;color:var(--blue)}
.theme-preview{grid-column:1/-1;height:70px;border-radius:8px;display:grid;grid-template-columns:28% 1fr;grid-template-rows:15px 1fr;gap:4px;padding:6px;border:1px solid var(--border)}
.dark-preview{background:#111214}.light-preview{background:#f3f4f6}
.theme-preview i:nth-child(1){grid-row:1/3;border-radius:4px;background:#1f1b20}
.theme-preview i:nth-child(2){border-radius:4px;background:#282a2f}
.theme-preview i:nth-child(3){border-radius:4px;background:#1d1e22}
.light-preview i:nth-child(1){background:#e1e3e7}.light-preview i:nth-child(2){background:#fff}.light-preview i:nth-child(3){background:#e9ebef}
.language-row{display:grid;grid-template-columns:1fr 1fr;gap:7px}
.language-option{
  min-height:46px;border:1px solid var(--border);border-radius:10px;background:transparent;color:var(--muted);
  display:grid;grid-template-columns:28px minmax(0,1fr) 14px;align-items:center;gap:8px;padding:0 9px;text-align:left;cursor:pointer
}
.language-option:hover,.language-option.selected{background:var(--hover);border-color:var(--border-strong);color:var(--text)}
.language-option>span{width:26px;height:26px;border-radius:7px;background:var(--panel-3);display:grid;place-items:center;font-size:9px;font-weight:800}
.language-option strong{font-size:10px}.language-option svg{width:13px;height:13px;opacity:0}.language-option.selected svg{opacity:1;color:var(--blue)}
.setting-toggle{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:9px 2px;cursor:pointer}
.setting-toggle>span{display:flex;flex-direction:column}.setting-toggle strong{font-size:10.8px}.setting-toggle small{font-size:9px;color:var(--dim);margin-top:3px}
.setting-toggle input{display:none}
.setting-toggle>i{width:35px;height:20px;border-radius:999px;background:var(--panel-3);position:relative;transition:.18s ease;flex:0 0 auto}
.setting-toggle>i:after{content:"";position:absolute;width:14px;height:14px;border-radius:50%;background:#fff;top:3px;left:3px;transition:.18s ease;box-shadow:0 2px 6px rgba(0,0,0,.25)}
.setting-toggle input:checked+i{background:var(--blue-strong)}.setting-toggle input:checked+i:after{transform:translateX(15px)}
.settings-link{width:100%;min-height:46px;border:0;border-radius:10px;background:transparent;color:var(--muted);display:grid;grid-template-columns:minmax(0,1fr) 16px;align-items:center;padding:6px 8px;text-align:left;cursor:pointer}
.settings-link:hover{background:var(--hover);color:var(--text)}
.settings-link strong{display:block;font-size:10.8px}.settings-link small{display:block;color:var(--dim);font-size:9px;margin-top:3px}
.settings-link>svg{width:14px;height:14px}

.modal-backdrop{position:fixed;inset:0;z-index:120;background:rgba(4,5,7,.58);backdrop-filter:blur(6px);display:grid;place-items:center;padding:20px}
.modal-card{width:min(430px,100%);border:1px solid var(--border-strong);border-radius:15px;background:var(--panel);box-shadow:var(--shadow-lg);padding:16px}
.modal-heading{display:flex;align-items:center;justify-content:space-between}.modal-heading h3{margin:5px 0 0;font-size:15px}
.modal-field{display:flex;flex-direction:column;gap:7px;margin-top:18px}.modal-field span{font-size:9.5px;color:var(--muted)}
.modal-field input{height:39px;border:1px solid var(--border);border-radius:9px;background:var(--panel-2);color:var(--text);outline:0;padding:0 10px;font-size:11.5px}
.modal-field input:focus{border-color:rgba(91,140,255,.38);box-shadow:0 0 0 3px rgba(91,140,255,.05)}
.modal-actions{display:flex;justify-content:flex-end;gap:7px;margin-top:16px}
.secondary-button,.primary-button{height:34px;border-radius:9px;padding:0 13px;cursor:pointer;font-size:10.5px}
.secondary-button{border:1px solid var(--border);background:transparent;color:var(--muted)}.secondary-button:hover{background:var(--hover);color:var(--text)}
.primary-button{border:1px solid var(--blue-strong);background:var(--blue-strong);color:#fff}.primary-button:hover{background:#4a7df8}

::-webkit-scrollbar{width:7px;height:7px}
::-webkit-scrollbar-track{background:transparent}
::-webkit-scrollbar-thumb{background:rgba(120,124,134,.25);border-radius:999px}
::-webkit-scrollbar-thumb:hover{background:rgba(120,124,134,.42)}
*{scrollbar-width:thin;scrollbar-color:rgba(120,124,134,.25) transparent}

html[dir="rtl"] .sidebar{border-right:0;border-left:1px solid rgba(255,255,255,.025)}
html[dir="rtl"] .conversation.active:before{left:auto;right:0}
html[dir="rtl"] .conversation-main,html[dir="rtl"] .context-menu button,html[dir="rtl"] .analysis-row,html[dir="rtl"] .settings-link,html[dir="rtl"] .theme-option,html[dir="rtl"] .language-option{text-align:right}
html[dir="rtl"] .context-menu{right:auto;left:4px}
html[dir="rtl"] .drawer{right:auto;left:0;border-left:0;border-right:1px solid var(--border);box-shadow:24px 0 70px rgba(0,0,0,.25)}
html[dir="rtl"] .setting-toggle>i:after{left:auto;right:3px}
html[dir="rtl"] .setting-toggle input:checked+i:after{transform:translateX(-15px)}

@media(max-width:1100px){
  .starter-grid{grid-template-columns:1fr;max-width:650px}
  .starter-card{min-height:70px}
}
@media(max-width:860px){
  .sidebar{position:absolute;left:0;top:0;bottom:0;z-index:100;box-shadow:18px 0 50px rgba(0,0,0,.35)}
  html[dir="rtl"] .sidebar{left:auto;right:0;box-shadow:-18px 0 50px rgba(0,0,0,.25)}
  .workspace-title .status-text,.toolbar-separator{display:none}
  .empty-state{padding-left:18px;padding-right:18px}
  .drawer{width:min(92vw,360px)}
}
@media(max-width:620px){
  .workspace-toolbar{padding-left:10px;padding-right:10px}
  .toolbar-button span{display:none}
  .hero-copy h1{font-size:29px}
  .hero-copy p{max-width:360px}
  .composer-wrap{width:100%}
  .starter-grid{display:none}
  .theme-picker,.language-row{grid-template-columns:1fr}
}
@media(prefers-reduced-motion:reduce){
  *,*::before,*::after{scroll-behavior:auto!important;transition:none!important;animation:none!important}
}
/* Production compatibility: legacy FDC AI behavior rendered in the new shell */
.conversation-section { display:grid; gap:6px; margin-bottom:18px; }
.conversation-section-title { padding:0 10px 6px; color:var(--dim); font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.08em; }
.conversation-item { position:relative; display:grid; grid-template-columns:20px 1fr 30px; align-items:center; gap:8px; padding:7px 8px; border-radius:10px; color:var(--muted); }
.conversation-item:hover,.conversation-item.active { background:var(--hover); color:var(--text); }
.conversation-item>div>strong { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:13px; font-weight:600; color:inherit; }
.conversation-item>div>span { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; margin-top:2px; font-size:10.5px; color:var(--dim); }
.conversation-menu-wrap { position:relative; }
.mini-btn { width:28px; height:28px; border:0; border-radius:8px; display:grid; place-items:center; background:transparent; color:var(--dim); cursor:pointer; }
.mini-btn svg,.sidebar-icon { width:15px; height:15px; }
.conversation-dropdown { position:absolute; top:32px; right:0; z-index:80; display:none; min-width:150px; padding:6px; border:1px solid var(--border); border-radius:10px; background:var(--panel); box-shadow:0 18px 44px rgba(0,0,0,.34); }
.conversation-dropdown.open { display:grid; gap:2px; }
.conversation-action { border:0; border-radius:8px; padding:8px; display:flex; gap:8px; align-items:center; background:transparent; color:var(--muted); cursor:pointer; font-size:12px; }
.conversation-action:hover { background:var(--hover); color:var(--text); }
.conversation-action.danger { color:#fb7185; }
.conversation-action svg { width:14px; height:14px; }
.conversation-empty { padding:18px 10px; color:var(--dim); font-size:12px; }
.msg { display:flex; gap:14px; width:100%; }
.msg.user { justify-content:flex-end; }
.msg .avatar { width:30px; height:30px; flex:0 0 auto; display:grid; place-items:center; border:1px solid var(--border); border-radius:9px; background:var(--panel-2); color:var(--dim); font-size:10px; font-weight:700; }
.msg .bubble { max-width:min(760px,86%); padding:11px 13px; border-radius:12px; color:var(--text); font-size:14px; line-height:1.65; white-space:pre-wrap; }
.msg.user .bubble { background:var(--active); }
.msg.ai .bubble,.msg.system .bubble { background:transparent; padding-left:0; }
.msg.system .bubble { color:var(--muted); }
#messages { display:flex; flex-direction:column; gap:22px; }
#conversationModal { display:none; align-items:center; justify-content:center; }
#conversationModal.open { display:flex; }
#conversationModal .conversation-modal { width:min(420px,calc(100vw - 32px)); }
#conversationModal .modal-error { min-height:16px; margin-top:5px; color:#fb7185; font-size:11px; }
#conversationModal .modal-btn.danger { background:#ef4444; color:#fff; }
#conversationModal .modal-field { display:grid; gap:7px; }
#conversationModal .modal-input { width:100%; min-height:42px; border:1px solid var(--border); border-radius:10px; background:var(--panel-2); color:var(--text); padding:0 12px; }
.compact .conversation-item { padding-top:5px; padding-bottom:5px; }
