:root {
  --ink: #f4efe8;
  --muted: #a59e96;
  --faint: #706a64;
  --bg: #151311;
  --panel: #1c1916;
  --panel-2: #24201c;
  --line: rgba(244, 239, 232, .1);
  --accent: #d96841;
  --accent-light: #ef8b63;
  --cream: #f4eee5;
}

* { box-sizing: border-box; }
body {
  margin: 0; min-width: 320px; background: var(--bg); color: var(--ink);
  font-family: "DM Sans", sans-serif; -webkit-font-smoothing: antialiased;
  height: 100vh; overflow: hidden;
}
button, textarea { font: inherit; }
button { border: 0; cursor: pointer; color: inherit; }
button:focus-visible, a:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent-light);
  outline-offset: 3px;
}
.app-shell { display: flex; height: 100vh; overflow: hidden; }

.sidebar {
  width: 276px; flex: 0 0 276px; padding: 26px 16px 16px; display: flex; flex-direction: column;
  background: #1a1714; border-right: 1px solid var(--line);
  -ms-overflow-style: none; overflow-y: auto; scrollbar-width: none; height: 100%;
}
.sidebar::-webkit-scrollbar, .history::-webkit-scrollbar { display: none; }
.brand { align-items: center; color: var(--ink); display: flex; font-family: "Playfair Display", serif; font-size: 22px; gap: 10px; letter-spacing: -.6px; padding: 0 10px 27px; text-decoration: none; }
.brand > span:last-child span { color: var(--accent-light); }
.brand-mark { align-items: center; background: var(--accent); border-radius: 8px; color: #22120d; display: inline-flex; height: 27px; justify-content: center; width: 27px; }
.brand-mark svg { height: 20px; width: 20px; }

.new-chat { align-items: center; background: var(--panel-2); border: 1px solid var(--line); border-radius: 9px; display: flex; font-size: 13px; font-weight: 600; gap: 9px; margin-bottom: 23px; padding: 10px 11px; text-align: left; transition: background .2s; width: 100%; }
.new-chat:hover, .new-chat:focus-visible { background: #302a25; }
.plus { color: var(--accent-light); font-size: 21px; font-weight: 300; line-height: 14px; }
kbd { background: rgba(255,255,255,.07); border-radius: 4px; color: var(--faint); font-family: "DM Mono", monospace; font-size: 10px; margin-left: auto; padding: 3px 5px; }
.history { -ms-overflow-style: none; min-height: 0; overflow-y: auto; padding: 10px 3px 23px; flex: 1 1 auto; scrollbar-width: none; }
.history-toggle { align-items: center; background: transparent; border-radius: 7px; color: var(--faint); display: flex; font-family: "DM Mono", monospace; font-size: 10px; justify-content: space-between; letter-spacing: .1em; margin: 0; padding: 10px 7px; text-transform: uppercase; width: 100%; }
.history-toggle:hover { background: rgba(255,255,255,.05); color: var(--muted); }
.history-toggle svg { height: 15px; transition: transform .18s ease; width: 15px; }
.history-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
#sessionList { overflow: hidden; }
#sessionList[hidden] { display: none; }
.session-wrapper { position: relative; display: flex; align-items: center; width: 100%; border-radius: 6px; transition: background .15s; }
.session-wrapper:hover, .session-wrapper.active { background: rgba(255,255,255,.05); }
.session { background: transparent; color: #b7afa6; display: block; font-size: 13px; overflow: hidden; padding: 8px 7px; text-align: left; text-overflow: ellipsis; white-space: nowrap; width: 100%; }
.session-wrapper:hover .session, .session-wrapper.active .session { color: var(--ink); }
.session.active::before { background: var(--accent); border-radius: 50%; content: ""; display: inline-block; height: 5px; margin: 0 8px 1px 1px; width: 5px; }

.session-delete { opacity: 0; background: transparent; color: var(--faint); padding: 8px; flex: 0 0 auto; display: flex; align-items: center; justify-content: center; }
.session-delete { font-size: 20px; line-height: 1; }
.session-wrapper:hover .session-delete { opacity: 1; }
.session-delete:hover { color: #f46b6b; }
.sidebar-bottom { border-top: 1px solid var(--line); margin-top: auto; padding-top: 15px; }
.account-card { align-items: center; background: transparent; border-radius: 9px; display: flex; gap: 10px; padding: 8px; text-align: left; width: 100%; }
.account-card:hover { background: rgba(255,255,255,.05); }
.avatar { align-items: center; background: #674336; border: 1px solid #a66d58; border-radius: 50%; color: #fce4d7; display: inline-flex; flex: 0 0 auto; font-family: "DM Mono", monospace; font-size: 10px; font-weight: 500; height: 30px; justify-content: center; width: 30px; }
.account-name { display: grid; gap: 1px; min-width: 0; }
.account-name strong, .popover-profile strong { font-size: 12px; font-weight: 600; }
.account-name small, .popover-profile small { color: var(--faint); font-size: 10px; }
.chevron { color: var(--faint); height: 15px; margin-left: auto; width: 15px; }

.main-content { background: radial-gradient(circle at 55% 22%, #24201b 0, var(--bg) 38%); min-width: 0; width: 100%; display: flex; flex-direction: column; height: 100%; overflow: hidden; }
.topbar { align-items: center; display: flex; height: 74px; padding: 0 38px; flex: 0 0 74px; }
.topbar-spacer { flex: 1; }
.sign-in { background: var(--cream); border-radius: 7px; color: #211d19; font-size: 13px; font-weight: 700; padding: 10px 17px; transition: transform .15s, background .15s; }
.sign-in:hover { background: white; transform: translateY(-1px); }
.mobile-menu { background: transparent; display: none; padding: 4px; }
.mobile-menu span { background: var(--ink); display: block; height: 1px; margin: 4px; width: 18px; }
.welcome { display: flex; flex-direction: column; justify-content: center; margin: 0 auto; max-width: 650px; flex: 1; min-height: 0; padding: 0 24px; width: 100%; }
.chat-messages { display: flex; flex-direction: column; gap: 24px; margin-bottom: 20px; width: 100%; overflow-y: auto; padding-right: 10px; flex: 1 1 auto; }
.chat-intro { margin-bottom: 20px; text-align: left; flex: 0 0 auto; margin-top: auto; }
.chat-intro h1 { color: var(--ink); font-family: "DM Sans", sans-serif; font-size: clamp(25px, 3vw, 30px); font-weight: 500; letter-spacing: -.8px; line-height: 1.2; margin: 0; }
.chat-intro h1 span { color: var(--accent-light); font-style: normal; }
.chat-message { max-width: 85%; }
.chat-message.user { align-self: flex-end; background: rgba(255,255,255,.06); border: 1px solid var(--line); border-radius: 20px; padding: 12px 18px; }
.chat-message.user .chat-message-content { line-height: 1.55; margin: 0; white-space: pre-wrap; }
.chat-message.assistant { align-self: flex-start; background: transparent; border: none; padding: 0; max-width: 100%; }
.chat-message.assistant .chat-message-content { color: #e9e4de; font-size: 16px; letter-spacing: -.01em; line-height: 1.68; max-width: 720px; }
.chat-message.assistant .chat-message-content.is-generating { color: var(--muted); }
.loading-dots { align-items: center; display: inline-flex; gap: 5px; height: 20px; }
.loading-dots span { animation: dot-bounce .8s ease-in-out infinite; background: currentColor; border-radius: 50%; display: block; height: 6px; width: 6px; }
.loading-dots span:nth-child(2) { animation-delay: .12s; }
.loading-dots span:nth-child(3) { animation-delay: .24s; }
.chat-message.assistant .chat-message-content p { margin: 0 0 18px 0; }
.chat-message.assistant .chat-message-content p:last-child { margin-bottom: 0; }
.chat-message.assistant .chat-message-content h1,
.chat-message.assistant .chat-message-content h2,
.chat-message.assistant .chat-message-content h3 { color: var(--ink); font-family: "DM Sans", sans-serif; font-weight: 650; letter-spacing: -.035em; line-height: 1.25; margin: 26px 0 10px; }
.chat-message.assistant .chat-message-content h1 { font-size: 23px; }
.chat-message.assistant .chat-message-content h2 { font-size: 20px; }
.chat-message.assistant .chat-message-content h3 { font-size: 17px; }
.chat-message.assistant .chat-message-content > :first-child { margin-top: 0; }
.chat-message.assistant .chat-message-content strong { color: #fffaf4; font-weight: 700; }
.chat-message.assistant .chat-message-content em { color: #ddd5cd; }
.chat-message.assistant .chat-message-content a { color: var(--accent-light); text-decoration: underline; text-decoration-color: rgba(239,139,99,.45); text-underline-offset: 3px; }
.chat-message.assistant .chat-message-content a:hover { color: var(--ink); }
.chat-message.assistant .chat-message-content ul,
.chat-message.assistant .chat-message-content ol { margin: 0 0 18px 0; padding-left: 24px; }
.chat-message.assistant .chat-message-content li { margin-bottom: 9px; padding-left: 3px; }
.chat-message.assistant .chat-message-content li::marker { color: var(--accent-light); font-weight: 700; }
.chat-message.assistant .chat-message-content code { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.1); border-radius: 4px; color: #f7d7c8; font-family: "DM Mono", monospace; font-size: .84em; padding: 2px 4px; }
.chat-message.assistant .chat-message-content pre { background: #1c1916; border: 1px solid var(--line); border-radius: 8px; margin: 0 0 18px; overflow-x: auto; padding: 14px; }
.chat-message.assistant .chat-message-content pre code { background: transparent; border: 0; color: #e9e4de; padding: 0; }
.chat-message.assistant .chat-message-content blockquote { border-left: 2px solid var(--accent); color: #c8c0b8; margin: 0 0 18px; padding-left: 14px; }
.grounding-sources { align-self: flex-end; color: var(--muted); font-size: 11px; margin: 12px 0 0 auto; max-width: min(100%, 430px); position: relative; width: 100%; }
.source-toggle { align-items: center; background: rgba(255,255,255,.035); border: 1px solid var(--line); border-radius: 999px; color: var(--muted); display: inline-flex; float: right; font-family: "DM Mono", monospace; font-size: 10px; font-weight: 600; gap: 7px; letter-spacing: .055em; min-height: 32px; padding: 6px 7px 6px 11px; text-transform: uppercase; transition: background .16s ease, border-color .16s ease, color .16s ease; }
.source-toggle::after { content: "⌄"; font-family: "DM Sans", sans-serif; font-size: 15px; font-weight: 400; line-height: 1; margin: -3px 0 0 1px; transition: transform .16s ease; }
.source-toggle[aria-expanded="true"]::after { transform: rotate(180deg); }
.source-toggle-count { align-items: center; background: rgba(244,239,232,.1); border-radius: 999px; color: var(--ink); display: inline-flex; font-size: 9px; height: 18px; justify-content: center; min-width: 18px; padding: 0 5px; }
.source-toggle:hover, .source-toggle:focus-visible { background: rgba(255,255,255,.075); border-color: rgba(239,139,99,.62); color: var(--ink); }
.grounding-source-panel { background: linear-gradient(145deg, rgba(44,39,34,.98), rgba(29,26,23,.98)); border: 1px solid rgba(244,239,232,.14); border-radius: 14px; box-shadow: 0 18px 42px rgba(0,0,0,.35), 0 2px 7px rgba(0,0,0,.22); clear: both; margin-top: 9px; overflow: hidden; padding: 10px; }
.grounding-source-panel[hidden] { display: none; }
.grounding-source-header { align-items: center; display: flex; justify-content: space-between; margin: 1px 3px 9px; }
.grounding-source-header h3 { color: var(--muted); font-family: "DM Mono", monospace; font-size: 10px; font-weight: 600; letter-spacing: .08em; margin: 0; text-transform: uppercase; }
.source-close { align-items: center; background: rgba(255,255,255,.055); border-radius: 50%; color: var(--muted); display: inline-flex; font-size: 0; height: 24px; justify-content: center; padding: 0; width: 24px; }
.source-close::before { content: "×"; font-family: "DM Sans", sans-serif; font-size: 18px; font-weight: 300; line-height: 1; }
.source-close:hover, .source-close:focus-visible { background: rgba(255,255,255,.11); color: var(--ink); }
.grounding-source-list { display: grid; gap: 7px; list-style: none; margin: 0; max-height: min(44vh, 310px); overflow-y: auto; overscroll-behavior: contain; padding: 0 2px 1px; scrollbar-color: rgba(244,239,232,.2) transparent; scrollbar-width: thin; }
.grounding-source-list::-webkit-scrollbar { width: 5px; }
.grounding-source-list::-webkit-scrollbar-thumb { background: rgba(244,239,232,.2); border-radius: 999px; }
.grounding-source-item { margin: 0; }
.source-card { align-items: flex-start; background: rgba(255,255,255,.045); border: 1px solid transparent; border-radius: 10px; color: var(--ink); display: flex; gap: 10px; padding: 10px; text-decoration: none; transition: background .16s ease, border-color .16s ease, transform .16s ease; }
.source-card:hover, .source-card:focus-visible { background: rgba(255,255,255,.085); border-color: rgba(239,139,99,.48); color: var(--ink); transform: translateY(-1px); }
.source-card-mark { align-items: center; background: linear-gradient(145deg, #aa654e, #6f4435); border: 1px solid rgba(255,226,210,.18); border-radius: 7px; color: #fff4ec; display: inline-flex; flex: 0 0 auto; font-family: "DM Mono", monospace; font-size: 11px; font-weight: 700; height: 28px; justify-content: center; margin-top: 1px; text-transform: uppercase; width: 28px; }
.source-card-body { display: grid; gap: 3px; min-width: 0; }
.source-card-identity { color: var(--accent-light); font-family: "DM Mono", monospace; font-size: 9px; letter-spacing: .025em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.source-card-title { color: var(--ink); display: -webkit-box; font-size: 12px; font-weight: 650; letter-spacing: -.01em; line-height: 1.35; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.source-card-description { color: var(--muted); display: -webkit-box; font-size: 11px; line-height: 1.4; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.source-card-arrow { color: var(--faint); flex: 0 0 auto; font-size: 13px; line-height: 1; margin: 3px 0 0 auto; }
.source-card:hover .source-card-arrow, .source-card:focus-visible .source-card-arrow { color: var(--accent-light); }
.google-search-suggestions { margin-top: 9px; }
.chatbox { background: #211d19; border: 1px solid rgba(244,239,232,.14); border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.17); min-height: 126px; padding: 16px 16px 12px; transition: border .2s, box-shadow .2s; flex: 0 0 auto; }
.chatbox:focus-within { border-color: rgba(239,139,99,.55); box-shadow: 0 10px 30px rgba(0,0,0,.17), 0 0 0 3px rgba(217,104,65,.08); }
textarea { background: transparent; border: 0; color: var(--ink); font-size: 14px; line-height: 1.5; min-height: 56px; outline: 0; padding: 0 2px; resize: none; width: 100%; }
textarea::placeholder { color: #7d746c; }
.chat-actions { align-items: center; display: flex; margin-top: 6px; }
.add-button { background: transparent; border: 1px solid var(--line); border-radius: 5px; color: var(--muted); font-size: 17px; height: 26px; line-height: 20px; width: 26px; }
.add-button:disabled { cursor: not-allowed; opacity: .45; }
.deep-research-button { background: transparent; border: 1px solid var(--line); border-radius: 5px; color: var(--muted); font-family: "DM Mono", monospace; font-size: 9px; letter-spacing: .02em; margin-left: 8px; padding: 6px 8px; }
.deep-research-button:hover, .deep-research-button:focus-visible { border-color: var(--accent-light); color: var(--ink); }
.deep-research-button.active { background: rgba(217,104,65,.28); border-color: var(--accent-light); box-shadow: 0 0 0 2px rgba(217,104,65,.16); color: #fff1e9; font-weight: 700; }
.deep-research-button.active::before { background: currentColor; border-radius: 50%; content: ""; display: inline-block; height: 5px; margin: 0 5px 1px 0; vertical-align: middle; width: 5px; }
.deep-research-button.limited { border-color: #d9a441; color: #f1c36b; }
.deep-research-button:disabled { cursor: wait; opacity: .6; }
.provider-state { align-items: center; color: var(--accent-light); display: inline-flex; font-family: "DM Mono", monospace; font-size: 9px; letter-spacing: .02em; margin-left: 8px; }
.provider-state::before { background: currentColor; border-radius: 50%; content: ""; height: 5px; margin-right: 5px; opacity: .8; width: 5px; }
.hint { color: var(--faint); font-size: 10px; margin-left: 10px; }
.hint kbd { margin-left: 2px; }
.send-button { align-items: center; background: var(--accent); border-radius: 6px; display: flex; height: 29px; justify-content: center; margin-left: auto; transition: background .15s; width: 29px; }
.send-button:hover { background: var(--accent-light); }
.send-button:disabled { cursor: wait; opacity: .55; }
.send-button svg { height: 16px; width: 16px; }
.stop-button, .retry-button { background: transparent; border: 1px solid rgba(239,139,99,.55); border-radius: 6px; color: var(--accent-light); font-size: 11px; font-weight: 600; padding: 6px 9px; }
.stop-button { margin-left: auto; }
.retry-button { margin-top: 10px; }
.stop-button:hover, .stop-button:focus-visible, .retry-button:hover, .retry-button:focus-visible { background: rgba(217,104,65,.14); color: var(--ink); }
.research-progress { align-self: flex-start; background: rgba(217,104,65,.08); border: 1px solid rgba(217,104,65,.3); border-radius: 10px; color: var(--muted); display: grid; gap: 4px; max-width: 100%; padding: 10px 12px; }
.research-progress strong { color: var(--ink); font-size: 12px; font-weight: 650; }
.research-progress span { font-size: 11px; line-height: 1.4; }
.research-progress[data-state="failed"] { border-color: rgba(240,125,114,.55); }
.research-progress[data-state="cancelled"] { border-color: rgba(165,158,150,.4); }
.disclaimer { color: #68615a; font-size: 10px; margin: 12px 0; text-align: center; }

.overlay { display: none; inset: 0; position: fixed; z-index: 4; }
.popover { background: #28231f; border: 1px solid rgba(255,255,255,.12); border-radius: 12px; box-shadow: 0 18px 50px rgba(0,0,0,.42); display: none; padding: 8px; position: fixed; width: 268px; z-index: 5; }
.popover.open { display: block; animation: pop .16s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(5px) scale(.98); } to { opacity: 1; transform: scale(var(--modal-scale, 1)); } }
.popover-profile { align-items: center; display: flex; gap: 10px; padding: 9px 8px 12px; }
.popover-profile > span:last-child { display: grid; gap: 2px; }
.avatar.large { height: 35px; width: 35px; }
.popover-divider { background: var(--line); height: 1px; margin: 4px 0; }
.popover button:not(.modal-close) { align-items: center; background: transparent; border-radius: 7px; color: #ded6ce; display: flex; font-size: 13px; gap: 10px; padding: 10px 8px; text-align: left; width: 100%; }
.popover button:not(.modal-close):hover { background: rgba(255,255,255,.07); }
.menu-icon { color: var(--muted); font-size: 17px; text-align: center; width: 18px; }
.theme-value { color: var(--faint); font-size: 11px; margin-left: auto; }
.menu-arrow { color: var(--faint); font-size: 19px; margin-left: auto; }
.theme-value + .menu-arrow { margin-left: 0; }

.modal-backdrop { align-items: center; background: #000; display: none; inset: 0; justify-content: center; padding: 12px; position: fixed; z-index: 10; }
.modal-backdrop.open { display: flex; }
.modal-backdrop.account-required { align-items: center; backdrop-filter: blur(9px); background: rgba(13,10,8,.5); justify-content: center; padding: 20px; }
.sign-in-modal { --modal-scale: 1; background: linear-gradient(145deg, #302923, #211d19); border: 1px solid rgba(255,255,255,.14); border-radius: 20px; box-shadow: 0 24px 70px rgba(0,0,0,.45); max-width: 410px; overflow: hidden; padding: clamp(20px, 4.5vh, 36px); position: relative; text-align: center; transform: scale(var(--modal-scale)); transform-origin: center; width: 100%; }
.modal-backdrop.account-required .sign-in-modal { animation: pop .2s ease-out; box-shadow: 0 24px 70px rgba(0,0,0,.62), 0 0 0 1px rgba(239,139,99,.13); }
.modal-close { background: transparent; color: var(--muted); font-size: 25px; line-height: 1; position: absolute; right: 14px; top: 11px; }
.modal-mark { height: 38px; margin-bottom: 13px; width: 38px; }
.auth-kicker { color: var(--accent-light); display: block; font-family: "DM Mono", monospace; font-size: 10px; letter-spacing: .12em; margin-bottom: 8px; text-transform: uppercase; }
.sign-in-modal h2 { font-family: "Playfair Display", serif; font-size: 30px; letter-spacing: -.8px; margin: 0 0 8px; }
.sign-in-modal p { color: var(--muted); font-size: 13px; line-height: 1.5; margin: 0 0 22px; }
.google-button, .email-button { align-items: center; border-radius: 8px; display: flex; font-size: 13px; font-weight: 600; justify-content: center; padding: 12px; width: 100%; }
.google-button { background: #f7f5f2; box-shadow: 0 7px 18px rgba(0,0,0,.15); color: #24201d; gap: 10px; min-height: 52px; transition: transform .15s, background .15s; }
.google-button:hover { background: white; transform: translateY(-1px); }
.google-g { color: #4285f4; font-family: Arial, sans-serif; font-size: 18px; font-weight: 700; }
.email-button { background: var(--accent); border: 1px solid transparent; color: #25130c; }
.email-button:hover { background: var(--accent-light); }
.email-auth-form, .onboarding-form { display: grid; gap: 9px; }
.password-field { position: relative; }
.password-field .email-input { padding-right: 57px; }
.password-toggle { background: transparent; color: var(--accent-light); font-family: "DM Mono", monospace; font-size: 10px; font-weight: 500; letter-spacing: .04em; padding: 6px; position: absolute; right: 7px; top: 50%; transform: translateY(-50%); }
.password-toggle:hover, .password-toggle:focus-visible { color: var(--ink); }
.onboarding-form[hidden] { display: none; }
.sign-in-modal.onboarding .auth-content { display: none; }
.sign-in-modal.onboarding .modal-mark { margin-bottom: 13px; }
.onboarding-form p { color: var(--muted); font-size: 13px; line-height: 1.5; margin: 0 0 13px; }
.verification-panel[hidden] { display: none; }
.sign-in-modal.verification .auth-kicker,
.sign-in-modal.verification .modal-mark,
.sign-in-modal.verification > h2,
.sign-in-modal.verification .auth-content { display: none; }
.verification-panel { text-align: center; }
.verification-panel .auth-kicker { margin-bottom: 10px; }
.verification-panel h2 { margin-bottom: 9px; }
.verification-panel p { margin-bottom: 18px; }
.verification-panel p strong { color: var(--ink); font-weight: 600; overflow-wrap: anywhere; }
.verification-form { display: grid; gap: 10px; }
.verification-code { font-family: "DM Mono", monospace; font-size: 19px; letter-spacing: .36em; padding-left: calc(12px + .36em); text-align: center; }
.verification-status { color: var(--muted); font-size: 11px; line-height: 1.45; margin: 12px 0 0; min-height: 1.45em; }
.verification-status.is-error { color: #f1a18a; }
.verification-links { display: flex; gap: 16px; justify-content: center; margin-top: 18px; }
.text-button { background: transparent; color: var(--accent-light); font-size: 11px; padding: 2px; text-decoration: underline; text-underline-offset: 3px; }
.text-button:hover, .text-button:focus-visible { color: var(--ink); }
.email-button:disabled, .text-button:disabled { cursor: wait; opacity: .6; }
.forgot-password-link { margin: 12px auto -3px; }
.email-input { background: rgba(255,255,255,.045); border: 1px solid rgba(255,255,255,.15); border-radius: 9px; color: var(--ink); font: inherit; font-size: 13px; outline: 0; padding: 12px; width: 100%; }
.email-input:focus { border-color: var(--accent-light); box-shadow: 0 0 0 3px rgba(217,104,65,.1); }
.signup-fields { display: grid; gap: 9px; }
.auth-mode { background: rgba(0,0,0,.2); border: 1px solid var(--line); border-radius: 10px; display: grid; gap: 4px; grid-template-columns: 1fr 1fr; margin: 0 0 12px; padding: 4px; }
.auth-mode-button { background: transparent; border-radius: 7px; color: var(--muted); font-size: 12px; font-weight: 600; padding: 9px; }
.auth-mode-button.active { background: rgba(255,255,255,.11); color: var(--ink); }
.or { align-items: center; color: var(--faint); display: flex; font-family: "DM Mono", monospace; font-size: 9px; gap: 10px; margin: 19px 0 14px; text-transform: uppercase; }
.or span { background: var(--line); height: 1px; width: 100%; }
.sign-in-modal small { color: var(--faint); display: block; font-size: 10px; line-height: 1.5; margin-top: 17px; }
.settings-backdrop { overflow-y: auto; }
.settings-modal { background: linear-gradient(145deg, #302923, #211d19); border: 1px solid rgba(255,255,255,.14); border-radius: 20px; box-shadow: 0 24px 70px rgba(0,0,0,.45); max-width: 500px; padding: 30px; position: relative; width: 100%; }
.settings-modal h2 { font-family: "Playfair Display", serif; font-size: 29px; letter-spacing: -.7px; margin: 0 0 6px; }
.settings-description { color: var(--muted); font-size: 13px; line-height: 1.5; margin: 0 0 18px; }
.settings-tabs { border-bottom: 1px solid var(--line); display: flex; gap: 3px; margin-bottom: 15px; overflow-x: auto; }
.settings-tab { background: transparent; border-bottom: 2px solid transparent; color: var(--muted); font-size: 12px; font-weight: 600; padding: 9px 10px; white-space: nowrap; }
.settings-tab.active { border-color: var(--accent-light); color: var(--ink); }
.settings-tab.danger-tab.active { border-color: #f07d72; color: #ffaaa1; }
.settings-status { color: var(--muted); font-size: 12px; line-height: 1.45; min-height: 1.45em; margin: 0 0 12px; }
.settings-status.is-error { color: #f1a18a; }
.settings-status.is-success { color: #a8d89b; }
.settings-form { display: grid; gap: 8px; text-align: left; }
.settings-form label { color: var(--muted); font-size: 12px; font-weight: 600; margin-top: 4px; }
.settings-form h3, .delete-warning h3 { font-size: 15px; margin: 0; }
.settings-form p, .delete-warning p { color: var(--muted); font-size: 12px; line-height: 1.5; margin: 0 0 4px; }
.settings-form-separated { border-top: 1px solid var(--line); margin-top: 21px; padding-top: 21px; }
.delete-warning { background: rgba(190,58,49,.13); border: 1px solid rgba(240,125,114,.35); border-radius: 10px; margin-bottom: 15px; padding: 13px; }
.delete-warning h3 { color: #ffaaa1; }
.delete-warning p { margin-top: 6px; }
.delete-button { background: transparent; border: 1px solid #d46157; border-radius: 8px; color: #ffaaa1; font-size: 13px; font-weight: 700; padding: 12px; }
.delete-button:hover:not(:disabled), .delete-button:focus-visible { background: rgba(190,58,49,.18); }
.delete-button:disabled { cursor: not-allowed; opacity: .5; }
.toast { background: #eee7dd; border-radius: 7px; bottom: 25px; color: #241f1b; display: none; font-size: 13px; font-weight: 600; left: 50%; padding: 11px 15px; position: fixed; transform: translateX(-50%); z-index: 20; }
.toast.show { display: block; animation: pop .18s ease-out; }
.sr-only { clip: rect(0,0,0,0); clip-path: inset(50%); height: 1px; overflow: hidden; position: absolute; white-space: nowrap; width: 1px; }

@keyframes dot-bounce { 0%, 60%, 100% { opacity: .35; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-4px); } }

body.light { --ink: #261f1a; --muted: #736b63; --faint: #958b81; --bg: #f6f2eb; --panel: #fffdfa; --panel-2: #eee7de; --line: rgba(64,42,28,.12); --cream: #2a201b; }
body.light .sidebar { background: #eee8df; }
body.light .main-content { background: radial-gradient(circle at 55% 22%, #fffdf9 0, var(--bg) 43%); }
body.light .chatbox { background: #fffdf9; }
body.light .popover, body.light .sign-in-modal { background: #fffdfa; }
body.light .settings-modal { background: #fffdfa; }
body.light .popover button:not(.modal-close) { color: #312821; }
body.light .sign-in { color: #fff; }
body.light .source-toggle { background: rgba(64,42,28,.035); }
body.light .source-toggle-count { background: rgba(64,42,28,.1); }
body.light .grounding-source-panel { background: linear-gradient(145deg, #fffdfa, #f2ece4); border-color: rgba(64,42,28,.14); box-shadow: 0 18px 42px rgba(50,35,24,.16), 0 2px 7px rgba(50,35,24,.1); }
body.light .source-card { background: rgba(64,42,28,.04); }
body.light .source-card:hover, body.light .source-card:focus-visible { background: rgba(64,42,28,.075); }
body.light .source-card-mark { background: linear-gradient(145deg, #c4775b, #8d5542); }

@media (max-width: 780px) {
  .sidebar { box-shadow: 8px 0 30px rgba(0,0,0,.24); left: -280px; position: fixed; top: 0; transition: left .25s ease; z-index: 6; }
  .sidebar.open { left: 0; }
  .overlay.open { display: block; }
  .mobile-menu { display: block; }
  .topbar { padding: 0 18px; }
  .welcome { margin-top: 4vh; }
  .prompt-grid { grid-template-columns: 1fr; margin-top: 31px; }
  .prompt-card { padding: 11px 13px; }
}
@media (max-width: 440px) {
  .welcome { padding: 0 17px; }
  h1 { font-size: 43px; letter-spacing: -1.8px; }
  .hint { display: none; }
  .chat-actions { gap: 6px; }
  .deep-research-button { margin-left: 0; }
  .provider-state { display: none; }
  .chat-message { max-width: 94%; }
  .modal-backdrop { align-items: flex-end; padding: 0; }
  .sign-in-modal { border-radius: 20px 20px 0 0; max-height: 92dvh; overflow-y: auto; }
  .settings-backdrop { align-items: flex-end; padding: 0; }
  .settings-modal { border-radius: 20px 20px 0 0; max-height: 92dvh; overflow-y: auto; padding: 24px 20px; }
}

@media (max-height: 700px) {
  .modal-backdrop { padding: 12px; }
  .sign-in-modal { border-radius: 16px; max-width: 390px; padding: 16px 26px; }
  .modal-mark { height: 30px; margin-bottom: 7px; width: 30px; }
  .auth-kicker { margin-bottom: 4px; }
  .sign-in-modal h2 { font-size: 25px; margin-bottom: 5px; }
  .sign-in-modal p { font-size: 12px; line-height: 1.35; margin-bottom: 12px; }
  .google-button, .email-button { padding: 9px; }
  .or { margin: 10px 0 8px; }
  .auth-mode { margin-bottom: 8px; }
  .auth-mode-button { padding: 7px; }
  .email-auth-form, .onboarding-form, .signup-fields { gap: 7px; }
  .email-input { padding: 9px 12px; }
  .sign-in-modal small { font-size: 9px; line-height: 1.35; margin-top: 9px; }
}

@media (max-height: 500px) {
  .sign-in-modal { padding: 12px 22px; }
  .modal-mark { display: none; }
  .auth-kicker { font-size: 9px; }
  .sign-in-modal h2 { font-size: 22px; }
  .sign-in-modal small { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}
