:root {
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font-synthesis: none;
  color: #24392e;
  background: #f8faf6;
  --green: #244f3c;
  --green-hover: #193e2d;
  --ink: #24392e;
  --muted: #58695d;
  --line: #d7e1d5;
  --surface: #fff;
  --canvas: #fafbf8;
  --focus: #316b50;
  --link: #195c43;
}
* { box-sizing: border-box; }
body { margin: 0; font-size: 16px; line-height: 1.6; }
button, input, textarea, select { font: inherit; }
button, a, input, textarea, select { -webkit-tap-highlight-color: transparent; }
button { border: 0; cursor: pointer; }
button:disabled { cursor: wait; opacity: .58; }
button:focus-visible, a:focus-visible, summary:focus-visible, .md-table-wrap:focus-visible {
  outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px;
}
input:focus, textarea:focus, select:focus { outline: 2px solid var(--focus); outline-offset: 2px; }
a { color: var(--link); text-decoration: underline; text-decoration-thickness: .08em; text-underline-offset: .18em; }
a:hover { color: #103e2d; text-decoration-thickness: .12em; }
[hidden] { display: none !important; }
h1, h2, h3, h4, h5, h6, p { margin: 0; }
input, textarea, select {
  width: 100%; border: 1px solid #b9c8b7; border-radius: 8px; padding: 12px;
  color: var(--ink); background: var(--surface);
}
input::placeholder, textarea::placeholder { color: #66765f; opacity: 1; }
textarea { resize: vertical; line-height: 1.65; }
label { display: block; font-size: 14px; font-weight: 600; }
label input, label textarea, label select { display: block; margin-top: 8px; }
small { font-size: 12px; }
.brand {
  display: flex; align-items: center; gap: 10px; width: fit-content; color: var(--ink);
  font-size: 23px; font-weight: 650; letter-spacing: -.7px; text-decoration: none;
}
.brand:hover { color: var(--green); text-decoration: none; }
.brand-mark {
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 34px; height: 34px; padding-right: 2px; border-radius: 9px;
  background: var(--green); color: #fff; font-size: 21px; font-weight: 600; letter-spacing: -2px;
}
.eyebrow { color: #536c58; font-size: 11px; font-weight: 650; letter-spacing: 1.4px; }
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  min-height: 44px; padding: 11px 17px; border-radius: 8px; font-size: 14px; font-weight: 600;
}
.primary { color: #fff; background: var(--green); }
.primary:hover { background: var(--green-hover); }
.icon-button {
  min-width: 36px; min-height: 36px; padding: 8px; border-radius: 7px;
  color: #4d6352; background: transparent; font-size: 21px; line-height: 1;
}
.icon-button:hover { background: #e5ede3; }
.status-dot { display: inline-block; flex-shrink: 0; width: 7px; height: 7px; border-radius: 50%; background: #527658; }
.status-dot.amber { background: #9c7525; }
.text-button { padding: 8px 0; color: #315e3a; background: transparent; font-size: 13px; font-weight: 550; }
.text-button:hover { text-decoration: underline; text-underline-offset: 3px; }
.text-button.muted { color: #58695d; }

/* Access and profile selection. */
.auth-view { display: grid; grid-template-columns: 46% 54%; min-height: 100dvh; background: #fff; }
.auth-brand {
  position: relative; display: flex; flex-direction: column; justify-content: space-between;
  overflow: hidden; padding: 42px 54px; background: #edf3e9;
}
.auth-brand::after {
  position: absolute; top: 24%; right: -270px; width: 410px; height: 410px;
  border: 1px solid #d2dfcf; border-radius: 50%; box-shadow: 0 0 0 70px #e9f0e5, 0 0 0 71px #d9e5d5;
  content: ""; pointer-events: none;
}
.auth-intro { z-index: 1; padding: 70px 0 100px; }
.auth-intro h1 { margin: 22px 0; font-size: clamp(40px, 4.4vw, 67px); line-height: 1.13; font-weight: 500; letter-spacing: -2.5px; }
.auth-intro > p { color: #506a56; font-size: 16px; line-height: 1.8; }
.connected-services { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 30px; }
.connected-services span { padding: 6px 10px; border: 1px solid #bfcebb; border-radius: 6px; color: #415f48; font-size: 13px; }
.auth-footer { z-index: 1; display: flex; align-items: center; gap: 8px; color: #516c57; font-size: 13px; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 48px; }
.auth-form { width: 100%; max-width: 370px; }
.auth-form h2 { margin: 16px 0 10px; font-size: 29px; font-weight: 600; letter-spacing: -.7px; line-height: 1.3; }
.auth-form section > p, .auth-form > p, .auth-form > div > p { color: var(--muted); font-size: 15px; line-height: 1.7; }
.auth-form > label { margin-top: 24px; }
.auth-form input { padding: 13px; font-size: 16px; }
.auth-form > .button { justify-content: space-between; width: 100%; margin-top: 27px; }
.auth-form .auth-hint { margin-top: 20px; color: #52644f; font-size: 13px; line-height: 1.65; text-align: center; }
.auth-form .inline-error { margin-top: 15px; color: #983d2b; font-size: 14px; line-height: 1.65; }
#password-form { margin-top: 26px; }
#password-form label + label { margin-top: 19px; }
#password-form .button, #profile-form > .button { justify-content: space-between; width: 100%; margin-top: 24px; }
#password-form .password-guidance { margin-top: 12px; color: #586b57; font-size: 13px; line-height: 1.65; }
.auth-logout { display: block; margin: 15px auto 0; }
.profile-list { display: flex; flex-direction: column; gap: 10px; margin: 24px 0; }
.profile-option { display: flex; align-items: center; gap: 12px; padding: 14px; border: 1px solid #cddbc6; border-radius: 8px; color: #35512d; background: #f1f6ec; font-size: 15px; text-align: left; }
.profile-option:hover { background: #e6efde; }
.profile-option span:last-child { margin-left: auto; color: #52674a; }

/* The chat keeps readable prose inside a wider workspace for tables. */
.app { display: flex; height: 100dvh; overflow: hidden; }
.sidebar { display: flex; flex-direction: column; flex-shrink: 0; width: 260px; min-height: 0; padding: 25px 18px 0; border-right: 1px solid var(--line); background: #edf2e9; }
.sidebar > .brand { padding-left: 5px; font-size: 22px; }
.workspace-label, .section-label { color: #566d54; font-size: 11px; font-weight: 650; letter-spacing: 1px; }
.workspace-label { margin: 29px 6px 13px; }
.section-label { margin: 25px 7px 10px; }
.new-chat { justify-content: flex-start; border: 1px solid #c6d5c0; color: #304f34; background: #fff; }
.new-chat:hover { border-color: #7f9b77; background: #fbfdf8; }
.new-chat span { font-size: 22px; font-weight: 400; }
.chat-list { display: flex; flex: 1; flex-direction: column; min-height: 0; gap: 4px; overflow-y: auto; }
.chat-list button { display: block; flex-shrink: 0; width: 100%; overflow: hidden; padding: 11px 12px; border: 1px solid transparent; border-radius: 7px; color: #4a624b; background: transparent; font-size: 14px; line-height: 1.5; text-align: left; text-overflow: ellipsis; white-space: nowrap; }
.chat-list button:hover { background: #e3ecde; }
.chat-list button.active { border-color: #c7d7bf; color: #24472a; background: #dce8d5; font-weight: 600; }
.empty-list { padding: 10px 7px; color: #5d7058; font-size: 13px; line-height: 1.65; }
.sidebar-bottom { margin-top: auto; padding-top: 16px; }
.memory-link { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 5px 16px; color: #3e5e3b; background: transparent; font-size: 14px; text-align: left; }
.memory-link:hover { color: #224b28; }
.memory-link small { display: block; margin-top: 4px; color: #5b7053; font-size: 11px; line-height: 1.45; }
.memory-link > span:last-child { margin-left: auto; }
.memory-icon { font-size: 22px; }
.user-row { display: flex; align-items: center; gap: 10px; padding: 15px 3px; border-top: 1px solid #cfdcc9; }
.avatar { display: flex; align-items: center; justify-content: center; flex-shrink: 0; width: 33px; height: 33px; border-radius: 50%; color: #3d5b3b; background: #d9e6d1; font-size: 13px; font-weight: 600; }
.user-info { flex: 1; overflow: hidden; }
.user-info strong { display: block; overflow: hidden; color: #2d492d; font-size: 13px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.user-info small { display: block; margin-top: 3px; color: #586e51; font-size: 11px; }
.logout-button { padding: 0 4px 18px; color: #4c6649; background: transparent; font-size: 12px; text-align: left; }
.logout-button:hover { color: var(--green); text-decoration: underline; }
.chat-main { display: flex; flex: 1; flex-direction: column; min-width: 0; min-height: 0; background: var(--canvas); }
.chat-header { display: flex; flex-shrink: 0; align-items: center; justify-content: space-between; min-height: 84px; gap: 20px; padding: 16px 32px; border-bottom: 1px solid var(--line); background: #fff; }
.chat-heading { display: flex; flex: 1; align-items: center; min-width: 0; gap: 10px; }
.chat-heading > div { min-width: 0; }
.header-kicker { margin-bottom: 5px; color: #5b705a; font-size: 10px; font-weight: 650; letter-spacing: 1.1px; }
.chat-header h1 { overflow: hidden; color: #2b422d; font-size: 19px; font-weight: 600; letter-spacing: -.2px; line-height: 1.4; text-overflow: ellipsis; white-space: nowrap; }
.header-controls { display: flex; flex-shrink: 0; align-items: center; gap: 18px; }
.model-control { display: flex; flex-direction: column; width: 238px; min-width: 0; gap: 4px; }
.model-control label { color: #536b51; font-size: 12px; font-weight: 500; }
.model-control select { min-height: 38px; padding: 7px 28px 7px 11px; border-color: #c3d1bd; border-radius: 7px; color: #2c4b2d; background: #f8fbf4; font-size: 13px; text-overflow: ellipsis; cursor: pointer; }
.model-control select:disabled { cursor: default; opacity: .7; }
.mode-badge { display: flex; align-items: center; flex-shrink: 0; gap: 7px; padding: 8px 10px; border: 1px solid #dedcc9; border-radius: 6px; color: #5c603d; background: #f6f5eb; font-size: 12px; line-height: 1.5; white-space: nowrap; }
.conversation { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 22px max(28px, calc((100% - 800px) / 2)) 25px; scroll-behavior: smooth; scrollbar-gutter: stable; }
.conversation:focus-visible { outline: 2px solid var(--focus); outline-offset: -4px; }
.welcome { max-width: 590px; margin: 32px auto 28px; text-align: center; }
.welcome-mark { position: relative; display: flex; align-items: center; justify-content: center; width: 60px; height: 60px; margin: 0 auto 24px; padding-right: 4px; border: 1px solid #d2dec9; border-radius: 16px; color: #4e6945; background: #edf3e6; font-size: 32px; font-weight: 500; letter-spacing: -4px; }
.welcome-mark span { position: absolute; right: -3px; bottom: -3px; width: 16px; height: 16px; border: 4px solid var(--canvas); border-radius: 50%; background: #789969; }
.welcome .eyebrow { color: #59724f; font-size: 10px; letter-spacing: 1.3px; }
.welcome h2 { margin: 14px 0; color: #314c31; font-size: 30px; font-weight: 500; letter-spacing: -.8px; line-height: 1.25; }
.welcome > p { color: #5b7052; font-size: 15px; line-height: 1.75; }
.welcome-info { display: flex; gap: 12px; max-width: 470px; margin: 26px auto 0; padding: 17px 19px; border: 1px solid #dce5cf; border-radius: 9px; color: #526b43; background: #f1f5e9; text-align: left; }
.info-icon { display: flex; align-items: center; justify-content: center; flex-shrink: 0; width: 17px; height: 17px; margin-top: 3px; border: 1px solid #889e73; border-radius: 50%; font-size: 11px; line-height: 1; }
.welcome-info strong { color: #38532f; font-size: 14px; font-weight: 600; }
.welcome-info p { margin-top: 6px; color: #576e49; font-size: 13px; line-height: 1.65; }
.service-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 16px; margin-top: 24px; color: #59714d; font-size: 12px; }
.service-row small { padding-left: 15px; border-left: 1px solid #c9d6be; color: #627555; font-size: 11px; }
.message-list { padding-top: 4px; }
.message { max-width: 100%; margin: 0 0 34px; font-size: 16px; line-height: 1.7; }
.message-header { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; margin-bottom: 10px; color: #586c57; font-size: 12px; line-height: 1.5; }
.message-header strong { color: #365436; font-size: 13px; font-weight: 650; }
.message-header time { font-variant-numeric: tabular-nums; }
.message-body { color: #273e2b; overflow-wrap: anywhere; white-space: pre-wrap; }
.message.user { max-width: min(100%, 44rem); margin-left: auto; }
.message.user .message-body { padding: 14px 18px; border: 1px solid #d4e1cb; border-radius: 5px 12px 12px 12px; background: #edf3e7; }
.message.assistant .message-body { padding: 2px 0; }

/* Markdown never contains untrusted HTML; these are renderer-owned elements. */
.markdown-body { white-space: normal; }
.markdown-body > :first-child { margin-top: 0; }
.markdown-body > :last-child { margin-bottom: 0; }
.markdown-body p, .markdown-body ul, .markdown-body ol, .markdown-body blockquote { max-width: 74ch; margin: 0 0 1em; }
.markdown-body h2, .markdown-body h3, .markdown-body h4, .markdown-body h5, .markdown-body h6 { max-width: 64ch; color: #203b24; font-weight: 650; line-height: 1.35; }
.markdown-body h2 { margin: 1.5em 0 .65em; font-size: 21px; }
.markdown-body h3 { margin: 1.35em 0 .6em; font-size: 19px; }
.markdown-body h4 { margin: 1.2em 0 .55em; font-size: 17px; }
.markdown-body h5, .markdown-body h6 { margin: 1.2em 0 .55em; font-size: 16px; }
.markdown-body hr { margin: 1.5em 0; border: 0; border-top: 1px solid var(--line); }
.markdown-body strong { color: #1e3923; font-weight: 650; }
.markdown-body em { color: inherit; }
.markdown-body ul, .markdown-body ol { padding-left: 1.6em; }
.markdown-body li { padding-left: .15em; margin: .35em 0; }
.markdown-body li > p { margin-bottom: .5em; }
.markdown-body li > ul, .markdown-body li > ol { margin: .4em 0 .5em; }
.markdown-body blockquote { margin-left: 0; padding: 10px 16px; border-left: 3px solid #7f9d72; color: #465c40; background: #f0f5e9; }
.markdown-body blockquote > :last-child { margin-bottom: 0; }
.message-body a, .message-source-list a { color: var(--link); text-decoration: underline; text-decoration-thickness: .08em; text-underline-offset: .18em; overflow-wrap: anywhere; }
.message-body a:hover, .message-source-list a:hover { color: #103f2b; text-decoration-thickness: .12em; }
.message-body a:visited, .message-source-list a:visited { color: #60477a; }
.message-body code, .run-reference code {
  padding: .13em .35em; border: 1px solid #d1ddc9; border-radius: 4px;
  color: #294728; background: #edf3e7;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace; font-size: .87em; line-height: 1.55;
}
.markdown-body pre.md-code-block { max-width: 100%; max-height: 420px; overflow: auto; margin: 1.1em 0; padding: 16px 18px; border: 1px solid #cbd9c2; border-radius: 8px; color: #203e25; background: #eff4e9; font-size: 14px; line-height: 1.65; tab-size: 4; white-space: pre; overflow-wrap: normal; }
.markdown-body pre.md-code-block code { display: block; padding: 0; border: 0; border-radius: 0; color: inherit; background: transparent; font-size: inherit; line-height: inherit; white-space: inherit; }
.md-table-wrap { width: 100%; max-width: 100%; overflow-x: auto; overscroll-behavior-x: contain; margin: 1.25em 0; border: 1px solid #c9d7c1; border-radius: 8px; background: #fff; }
.md-table { width: 100%; min-width: 28rem; border-collapse: collapse; color: #29432c; font-size: 14px; line-height: 1.55; text-align: left; font-variant-numeric: tabular-nums; }
.md-table th, .md-table td { min-width: 5.5rem; max-width: 28rem; padding: 10px 14px; vertical-align: top; overflow-wrap: anywhere; }
.md-table th { border-bottom: 2px solid #bfceb5; color: #28442b; background: #eaf1e3; font-size: 13px; font-weight: 650; text-align: inherit; }
.md-table td { border-bottom: 1px solid #dce5d4; }
.md-table tbody tr:last-child td { border-bottom: 0; }
.md-table tbody tr:nth-child(even) { background: #f5f8f0; }
.md-table tbody tr:hover { background: #edf4e5; }
.md-table .md-numeric, .md-table .md-align-right { text-align: right; }
.md-table .md-align-center { text-align: center; }
.md-table .md-align-left { text-align: left; }
.message-sources { margin-top: 20px; padding-top: 13px; border-top: 1px solid var(--line); font-size: 13px; line-height: 1.65; }
.message-sources > strong { color: #405f3a; font-size: 12px; font-weight: 650; }
.message-source-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; padding: 0; margin: 8px 0 0; list-style: none; }
.message-source-list li { min-width: 0; max-width: 100%; }
.message-source-list a { display: inline-block; max-width: 100%; padding: 2px 0; }
.message-sources-more { margin-top: 8px; }
.message-sources-more > summary { width: fit-content; padding: 4px 0; color: #355b35; font-size: 13px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

/* Run status stays subordinate to the answer but remains legible. */
.run-card { margin-top: 18px; padding: 17px 20px; border: 1px solid #dcd8bb; border-radius: 9px; background: #f7f6ec; }
.run-card-heading { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; }
.run-card strong { color: #655c32; font-size: 14px; font-weight: 650; }
.run-state { margin-left: auto; color: #675e3e; font-size: 12px; }
.run-card p { margin: 9px 0 0 16px; color: #625b3e; font-size: 13px; line-height: 1.65; }
.run-actions { display: flex; flex-wrap: wrap; gap: 18px; margin-left: 16px; }
.run-details { margin: 14px 0 0 16px; padding-top: 12px; border-top: 1px solid #d9d4b5; color: #60583c; font-size: 13px; line-height: 1.65; }
.run-details summary { width: fit-content; padding: 3px 0; color: #3e5c35; cursor: pointer; }
.run-details[open] > summary { margin-bottom: 13px; }
.run-card .run-details p { margin: 6px 0; color: #60583c; font-size: 13px; overflow-wrap: anywhere; }
.run-metrics { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 16px; margin: 0 0 14px; }
.run-metrics dt { color: #675f42; }
.run-metrics dd { margin: 0; color: #415436; font-variant-numeric: tabular-nums; text-align: right; }
.run-card .run-diagnostic-failure { color: #893f2b; font-weight: 650; }
.run-card .run-detail-heading { margin-top: 14px; color: #435c35; font-weight: 650; }
.run-card .run-diagnostic-code, .run-reference { color: #675e40; font-size: 12px; overflow-wrap: anywhere; }
.run-call-list, .run-tool-list { margin: 8px 0 12px; padding-left: 22px; }
.run-call-list > li { padding: 8px 0; border-bottom: 1px solid #e0dcc1; }
.run-call-list > li:last-child { border-bottom: 0; }
.run-card .run-call-title { color: #435b36; font-size: 13px; font-weight: 600; }

/* Composer and personal memory. */
.composer-wrap { flex-shrink: 0; padding: 12px max(28px, calc((100% - 800px) / 2)) 16px; border-top: 1px solid #e3e9dc; background: var(--canvas); }
.composer { padding: 13px 16px 10px; border: 1px solid #b8cbb0; border-radius: 12px; background: #fff; box-shadow: 0 3px 14px #314f2307; }
.composer:focus-within { border-color: #749b64; box-shadow: 0 0 0 2px #6e985c20; }
.composer textarea { min-height: 54px; max-height: 180px; padding: 0; border: 0; border-radius: 0; outline: none; color: #29442d; background: transparent; font-size: 16px; line-height: 1.6; resize: none; box-shadow: none; }
.composer-bottom { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 5px; }
.composer-bottom > span { color: #586d4e; font-size: 11px; line-height: 1.5; }
.privacy-icon { margin-right: 4px; color: #4f6b40; }
.send-button { flex-shrink: 0; width: 38px; height: 38px; border-radius: 8px; color: #fff; background: #3f6f32; font-size: 23px; line-height: 1; }
.send-button:hover { background: #2e5923; }
.composer-caption { margin-top: 10px; color: #607252; font-size: 11px; line-height: 1.5; text-align: center; }
.composer-caption span { padding: 0 7px; }
.menu-toggle { display: none; }
.drawer-backdrop { position: fixed; inset: 0; z-index: 5; background: #1d302455; }
.memory-drawer { position: fixed; inset: 0 0 0 auto; z-index: 6; width: min(480px, 100%); overflow-y: auto; padding: 32px; background: #fff; box-shadow: -8px 0 60px #18392720; }
.drawer-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.drawer-heading .eyebrow { font-size: 10px; }
.drawer-heading h2 { margin-top: 10px; font-size: 24px; font-weight: 600; letter-spacing: -.5px; line-height: 1.3; }
.drawer-description { margin-top: 18px; color: #576d4e; font-size: 14px; line-height: 1.7; }
.memory-form { display: flex; flex-direction: column; gap: 18px; margin-top: 22px; padding: 19px; border: 1px solid #d7e3cc; border-radius: 9px; background: #f4f8ee; }
.memory-form label { color: #3c5d33; font-size: 14px; }
.memory-form input, .memory-form textarea { font-size: 15px; }
.optional { margin-left: 5px; color: #59754a; font-size: 12px; font-weight: 400; }
.memory-form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 15px; }
.memory-form .button { min-height: 40px; padding: 9px 15px; font-size: 13px; }
.memory-section-label { margin: 29px 0 12px; }
.memory-item { padding: 18px 0; border-bottom: 1px solid #d9e3cf; }
.memory-item-heading { display: flex; align-items: center; gap: 8px; }
.memory-item strong { color: #385a2c; font-size: 15px; font-weight: 600; }
.scope-label { margin-left: auto; padding: 3px 7px; border-radius: 4px; color: #526f40; background: #edf4e4; font-size: 11px; }
.memory-item p { margin-top: 9px; color: #536d46; font-size: 14px; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; }
.memory-item-actions { display: flex; gap: 18px; margin-top: 4px; }
.memory-item-actions .text-button { font-size: 13px; }
.toast { position: fixed; top: 18px; left: 50%; z-index: 20; width: max-content; max-width: calc(100% - 32px); padding: 13px 20px; transform: translateX(-50%); border: 1px solid #c8af7f; border-radius: 9px; color: #735124; background: #fffcf2; font-size: 14px; line-height: 1.65; box-shadow: 0 6px 28px #263b2220; }
.initial-loading { display: flex; align-items: center; justify-content: center; gap: 14px; height: 100dvh; color: #526c45; font-size: 15px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (min-width: 1500px) {
  .conversation, .composer-wrap { padding-right: max(40px, calc((100% - 860px) / 2)); padding-left: max(40px, calc((100% - 860px) / 2)); }
  .welcome { margin-top: 55px; }
}
@media (max-width: 1050px) {
  .sidebar { width: 230px; padding-right: 15px; padding-left: 15px; }
  .chat-header { gap: 14px; padding-right: 24px; padding-left: 24px; }
  .header-controls { gap: 12px; }
  .model-control { width: 210px; }
  .mode-badge { padding: 7px 8px; font-size: 11px; }
  .conversation, .composer-wrap { padding-right: 24px; padding-left: 24px; }
  .auth-brand { padding: 35px; }
  .auth-intro h1 { font-size: 42px; }
  .auth-main { padding: 35px; }
}
@media (min-width: 769px) and (max-height: 720px) {
  .workspace-label { margin-top: 24px; }
  .section-label { margin-top: 20px; }
  .sidebar-bottom { padding-top: 10px; }
  .welcome { margin-top: 12px; margin-bottom: 20px; }
  .welcome-mark { width: 44px; height: 44px; margin-bottom: 14px; border-radius: 12px; font-size: 26px; }
  .welcome h2 { margin: 11px 0; font-size: 27px; }
  .welcome-info { margin-top: 18px; padding: 13px 16px; }
  .service-row { margin-top: 16px; }
}
@media (max-width: 768px) {
  .sidebar { position: fixed; inset: 0 auto 0 0; z-index: 4; display: none; width: 280px; box-shadow: 8px 0 30px #2d493330; }
  .sidebar.open { display: flex; }
  .menu-toggle { display: block; }
  .chat-header { flex-wrap: wrap; gap: 11px; padding: 13px 20px; }
  .chat-heading { flex: 1 1 100%; }
  .chat-header h1 { font-size: 18px; }
  .header-controls { justify-content: space-between; width: 100%; gap: 12px; }
  .model-control { flex: 1; width: auto; max-width: 290px; }
  .model-control label { font-size: 11px; }
  .model-control select { min-height: 36px; font-size: 13px; }
  .mode-badge { align-self: flex-end; font-size: 11px; }
  .header-kicker { font-size: 10px; }
  .conversation { padding: 20px 20px 18px; }
  .composer-wrap { padding: 10px 16px 12px; }
  .composer { padding: 12px 14px 9px; }
  .composer textarea { min-height: 48px; }
  .composer-caption { margin-top: 8px; font-size: 11px; }
  .welcome { margin-top: 22px; }
  .welcome h2 { font-size: 27px; }
  .welcome-info { margin-top: 20px; padding: 15px; }
  .service-row { gap: 12px; }
  .run-card { padding: 15px 16px; }
  .run-state { margin-left: 16px; }
  .run-details { margin-left: 0; }
  .md-table th, .md-table td { padding: 10px 12px; }
  .markdown-body pre.md-code-block { padding: 14px; font-size: 13px; }
  .memory-drawer { padding: 25px; }
  .auth-view { display: block; }
  .auth-brand { min-height: 180px; padding: 25px; }
  .auth-intro { padding: 25px 0 5px; }
  .auth-intro h1 { margin: 10px 0; font-size: 32px; letter-spacing: -1px; }
  .auth-intro h1 br { display: none; }
  .auth-intro > p, .auth-footer, .connected-services, .auth-intro > .eyebrow { display: none; }
  .auth-main { padding: 32px 25px; }
  .auth-form { max-width: 440px; }
}
@media (max-width: 420px) {
  .chat-header { padding-right: 16px; padding-left: 16px; }
  .conversation { padding-right: 16px; padding-left: 16px; }
  .header-controls { gap: 9px; }
  .mode-badge { padding: 7px; font-size: 10px; }
  .model-control select { padding-right: 18px; padding-left: 8px; font-size: 12px; }
  .message.user .message-body { padding: 12px 14px; }
  .message { margin-bottom: 29px; }
  .message-header { column-gap: 8px; font-size: 11px; }
  .message-header strong { font-size: 12px; }
  .composer-bottom > span { font-size: 10px; }
  .composer-caption { font-size: 10px; }
  .welcome h2 { font-size: 25px; }
  .service-row { gap: 10px; font-size: 11px; }
  .service-row small { padding-left: 10px; font-size: 10px; }
  .run-card p, .run-actions { margin-left: 0; }
  .run-metrics { column-gap: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}
