@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans+Arabic:wght@400;500;600;700&display=swap');

:root {
  color-scheme: light;
  --page: #f5f8fd;
  --panel: rgba(255,255,255,.9);
  --sidebar: rgba(249,251,255,.94);
  --ink: #13243b;
  --muted: #7b8ba0;
  --muted-2: #9aa8b8;
  --line: #e7edf5;
  --blue: #4778f5;
  --blue-dark: #183d68;
  --blue-soft: #edf3ff;
  --card: rgba(255,255,255,.76);
  --shadow: 0 22px 80px rgba(55,83,124,.09);
  --font: "IBM Plex Sans Arabic", "Noto Sans Arabic", Tahoma, sans-serif;
  font-family: var(--font);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; }
body { overflow: hidden; background: var(--page); color: var(--ink); font-family: var(--font); }
button, input, textarea { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, textarea:focus-visible { outline: 3px solid rgba(71,120,245,.35); outline-offset: 3px; }
button:disabled { cursor: not-allowed; }
[hidden] { display: none !important; }
.app-shell { display: flex; width: 100%; height: 100%; min-height: 0; direction: rtl; background: var(--page); }
.sidebar { position: relative; z-index: 20; display: flex; flex: 0 0 292px; flex-direction: column; width: 292px; height: 100%; padding: 25px 19px 17px; overflow: hidden; background: var(--sidebar); border-left: 1px solid rgba(218,228,240,.8); backdrop-filter: blur(20px); }
.sidebar-brand-row { display: flex; height: 52px; align-items: center; justify-content: space-between; margin: 0 3px 28px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.brand-mark { display: grid; width: 41px; height: 41px; place-items: center; overflow: hidden; border-radius: 14px; box-shadow: 0 5px 15px rgba(44,88,177,.14); }
.brand-mark img { display: block; width: 100%; height: 100%; }
.brand-copy { display: grid; gap: 1px; }
.brand-copy strong { font-family: Arial,sans-serif; font-size: 23px; font-weight: 700; letter-spacing: -.9px; line-height: 1; }
.brand-copy small { color: var(--muted); font-size: 11px; font-weight: 500; }
.icon-button { display: inline-grid; flex: 0 0 auto; width: 40px; height: 40px; place-items: center; padding: 0; color: #687b93; background: rgba(255,255,255,.68); border: 1px solid rgba(223,231,242,.9); border-radius: 13px; cursor: pointer; transition: color .2s, border-color .2s, background .2s, transform .2s; }
.icon-button:hover { color: var(--blue); background: #fff; border-color: #cbd9f5; transform: translateY(-1px); }
.icon-button svg, .new-chat-button svg, .search-box svg, .theme-symbol svg, .privacy-footnote svg, .suggestion-icon svg, .send-button svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.sidebar-close, .menu-button, .mobile-brand { display: none; }
.new-chat-button { display: flex; width: 100%; height: 48px; align-items: center; gap: 10px; padding: 0 14px; color: #fff; background: linear-gradient(110deg,#173451,#1c4169 75%,#254e79); border: 0; border-radius: 14px; box-shadow: 0 8px 17px rgba(19,57,96,.13); cursor: pointer; transition: transform .2s, box-shadow .2s; }
.new-chat-button:hover { transform: translateY(-1px); box-shadow: 0 12px 23px rgba(19,57,96,.2); }
.new-chat-button svg { width: 17px; height: 17px; color: #d8e7ff; }
.new-chat-button span { font-size: 13px; font-weight: 600; }
kbd { display: inline-grid; min-width: 22px; height: 21px; place-items: center; padding: 0 5px; color: #9db0c7; background: rgba(255,255,255,.09); border: 1px solid rgba(255,255,255,.1); border-radius: 6px; font: 10px var(--font); }
.history-head { display: flex; align-items: center; justify-content: space-between; margin: 28px 3px 12px; color: #4d6179; font-size: 12px; font-weight: 600; }
.history-caption { color: #a2afbf; font-size: 10px; font-weight: 500; }
.search-box { display: flex; height: 42px; align-items: center; gap: 9px; padding: 0 11px; background: rgba(241,245,251,.78); border: 1px solid #e7edf5; border-radius: 12px; color: #94a3b4; }
.search-box svg { width: 16px; height: 16px; }
.search-box input { min-width: 0; width: 100%; padding: 0; color: var(--ink); background: transparent; border: 0; outline: 0; font-size: 11px; }
.search-box input::placeholder { color: #a6b1bf; }
.search-box kbd { min-width: 18px; height: 18px; color: #a3afbd; background: rgba(255,255,255,.8); border-color: #e7edf5; }
.chat-list { display: flex; flex: 1 1 auto; min-height: 0; flex-direction: column; gap: 6px; margin-top: 15px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #dfe6ef transparent; }
.chat-item-row { display: flex; min-width: 0; align-items: center; gap: 4px; }
.chat-item { display: flex; flex: 1 1 auto; min-width: 0; width: auto; min-height: 46px; align-items: center; gap: 10px; padding: 7px 9px; color: #68798e; background: transparent; border: 1px solid transparent; border-radius: 12px; text-align: right; cursor: pointer; transition: background .2s, border-color .2s, color .2s; }
.chat-item:hover { color: #26486e; background: rgba(238,244,252,.85); }
.chat-item.active { color: #1c3e66; background: #edf3fb; border-color: #e4ebf5; }
.chat-item:disabled { opacity: .55; cursor: progress; }
.chat-item svg { flex: 0 0 16px; width: 16px; height: 16px; fill: none; stroke: #96a5b7; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.chat-item span { display: block; overflow: hidden; font-size: 11px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.chat-delete { display: grid; flex: 0 0 34px; width: 34px; height: 34px; place-items: center; padding: 0; color: #9a6f70; background: transparent; border: 1px solid transparent; border-radius: 10px; cursor: pointer; transition: color .18s,background .18s,border-color .18s; }
.chat-delete:hover { color: #bb4d56; background: #fff0f0; border-color: #f2dada; }
.chat-delete:disabled { opacity: .4; cursor: not-allowed; }
.chat-delete svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.chat-empty { padding: 18px 6px; color: #a0adbc; font-size: 11px; line-height: 1.8; text-align: center; }
.sidebar-spacer { flex: 0 0 18px; height: 18px; min-height: 18px; }
.sidebar-note { display: flex; gap: 9px; align-items: flex-start; padding: 12px 10px; background: rgba(237,243,252,.76); border: 1px solid #e8eef6; border-radius: 13px; }
.note-icon { display: grid; flex: 0 0 27px; width: 27px; height: 27px; place-items: center; color: #6083cf; background: #fff; border-radius: 9px; }
.note-icon svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.sidebar-note p { display: grid; gap: 3px; margin: 0; }
.sidebar-note strong { color: #556a83; font-size: 10px; font-weight: 600; }
.sidebar-note p span { color: #8796a8; font-size: 9px; line-height: 1.7; }
.sidebar-bottom { margin-top: 13px; }
.clear-history-button { display: flex; width: 100%; min-height: 38px; align-items: center; gap: 9px; padding: 0 9px; color: #78879a; background: transparent; border: 0; border-radius: 10px; font-size: 10px; text-align: right; cursor: pointer; }
.clear-history-button svg { display: block; flex: 0 0 17px; width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.clear-history-button:hover { color: #b84e57; background: #fff0f0; }
.theme-toggle { display: flex; width: 100%; height: 42px; align-items: center; gap: 9px; padding: 0 8px; color: #77889e; background: transparent; border: 0; border-radius: 10px; cursor: pointer; text-align: right; }
.theme-toggle:hover { background: rgba(239,244,251,.8); }
.theme-symbol { display: grid; width: 25px; place-items: center; color: #8092a8; }
.theme-symbol svg { width: 17px; height: 17px; }
.theme-toggle > span:nth-child(2) { flex: 1; font-size: 10px; }
.toggle-track { display: flex; width: 29px; height: 16px; align-items: center; padding: 2px; background: #dfe6f0; border-radius: 99px; transition: background .2s; }
.toggle-track span { width: 12px; height: 12px; background: #fff; border-radius: 50%; box-shadow: 0 1px 3px #aebbd0; transition: transform .2s; }
.online-dot, .connection-state > span { width: 7px; height: 7px; background: #4bbb8b; border-radius: 50%; box-shadow: 0 0 0 3px rgba(75,187,139,.12); }
.main-area { position: relative; display: flex; flex: 1 1 auto; min-width: 0; flex-direction: column; overflow: hidden; background: radial-gradient(ellipse at 59% 31%,rgba(221,239,255,.78) 0,rgba(238,246,255,.35) 19%,transparent 45%), radial-gradient(ellipse at 5% 80%,rgba(218,243,242,.42) 0,transparent 34%), #fbfcfe; }
.topbar { position: relative; z-index: 2; display: flex; flex: 0 0 66px; align-items: center; justify-content: space-between; padding: 0 31px; border-bottom: 1px solid rgba(226,233,243,.75); background: rgba(255,255,255,.45); backdrop-filter: blur(16px); }
.topbar-start, .topbar-end { display: flex; align-items: center; gap: 12px; }
.workspace-label { display: flex; align-items: center; gap: 8px; color: #4d6078; font-size: 12px; font-weight: 600; }
.tiny-spark { color: #6c8df2; font-size: 17px; }
.version-pill { padding: 3px 8px; color: #6481c3; background: rgba(232,239,255,.75); border: 1px solid #e2eaff; border-radius: 99px; font-size: 9px; font-weight: 500; }
.connection-state { display: flex; align-items: center; gap: 8px; color: #8392a5; font-size: 10px; }
.connection-state > span { width: 6px; height: 6px; box-shadow: 0 0 0 3px rgba(75,187,139,.1); }
.top-theme { width: 35px; height: 35px; border-radius: 12px; }
.top-theme svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.chat-export { position: relative; flex: 0 0 auto; }
.chat-export > summary { display: grid; width: 35px; height: 35px; place-items: center; color: #71839a; background: rgba(255,255,255,.68); border: 1px solid rgba(223,231,242,.9); border-radius: 12px; cursor: pointer; font-size: 19px; line-height: 1; list-style: none; }
.chat-export > summary::-webkit-details-marker { display: none; }
.chat-export[open] > summary { color: #496ecf; background: #edf3ff; border-color: #d9e4fb; }
.chat-export-menu { position: absolute; top: calc(100% + 7px); inset-inline-start: auto; inset-inline-end: 0; z-index: 25; display: none; min-width: 148px; max-width: min(190px,calc(100vw - 24px)); gap: 5px; padding: 7px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 30px rgba(22,43,72,.17); }
.chat-export[open] > .chat-export-menu { display: grid; }
.chat-export-menu > button { display: flex; width: 100%; min-height: 36px; align-items: center; padding: 0 10px; color: #53667e; background: transparent; border: 0; border-radius: 8px; font: inherit; font-size: 11px; text-align: right; cursor: pointer; }
.chat-export-menu > button:hover { color: #315fbf; background: #f0f5ff; }
.conversation-stage { position: relative; display: flex; flex: 1 1 auto; min-height: 0; flex-direction: column; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #dce5f1 transparent; }
.welcome-screen { display: grid; flex: 1 0 auto; min-height: min-content; place-items: center; padding: 18px 34px 16px; }
.welcome-content { width: min(100%, 760px); margin: auto; text-align: center; animation: rise .65s cubic-bezier(.22,.7,.23,1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
.orb-wrap { position: relative; display: grid; width: 116px; height: 116px; place-items: center; margin: 2px auto 12px; }
.orb-halo { position: absolute; inset: 15px; background: #548bff; border-radius: 50%; opacity: .22; filter: blur(23px); animation: breathe 4.5s ease-in-out infinite; }
.orb { position: relative; width: 84px; height: 84px; overflow: hidden; background: radial-gradient(circle at 33% 23%,#d2faff 0,#83ddff 4%,#49adfa 15%,#2674ec 39%,#163b9b 69%,#111f58 100%); border: 1px solid rgba(255,255,255,.88); border-radius: 50%; box-shadow: inset 8px 8px 20px rgba(212,252,255,.62), inset -12px -13px 24px rgba(13,32,110,.7), 0 11px 29px rgba(38,93,200,.23), 0 0 30px rgba(81,137,255,.2); }
.orb::after { position: absolute; inset: 1px; background: radial-gradient(ellipse at 30% 15%,rgba(255,255,255,.3),transparent 48%); border-radius: 50%; content: ""; }
.orb-ring { position: absolute; z-index: 1; top: 32px; left: -8px; width: 101px; height: 33px; border: 1.4px solid rgba(203,246,255,.88); border-radius: 50%; box-shadow: 0 0 8px rgba(151,231,255,.75),inset 0 0 7px rgba(128,194,255,.6); }
.ring-one { transform: rotate(-28deg); }
.ring-two { top: 28px; left: -10px; width: 103px; height: 39px; border-color: rgba(104,198,255,.68); transform: rotate(37deg); }
.ring-three { top: 38px; left: 1px; width: 84px; height: 24px; border-color: rgba(224,251,255,.8); transform: rotate(6deg); }
.orb-glint { position: absolute; z-index: 2; top: 16px; left: 20px; width: 17px; height: 8px; background: rgba(255,255,255,.84); border-radius: 50%; filter: blur(5px); transform: rotate(-37deg); }
.orb-star { position: absolute; z-index: 3; color: #fff; text-shadow: 0 0 9px #d5ffff; }
.star-one { top: 7px; right: 15px; font-size: 9px; }
.star-two { bottom: 13px; left: 17px; font-size: 19px; }
@keyframes breathe { 0%,100% { opacity: .17; transform: scale(.92); } 50% { opacity: .3; transform: scale(1.1); } }
.welcome-eyebrow { display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px; color: #6981a0; background: rgba(255,255,255,.65); border: 1px solid rgba(223,233,246,.85); border-radius: 999px; font-size: 10px; }
.welcome-eyebrow > span { width: 5px; height: 5px; background: #65b6dc; border-radius: 50%; box-shadow: 0 0 0 3px rgba(101,182,220,.12); }
.welcome-content h1 { margin: 11px 0 5px; color: #182c45; font-size: clamp(29px,3.2vw,39px); font-weight: 600; letter-spacing: -.85px; line-height: 1.4; }
.welcome-content h1 span { color: #567ce8; }
.welcome-description { margin: 0; color: #8492a4; font-size: 12px; line-height: 1.9; }
.suggestion-heading { display: flex; align-items: center; gap: 12px; margin: 24px 0 11px; color: #687d96; font-size: 10px; font-weight: 600; text-align: right; }
.suggestion-rule { flex: 1; height: 1px; background: linear-gradient(90deg,transparent,#e2e9f1); }
.suggestion-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; text-align: right; }
.suggestion-card { display: flex; min-height: 65px; align-items: center; gap: 11px; padding: 10px 12px; color: var(--ink); background: var(--card); border: 1px solid rgba(223,231,242,.92); border-radius: 14px; box-shadow: 0 3px 12px rgba(61,94,145,.025); cursor: pointer; text-align: right; transition: transform .2s,border-color .2s,box-shadow .2s,background .2s; }
.suggestion-card:hover { background: #fff; border-color: #cbdaf8; box-shadow: 0 8px 23px rgba(71,120,245,.09); transform: translateY(-2px); }
.suggestion-icon { display: grid; flex: 0 0 34px; width: 34px; height: 34px; place-items: center; border-radius: 11px; }
.suggestion-icon svg { width: 17px; height: 17px; }
.icon-violet { color: #7868d9; background: #f0edff; }
.icon-blue { color: #477ae0; background: #edf3ff; }
.icon-teal { color: #3e9b9e; background: #e9f7f5; }
.icon-amber { color: #c3873d; background: #fff5e8; }
.suggestion-text { display: grid; min-width: 0; flex: 1; gap: 3px; }
.suggestion-text strong { color: #3d536d; font-size: 11px; font-weight: 600; }
.suggestion-text small { overflow: hidden; color: #93a0af; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.suggestion-arrow { align-self: flex-start; padding: 1px 1px 0 0; color: #a2b1c3; font-size: 13px; transition: color .2s,transform .2s; }
.suggestion-card:hover .suggestion-arrow { color: var(--blue); transform: translate(-2px,2px); }
.privacy-footnote { display: flex; align-items: center; justify-content: center; gap: 7px; margin-top: 15px; color: #9aa7b6; font-size: 9px; }
.privacy-footnote svg { width: 13px; height: 13px; color: #9dadc0; stroke-width: 1.6; }
.thread-view { width: 100%; flex: 1 0 auto; padding: 34px 28px 26px; }
.messages-list { display: flex; width: min(100%, 790px); flex-direction: column; gap: 24px; margin: 0 auto; }
.message-row { display: flex; align-items: flex-start; gap: 10px; animation: message-in .32s ease both; }
@keyframes message-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
.assistant-avatar { display: grid; flex: 0 0 34px; width: 34px; height: 34px; place-items: center; overflow: hidden; background: #eaf1ff; border: 1px solid #e0e9fb; border-radius: 12px; box-shadow: 0 3px 9px rgba(65,105,184,.1); }
.assistant-avatar img { width: 100%; height: 100%; }
.user-avatar { display: grid; flex: 0 0 34px; width: 34px; height: 34px; place-items: center; color: #5475c8; background: #eef3fd; border: 1px solid #e4ebf6; border-radius: 12px; font-size: 12px; font-weight: 600; }
.message-main { min-width: 0; flex: 1; }
.message-meta { display: flex; align-items: center; gap: 8px; min-height: 22px; margin: 1px 0 6px; color: #8292a7; font-size: 10px; }
.message-meta strong { color: #425972; font-size: 11px; font-weight: 600; }
.message-bubble { max-width: min(100%,700px); padding: 15px 18px; color: #263b55; background: rgba(255,255,255,.92); border: 1px solid rgba(216,226,239,.98); border-radius: 4px 15px 15px 15px; box-shadow: 0 4px 14px rgba(45,75,116,.045); font-size: 17px; font-weight: 450; line-height: 1.9; overflow-wrap: anywhere; white-space: pre-wrap; }
.message-image { display: block; max-width: min(100%,360px); max-height: 360px; margin-top: 10px; border: 1px solid #dfe7f2; border-radius: 12px; object-fit: contain; }
.speak-button { display: inline-flex; min-height: 34px; align-items: center; gap: 6px; margin-top: 7px; padding: 4px 10px; color: #58739b; background: rgba(255,255,255,.75); border: 1px solid #e2e9f3; border-radius: 10px; font-size: 13px; cursor: pointer; }
.speak-button:hover { color: #3c68d1; background: #f1f5ff; border-color: #cbd9f4; }
.user-row .message-bubble { background: linear-gradient(135deg,#eff4ff,#f4f7fc); border-color: #e6ecf8; border-radius: 15px 4px 15px 15px; }
.typing-row { display: flex; width: min(100%,790px); align-items: center; gap: 10px; margin: 21px auto 0; }
.typing-bubble { display: flex; align-items: center; gap: 4px; padding: 9px 12px; color: #8292a6; background: rgba(255,255,255,.76); border: 1px solid #e8eef6; border-radius: 12px; }
.typing-bubble > span { width: 5px; height: 5px; background: #6f91d9; border-radius: 50%; animation: typing 1.1s infinite ease-in-out; }
.typing-bubble > span:nth-child(2) { animation-delay: .14s; }
.typing-bubble > span:nth-child(3) { animation-delay: .28s; }
.typing-bubble i { margin-right: 5px; font-size: 9px; font-style: normal; }
@keyframes typing { 0%,60%,100% { opacity:.38; transform:translateY(0); } 30% { opacity:1; transform:translateY(-3px); } }
.error-panel { display: flex; width: min(100%,790px); align-items: center; gap: 11px; margin: 19px auto 0; padding: 13px 14px; background: #fff8f4; border: 1px solid #f5e2d7; border-radius: 13px; }
.error-symbol { display: grid; flex: 0 0 24px; width: 24px; height: 24px; place-items: center; color: #bb7354; background: #fae9df; border-radius: 50%; font-size: 13px; font-weight: 700; }
.error-panel div { flex: 1; }
.error-panel strong { color: #805c4e; font-size: 11px; }
.error-panel p { margin: 3px 0 0; color: #a07d70; font-size: 9px; line-height: 1.7; }
.error-panel button { padding: 7px 10px; color: #a2644d; background: #fff; border: 1px solid #f1d6c8; border-radius: 9px; font-size: 9px; font-weight: 600; cursor: pointer; }
.error-panel button:hover { background: #fff1e9; }
.error-panel button span { margin-right: 4px; font-size: 13px; }
.composer-dock { position: relative; z-index: 3; flex: 0 0 auto; padding: 10px 30px max(19px,env(safe-area-inset-bottom)); background: linear-gradient(180deg,rgba(251,252,254,0),rgba(251,252,254,.88) 17%,rgba(251,252,254,.96)); }
.composer-wrap { width: min(100%,790px); margin: 0 auto; }
.composer { position: relative; display: flex; min-height: 107px; flex-direction: column; padding: 14px 16px 10px; background: rgba(255,255,255,.94); border: 1px solid #e0e8f2; border-radius: 18px; box-shadow: 0 9px 28px rgba(58,91,141,.08),0 1px 2px rgba(55,82,120,.04); transition: border-color .2s,box-shadow .2s; }
.composer:focus-within { border-color: #b8cbf7; box-shadow: 0 10px 32px rgba(58,91,141,.1),0 0 0 3px rgba(93,133,230,.07); }
.composer-input-label { position: absolute; top: 14px; right: 16px; color: #718de3; font-size: 13px; }
.composer-star { display: inline-block; animation: slow-turn 17s linear infinite; }
@keyframes slow-turn { to { transform: rotate(360deg); } }
.composer textarea { width: 100%; min-height: 40px; max-height: 148px; resize: none; padding: 0 23px 0 1px; color: #283d55; background: transparent; border: 0; outline: 0; font-size: 16px; line-height: 1.8; }
.composer textarea::placeholder { color: #a2adbb; }
.composer textarea:disabled { opacity: .65; }
.attachment-preview { display: flex; align-items: center; gap: 9px; margin: 1px 0 8px; padding: 6px 8px; color: #4c617b; background: #f3f7fd; border: 1px solid #e2eaf5; border-radius: 11px; font-size: 12px; }
.attachment-preview img { width: 42px; height: 42px; border-radius: 8px; object-fit: cover; }
.attachment-preview span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attachment-preview button { width: 28px; height: 28px; color: #6c7d91; background: #fff; border: 1px solid #e2e8f0; border-radius: 8px; font-size: 18px; cursor: pointer; }
.composer-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 6px; }
.composer-hint { display: flex; align-items: center; gap: 6px; color: #a5b0bd; font-size: 9px; }
.enter-icon { display: grid; width: 17px; height: 17px; place-items: center; color: #8595a9; background: #f2f5f9; border: 1px solid #e8edf3; border-radius: 5px; font-size: 12px; }
.hint-divider { color: #c3ccd6; }
.composer-actions { display: flex; align-items: center; gap: 11px; }
.media-button { display: inline-grid; width: 34px; height: 34px; place-items: center; padding: 0; color: #617894; background: #f4f7fc; border: 1px solid #e4ebf5; border-radius: 11px; cursor: pointer; transition: color .2s,background .2s,border-color .2s,transform .2s; }
.media-button:hover { color: #426fe0; background: #edf3ff; border-color: #cfdbf5; transform: translateY(-1px); }
.media-button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.voice-button.recording { color: #fff; background: #d74d5b; border-color: #d74d5b; animation: voice-pulse 1.4s ease-in-out infinite; }
@keyframes voice-pulse { 50% { box-shadow: 0 0 0 6px rgba(215,77,91,.16); } }
.char-count { color: #a7b2c0; font-size: 9px; direction: ltr; }
.send-button { display: grid; width: 35px; height: 35px; place-items: center; color: #fff; background: linear-gradient(140deg,#7195ff,#4d6ceb 60%,#5860d2); border: 0; border-radius: 12px; box-shadow: 0 5px 12px rgba(79,111,225,.24); cursor: pointer; transition: opacity .2s,transform .2s,box-shadow .2s; }
.send-button:hover:not(:disabled) { box-shadow: 0 8px 18px rgba(79,111,225,.32); transform: translateY(-1px); }
.send-button:disabled { opacity: .48; box-shadow: none; cursor: not-allowed; }
.send-button svg { width: 18px; height: 18px; stroke-width: 2; }
.toast { position: fixed; z-index: 40; right: 50%; bottom: 25px; padding: 10px 15px; color: #fff; background: #183c63; border-radius: 10px; box-shadow: 0 8px 26px rgba(25,53,83,.2); font-size: 11px; opacity: 0; pointer-events: none; transform: translate(50%,10px); transition: opacity .22s,transform .22s; }
.toast.show { opacity: 1; transform: translate(50%,0); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; clip-path: inset(50%); border: 0; }

body[data-theme="night"] { color-scheme: dark; --page:#0e1521; --panel:rgba(22,31,47,.93); --sidebar:rgba(15,24,38,.98); --ink:#e4edf8; --muted:#92a2b8; --line:#253348; --card:rgba(29,43,62,.79); --shadow:0 22px 80px rgba(0,0,0,.25); }
body[data-theme="night"] .app-shell { background: #0e1521; }
body[data-theme="night"] .sidebar { border-color: #233247; }
body[data-theme="night"] .main-area { background: radial-gradient(ellipse at 59% 31%,rgba(41,65,113,.35),transparent 48%),radial-gradient(ellipse at 5% 80%,rgba(27,79,84,.18),transparent 34%),#111b2a; }
body[data-theme="night"] .topbar { background: rgba(18,28,43,.66); border-color: #253347; }
body[data-theme="night"] .workspace-label,body[data-theme="night"] .welcome-content h1,body[data-theme="night"] .suggestion-text strong,body[data-theme="night"] .message-meta strong { color:#e2eafb; }
body[data-theme="night"] .welcome-content h1 span { color:#8aa9ff; }
body[data-theme="night"] .welcome-description,body[data-theme="night"] .suggestion-text small,body[data-theme="night"] .suggestion-heading,body[data-theme="night"] .connection-state { color:#a1afc4; }
body[data-theme="night"] .suggestion-card,body[data-theme="night"] .composer,body[data-theme="night"] .message-bubble,body[data-theme="night"] .typing-bubble { color:#dce7f8; background:rgba(24,37,56,.94); border-color:#2b3b52; }
body[data-theme="night"] .attachment-preview { color:#d3dfef; background:#1b2a40; border-color:#30425a; }
body[data-theme="night"] .speak-button { color:#c4d3e8; background:#192940; border-color:#30415a; }
body[data-theme="night"] .media-button { color:#bdcbe0; background:#1d2c42; border-color:#30415a; }
body[data-theme="night"] .user-row .message-bubble { background: #203350; border-color:#304566; }
body[data-theme="night"] .suggestion-card:hover { background:#233753; border-color:#526b9d; }
body[data-theme="night"] .welcome-eyebrow { color:#b1bfd2; background:rgba(29,44,65,.68); border-color:#2c3d53; }
body[data-theme="night"] .privacy-footnote,body[data-theme="night"] .message-meta { color:#91a1b8; }
body[data-theme="night"] .composer-dock { background:linear-gradient(180deg,rgba(17,27,42,0),rgba(17,27,42,.9) 17%,#111b2a); }
body[data-theme="night"] .composer textarea { color:#e0e9f7; }
body[data-theme="night"] .composer textarea::placeholder { color:#8798ad; }
body[data-theme="night"] .sidebar-note,body[data-theme="night"] .chat-item.active { background:#1c2b41; border-color:#293b55; }
body[data-theme="night"] .sidebar-note strong,body[data-theme="night"] .history-head { color:#cfdbeb; }
body[data-theme="night"] .chat-item { color:#a4b3c6; }
body[data-theme="night"] .chat-item:hover { background:#1a293e; }
body[data-theme="night"] .chat-item.active { color:#dbe7f6; }
body[data-theme="night"] .chat-delete { color:#be9296; }
body[data-theme="night"] .chat-delete:hover { color:#ffc4c8; background:#402932; border-color:#684047; }
body[data-theme="night"] .search-box { background:#172438; border-color:#293950; }
body[data-theme="night"] .search-box input { color:#e1eaf7; }
body[data-theme="night"] .search-box kbd { background:#20314b; border-color:#334762; }
body[data-theme="night"] .sidebar-note p span { color:#9aaac0; }
body[data-theme="night"] .clear-history-button { color:#aebbd0; }
body[data-theme="night"] .clear-history-button:hover { color:#ffc4c8; background:#402932; }
body[data-theme="night"] .theme-toggle { color:#b3c0d2; }
body[data-theme="night"] .theme-toggle:hover { background:#1c2b41; }
body[data-theme="night"] .toggle-track { background:#4f6ea9; }
body[data-theme="night"] .toggle-track span { transform:translateX(-13px); }
body[data-theme="night"] .top-theme,body[data-theme="night"] .icon-button { color:#b2c1d5; background:#1a2940; border-color:#2b3d56; }
body[data-theme="night"] .chat-export > summary { color:#b2c1d5; background:#1a2940; border-color:#2b3d56; }
body[data-theme="night"] .chat-export[open] > summary { color:#bbceff; background:#1c2e48; }
body[data-theme="night"] .chat-export-menu { background:#17263b; border-color:#30415a; box-shadow:0 12px 30px rgba(0,0,0,.36); }
body[data-theme="night"] .chat-export-menu > button { color:#c3d0e3; }
body[data-theme="night"] .chat-export-menu > button:hover { color:#c6d5ff; background:#203350; }
body[data-theme="night"] .version-pill { color:#b2c4fc; background:#202e4a; border-color:#2b3e5f; }
body[data-theme="night"] .suggestion-rule { background:linear-gradient(90deg,transparent,#2a3a51); }
body[data-theme="night"] .error-panel { background:#30251f; border-color:#51392e; }
body[data-theme="night"] .error-panel strong { color:#efc0aa; }
body[data-theme="night"] .error-panel p { color:#c8a18f; }
body[data-theme="night"] .error-panel button { color:#efbda3; background:#3b2b24; border-color:#5a4033; }

@media (min-height: 920px) and (min-width: 800px) { .welcome-content { transform: translateY(-6px); } }
@media (max-width: 1020px) {
  .sidebar { flex-basis: 262px; width: 262px; padding-inline: 16px; }
  .topbar { padding-inline: 23px; }
  .welcome-screen { padding-inline: 24px; }
  .composer-dock { padding-inline: 23px; }
}
@media (max-width: 720px) {
  body { background: #fbfcfe; }
  .app-shell { position: relative; }
  .sidebar { position: fixed; top: 0; right: 0; bottom: 0; z-index: 31; width: min(86vw,310px); height: 100dvh; padding-top: max(20px,env(safe-area-inset-top)); border-left: 0; box-shadow: -18px 0 60px rgba(21,42,69,.14); transform: translateX(110%); transition: transform .28s cubic-bezier(.22,.75,.25,1); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-scrim { position: fixed; inset: 0; z-index: 30; display: block; background: rgba(17,32,52,.3); opacity: 0; pointer-events: none; backdrop-filter: blur(2px); transition: opacity .25s; }
  .sidebar-scrim.open { opacity: 1; pointer-events: auto; }
  .sidebar-close, .menu-button, .mobile-brand { display: inline-grid; }
  .sidebar-close { width: 33px; height: 33px; }
  .main-area { width: 100%; min-height: 0; background: radial-gradient(ellipse at 52% 27%,rgba(221,239,255,.64),transparent 43%),linear-gradient(145deg,#fbfcfe,#f8fbff); }
  .topbar { flex-basis: 56px; padding: 0 15px; }
  .topbar-start, .topbar-end { gap: 9px; }
  .menu-button { width: 35px; height: 35px; background: rgba(255,255,255,.8); }
  .menu-button svg { width: 17px; height: 17px; }
  .mobile-brand { grid-auto-flow: column; align-items: center; gap: 6px; color: #253951; font: 700 18px Arial,sans-serif; letter-spacing: -.6px; }
  .mobile-brand img { width: 26px; height: 26px; border-radius: 9px; }
  .workspace-label { gap: 6px; font-size: 10px; }
  .tiny-spark { font-size: 14px; }
  .version-pill { padding: 2px 6px; font-size: 8px; }
  .connection-state { gap: 6px; font-size: 9px; }
  .top-theme { display: none; }
  .welcome-screen { display: block; padding: 12px 17px 16px; }
  .welcome-content { width: min(100%,470px); padding-top: 10px; }
  .orb-wrap { width: 94px; height: 94px; margin-top: 0; margin-bottom: 9px; }
  .orb { width: 72px; height: 72px; }
  .orb-ring { top: 28px; left: -7px; width: 86px; height: 29px; }
  .ring-two { top: 25px; left: -9px; width: 90px; height: 34px; }
  .ring-three { top: 33px; left: 0; width: 73px; height: 22px; }
  .orb-glint { top: 14px; left: 16px; }
  .welcome-eyebrow { padding: 4px 9px; font-size: 9px; }
  .welcome-content h1 { margin-top: 9px; font-size: 28px; }
  .welcome-description { font-size: 11px; line-height: 1.8; }
  .desktop-break { display: none; }
  .suggestion-heading { margin: 18px 0 9px; font-size: 9px; }
  .suggestion-grid { gap: 7px; }
  .suggestion-card { min-height: 59px; gap: 8px; padding: 8px; border-radius: 12px; }
  .suggestion-icon { flex-basis: 29px; width: 29px; height: 29px; border-radius: 9px; }
  .suggestion-icon svg { width: 15px; height: 15px; }
  .suggestion-text strong { font-size: 10px; }
  .suggestion-text small { font-size: 8px; }
  .suggestion-arrow { display: none; }
  .privacy-footnote { margin-top: 11px; font-size: 8px; }
  .composer-dock { padding: 8px 12px max(12px,env(safe-area-inset-bottom)); background: linear-gradient(180deg,rgba(250,252,255,0),rgba(250,252,255,.9) 15%,#fbfcfe); }
  .composer { min-height: 96px; padding: 12px 12px 8px; border-radius: 16px; }
  .composer-input-label { top: 11px; right: 13px; }
  .composer textarea { min-height: 40px; max-height: 110px; padding-right: 21px; font-size: 16px; }
  .composer-hint { font-size: 8px; gap: 4px; }
  .composer-hint .hint-divider, .composer-hint .hint-divider + span { display: none; }
  .char-count { font-size: 8px; }
  .send-button { width: 33px; height: 33px; border-radius: 11px; }
  .media-button { width: 32px; height: 32px; border-radius: 10px; }
  .composer-disclaimer { margin-top: 6px; font-size: 7px; }
  .thread-view { padding: 23px 14px 19px; }
  .messages-list { gap: 19px; }
  .message-row, .typing-row { gap: 8px; }
  .assistant-avatar, .user-avatar { flex-basis: 30px; width: 30px; height: 30px; border-radius: 10px; }
  .message-bubble { padding: 12px 14px; font-size: 16px; line-height: 1.9; }
  .message-meta { font-size: 9px; }
  .message-meta strong { font-size: 10px; }
  .error-panel { flex-wrap: wrap; gap: 8px; padding: 11px; }
  .error-panel p { font-size: 8px; }
  .error-panel button { margin-right: auto; }
  body[data-theme="night"] .main-area { background: radial-gradient(ellipse at 52% 27%,rgba(41,65,113,.35),transparent 45%),#111b2a; }
  body[data-theme="night"] .mobile-brand { color: #e1eafa; }
  body[data-theme="night"] .menu-button { background:#1a2940; border-color:#2b3d56; }
  body[data-theme="night"] .composer-dock { background:linear-gradient(180deg,rgba(17,27,42,0),rgba(17,27,42,.9) 15%,#111b2a); }
}
@media (max-width: 380px) {
  .workspace-label { font-size: 9px; }
  .connection-state { font-size: 8px; }
  .suggestion-card { gap: 6px; padding: 7px; }
  .suggestion-text small { letter-spacing: -.15px; }
  .welcome-content h1 { font-size: 26px; }
}
@media (max-height: 690px) and (min-width: 721px) {
  .welcome-screen { padding-block: 9px; }
  .orb-wrap { width: 96px; height: 96px; transform: scale(.86); margin-top: -3px; margin-bottom: -1px; }
  .welcome-content h1 { font-size: 29px; }
  .suggestion-heading { margin-top: 15px; }
  .suggestion-card { min-height: 57px; }
  .privacy-footnote { margin-top: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  *,*::before,*::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* Voice conversation — dark neon stage inspired by the supplied reference. */
.voice-overlay { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 18px; background: rgba(3,8,18,.83); backdrop-filter: blur(14px); }
.voice-overlay[hidden] { display: none !important; }
.voice-panel { display: flex; width: min(100%,610px); min-height: min(680px,calc(100dvh - 36px)); flex-direction: column; padding: 19px 25px 17px; overflow: hidden; color: #f4f8ff; background: radial-gradient(ellipse at 50% 45%,rgba(20,63,118,.25),transparent 45%),linear-gradient(150deg,#07121f,#030913 65%,#07111f); border: 1px solid rgba(120,169,227,.2); border-radius: 27px; box-shadow: 0 32px 100px rgba(0,0,0,.48),inset 0 1px rgba(255,255,255,.035); }
.voice-header { display: flex; align-items: center; justify-content: space-between; }
.voice-brand { display: flex; align-items: center; gap: 9px; color: #edf4ff; font-size: 16px; font-weight: 700; }
.voice-brand img { width: 37px; height: 37px; border-radius: 12px; box-shadow: 0 0 18px rgba(75,133,255,.2); }
.voice-brand small { display: block; margin-top: 2px; color: #91a4bf; font-size: 10px; font-weight: 500; }
.voice-close { display: grid; width: 38px; height: 38px; place-items: center; color: #c1d0e5; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.11); border-radius: 13px; font-size: 25px; cursor: pointer; }
.voice-close:hover { color: #fff; background: rgba(255,255,255,.12); }
.voice-stage { display: flex; flex: 1; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.voice-state-pill { display: inline-flex; min-height: 34px; align-items: center; padding: 5px 14px; color: #9aaeff; background: rgba(76,103,211,.16); border: 1px solid rgba(104,131,236,.2); border-radius: 999px; font-size: 14px; font-weight: 600; box-shadow: 0 0 22px rgba(74,106,219,.08); }
.voice-stage h2 { margin: 16px 0 3px; color: #f5f8ff; font-size: clamp(21px,4vw,28px); font-weight: 600; }
.voice-caption { margin: 0; color: #aab7ca; font-size: 15px; line-height: 1.7; }
.voice-visual { display: flex; width: min(100%,460px); align-items: center; justify-content: center; gap: 14px; margin: 32px 0 18px; }
.voice-orb { position: relative; display: grid; flex: 0 0 clamp(118px,26vw,158px); width: clamp(118px,26vw,158px); height: clamp(118px,26vw,158px); place-items: center; background: radial-gradient(circle at 38% 32%,#11263e 0,#071321 61%,#030912); border: 2px solid rgba(111,159,255,.95); border-radius: 50%; box-shadow: 0 0 14px rgba(69,145,255,.88),0 0 43px rgba(48,104,232,.5),inset 0 0 22px rgba(71,140,255,.17); transition: border-color .35s,box-shadow .35s,transform .35s; }
.voice-orb::before { position: absolute; inset: -10px; border: 1px dotted rgba(116,157,255,.63); border-radius: 50%; content: ""; animation: voice-orbit 16s linear infinite; }
.voice-orb::after { position: absolute; inset: 8px; border: 1px solid rgba(103,159,255,.12); border-radius: 50%; content: ""; }
.voice-face { position: relative; z-index: 1; display: flex; width: 76px; height: 54px; flex-direction: column; align-items: center; justify-content: center; gap: 12px; }
.voice-eyes { display: flex; width: 51px; align-items: center; justify-content: space-between; }
.voice-eyes i { display: block; width: 9px; height: 16px; background: #f1fbff; border-radius: 50%; box-shadow: 0 0 9px rgba(167,234,255,.8); }
.voice-mouth { display: block; width: 17px; height: 7px; border-bottom: 2px solid #e8f4ff; border-radius: 0 0 50% 50%; transition: width .25s,height .25s,border .25s; }
.voice-wave { display: flex; flex: 1 1 94px; max-width: 120px; height: 82px; align-items: center; justify-content: center; gap: 3px; overflow: hidden; }
.voice-wave i { display: block; width: 3px; min-height: 3px; height: 7px; background: #7694ff; border-radius: 5px; box-shadow: 0 0 8px rgba(91,133,255,.8); transition: height .08s linear,background .3s; }
.voice-transcript { width: min(100%,420px); max-height: 80px; margin: 1px 0 0; padding: 10px 14px; overflow: auto; color: #dce7f6; background: rgba(255,255,255,.045); border: 1px solid rgba(211,226,247,.1); border-radius: 14px; font-size: 14px; line-height: 1.7; }
.voice-error { max-width: 420px; margin: 4px 0; color: #ffc3a7; font-size: 13px; line-height: 1.7; }
.voice-audio { width: min(100%,460px); margin: 12px auto 0; color-scheme: dark; accent-color: #6f8cff; border-radius: 12px; }
.voice-controls { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-top: 5px; color: #d1dcee; font-size: 13px; }
.voice-mic-action { display: grid; width: 66px; height: 66px; place-items: center; color: #fff; background: linear-gradient(145deg,#5287ff,#4758db); border: 1px solid rgba(204,222,255,.52); border-radius: 50%; box-shadow: 0 0 0 9px rgba(100,131,245,.1),0 0 36px rgba(68,118,255,.48); cursor: pointer; transition: transform .2s,background .25s,box-shadow .25s; }
.voice-mic-action:hover { transform: scale(1.05); }
.voice-mic-action svg { width: 27px; height: 27px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.voice-end { margin-top: 9px; padding: 7px 15px; color: #9aa9bf; background: transparent; border: 1px solid rgba(196,214,239,.15); border-radius: 999px; font: inherit; font-size: 12px; cursor: pointer; }
.voice-end:hover { color: #fff; border-color: rgba(218,231,249,.45); }
.voice-privacy { margin: 15px 0 0; color: #71819a; font-size: 10px; line-height: 1.6; text-align: center; }
@keyframes voice-orbit { to { transform: rotate(360deg); } }
.voice-stage[data-state="listening"] .voice-orb { border-color: #68f0d4; box-shadow: 0 0 15px rgba(87,255,224,.88),0 0 48px rgba(25,206,174,.48),inset 0 0 22px rgba(63,242,207,.2); transform: scale(1.035); }
.voice-stage[data-state="listening"] .voice-orb::before { border-color: rgba(98,246,218,.8); }
.voice-stage[data-state="listening"] .voice-wave i { background: #55efd2; box-shadow: 0 0 8px rgba(67,237,209,.85); }
.voice-stage[data-state="listening"] .voice-state-pill { color: #86ffe8; background: rgba(38,191,164,.13); border-color: rgba(73,226,203,.24); }
.voice-stage[data-state="listening"] .voice-mouth { width: 14px; height: 2px; border: 0; background: #e8fffc; border-radius: 6px; }
.voice-stage[data-state="speaking"] .voice-orb,.voice-stage[data-state="processing"] .voice-orb { border-color: #5bb8ff; box-shadow: 0 0 16px rgba(77,169,255,.93),0 0 49px rgba(42,112,248,.56),inset 0 0 23px rgba(71,150,255,.19); animation: voice-speaking 1.35s ease-in-out infinite; }
.voice-stage[data-state="speaking"] .voice-wave i,.voice-stage[data-state="processing"] .voice-wave i { background: #59aaff; box-shadow: 0 0 8px rgba(82,164,255,.85); }
.voice-stage[data-state="speaking"] .voice-state-pill,.voice-stage[data-state="processing"] .voice-state-pill { color: #8bc8ff; background: rgba(39,117,204,.16); border-color: rgba(73,157,240,.28); }
.voice-stage[data-state="speaking"] .voice-mouth { width: 17px; height: 11px; border: 0; background: #f0f9ff; border-radius: 5px 5px 14px 14px; animation: voice-mouth 0.28s ease-in-out infinite alternate; }
.voice-stage[data-state="error"] .voice-state-pill { color: #ffc4a7; background: rgba(200,92,61,.14); border-color: rgba(239,143,98,.22); }
.voice-stage[data-state="error"] .voice-orb { border-color: #d8876a; box-shadow: 0 0 20px rgba(194,96,68,.42); }
.voice-stage[data-state="error"] .voice-mic-action { background: linear-gradient(145deg,#eea47a,#d36d62); }
@keyframes voice-speaking { 50% { transform: scale(1.055); } }
@keyframes voice-mouth { to { transform: scaleY(.55); } }
@media (max-width:520px) {
  .voice-overlay { padding: 0; }
  .voice-panel { width: 100%; min-height: 100dvh; padding: max(18px,env(safe-area-inset-top)) 18px max(16px,env(safe-area-inset-bottom)); border: 0; border-radius: 0; }
  .voice-visual { gap: 7px; margin: 36px 0 20px; }
  .voice-wave { max-width: 88px; gap: 2px; }
  .voice-wave i { width: 2px; }
  .voice-orb { flex-basis: 130px; width: 130px; height: 130px; }
  .voice-caption { font-size: 14px; }
}

body.voice-open { overflow: hidden; }
.voice-mic-action.is-stop { background: linear-gradient(145deg,#28b79e,#168b8b); box-shadow: 0 0 0 9px rgba(67,229,200,.1),0 0 36px rgba(34,221,192,.42); }
.voice-mic-action.is-retry { background: linear-gradient(145deg,#eea47a,#d36d62); box-shadow: 0 0 0 9px rgba(238,147,110,.1),0 0 34px rgba(222,117,84,.4); }


/* Conversation organization, document context, and streaming actions. */
.folder-filter-wrap { display: block; margin-top: 8px; }
.folder-filter-wrap select { width: 100%; min-height: 36px; padding: 0 10px; color: #64768d; background: rgba(245,248,253,.86); border: 1px solid #e5ecf5; border-radius: 10px; font-size: 11px; }
.chat-item-row { position: relative; display: flex; width: 100%; min-width: 0; max-width: 100%; flex: 0 0 auto; align-items: center; gap: 4px; }
.chat-item-copy { display: grid !important; flex: 1 1 auto; min-width: 0; gap: 2px; line-height: 1.35; }
.chat-item-copy strong,.chat-item-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-item-copy strong { color: inherit; font-size: 11px; font-weight: 600; }
.chat-item-copy small { color: #97a5b5; font-size: 9px; font-weight: 400; }
.chat-pin,.chat-more summary { display: grid; flex: 0 0 29px; width: 29px; height: 32px; place-items: center; padding: 0; color: #91a0b2; background: transparent; border: 1px solid transparent; border-radius: 9px; cursor: pointer; font-size: 16px; list-style: none; }
.chat-pin:hover,.chat-more summary:hover { color: #5277da; background: #f1f5fc; }
.chat-pin.is-pinned { color: #d49a39; }
.chat-more { position: relative; flex: 0 0 29px; }
.chat-more summary::-webkit-details-marker { display: none; }
.chat-more[open] summary { color: #5277da; background: #f1f5fc; }
.chat-more-menu { position: absolute; top: calc(100% + 3px); inset-inline-start: auto; inset-inline-end: 0; z-index: 45; display: none; min-width: 158px; gap: 4px; padding: 7px; background: #fff; border: 1px solid #e2e9f2; border-radius: 12px; box-shadow: 0 12px 30px rgba(22,43,72,.15); }
.chat-more[open] > .chat-more-menu { display: grid; }
.chat-more-menu > button { min-height: 34px; padding: 0 9px; color: #53667e; background: transparent; border: 0; border-radius: 8px; font-size: 11px; text-align: right; cursor: pointer; }
.chat-more-menu > button:hover { color: #315fbf; background: #f0f5ff; }
.chat-folder-control { display: grid; gap: 4px; padding: 4px 3px 0; color: #8492a4; font-size: 9px; }
.chat-folder-control select { min-height: 32px; padding: 0 7px; color: #50647d; background: #f7f9fc; border: 1px solid #e6edf5; border-radius: 8px; font: inherit; font-size: 10px; }

.message-document-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.message-document-badge { max-width: 100%; padding: 5px 8px; overflow: hidden; color: #5b6f87; background: rgba(239,244,251,.86); border: 1px solid #e3eaf4; border-radius: 8px; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.document-preview { display: grid; gap: 6px; margin: 2px 0 8px; }
.document-chip { display: flex; min-width: 0; align-items: center; gap: 8px; padding: 6px 8px; color: #516681; background: #f2f6fc; border: 1px solid #e2eaf5; border-radius: 10px; }
.document-chip-icon { flex: 0 0 auto; padding: 4px 5px; color: #4d74ce; background: #fff; border: 1px solid #e1e9f5; border-radius: 6px; font: 700 8px Arial,sans-serif; }
.document-chip-name { flex: 1; min-width: 0; overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.document-chip button { flex: 0 0 25px; width: 25px; height: 25px; color: #7d8da1; background: #fff; border: 1px solid #e1e8f1; border-radius: 7px; font-size: 17px; cursor: pointer; }
.message-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.message-action { min-height: 32px; padding: 4px 10px; color: #617792; background: rgba(255,255,255,.68); border: 1px solid #e2e9f2; border-radius: 9px; font-size: 10px; cursor: pointer; }
.message-action:hover { color: #3d67ce; background: #f0f5ff; border-color: #d0dcf5; }
.partial-response-note { display: block; margin-top: 7px; color: #b17b50; font-size: 10px; }
.continue-action { color: #3869cb; }
.retry-action { color: #8b6d5b; }
.stop-button { min-height: 34px; padding: 0 11px; color: #a44750; background: #fff3f3; border: 1px solid #f0d5d8; border-radius: 10px; font-size: 10px; font-weight: 600; cursor: pointer; }
.stop-button:hover:not(:disabled) { color: #933b43; background: #ffe9eb; }
.stop-button:disabled { opacity: .55; }
.tone-control { display: flex; align-items: center; gap: 5px; color: #8594a8; font-size: 9px; }
.tone-control select { max-width: 82px; min-height: 32px; padding: 0 6px; color: #536984; background: #f5f8fc; border: 1px solid #e4ebf5; border-radius: 9px; font-size: 10px; }

body[data-theme="night"] .folder-filter-wrap select,body[data-theme="night"] .tone-control select,body[data-theme="night"] .chat-folder-control select { color: #d6e2f2; background: #192940; border-color: #30415a; }
body[data-theme="night"] .chat-item-copy small { color: #9aa9be; }
body[data-theme="night"] .chat-pin,body[data-theme="night"] .chat-more summary { color: #a4b4cb; }
body[data-theme="night"] .chat-pin:hover,body[data-theme="night"] .chat-more summary:hover,body[data-theme="night"] .chat-more[open] summary { color: #bbceff; background: #1c2e48; }
body[data-theme="night"] .chat-pin.is-pinned { color: #f0c36d; }
body[data-theme="night"] .chat-more-menu { background: #17263b; border-color: #30415a; box-shadow: 0 12px 30px rgba(0,0,0,.36); }
body[data-theme="night"] .chat-more-menu > button { color: #c3d0e3; }
body[data-theme="night"] .chat-more-menu > button:hover { color: #c6d5ff; background: #203350; }
body[data-theme="night"] .document-chip,body[data-theme="night"] .message-document-badge { color: #cad8e9; background: #1c2d45; border-color: #334660; }
body[data-theme="night"] .document-chip-icon,body[data-theme="night"] .document-chip button { color: #c1d1e8; background: #243753; border-color: #3a4d68; }
body[data-theme="night"] .message-action { color: #c0cde0; background: #1b2b42; border-color: #33455f; }
body[data-theme="night"] .message-action:hover { color: #d6e1ff; background: #243858; }
body[data-theme="night"] .partial-response-note { color: #e4b17f; }
body[data-theme="night"] .stop-button { color: #ffc4ca; background: #38232b; border-color: #603540; }
@media (max-width:720px) {
  .folder-filter-wrap select { min-height: 38px; }
  .chat-item-row { gap: 2px; }
  .chat-pin,.chat-more summary { flex-basis: 27px; width: 27px; height: 34px; }
  .chat-more { flex-basis: 27px; }
  .chat-delete { flex-basis: 30px; width: 30px; height: 32px; }
  .chat-delete svg { flex: 0 0 16px; width: 16px; height: 16px; }
  .composer-actions { gap: 6px; }
  .tone-control > span { display: none; }
  .tone-control select { max-width: 75px; min-height: 32px; font-size: 9px; }
  .message-actions { gap: 5px; }
  .message-action { min-height: 34px; }
}
@media (max-width:380px) {
  .composer-actions { gap: 4px; }
  .tone-control select { max-width: 67px; padding-inline: 3px; font-size: 8px; }
  .char-count { display: none; }
  .stop-button { padding-inline: 7px; font-size: 9px; }
}
