:root {
  --bg: #ffffff;
  --surface: #f6fafb;
  --surface-strong: #edf7f8;
  --text: #0c2938;
  --text-soft: #5d7480;
  --text-faint: #8ca0aa;
  --line: #d9e7ea;
  --line-strong: #bdd5d9;
  --teal: #078894;
  --teal-hover: #04747e;
  --teal-soft: #e7f7f8;
  --coral: #f28a68;
  --danger: #d94b4b;
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 18px;
  --sidebar: 272px;
  --topbar: 76px;
  --composer-width: 980px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; overscroll-behavior: none; }
body {
  font-family: Inter, -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input, textarea { font: inherit; }
button { color: inherit; }
svg { fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }

.app-shell { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); width: 100%; height: 100vh; height: 100dvh; min-height: 0; overflow: hidden; }
.sidebar { position: relative; z-index: 20; display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden; border-right: 1px solid #d4e6e9; background: linear-gradient(180deg,#fbfeff 0%,#f7fcfd 64%,#f1f9fa 100%); padding: 18px 15px 14px; }
.sidebar::before { content: ""; position: absolute; z-index: 0; left: -90px; right: -90px; bottom: 88px; height: 170px; opacity: .72; background: radial-gradient(120% 62% at 25% 100%,rgba(116,205,216,.17) 0 34%,transparent 35%), radial-gradient(110% 58% at 82% 100%,rgba(114,198,211,.11) 0 31%,transparent 32%); pointer-events: none; }
.sidebar > * { position: relative; z-index: 1; }
.brand-row { display: flex; align-items: center; justify-content: space-between; height: 48px; margin-bottom: 18px; }
.brand { display: flex; align-items: center; gap: 9px; min-width: 0; font-size: 20px; letter-spacing: -.02em; }
.brand img { width: 58px; height: 48px; object-fit: contain; filter: drop-shadow(0 4px 7px rgba(12,66,80,.11)); }
.brand strong { white-space: nowrap; }
.icon-button { position: relative; display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.92); cursor: pointer; transition: border-color .18s,background .18s,box-shadow .18s,transform .18s; }
.icon-button:hover { background: var(--surface); border-color: var(--line-strong); }
.icon-button svg { width: 20px; height: 20px; }
.portal-back { color: var(--text); text-decoration: none; transition: color .18s ease, background .18s ease, border-color .18s ease, box-shadow .18s ease, transform .18s ease; }
.portal-back svg { width: 19px; height: 19px; stroke-width: 1.9; }
.portal-back:hover { color: var(--teal); background: var(--teal-soft); border-color: #aed5d9; box-shadow: 0 0 0 3px rgba(8,127,140,.06); transform: translateX(-1px); }
.portal-back:focus-visible { color: var(--teal); border-color: #91c9ce; outline: 3px solid rgba(8,127,140,.12); outline-offset: 2px; }
.tooltip { position: absolute; top: 44px; right: -28px; width: max-content; z-index: 5; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--text); font-size: 12px; opacity: 0; transform: translateY(-3px); pointer-events: none; transition: .18s ease; box-shadow: 0 8px 20px rgba(14, 45, 58, .08); }
.portal-back:hover .tooltip { opacity: 1; transform: translateY(0); }
.new-chat { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 54px; border: 0; border-radius: 12px; background: linear-gradient(135deg,#07929e,#087f8c); color: #fff; box-shadow: 0 9px 20px rgba(8,127,140,.16); font-size: 15px; font-weight: 700; cursor: pointer; transition: transform .18s,box-shadow .18s; }
.new-chat:hover { background: linear-gradient(135deg,#078894,#066f7a); box-shadow: 0 12px 24px rgba(8,127,140,.22); transform: translateY(-1px); }
.new-chat svg { width: 22px; height: 22px; }
.search-box { display: flex; align-items: center; gap: 9px; height: 46px; margin-top: 14px; padding: 0 12px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.9); transition: border-color .18s,box-shadow .18s; }
.search-box:focus-within { border-color: #8dcbd1; box-shadow: 0 0 0 3px rgba(8,127,140,.07); }
.search-box svg { width: 18px; height: 18px; color: var(--text-soft); }
.search-box input { min-width: 0; flex: 1; border: 0; outline: 0; color: var(--text); font-size: 13px; background: transparent; }
.search-box input::placeholder { color: #9aa7ad; }
.search-box kbd { border: 0; background: transparent; color: #a0abb1; font-size: 11px; }
.conversation-list { min-height: 0; flex: 1; overflow-y: auto; margin: 17px -4px 10px; padding: 0 4px; scrollbar-width: thin; }
.conversation-group-label { margin: 12px 8px 7px; color: var(--text-faint); font-size: 12px; font-weight: 550; }
.conversation-item { display: grid; grid-template-columns: 20px minmax(0,1fr) 22px; align-items: center; gap: 9px; width: 100%; height: 44px; margin-bottom: 3px; padding: 0 10px; border: 1px solid transparent; border-radius: 11px; background: transparent; text-align: left; cursor: pointer; transition: background .16s,border-color .16s,transform .16s; }
.conversation-item:hover { background: var(--surface); }
.conversation-item.active { border-color: #b9dfe3; background: rgba(231,247,248,.9); box-shadow: inset 3px 0 0 var(--teal); }
.conversation-item > svg { width: 18px; height: 18px; }
.conversation-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.conversation-more { opacity: 0; }
.conversation-item:hover .conversation-more, .conversation-item.active .conversation-more { opacity: 1; }
.utility-nav { display: grid; gap: 2px; padding: 9px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.utility-nav button, .utility-nav a { display: flex; align-items: center; gap: 11px; height: 44px; padding: 0 10px; border: 0; border-radius: 10px; background: transparent; color: var(--text); font-size: 13px; font-weight: 520; text-decoration: none; cursor: pointer; }
.utility-nav button:hover, .utility-nav a:hover { background: var(--surface); }
.utility-nav svg { width: 20px; height: 20px; }
.user-row { display: grid; grid-template-columns: 40px 1fr 18px; align-items: center; gap: 10px; width: 100%; height: 60px; padding: 9px 6px 0; border: 0; background: transparent; text-align: left; cursor: pointer; }
.user-row img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; border: 1px solid #d8e6e8; }
.user-row span { font-size: 13px; font-weight: 600; }
.user-row svg { width: 17px; height: 17px; }
.user-row[aria-expanded="true"] svg { transform: rotate(180deg); }
.avatar-menu { position: absolute; left: 15px; right: 15px; bottom: 66px; z-index: 55; display: none; padding: 13px; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: 0 18px 48px rgba(14,45,58,.16); }
.avatar-menu.open { display: block; animation: pop .14s ease-out; }
.avatar-menu header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 11px; }
.avatar-menu header > div { display: grid; gap: 2px; }
.avatar-menu header strong { font-size: 13px; }
.avatar-menu header small { color: var(--text-soft); font-size: 11px; }
.avatar-menu header button { display: grid; place-items: center; width: 26px; height: 26px; padding: 0; border: 0; border-radius: 7px; background: transparent; color: var(--text-soft); font-size: 20px; line-height: 1; cursor: pointer; }
.avatar-menu header button:hover { background: var(--surface); }
.account-balance { display: flex; align-items: center; justify-content: space-between; margin-bottom: 11px; padding: 10px 11px; border-radius: 10px; background: var(--teal-soft); color: var(--teal-hover); font-size: 11px; }
.account-balance strong { font-size: 12px; }
.account-balance b { font-size: 16px; }
.avatar-menu-label { margin: 0 0 8px; color: var(--text-soft); font-size: 11px; }
.account-logout { margin-top: 11px; padding-top: 10px; border-top: 1px solid var(--line); }
.account-logout button { width: 100%; height: 34px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--text-soft); font-size: 12px; cursor: pointer; }
.account-logout button:hover { border-color: #9fcbd0; background: var(--surface); color: var(--teal-hover); }
.avatar-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px 7px; }
.avatar-option { position: relative; display: grid; justify-items: center; gap: 5px; min-width: 0; padding: 6px 3px 5px; border: 1px solid transparent; border-radius: 10px; background: transparent; cursor: pointer; }
.avatar-option:hover { background: var(--surface); }
.avatar-option.selected { border-color: #9dcfd4; background: var(--teal-soft); }
.avatar-option img { width: 47px; height: 47px; border-radius: 50%; object-fit: cover; border: 1px solid #d8e6e8; }
.avatar-option span { width: 100%; overflow: hidden; color: var(--text-soft); font-size: 10px; text-align: center; text-overflow: ellipsis; white-space: nowrap; }
.avatar-option.selected::after { content: "✓"; position: absolute; top: 3px; right: 4px; display: grid; place-items: center; width: 17px; height: 17px; border: 2px solid #fff; border-radius: 50%; background: var(--teal); color: #fff; font-size: 10px; font-weight: 800; }

.main-panel { position: relative; min-width: 0; min-height: 0; display: grid; grid-template-rows: var(--topbar) minmax(0,1fr) auto; height: 100%; overflow: hidden; background: #fff; }
.topbar { position: relative; z-index: 10; display: flex; align-items: center; gap: 5px; padding: 0 28px; border-bottom: 1px solid rgba(217,231,234,.9); background: rgba(255,255,255,.93); backdrop-filter: blur(14px); box-shadow: 0 4px 18px rgba(14,45,58,.025); }
.topbar h1 { margin: 0; max-width: 44vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 18px; line-height: 1; letter-spacing: -.01em; }
.title-caret { display: grid; place-items: center; width: 28px; height: 28px; border: 0; background: transparent; cursor: pointer; }
.title-caret svg { width: 17px; height: 17px; }
.topbar-spacer { flex: 1; }
.quota-pill { display: flex; align-items: baseline; gap: 6px; height: 38px; padding: 0 13px; border: 1px solid #a9d8dd; border-radius: 999px; background: linear-gradient(180deg,#f8ffff,#eaf8f9); color: var(--teal-hover); box-shadow: 0 4px 13px rgba(8,127,140,.07); cursor: pointer; }
.quota-pill span { font-size: 11px; }
.quota-pill strong { font-size: 13px; }
.model-picker { position: relative; }
.model-picker > button { display: flex; align-items: center; gap: 8px; height: 42px; padding: 0 14px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.95); box-shadow: 0 4px 15px rgba(14,45,58,.035); font-size: 13px; cursor: pointer; }
.model-picker > button:hover { background: var(--surface); }
.model-picker > button svg { width: 19px; height: 19px; }
.model-picker > button svg:last-child { width: 15px; height: 15px; }
.more-button { margin-left: 10px; }
.mobile-menu { display: none; }
.mobile-brand { display: none; align-items: center; gap: 7px; min-width: 0; }
.mobile-brand img { width: 34px; height: 32px; object-fit: contain; }
.mobile-brand strong { white-space: nowrap; font-size: 15px; letter-spacing: -.02em; }
.popover { position: absolute; z-index: 50; display: none; min-width: 260px; padding: 7px; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: 0 14px 36px rgba(14,45,58,.12); }
.popover.open { display: block; animation: pop .14s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(.99); } to { opacity: 1; transform: none; } }
.model-menu { top: 47px; right: 0; }
.model-option { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; width: 100%; padding: 10px; border: 0; border-radius: 8px; background: transparent; text-align: left; cursor: pointer; }
.model-option:hover, .model-option.selected { background: var(--surface-strong); }
.model-option strong { font-size: 13px; }
.model-option small { grid-column: 1; color: var(--text-soft); font-size: 11px; }
.model-option svg { grid-row: 1 / span 2; grid-column: 2; align-self: center; width: 17px; color: var(--teal); }

.chat-scroll { position: relative; min-height: 0; overflow-x: hidden; overflow-y: auto; scroll-behavior: smooth; overscroll-behavior-y: contain; touch-action: pan-y; -webkit-overflow-scrolling: touch; scrollbar-gutter: stable; background: radial-gradient(70% 28% at 88% 100%,rgba(132,210,220,.10),transparent 72%), radial-gradient(55% 24% at 18% 100%,rgba(141,215,224,.08),transparent 74%), #fff; }
.messages { position: relative; z-index: 1; width: min(900px, calc(100% - 56px)); margin: 0 auto; padding: 44px 0 24px; }
.message { display: grid; gap: 12px; margin-bottom: 22px; }
.message.user { grid-template-columns: minmax(0,1fr) 42px; padding-left: 16%; }
.message.assistant { grid-template-columns: 46px minmax(0,1fr); }
.avatar { width: 44px; height: 44px; align-self: start; object-fit: contain; border: 1px solid #deeaec; border-radius: 50%; background: #fff; box-shadow: 0 5px 14px rgba(14,45,58,.065); }
.message.user .avatar { grid-column: 2; border: 1px solid #c7e2e5; object-fit: cover; }
.message.user .message-content { grid-column: 1; grid-row: 1; justify-self: end; max-width: 700px; }
.user-bubble { padding: 14px 17px; border: 1px solid #98d3d9; border-radius: 17px 17px 5px 17px; background: linear-gradient(135deg,#f8fdfe,#e8f7f8); box-shadow: 0 5px 16px rgba(8,127,140,.06); font-size: 14px; line-height: 1.65; }
.user-meta { margin-top: 5px; color: var(--text-faint); font-size: 11px; text-align: right; }
.assistant-head { display: flex; align-items: center; gap: 10px; height: 28px; margin-bottom: 5px; }
.assistant-head strong { font-size: 13px; }
.assistant-head time { color: var(--text-faint); font-size: 11px; }
.assistant-copy { font-size: 14px; line-height: 1.75; }
.assistant-copy p { margin: 0 0 9px; }
.assistant-copy .finding { display: grid; grid-template-columns: 24px 1fr; gap: 8px; margin: 8px 0; }
.finding-index { display: grid; place-items: center; width: 22px; height: 22px; margin-top: 1px; border-radius: 50%; background: var(--teal); color: #fff; font-size: 12px; font-weight: 700; }
.typing-dots { display: flex; gap: 5px; padding: 10px 0; }
.typing-dots i { width: 7px; height: 7px; border-radius: 50%; background: #9fb4bb; animation: bounce 1s infinite ease-in-out; }
.typing-dots i:nth-child(2) { animation-delay: .13s; }
.typing-dots i:nth-child(3) { animation-delay: .26s; }
@keyframes bounce { 0%,60%,100% { transform: translateY(0); opacity: .55; } 30% { transform: translateY(-5px); opacity: 1; } }
.chart-card { margin-top: 15px; padding: 17px 18px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.chart-card h3 { margin: 0 0 9px; font-size: 16px; }
.chart-legend { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; color: var(--text-soft); font-size: 12px; }
.legend-line { width: 28px; height: 2px; background: var(--teal); position: relative; }
.legend-line::after { content: ""; position: absolute; width: 7px; height: 7px; left: 10px; top: -2.5px; border-radius: 50%; background: var(--teal); }
.chart-svg { display: block; width: 100%; height: 190px; overflow: visible; }
.chart-footer { display: flex; align-items: center; gap: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.chart-source { display: flex; align-items: center; gap: 7px; min-width: 0; margin-right: auto; color: var(--text-soft); font-size: 12px; }
.file-badge { display: grid; place-items: center; width: 22px; height: 24px; border-radius: 4px; background: #1f9d55; color: #fff; font-size: 10px; font-weight: 800; }
.card-action { display: flex; align-items: center; gap: 7px; min-height: 34px; padding: 0 11px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font-size: 12px; cursor: pointer; text-decoration: none; color: var(--text); }
.card-action:hover { background: var(--surface); }
.card-action svg { width: 16px; height: 16px; }
.activity-row { display: flex; align-items: center; gap: 22px; margin-top: 14px; padding: 11px 15px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.76); color: var(--text-soft); box-shadow: 0 5px 18px rgba(14,45,58,.025); font-size: 12px; }
.activity-item { display: flex; align-items: center; gap: 7px; }
.activity-item svg { width: 17px; height: 17px; color: var(--teal); }
.empty-state { display: grid; place-items: center; min-height: 52vh; text-align: center; }
.empty-state img { width: 96px; height: 76px; object-fit: contain; }
.empty-state h2 { margin: 10px 0 6px; font-size: 22px; }
.empty-state p { max-width: 440px; margin: 0; color: var(--text-soft); font-size: 14px; line-height: 1.7; }

.composer-wrap { position: relative; z-index: 5; min-height: 0; flex-shrink: 0; padding: 10px 24px 24px; background: linear-gradient(180deg,rgba(255,255,255,0),#fff 24%); }
.composer { width: min(var(--composer-width), 100%); min-height: 124px; margin: 0 auto; padding: 14px 16px 12px; border: 1px solid #90cbd1; border-radius: 19px; background: rgba(255,255,255,.98); box-shadow: 0 16px 40px rgba(18,61,73,.095),0 2px 8px rgba(8,127,140,.04); transition: border-color .18s, box-shadow .18s,transform .18s; }
.composer:focus-within { border-color: var(--teal); box-shadow: 0 18px 44px rgba(18,61,73,.11),0 0 0 3px rgba(8,127,140,.075); transform: translateY(-1px); }
.composer > .composer-icon { float: left; margin: 1px 8px 0 0; }
.composer textarea { width: calc(100% - 46px); min-height: 46px; max-height: 150px; resize: none; padding: 7px 4px; border: 0; outline: 0; color: var(--text); background: transparent; font-size: 14px; line-height: 1.6; }
.composer textarea::placeholder { color: #98a5ac; }
.composer-icon { display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 9px; background: transparent; cursor: pointer; }
.composer-icon:hover { background: var(--surface); }
.composer-icon svg { width: 22px; height: 22px; }
.composer-bottom { clear: both; display: flex; align-items: end; justify-content: space-between; gap: 14px; }
.tool-picker { position: relative; }
.tool-picker > button { display: flex; align-items: center; gap: 7px; height: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: 9px; background: #fff; font-size: 12px; cursor: pointer; }
.tool-picker > button svg { width: 17px; height: 17px; }
.tool-picker > button svg:last-child { width: 14px; }
.tool-menu { left: 0; bottom: 44px; }
.tool-menu button { display: grid; width: 100%; gap: 3px; padding: 9px 10px; border: 0; border-radius: 8px; background: transparent; text-align: left; cursor: pointer; }
.tool-menu button:hover { background: var(--surface-strong); }
.tool-menu strong { font-size: 12px; }
.tool-menu small { color: var(--text-soft); font-size: 11px; }
.composer-actions { display: flex; align-items: center; gap: 8px; }
.send-button { display: grid; place-items: center; width: 46px; height: 46px; padding: 0; border: 0; border-radius: 50%; background: linear-gradient(145deg,#0795a1,#067a84); color: #fff; box-shadow: 0 8px 18px rgba(8,127,140,.23); cursor: pointer; transition: transform .18s,box-shadow .18s; }
.send-button:hover { background: linear-gradient(145deg,#078995,#056d77); box-shadow: 0 10px 23px rgba(8,127,140,.28); transform: translateY(-1px); }
.send-button:disabled { opacity: .45; cursor: not-allowed; }
.send-button svg { width: 21px; height: 21px; }

.scrim { display: none; position: fixed; inset: 0; z-index: 15; background: rgba(13,37,48,.28); }
.modal { position: fixed; inset: 0; z-index: 100; display: none; place-items: center; padding: 22px; background: rgba(13,37,48,.28); }
.modal.open { display: grid; }
.modal-card { width: min(620px, 100%); max-height: min(720px, calc(100vh - 44px)); overflow-y: auto; padding: 22px; border: 1px solid var(--line); border-radius: 18px; background: #fff; box-shadow: 0 24px 70px rgba(14,45,58,.18); }
.modal-card header { display: flex; align-items: start; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.modal-card h2 { margin: 0 0 5px; font-size: 20px; }
.modal-card header p { margin: 0; color: var(--text-soft); font-size: 13px; line-height: 1.6; }
.modal-close { width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 9px; background: #fff; font-size: 22px; line-height: 1; cursor: pointer; }
.upload-zone { display: grid; place-items: center; width: 100%; min-height: 150px; padding: 18px; border: 1px dashed #a9c8cc; border-radius: 14px; background: #f8fcfc; cursor: pointer; }
.upload-zone:hover { border-color: var(--teal); }
.upload-zone svg { width: 30px; height: 30px; margin-bottom: 8px; color: var(--teal); }
.upload-zone strong { font-size: 14px; }
.upload-zone span { margin-top: 5px; color: var(--text-soft); font-size: 11px; }
.modal-list { display: grid; gap: 9px; margin-top: 18px; }
.list-row { display: grid; grid-template-columns: 40px minmax(0,1fr) auto; align-items: center; gap: 11px; min-height: 58px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 11px; }
.list-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 9px; background: var(--teal-soft); color: var(--teal); }
.list-icon svg { width: 20px; height: 20px; }
.list-main { min-width: 0; }
.list-main strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.list-main small { color: var(--text-soft); font-size: 11px; }
.list-row button, .list-row a { padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--text); font-size: 11px; text-decoration: none; cursor: pointer; }
.setting-row { display: grid; grid-template-columns: 130px 1fr auto; align-items: center; min-height: 58px; border-bottom: 1px solid var(--line); font-size: 13px; }
.setting-row > span { color: var(--text-soft); }
.setting-row code { overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.switch input { display: none; }
.switch span { display: block; width: 42px; height: 24px; padding: 3px; border-radius: 999px; background: #ccd7db; cursor: pointer; transition: .2s; }
.switch span::after { content: ""; display: block; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: .2s; }
.switch input:checked + span { background: var(--teal); }
.switch input:checked + span::after { transform: translateX(18px); }
.detail-copy { padding: 16px; border-radius: 12px; background: var(--surface); }
.detail-copy h3 { margin: 0 0 8px; font-size: 15px; }
.detail-copy p { margin: 0; color: var(--text-soft); font-size: 13px; line-height: 1.75; }
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 200; max-width: min(420px, calc(100% - 32px)); padding: 10px 15px; border-radius: 9px; background: #173845; color: #fff; font-size: 12px; opacity: 0; transform: translate(-50%,10px); pointer-events: none; transition: .22s; }
.toast.show { opacity: 1; transform: translate(-50%,0); }

@media (max-width: 760px) {
  :root { --topbar: 72px; }
  .app-shell { display: block; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: min(84vw, 310px); transform: translateX(-102%); transition: transform .24s ease; box-shadow: 18px 0 50px rgba(14,45,58,.12); }
  .app-shell.sidebar-open .sidebar { transform: translateX(0); }
  .app-shell.sidebar-open .scrim { display: block; }
  .main-panel { height: 100vh; height: 100dvh; }
  .topbar { padding: 0 12px; gap: 6px; }
  .mobile-menu { display: grid; flex: 0 0 auto; border: 0; }
  .mobile-brand { display: flex; }
  .topbar h1 { max-width: 22vw; font-size: 16px; }
  .title-caret { display: none; }
  .model-picker > button { max-width: 38vw; height: 38px; padding: 0 9px; }
  .model-picker > button span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .more-button { display: none; }
  .quota-pill { height: 34px; padding: 0 8px; }
  .quota-pill span { display: inline; font-size: 10px; }
  .messages { width: calc(100% - 28px); padding-top: 28px; }
  .message { gap: 8px; margin-bottom: 20px; }
  .message.user { grid-template-columns: minmax(0,1fr) 36px; padding-left: 10%; }
  .message.assistant { grid-template-columns: 38px minmax(0,1fr); }
  .avatar { width: 36px; height: 36px; }
  .assistant-copy, .user-bubble { font-size: 14px; }
  .chart-card { margin-left: calc(-38px - 8px); padding: 15px 13px 11px; }
  .chart-svg { height: 180px; }
  .chart-svg .axis-value { display: none; }
  .chart-footer { flex-wrap: wrap; }
  .chart-source { width: 100%; }
  .card-action.secondary { display: none; }
  .activity-row { margin-left: calc(-38px - 8px); gap: 12px; overflow-x: auto; white-space: nowrap; }
  .composer-wrap { padding: 8px 12px max(14px,env(safe-area-inset-bottom)); }
  .composer { min-height: 116px; border-radius: 17px; box-shadow: 0 12px 30px rgba(18,61,73,.1); }
  .composer textarea { font-size: 16px; }
  .modal { padding: 12px; align-items: end; }
  .modal-card { width: 100%; max-height: 82vh; border-radius: 18px 18px 12px 12px; }
  .tooltip { display: none; }
}

@media (max-width: 420px) {
  .topbar { padding: 0 10px; }
  .topbar h1, .title-caret { display: none; }
  .mobile-brand { flex: 1 1 auto; }
  .topbar-spacer { display: none; }
  .mobile-brand img { width: 30px; height: 30px; }
  .mobile-brand strong { font-size: 14px; }
  .model-picker > button { width: 118px; max-width: 118px; }
  .model-picker > button svg:first-child { display: none; }
  .quota-pill { display: flex; }
  .messages { width: calc(100% - 22px); }
  .chart-card { padding-inline: 10px; }
  .chart-svg { height: 164px; }
  .activity-item:nth-child(2) { display: none; }
}

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