/* Focus, scrolling, and small interaction details for Nova's core theme. */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

::selection {
  color: var(--accent-ink);
  background: var(--accent);
}

* {
  scrollbar-color: #55554d transparent;
  scrollbar-width: thin;
}

*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: #494941; border: 2px solid transparent; border-radius: 8px; background-clip: padding-box; }
*::-webkit-scrollbar-thumb:hover { background-color: #69695f; }

.message-body pre {
  position: relative;
  padding-top: 37px;
}

.copy-code {
  position: absolute;
  top: 7px;
  right: 8px;
  border: 1px solid #484840;
  border-radius: 5px;
  padding: 3px 8px;
  background: #252522;
  color: #d0cfc6;
  font-size: 10px;
  line-height: 1.5;
  transition: background .16s ease, border-color .16s ease;
}

.copy-code:hover { background: #34342f; border-color: #74746a; }
.character-count { color: #96958d; font-size: 9px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.character-count.near-limit { color: #f0b56c; }
.composer textarea:focus-visible { outline: none; }
.composer:focus-within { box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 24%, transparent), 0 7px 30px #0002; }
button, .suggestion, .nav-item, .history-item { -webkit-tap-highlight-color: transparent; }

body.light * { scrollbar-color: #c3c2b9 transparent; }
body.light *::-webkit-scrollbar-thumb { background-color: #c3c2b9; }
body.light .copy-code { background: #e4e3da; color: #30302a; border-color: #c9c8be; }
body.light .copy-code:hover { background: #d8d7cc; }
body.light .character-count { color: #67665e; }
body.light .character-count.near-limit { color: #985d17; }

@media (max-width: 480px) {
  .character-count { font-size: 8px; }
  .tool-right { gap: 4px; }
}

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

.model-badge,.message-model{font-size:9px;letter-spacing:.01em;color:var(--muted);white-space:nowrap}
.message-model { display: inline-flex; align-self: flex-start; margin: 0; padding: 0; border: 0; border-radius: 0; color: var(--muted); font-size: 10px; }
.signin-btn{border:1px solid var(--line);border-radius:7px;background:var(--surface);color:var(--text);padding:6px 10px;font-size:11px}
.signin-btn:hover{border-color:var(--accent)}
.profile-menu{display:flex;align-items:center;gap:7px}
.profile-avatar{width:26px;height:26px;border-radius:50%;display:grid;place-items:center;background:var(--accent);color:var(--accent-ink);font-size:11px;font-weight:700}
.profile-name{max-width:120px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:10px;color:var(--soft)}
.profile-menu .setting-action{font-size:10px}
.top-actions{min-width:0}
@media(max-width:700px){.model-badge{display:none}.profile-name{display:none}.profile-menu{gap:4px}}

/* Workspace refinement */
:root {
  --bg: #141411;
  --side: #191916;
  --surface: #1e1e1a;
  --surface2: #282822;
  --line: #34342e;
  --text: #f0efe8;
  --muted: #aaa99e;
  --soft: #cecdc3;
  --accent: #c9d9a2;
  --accent-ink: #22271a;
  --serif: Inter, "DM Sans", "Segoe UI", sans-serif;
}

body { font-family: Inter, "DM Sans", "Segoe UI Variable", "Segoe UI", sans-serif; font-size: 14px; letter-spacing: .005em; }
.sidebar { padding: 22px 14px 14px; background: var(--side); border-color: #292923; }
.brand { margin-bottom: 25px; font-size: 21px; letter-spacing: -.04em; }
.brand-mark { font-size: 21px; }
.new-chat { border-radius: 9px; box-shadow: 0 2px 8px #0002; }
.nav-item { height: 40px; border-radius: 8px; }
.topbar { height: 64px; border-color: #292923; }
.model-name { font-size: 14px; letter-spacing: -.01em; }
.chat-scroll { scroll-behavior: smooth; }
.welcome { width: min(620px, 100%); }
.welcome h1, .library-heading h1 { font-family: Inter, "DM Sans", "Segoe UI", sans-serif; font-size: clamp(35px, 4.4vw, 49px); font-weight: 500; letter-spacing: -.045em; line-height: 1.12; }
.welcome-sub { font-size: 14px; color: #b0afa5; line-height: 1.8; }
.suggestion { min-height: 72px; border-radius: 11px; padding: 12px; background: #191916; box-shadow: 0 2px 10px #0001; }
.suggestion strong { font-size: 12px; }
.suggestion small { font-size: 10.5px; }
.composer { border-radius: 15px; padding: 14px 14px 9px; background: #1b1b18; box-shadow: 0 10px 38px #0003; }
.composer textarea { font-size: 14px; line-height: 1.65; padding: 3px 6px 10px; }
.composer:focus-within { border-color: #7d8867; }
.messages { width: min(790px, 100%); gap: 20px; }
.message { gap: 13px; }
.message.assistant { flex-direction: column; align-items: flex-start; gap: 6px; }
.message-body { font-size: 14px; line-height: 1.8; }
.message.assistant .message-body { max-width: min(680px, 100%); padding: 10px 14px; background: var(--surface); border-radius: 12px; }
.message.user .message-body { border-radius: 14px 14px 4px 14px; }
.assistant-mark { border-radius: 9px; }
.message-actions { margin-left: 0; }
.message-action { border: 0; border-radius: 6px; background: transparent; color: var(--muted); padding: 4px 7px; font-size: 10px; transition: color .15s, background .15s; }
.message-action:hover { color: var(--text); background: var(--surface2); }
.library-heading { margin-bottom: 7px; }
.library-heading h1 { margin: 0 0 6px; font-size: 32px; }
.library-heading > p:last-child, .library-empty, .history-empty { color: var(--muted); font-size: 12px; }
.saved-card { margin: 8px 0 12px 38px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: 0 3px 12px #0001; }
.saved-card-head { display: flex; align-items: center; gap: 7px; margin-bottom: 12px; color: var(--soft); font-size: 11px; }
.saved-card-head strong { margin-right: auto; }
.saved-card .message-body { max-width: 100%; }
.history-row { position: relative; display: flex; align-items: center; margin: 1px 0; border-radius: 8px; }
.history-row:hover, .history-row.current { background: #24241f; }
.history-row .history-item { flex: 1; min-width: 0; padding-right: 32px; color: var(--soft); background: transparent; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.history-row.current .history-item, .history-row:hover .history-item { color: var(--text); }
.history-delete { position: absolute; display: none; right: 4px; top: 4px; width: 30px; height: 30px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); font-size: 17px; }
.history-row:hover .history-delete, .history-row:focus-within .history-delete { display: block; }
.history-delete:hover { color: #f2a99b; background: var(--surface2); }
.history-empty { padding: 0 10px; }
.workspace-note { margin-top: 10px; padding: 13px 10px 2px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; }
.workspace-dot { display: inline-block; width: 6px; height: 6px; margin-right: 6px; border-radius: 50%; background: #a5c47b; }
.nav-backdrop { display: none; }
.nav-backdrop.visible { display: block; position: fixed; z-index: 4; inset: 0; border: 0; background: #090907a8; backdrop-filter: blur(2px); }
.share-btn:disabled { opacity: .45; cursor: default; }
.share-btn:not(:disabled):hover, .setting-action:hover { background: var(--surface2); }
.connection { color: var(--muted); }
.disclaimer { font-size: 10px; }
.toast { z-index: 30; box-shadow: 0 10px 36px #0004; }
.history-head .side-label { padding-left: 10px; }
body.light { --bg: #f5f4ef; --side: #eeede8; --surface: #fffefa; --surface2: #e8e7df; --line: #dfded6; --text: #282821; --muted: #737269; --soft: #55554c; --accent: #53643a; --accent-ink: #fff; }
body.light .sidebar { border-color: #dfded6; }
body.light .topbar { border-color: #e1e0d8; }
body.light .suggestion { background: #fbfaf6; box-shadow: 0 2px 10px #3d39230b; }
body.light .suggestion:hover { background: #f0efe8; }
body.light .composer { background: #fffefa; box-shadow: 0 8px 28px #574f2710; }
body.light .welcome-sub { color: #69685f; }
body.light .history-row:hover, body.light .history-row.current { background: #e3e2da; }
body.light .message.user .message-body { background: #e9e8e0; }
body.light .saved-card { background: #fffefa; box-shadow: 0 3px 12px #574f270b; }

.source-tools { display: flex; min-height: 27px; align-items: center; gap: 9px; padding: 0 5px 6px; }
.source-toggle { padding: 4px 5px; color: var(--accent); font-size: 10px; }
.source-toggle:hover { color: var(--text); }
.source-summary { overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.source-panel { padding: 4px 5px 11px; }
.source-entry { display: flex; gap: 8px; }
.source-entry input { min-width: 0; flex: 1; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; outline: none; background: var(--bg); color: var(--text); font: inherit; font-size: 11px; }
.source-entry input:focus { border-color: color-mix(in srgb, var(--accent) 70%, var(--line)); }
.source-entry .setting-action { flex: none; padding: 7px 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface2); color: var(--text); font-size: 10px; }
.source-hint { margin: 7px 1px 0; color: var(--muted); font-size: 9px; line-height: 1.5; }
.source-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.source-chip { display: inline-flex; max-width: 100%; align-items: center; gap: 5px; padding: 4px 6px 4px 9px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface2); color: var(--soft); font-size: 9px; }
.source-chip > span { max-width: min(52vw, 340px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.source-chip button { width: 19px; height: 19px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); font-size: 14px; line-height: 1; }
.source-chip button:hover { background: var(--line); color: var(--text); }
.source-panel.hidden { display: none; }

/* Clear: bright, calm canvas inspired by the supplied reference. */
:root {
  --bg: #ffffff;
  --side: #ffffff;
  --surface: #ffffff;
  --surface2: #f3f2ef;
  --line: #e4e2dd;
  --text: #25231f;
  --muted: #77746e;
  --soft: #4f4c46;
  --accent: #e87952;
  --accent-ink: #ffffff;
  --serif: Georgia, "Times New Roman", serif;
}

body, body.light {
  background: #fff;
  color: #25231f;
  --bg: #ffffff;
  --side: #ffffff;
  --surface: #ffffff;
  --surface2: #f3f2ef;
  --line: #e4e2dd;
  --text: #25231f;
  --muted: #77746e;
  --soft: #4f4c46;
  --accent: #e87952;
  --accent-ink: #ffffff;
}

.app-shell { background: #fff; }
.sidebar { width: 278px; padding: 18px 13px 12px; background: #fff; border-color: #e9e8e4; }
.brand { margin-bottom: 20px; font: 600 20px/1.2 Inter, "Segoe UI", sans-serif; letter-spacing: -.045em; }
.brand-mark, .welcome-symbol { color: #e87952; }
.brand-mark, .welcome-symbol, .splash-mark, .assistant-mark, .suggestion-icon, .spark-mini { display: inline-grid; place-items: center; }
.brand-mark svg { display: block; width: 23px; height: 23px; overflow: visible; }
.welcome-symbol svg { display: block; width: 34px; height: 34px; overflow: visible; }
.splash-mark svg { display: block; width: 48px; height: 48px; overflow: visible; }
.assistant-mark svg { display: block; width: 16px; height: 16px; overflow: visible; }
.suggestion-icon svg, .spark-mini svg { display: block; width: 16px; height: 16px; overflow: visible; }
.brand-mark svg path, .welcome-symbol svg path, .splash-mark svg path, .assistant-mark svg path, .suggestion-icon svg path, .spark-mini svg path { fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; }
.brand-mark svg circle, .welcome-symbol svg circle, .splash-mark svg circle, .assistant-mark svg circle, .suggestion-icon svg circle, .spark-mini svg circle { fill: currentColor; }
.new-chat { height: 38px; color: #292722; background: #f0efec; border: 1px solid #eeede9; box-shadow: none; font-weight: 500; }
.new-chat:hover { background: #e9e8e4; }
body .new-chat { color: #292722; background: #f0efec; }
body .new-chat:hover { background: #e9e8e4; }
#newChat { color: #292722; background: #f0efec; border: 1px solid #eeede9; }
#newChat:hover { background: #e9e8e4; }
.brand .collapse { display: none; }
.nav-item { color: #57544e; }
.nav-item:hover, .nav-item.active { color: #27251f; background: #f3f2ef; }
.nav-icon { color: #77746e; }
.side-label { color: #85817a; }
.history-row:hover, .history-row.current { background: #f3f2ef; }
.history-row .history-item { color: #5b5852; }
.history-row.current .history-item, .history-row:hover .history-item { color: #282620; }
.workspace-note, .profile { border-color: #e9e8e4; }
.topbar { height: 58px; padding: 0 28px; background: #fff; border: 0; }
.model-name { color: #292722; font-size: 14px; font-weight: 600; }
.top-actions { gap: 10px; }
.connection { color: #78756e; font-size: 11px; }
.connection i { background: #aaa69e; }
.connection.ready i { background: #5c9b6a; }
.icon-btn { color: #66625c; }
.icon-btn:hover { color: #292722; background: #f1f0ed; }
.chat-scroll { padding: 0 26px; }
.welcome { width: min(660px, 100%); transform: translateY(-16px); padding: 22px 0 28px; }
.welcome-symbol { margin-bottom: 17px; font-size: 37px; }
.welcome .eyebrow { display: none; }
.welcome h1 { color: #27241f; font: 400 clamp(35px, 4vw, 45px)/1.18 Georgia, "Times New Roman", serif; letter-spacing: -.035em; }
.welcome-sub { margin: 11px 0 29px; color: #79756f; font-size: 14px; line-height: 1.6; }
.suggestions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; text-align: left; }
.suggestion { min-height: 36px; gap: 0; padding: 7px 13px; color: #37342e; background: #fff; border: 1px solid #e5e3de; border-radius: 9px; box-shadow: 0 1px 2px #28251b08; }
.suggestion:hover { background: #faf9f7; border-color: #d4d1ca; }
.suggestion-icon, .suggestion small, .suggestion-arrow { display: none; }
.suggestion strong { font-size: 12px; font-weight: 500; }
.privacy-note { margin-top: 20px; color: #9a968f; }
.composer-wrap { padding: 0 25px 13px; }
.composer { width: min(642px, 100%); padding: 13px 14px 9px; background: #fff; border: 1px solid #dfddd8; border-radius: 17px; box-shadow: 0 5px 20px #403a2b0d; }
.composer:focus-within { border-color: #c9c5bd; box-shadow: 0 0 0 2px #e8795214, 0 5px 20px #403a2b0d; }
.composer textarea { min-height: 42px; padding: 3px 4px 9px; color: #292722; font-size: 14px; }
.composer textarea::placeholder { color: #8a867f; }
.source-tools { min-height: 23px; padding-bottom: 3px; }
.source-toggle { color: #68645d; font-size: 10px; }
.source-summary { display: none; }
.tool-btn { color: #625f58; }
.tool-btn:hover { background: #f1f0ed; }
.agent-select-wrap { color: #5d5952; border-color: #e9e7e2; }
.agent-select-wrap select { color: #4f4b45; }
.agent-select-wrap option { background: #fff; color: #25231f; }
.spark-mini { color: #e87952; }
.send-btn { color: #fff; background: #e87952; border-radius: 9px; }
.send-btn:hover { filter: brightness(.96); }
.shortcut, .character-count { color: #8b877f; }
.disclaimer { color: #96928b; font-size: 10px; }
.message-body { color: #34312b; }
.message.user .message-body { color: #2d2a24; background: #f2f1ee; border-color: #e8e6e1; }
.assistant-mark { color: #e87952; border-color: #f1d6cb; }
.message-body pre { background: #f6f5f2; border-color: #e5e3de; }
.message-body code { background: #f1f0ed; }
.message-body blockquote { color: #68645d; border-color: #e87952; }
.message-body a { color: #b95432; }
.message-actions button { color: #77736c; }
.message-actions { opacity: 1; }
.message-actions button { color: #69655e; }
.message-actions button:focus-visible, .attachment-remove:focus-visible { outline: 2px solid #b95432; outline-offset: 2px; }
.response-error { margin: 10px 0 0; padding: 9px 11px; color: #8f392d; background: #fff2ef; border: 1px solid #f0c9c0; border-radius: 8px; font-size: 12px; }
.attachment-status { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 8px; padding: 7px 10px; color: #4c4942; background: #f7f6f2; border: 1px solid #e5e3dd; border-radius: 8px; font-size: 11px; }
.attachment-remove { width: 24px; height: 24px; border: 0; border-radius: 6px; color: #66625b; background: transparent; font-size: 16px; }
.attachment-remove:hover { background: #e9e7e1; }
.message-body .table-wrap { max-width: 100%; margin: 12px 0; overflow-x: auto; border: 1px solid #e5e3de; border-radius: 8px; }
.message-body table { width: 100%; border-collapse: collapse; font-size: 12px; }
.message-body th, .message-body td { padding: 8px 10px; border-bottom: 1px solid #e5e3de; text-align: left; vertical-align: top; }
.message-body th { background: #f6f5f2; font-weight: 600; }
.message-body tr:last-child td { border-bottom: 0; }
.toast { background: #2d2a25; color: #fff; }
dialog { background: #fff; color: #25231f; border-color: #e4e2dd; box-shadow: 0 20px 80px #28251b1f; }
dialog::backdrop { background: #1f1d1970; }
.setting-action { color: #45413b; background: #f7f6f3; border-color: #e4e2dd; }
.setting-status { color: #5c9b6a; }
.splash-screen { color: #25231f; background: #fff; }
.splash-wordmark { color: #25231f; }
.splash-mark { color: #e87952; }
.splash-tagline { color: #77746e; }
.splash-caption { color: #929088; }

@media (max-width: 700px) {
  .sidebar { background: #fff; }
  .topbar { padding: 0 14px; }
  .chat-scroll { padding: 0 16px; }
  .welcome { transform: none; }
  .welcome h1 { font-size: 35px; }
  .composer-wrap { padding: 0 12px 74px; }
  .suggestions { gap: 7px; }
  .suggestion { padding-inline: 11px; }
}

.splash-screen { position: fixed; z-index: 1000; inset: 0; display: grid; place-items: center; overflow: hidden; color: var(--text); background: var(--bg); opacity: 1; transition: opacity .35s ease, transform .35s ease; }
.splash-content { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; transform: translateY(10px); opacity: 0; }
.is-playing .splash-content { animation: splash-content-in .65s .12s cubic-bezier(.2,.75,.25,1) forwards; }
.splash-mark { color: var(--accent); font-size: 48px; line-height: 1; transform: scale(.6); }
.is-playing .splash-mark { animation: splash-mark-in .75s .14s cubic-bezier(.16,1,.3,1) forwards; }
.splash-wordmark { margin-top: 15px; font-size: 32px; font-weight: 600; letter-spacing: -.07em; }
.splash-wordmark span { margin-left: 6px; color: var(--muted); font-size: 10px; font-weight: 500; letter-spacing: .12em; vertical-align: top; }
.splash-tagline { margin: 7px 0 24px; color: var(--muted); font-family: Inter, "DM Sans", "Segoe UI", sans-serif; font-size: 16px; font-style: normal; }
.splash-progress { width: 132px; height: 2px; overflow: hidden; border-radius: 2px; background: color-mix(in srgb, var(--muted) 20%, transparent); }
.splash-progress span { display: block; width: 100%; height: 100%; background: var(--accent); transform: scaleX(0); transform-origin: left center; }
.is-playing .splash-progress span { animation: splash-progress 2.8s cubic-bezier(.4,0,.2,1) forwards; }
.splash-caption { position: absolute; bottom: 34px; color: var(--muted); font-size: 9px; letter-spacing: .18em; opacity: 0; }
.is-playing .splash-caption { animation: splash-content-in .5s .4s ease forwards; }
.splash-screen.is-leaving { opacity: 0; transform: scale(1.015); pointer-events: none; }
.app-shell { transition: opacity .35s ease, transform .35s ease; }
.app-shell.is-entering { transform: translateY(8px); opacity: 0; }
.app-shell.is-visible { transform: translateY(0); opacity: 1; }
@keyframes splash-content-in { to { transform: translateY(0); opacity: 1; } }
@keyframes splash-mark-in { to { transform: scale(1); } }
@keyframes splash-progress { to { transform: scaleX(1); } }
@media (prefers-reduced-motion: reduce) {
  .splash-screen, .app-shell { transition-duration: .15s; }
  .is-playing .splash-content, .is-playing .splash-mark, .is-playing .splash-progress span, .is-playing .splash-caption { animation-duration: .25s; }
}

@media (max-width: 700px) {
  .sidebar { z-index: 6; }
  .nav-backdrop.visible { z-index: 5; }
  .topbar { padding: 0 15px; }
  .welcome h1 { font-size: 37px; }
  .welcome { padding: 22px 0; }
  .messages { padding-top: 28px; }
  .saved-card { margin-left: 0; }
}

@media (max-width: 390px) {
  .connection { display: none; }
  .topbar { padding: 0 10px; }
  .composer-wrap { padding-right: 10px; padding-left: 10px; }
  .tool-left { gap: 2px; }
  .tool-btn { padding-right: 4px; padding-left: 4px; }
  .agent-select-wrap { padding-left: 6px; }
}

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