:root {
  color-scheme: dark;
  --bg: #111217;
  --panel: #17181f;
  --panel-2: #1d1e26;
  --line: #ffffff14;
  --text: #f3f3f7;
  --muted: #9c9eac;
  --red: #ff5268;
  --blue: #6277ff;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { width: 100%; height: 100%; overflow: hidden; }
body { width: 100%; height: 100vh; height: 100dvh; min-width: 320px; min-height: 0; margin: 0; overflow: hidden; color: var(--text); background: var(--bg); }
button, input, textarea { font: inherit; }
button { color: inherit; cursor: pointer; }
.hidden { display: none !important; }
.muted { color: var(--muted); line-height: 1.65; }
.small { font-size: 12px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-weight: 720; font-size: 17px; letter-spacing: -.5px; }
.brand img { display: block; }
.brand-light { font-weight: 480; color: #c6c6d1; }
.brand-large { font-size: 26px; gap: 13px; }
.eyebrow { color: #ff8291; font-size: 11px; font-weight: 750; letter-spacing: 1.8px; }
.auth-view { width: 100%; min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; overflow-y: auto; padding: max(28px, env(safe-area-inset-top)) 28px max(28px, env(safe-area-inset-bottom)); background: radial-gradient(ellipse at 18% 8%, #7227354f, transparent 38%), radial-gradient(ellipse at 88% 92%, #344bbd45, transparent 40%), #111217; }
.auth-card { width: min(100%, 430px); min-width: 0; padding: 42px; border: 1px solid #ffffff16; border-radius: 24px; background: #17181fe8; box-shadow: 0 24px 80px #0006; }
.auth-card .eyebrow { margin: 34px 0 10px; }
.auth-card h1 { margin: 0 0 9px; font-size: 28px; letter-spacing: -.8px; }
.auth-card > .muted { margin: 0 0 27px; font-size: 14px; }
.auth-form { display: grid; gap: 17px; }
.auth-form label { display: grid; min-width: 0; gap: 8px; color: #d3d4dc; font-size: 13px; }
.auth-form input { width: 100%; padding: 13px 14px; border: 1px solid #ffffff20; border-radius: 11px; outline: none; color: var(--text); background: #111217; }
.password-input-wrap { position: relative; }
.password-input-wrap input { padding-right: 48px; }
.password-toggle { position: absolute; top: 50%; right: 7px; display: grid; width: 36px; height: 36px; place-items: center; transform: translateY(-50%); border: 0; border-radius: 8px; color: #bfc2d0; background: transparent; }
.password-toggle:hover, .password-toggle:focus-visible { color: #fff; background: #ffffff10; }
.eye-icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.eye-closed, .password-toggle[aria-pressed="true"] .eye-open { display: none; }
.password-toggle[aria-pressed="true"] .eye-closed { display: block; }
.auth-form input:focus, textarea:focus { border-color: #6678ff9c; box-shadow: 0 0 0 3px #6277ff1a; }
.primary-button, .secondary-button { border: 0; border-radius: 11px; padding: 13px 18px; color: #fff; font-weight: 700; background: linear-gradient(105deg, #d7475c, #586df4); }
.primary-button { margin-top: 5px; }
.text-button { display: block; margin: 20px auto 0; border: 0; color: #c3c6ff; background: none; }
.auth-footnote { margin: 26px 0 0; color: #787b89; text-align: center; font-size: 11px; }
#resetConfirmation { margin-top: 20px; color: #d3d4dc; font-size: 13px; line-height: 1.65; }
#resetConfirmation strong { display: block; margin: 12px 0; padding: 14px; border: 1px solid #ffffff20; border-radius: 11px; color: #fff; background: #111217; font-family: ui-monospace, monospace; font-size: 18px; letter-spacing: 1.5px; overflow-wrap: anywhere; }
#resetConfirmation code { color: #c3c6ff; }
.error-text { min-height: 16px; margin: 0; color: #ff8592; font-size: 12px; }
.app-shell { position: relative; display: flex; width: 100%; height: 100vh; height: 100dvh; min-height: 0; overflow: hidden; }
.sidebar { z-index: 4; display: flex; flex: 0 0 275px; flex-direction: column; padding: 17px 13px 12px; border-right: 1px solid var(--line); background: #15161c; }
.sidebar-top { display: flex; align-items: center; justify-content: space-between; padding: 0 4px 20px; }
.new-chat-button, .icon-button { display: grid; place-items: center; border: 1px solid #ffffff17; border-radius: 10px; background: #ffffff06; }
.new-chat-button { width: 37px; height: 37px; font-size: 24px; line-height: 1; }
.new-chat-wide { display: flex; align-items: center; gap: 11px; width: 100%; padding: 11px 12px; border: 1px solid #ffffff14; border-radius: 10px; color: #e8e8ed; background: #ffffff07; text-align: left; }
.new-chat-wide span { font-size: 20px; }
.sidebar-label { margin: 27px 9px 10px; color: #828592; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; }
.chat-list { display: grid; align-content: start; gap: 4px; overflow-y: auto; }
.chat-entry { display: flex; align-items: center; gap: 8px; width: 100%; padding: 10px; border: 0; border-radius: 9px; color: #d2d3dc; background: transparent; text-align: left; font-size: 13px; }
.chat-entry:hover, .chat-entry.active { background: #ffffff0d; }
.chat-entry-title { overflow: hidden; flex: 1; white-space: nowrap; text-overflow: ellipsis; }
.chat-delete { opacity: 0; border: 0; color: #aaa; background: none; }
.chat-entry:hover .chat-delete { opacity: 1; }
.sidebar-bottom { margin-top: auto; }
.tool-card { display: grid; grid-template-columns: 35px 1fr auto; align-items: center; gap: 9px; width: 100%; margin-bottom: 14px; padding: 12px 9px; border: 1px solid #ffffff12; border-radius: 13px; background: linear-gradient(115deg, #9e293121, #465bdb20); text-align: left; }
.tool-icon { display: grid; place-items: center; width: 33px; height: 33px; border-radius: 10px; color: #ffd1d6; background: linear-gradient(145deg, #b83d4e, #495ce0); font-size: 20px; }
.tool-card strong, .tool-card small { display: block; }
.tool-card strong { font-size: 12px; }
.tool-card small { margin-top: 4px; color: #999ba8; font-size: 10px; }
.tool-status { color: #e7ae6e; font-size: 8px; font-weight: 800; letter-spacing: .5px; }
.settings-button { display: flex; align-items: center; gap: 10px; width: 100%; margin: 0 0 8px; padding: 10px 11px; border: 1px solid transparent; border-radius: 9px; color: #c9cbd4; background: transparent; text-align: left; font-size: 12px; }
.settings-button:hover, .settings-button:focus-visible { border-color: #ffffff14; color: #fff; background: #ffffff0a; }
.settings-button > span { width: 18px; text-align: center; font-size: 16px; }
.account-row { display: flex; align-items: center; gap: 10px; padding: 12px 5px 3px; border-top: 1px solid var(--line); }
.avatar { display: grid; place-items: center; width: 35px; height: 35px; flex: 0 0 35px; border-radius: 50%; background: linear-gradient(140deg, #a8354a, #4558cd); font-weight: 750; }
.account-copy { flex: 1; min-width: 0; }
.account-copy strong, .account-copy small { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.account-copy strong { font-size: 12px; }
.account-copy small { margin-top: 3px; color: #9294a1; font-size: 10px; }
.icon-button { width: 36px; height: 36px; color: #c9cbd4; }
.chat-column { position: relative; display: flex; flex: 1; flex-direction: column; min-width: 0; min-height: 0; background: radial-gradient(ellipse at 50% 0, #2630501a, transparent 42%), var(--bg); }
.topbar { z-index: 2; display: flex; align-items: center; justify-content: space-between; min-height: 63px; padding: 0 27px; border-bottom: 1px solid #ffffff0b; background: #111217de; }
.model-picker { display: flex; align-items: center; gap: 9px; font-size: 13px; }
.model-picker > span:last-child { color: #8e909d; }
.model-dot { width: 8px; height: 8px; border-radius: 50%; background: linear-gradient(140deg, var(--red), var(--blue)); box-shadow: 0 0 12px #8274ff; }
.search-toggle { display: inline-flex; align-items: center; gap: 8px; padding: 8px 11px; border: 1px solid #ffffff18; border-radius: 9px; color: #b7b9c5; background: #ffffff05; font-size: 11px; }
.logout-top { display: inline-flex; width: auto; min-width: 36px; align-items: center; justify-content: center; gap: 7px; padding: 0 10px; white-space: nowrap; }
.search-toggle > span:first-child { font-size: 18px; }
.toggle-indicator { width: 7px; height: 7px; border-radius: 50%; background: #656876; }
.search-toggle[aria-pressed="true"] { border-color: #637aff80; color: #d3d9ff; background: #586cff1c; }
.search-toggle[aria-pressed="true"] .toggle-indicator { background: #7487ff; box-shadow: 0 0 8px #7487ff; }
.conversation { display: flex; flex: 1; flex-direction: column; align-items: center; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 35px 22px 18px; scroll-behavior: smooth; }
.welcome { display: flex; flex-direction: column; align-items: center; width: min(100%, 740px); margin: auto; padding: 35px 0; text-align: center; }
.welcome > img { margin-bottom: 17px; filter: drop-shadow(0 8px 28px #e4455a42); }
.welcome .eyebrow { margin: 0 0 10px; }
.welcome h1 { margin: 0; font-size: clamp(26px, 4vw, 37px); letter-spacing: -1.3px; }
.welcome > p:not(.eyebrow) { max-width: 530px; margin: 12px 0 26px; color: #999ba8; line-height: 1.65; font-size: 14px; }
.suggestions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; width: 100%; }
.suggestions button { display: flex; align-items: center; justify-content: space-between; min-height: 64px; padding: 13px; border: 1px solid #ffffff12; border-radius: 12px; color: #c4c6d0; background: #ffffff05; text-align: left; font-size: 12px; }
.suggestions button:hover { border-color: #7e6a8940; background: #ffffff09; }
.suggestions button span { color: #a4a8ff; font-size: 16px; }
.messages { display: grid; align-content: end; gap: 28px; width: min(100%, 780px); margin: auto; }
.message { display: flex; gap: 14px; align-items: flex-start; line-height: 1.7; }
.message-avatar { display: grid; place-items: center; width: 30px; height: 30px; flex: 0 0 30px; border-radius: 50%; background: linear-gradient(140deg, #a8354a, #4558cd); font-size: 12px; font-weight: 800; }
.message.user .message-avatar { background: #353640; }
.message-body { min-width: 0; padding-top: 2px; white-space: pre-wrap; overflow-wrap: anywhere; }
.message-body p { margin: 0; }
.message-body a { color: #9caaff; text-decoration: underline; text-underline-offset: 3px; }
.message-sources { display: grid; gap: 7px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.message-sources strong { color: #a8adbf; font-size: 11px; }
.message-sources a { font-size: 12px; }
.message-files { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.generated-image-link { display: block; width: fit-content; max-width: min(100%, 560px); margin-top: 12px; overflow: hidden; border: 1px solid #ffffff1a; border-radius: 14px; }
.generated-image { display: block; max-width: 100%; max-height: 560px; object-fit: contain; }
.file-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 250px; padding: 6px 9px; border: 1px solid #ffffff17; border-radius: 8px; color: #bfc1cc; background: #ffffff07; font-size: 11px; }
.file-chip a { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.typing { color: #9b9eae; }
.typing-caret::after { display: inline-block; width: 7px; height: 1em; margin-left: 3px; vertical-align: text-bottom; background: #9da8ff; content: ""; animation: typing-blink 1s steps(2, start) infinite; }
@keyframes typing-blink { to { visibility: hidden; } }
.composer-area { width: min(100%, 840px); margin: 0 auto; padding: 12px 22px max(13px, env(safe-area-inset-bottom)); }
.composer { display: flex; align-items: flex-end; gap: 8px; padding: 10px 11px; border: 1px solid #ffffff1b; border-radius: 18px; background: #202128; box-shadow: 0 12px 40px #0002; }
.composer:focus-within { border-color: #7c6d8b75; box-shadow: 0 0 0 3px #6779ff0e, 0 12px 40px #0002; }
.composer-icon { display: grid; place-items: center; width: 34px; height: 34px; flex: 0 0 34px; border: 0; border-radius: 50%; color: #c3c5cf; background: transparent; font-size: 21px; }
.composer-icon:hover { background: #ffffff0d; }
.live-chat-toggle { width: auto; min-width: 46px; padding: 0 8px; border: 1px solid #ffffff20; border-radius: 999px; color: #c3c5cf; font-size: 10px; font-weight: 800; letter-spacing: .4px; }
.live-chat-toggle.live-chat-active { border-color: #ff5268a8; color: #ff8795; background: #ff52681a; }
.agent-mode-toggle { width: auto; min-width: 52px; padding: 0 8px; border: 1px solid #ffffff20; border-radius: 999px; color: #c3c5cf; font-size: 9px; font-weight: 800; letter-spacing: .3px; }
.agent-mode-toggle.agent-mode-active { border-color: #8290ffad; color: #aab4ff; background: #6678ff20; }
.agent-task-card { display: grid; gap: 10px; margin-top: 12px; padding: 12px; border: 1px solid #8290ff55; border-radius: 12px; background: #6678ff12; white-space: pre-wrap; }
.agent-task-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.agent-task-actions button { padding: 8px 12px; border: 1px solid #ffffff2a; border-radius: 9px; color: #f5f6fb; background: #ffffff10; font: inherit; cursor: pointer; }
.agent-task-actions button:first-child { border-color: #8290ff80; background: #6678ff35; }
.agent-task-actions button:disabled { opacity: .5; cursor: wait; }
.live-chat-toggle:disabled { cursor: not-allowed; opacity: .42; }
.live-chat-status { min-height: 16px; margin: 4px 8px 0; color: #aeb0bd; font-size: 11px; line-height: 1.4; }
.image-generation-notice { margin: 6px 8px 0; color: #9295a3; text-align: center; font-size: 10px; line-height: 1.4; }
.image-generate-button { font-size: 17px; }
.sidebar-backdrop { display: none; }
.voice-hint { font-size: 17px; }
.voice-hint.voice-active { color: #fff; background: linear-gradient(145deg, #d54b5d, #536cf2); box-shadow: 0 0 0 3px #7180ff20; }
@media (prefers-reduced-motion: reduce) { .typing-caret::after { animation: none; } }
.composer textarea { flex: 1; max-height: 180px; min-height: 34px; resize: none; padding: 7px 3px; border: 1px solid transparent; outline: none; color: var(--text); background: transparent; line-height: 1.5; }
.composer textarea:focus { box-shadow: none; }
.composer textarea::placeholder { color: #868996; }
.send-button { display: grid; place-items: center; width: 34px; height: 34px; flex: 0 0 34px; border: 0; border-radius: 50%; color: #fff; background: linear-gradient(145deg, #d54b5d, #536cf2); font-size: 20px; font-weight: 700; }
.send-button:disabled { opacity: .48; cursor: default; }
.attachment-preview { display: flex; flex-wrap: wrap; gap: 7px; padding: 8px 6px 2px; }
.pending-file { display: inline-flex; align-items: center; gap: 6px; padding: 6px 8px; border: 1px solid #ffffff19; border-radius: 8px; color: #bfc1cc; background: #1d1e26; font-size: 11px; }
.pending-file button { border: 0; color: #aaa; background: none; }
.disclaimer { margin: 10px 0 0; color: #696c79; text-align: center; font-size: 10px; }
.toast { position: fixed; z-index: 10; bottom: 25px; left: 50%; transform: translate(-50%, 20px); opacity: 0; max-width: min(90vw, 500px); padding: 11px 15px; border: 1px solid #ffffff20; border-radius: 11px; background: #23242d; box-shadow: 0 12px 40px #0006; font-size: 13px; pointer-events: none; transition: .2s ease; }
.toast.visible { transform: translate(-50%, 0); opacity: 1; }
.application-dialog { position: relative; width: min(94vw, 480px); padding: 30px; border: 1px solid #ffffff1d; border-radius: 20px; color: var(--text); background: #1a1b22; box-shadow: 0 24px 90px #0009; }
.application-dialog::backdrop { background: #08090bd9; backdrop-filter: blur(5px); }
.settings-dialog { width: min(94vw, 520px); max-height: 88vh; overflow-y: auto; }
.settings-intro { margin: 10px 0 20px; color: #a4a6b0; font-size: 13px; line-height: 1.55; }
.voice-settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.voice-setting { display: grid; min-width: 0; gap: 7px; color: #d3d4dc; font-size: 12px; font-weight: 650; }
.voice-setting select { width: 100%; min-width: 0; padding: 11px 12px; border: 1px solid #ffffff20; border-radius: 10px; outline: none; color: var(--text); background: #111217; font: inherit; font-weight: 450; }
.voice-setting select:focus-visible { border-color: #7487ff; box-shadow: 0 0 0 3px #6277ff1a; }
.voice-preview-button { width: 100%; margin-top: 18px; border: 1px solid #ffffff1b; background: #ffffff0c; }
.voice-preview-button:disabled { opacity: .6; cursor: wait; }
.voice-settings-status { min-height: 18px; margin: 12px 0 0; color: #b7c1ff; font-size: 12px; line-height: 1.5; }
.voice-settings-note { margin: 10px 0 0; color: #888b98; font-size: 11px; line-height: 1.5; }
.dialog-close { position: absolute; top: 14px; right: 15px; border: 0; color: #a6a8b2; background: none; font-size: 26px; }
.tool-icon-large { width: 44px; height: 44px; font-size: 24px; }
.application-dialog .eyebrow { margin: 23px 0 8px; }
.application-dialog h2 { margin: 0; font-size: 24px; }
.application-dialog > p:not(.eyebrow) { color: #a4a6b0; line-height: 1.65; font-size: 13px; }
.workflow-steps { display: grid; gap: 10px; margin: 20px 0; padding: 15px; border: 1px solid #ffffff12; border-radius: 12px; background: #ffffff04; }
.workflow-steps span { display: flex; gap: 12px; color: #ff8491; font-size: 11px; }
.workflow-steps b { color: #d7d8df; font-size: 12px; font-weight: 550; }
.application-dialog .secondary-button { width: 100%; margin-top: 8px; border: 1px solid #ffffff1b; background: #ffffff0c; }
.mobile-only { display: none; }
@media (max-width: 760px) {
  .sidebar { position: fixed; inset: 0 auto 0 0; width: min(290px, 86vw); transform: translateX(-105%); transition: transform .2s ease; box-shadow: 15px 0 50px #0006; }
  .sidebar.open { transform: translateX(0); }
  .sidebar-backdrop.open { position: fixed; z-index: 3; inset: 0; display: block; width: 100%; height: 100%; border: 0; background: #07080bb8; backdrop-filter: blur(2px); }
  .mobile-only { display: grid; }
  .topbar { min-height: 108px; justify-content: flex-start; gap: 12px; padding: 54px 13px 10px; }
  .model-picker { flex: 1; }
  .model-picker > span:last-child { display: none; }
  .search-toggle { padding: 7px 8px; }
  .logout-top span { display: none; }
  .conversation { padding: 20px 15px 10px; }
  .suggestions { grid-template-columns: 1fr; max-width: 400px; }
  .suggestions button { min-height: 48px; }
  .composer-area { padding: 8px 10px max(11px, env(safe-area-inset-bottom)); }
  .auth-card { padding: 30px 24px; }
  .voice-settings-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
}

.global-home{position:fixed;top:max(14px,env(safe-area-inset-top));left:max(14px,env(safe-area-inset-left));z-index:3;display:inline-flex;align-items:center;gap:7px;min-height:40px;padding:0 13px;border:1px solid #ffffff24;border-radius:12px;background:#11131ceF;color:#f5f6fb;text-decoration:none;font-size:13px;font-weight:700;box-shadow:0 8px 26px #0005;backdrop-filter:blur(14px)}.global-home:hover{border-color:#ff5268;color:#fff}


.auth-card .text-button { display: block; width: 100%; margin-top: 15px; }
.auth-card .guest-button { color: #b7c1ff; }
.auth-card .auth-footnote { line-height: 1.6; }
.guest-mode #attachButton,
.guest-mode #liveChatToggle,
.guest-mode #voiceHint { display: none !important; }
.guest-mode #agentModeToggle { display: none !important; }
.guest-import { grid-template-columns: 18px minmax(0, 1fr) !important; align-items: start; color: #b7b9c5 !important; font-size: 12px !important; line-height: 1.5; }
.guest-import input { width: auto !important; margin: 3px 0 0; accent-color: #7487ff; }
.guest-expiry-notice { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 20px; border-bottom: 1px solid #ffbd5b55; color: #ffe4b2; background: #7a4d1424; font-size: 13px; }
.guest-expiry-notice a { flex: 0 0 auto; padding: 8px 12px; border-radius: 9px; color: white; background: linear-gradient(105deg, #d7475c, #586df4); font-weight: 700; text-decoration: none; }
@media (max-width: 580px) {
  .guest-expiry-notice { align-items: stretch; flex-direction: column; padding: 12px 15px; }
  .guest-expiry-notice a { text-align: center; }
}
