:root {
    color-scheme: light;
    --green: #afcb37;
    --green-deep: #88a722;
    --green-soft: #f1f7da;
    --ink: #253139;
    --ink-soft: #42515c;
    --muted: #63717a;
    --line: #e4e9e8;
    --surface: #fff;
    --canvas: #f6f8f7;
    --danger: #bd3c3c;
    --success: #237e4d;
    --shadow: 0 10px 34px rgba(30, 51, 52, .055);
    --radius: 20px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-width: 320px; scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; color: var(--ink); background: var(--canvas); font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif; font-size: 15px; -webkit-font-smoothing: antialiased; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .6; cursor: wait; }
a { color: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible { outline: 3px solid #567a1b; outline-offset: 3px; }
.icon { display: inline-block; width: 19px; height: 19px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important; }
.skip-link { position: fixed; z-index: 1000; top: -70px; left: 18px; background: #fff; padding: 12px 16px; border: 2px solid var(--green-deep); border-radius: 10px; }
.skip-link:focus { top: 12px; }
.site-shell { min-height: 100vh; display: flex; flex-direction: column; }
.site-header { background: rgba(255,255,255,.98); border-bottom: 1px solid var(--line); }
.header-inner { width: min(1360px, calc(100% - 56px)); min-height: 82px; margin: auto; display: flex; align-items: center; gap: 34px; }
.brand { display: inline-flex; align-items: center; gap: 16px; flex: 0 0 auto; text-decoration: none; }
.brand img { width: 157px; height: auto; display: block; }
.brand-divider { width: 1px; height: 32px; background: #d9e0d9; }
.brand-subtitle { font-size: 19px; font-weight: 800; letter-spacing: -.04em; line-height: 1.05; white-space: nowrap; }
.brand-subtitle small { display: block; margin-top: 5px; color: var(--muted); font-size: 11px; font-weight: 500; letter-spacing: .01em; }
.main-nav { display: flex; align-items: center; gap: 7px; margin-left: auto; }
.nav-link { border: 0; border-radius: 10px; padding: 11px 16px; background: transparent; color: var(--muted); font-weight: 650; font-size: 13px; white-space: nowrap; }
.nav-link:hover, .nav-link.is-active { background: #f1f6e4; color: #334b19; }
.header-cta { display: inline-flex; align-items: center; gap: 11px; padding: 12px 18px; border: 0; border-radius: 999px; background: var(--green); color: #202a19; font-size: 13px; font-weight: 800; white-space: nowrap; }
.header-cta:hover, .primary-button:hover, .send-button:hover { background: #bddb45; }
.header-cta .icon { width: 16px; height: 16px; }
.page-content { width: min(1360px, calc(100% - 56px)); margin: 0 auto; flex: 1; }
.hero { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 226px; padding: 28px 10px 30px 4px; overflow: hidden; }
.hero-content { max-width: 790px; position: relative; z-index: 1; }
.eyebrow, .panel-eyebrow, .sidebar-label { color: #6c8427; font-size: 11px; font-weight: 850; letter-spacing: .11em; }
.eyebrow { display: flex; align-items: center; gap: 9px; margin: 0 0 11px; }
.eyebrow-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px #e8f1c8; }
.hero h1 { margin: 0; font-size: clamp(29px, 3.2vw, 46px); line-height: 1.14; letter-spacing: -.052em; font-weight: 850; }
.hero h1 span { color: #86a725; }
.hero-description { margin: 12px 0 15px; max-width: 660px; color: var(--ink-soft); line-height: 1.62; font-size: 15px; }
.hero-points { display: flex; flex-wrap: wrap; gap: 20px; color: #50616b; font-size: 12px; font-weight: 600; }
.hero-points span { display: inline-flex; align-items: center; gap: 6px; }
.hero-points .icon { width: 16px; height: 16px; color: #80a01b; stroke-width: 2.8; }
.hero-art { position: relative; flex: 0 0 245px; height: 180px; display: grid; place-items: center; }
.hero-orbit { position: absolute; border: 1px solid #cddfa1; border-radius: 50%; }
.hero-orbit-one { width: 200px; height: 200px; }
.hero-orbit-two { width: 148px; height: 148px; background: linear-gradient(135deg,#eaf3cf,#d8e7a4); border: 0; box-shadow: 0 12px 30px rgba(132,159,38,.14); }
.hero-monogram { position: relative; z-index: 1; font-size: 92px; font-weight: 900; color: #88aa26; line-height: 1; letter-spacing: -.09em; transform: rotate(-8deg); }
.hero-art-label { position: absolute; z-index: 1; bottom: 11px; right: 10px; font-size: 11px; letter-spacing: .32em; color: #95aa68; font-weight: 900; }
.workspace { display: grid; grid-template-columns: 294px minmax(0, 1fr); align-items: start; gap: 24px; }
.sidebar { display: grid; gap: 18px; }
.sidebar-section, .sidebar-help { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.sidebar-section { padding: 19px 11px 12px; }
.sidebar-label { margin: 0 12px 13px; }
.topic-list { display: grid; gap: 3px; }
.topic-button { width: 100%; display: flex; align-items: center; gap: 11px; text-align: left; padding: 12px 11px; border: 0; border-radius: 12px; background: transparent; color: var(--ink); }
.topic-button:hover, .topic-button:focus-visible { background: #f2f7e5; }
.topic-icon { width: 39px; height: 39px; display: grid; place-items: center; border-radius: 12px; background: #f0f6dd; color: #6d8d24; flex: 0 0 39px; }
.topic-icon .icon { width: 20px; height: 20px; }
.topic-button strong, .topic-button small { display: block; }
.topic-button strong { font-size: 13px; font-weight: 750; }
.topic-button small { color: #78848b; font-size: 11px; margin-top: 4px; }
.topic-arrow { margin-left: auto; width: 14px; height: 14px; color: #a1acaf; }
.sidebar-help { padding: 22px; background: #ecf4d6; border-color: #e3efc2; }
.sidebar-help-icon { display: grid; place-items: center; width: 40px; height: 40px; margin-bottom: 14px; border-radius: 12px; background: #d9eaa7; color: #587921; }
.sidebar-help strong { display: block; font-size: 14px; }
.sidebar-help p { margin: 8px 0 15px; color: #53634b; font-size: 12px; line-height: 1.7; }
.sidebar-help-link { display: inline-flex; align-items: center; gap: 8px; border: 0; padding: 0; background: transparent; font-size: 12px; font-weight: 800; color: #4f6d1d; }
.sidebar-help-link .icon { width: 15px; height: 15px; }
.sidebar-privacy { display: flex; gap: 10px; padding: 3px 8px 0; color: #76818a; font-size: 11px; line-height: 1.55; }
.sidebar-privacy .icon { width: 19px; height: 19px; color: #80972f; }
.main-panels { min-width: 0; }
.panel { background: var(--surface); border: 1px solid #e1e7e5; border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.chat-panel { height: 650px; display: flex; flex-direction: column; }
.panel-header { min-height: 88px; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 21px 26px; border-bottom: 1px solid var(--line); }
.chat-header { min-height: 79px; padding: 13px 24px; }
.assistant-identity { display: flex; align-items: center; gap: 12px; }
.assistant-avatar { position: relative; display: grid; place-items: center; flex: 0 0 43px; width: 43px; height: 43px; border-radius: 14px; background: #fff; border: 1px solid #e4eade; overflow: visible; }
.assistant-avatar-image { display: block; width: 100%; height: 100%; object-fit: contain; padding: 6px; border-radius: inherit; }
.avatar-online { position: absolute; right: -2px; bottom: -2px; width: 11px; height: 11px; border: 2px solid #fff; background: #58a85f; border-radius: 50%; }
.assistant-identity strong, .assistant-identity small { display: block; }
.assistant-identity strong { font-size: 15px; }
.assistant-identity small { margin-top: 3px; font-size: 11px; color: var(--muted); }
.panel-header-actions { display: flex; align-items: center; gap: 10px; }
.connection-state { display: inline-flex; align-items: center; gap: 7px; border-radius: 999px; background: #f1f7e7; color: #54732b; padding: 8px 12px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.connection-state.is-local { background: #fff7e6; color: #865f20; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #75b45b; }
.connection-state.is-local .status-dot { background: #e1a348; }
.icon-button { display: inline-grid; place-items: center; width: 37px; height: 37px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: #53616a; }
.icon-button:hover { background: #f4f8ec; border-color: #c8d8a3; }
.chat-log { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 23px 25px 22px; background: linear-gradient(180deg,#fff 0%,#fdfefb 100%); scrollbar-color: #dce5dc transparent; }
.welcome { max-width: 560px; margin: 29px auto 14px; text-align: center; }
.welcome-icon { width: 58px; height: 58px; display: grid; place-items: center; margin: 0 auto 16px; border-radius: 18px; background: #edf5d7; color: #83a426; font-size: 34px; font-weight: 900; }
.welcome h2 { margin: 0; font-size: 21px; letter-spacing: -.025em; }
.welcome p { margin: 9px auto 20px; max-width: 410px; font-size: 13px; line-height: 1.65; color: var(--muted); }
.welcome-questions { display: grid; gap: 9px; max-width: 440px; margin: auto; }
.welcome-questions button { display: flex; align-items: center; justify-content: space-between; gap: 10px; text-align: left; padding: 12px 15px; border: 1px solid #e3e9e1; border-radius: 11px; background: #fff; font-size: 12px; font-weight: 650; color: #3c4c54; }
.welcome-questions button:hover { background: #f4f8ea; border-color: #cddca6; }
.welcome-questions .icon { width: 15px; height: 15px; color: #84a52b; }
.chat-message { display: flex; align-items: flex-start; gap: 10px; margin: 0 0 20px; }
.chat-message.is-user { justify-content: flex-end; }
.message-avatar { flex: 0 0 31px; display: grid; place-items: center; width: 31px; height: 31px; border-radius: 11px; background: #e8f2d3; color: #678c25; font-size: 18px; font-weight: 850; }
.message-body { min-width: 0; max-width: min(90%, 770px); }
.chat-message.is-user .message-body { max-width: min(80%, 640px); }
.message-bubble { border: 1px solid #e6ebe6; background: #f7faf4; border-radius: 3px 15px 15px 15px; padding: 15px 17px; color: #293940; font-size: 13px; line-height: 1.68; overflow-wrap: anywhere; }
.chat-message.is-user .message-bubble { border-radius: 15px 3px 15px 15px; background: #eaf4d6; border-color: #dce9c0; }
.message-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 7px; color: #849097; font-size: 10px; }
.chat-message.is-user .message-meta { justify-content: flex-end; }
.message-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 9px; }
.message-tools button { display: inline-flex; align-items: center; gap: 5px; border: 1px solid #e1e8df; border-radius: 8px; background: #fff; padding: 6px 8px; font-size: 11px; color: #52636a; }
.message-tools button:hover { background: #f0f6e5; }
.message-tools button:disabled { opacity: .55; }
.message-tools .icon { width: 14px; height: 14px; }
.message-sources { margin-top: 12px; padding-top: 10px; border-top: 1px solid #e0e7df; }
.message-sources summary { cursor: pointer; font-weight: 700; font-size: 11px; color: #4e7229; }
.message-sources summary:focus-visible { outline: 2px solid #567a1b; outline-offset: 3px; }
.message-sources[open] summary { margin-bottom: 8px; }
.message-sources ul { margin: 0; padding-left: 18px; }
.message-sources li { font-size: 11px; line-height: 1.6; }
.message-sources a { color: #4e7625; text-underline-offset: 2px; }
.markdown-content { color: #34454b; line-height: 1.72; font-size: 13px; overflow-wrap: anywhere; }
.markdown-content > :first-child { margin-top: 0; }
.markdown-content h3 { margin: 16px 0 7px; font-size: 14px; color: #243238; line-height: 1.35; }
.markdown-content p { margin: 8px 0 12px; }
.markdown-content ol, .markdown-content ul { margin: 8px 0 13px; padding-left: 23px; }
.markdown-content li { padding-left: 3px; margin-bottom: 7px; }
.markdown-content li::marker { color: #6d9424; font-weight: 800; }
.markdown-content strong { font-weight: 780; }
.markdown-content code { border-radius: 5px; padding: 2px 4px; background: #edf1ec; font-size: .92em; }
.markdown-content pre { overflow-x: auto; padding: 10px; border-radius: 9px; background: #eff3ed; white-space: pre-wrap; }
.markdown-content a { color: #3b7324; text-decoration: underline; text-underline-offset: 2px; }
.inline-alert { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 11px 22px; background: #fff3ed; border-top: 1px solid #f1d4c5; color: #9b4935; font-size: 12px; }
.text-button { padding: 5px; border: 0; background: transparent; color: inherit; font-weight: 750; text-decoration: underline; }
.attachment-preview { display: flex; align-items: center; gap: 12px; padding: 9px 24px; border-top: 1px solid var(--line); background: #f8faf7; }
.attachment-preview img { width: 52px; height: 52px; border: 1px solid var(--line); border-radius: 9px; object-fit: cover; }
.attachment-preview > div { min-width: 0; flex: 1; }
.attachment-preview strong, .attachment-preview small { display: block; }
.attachment-preview strong { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attachment-preview small { color: var(--muted); font-size: 10px; margin-top: 4px; }
.active-topic { display: block; margin: 0 0 9px; padding: 7px 10px; border-radius: 8px; background: #f3f7e7; color: #587321; font-size: 11px; line-height: 1.45; }
.active-topic[hidden] { display: none !important; }
.active-topic strong { font-weight: 700; }
.chat-composer { border-top: 1px solid var(--line); padding: 14px 22px 11px; background: #fff; }
.chat-composer textarea { display: block; width: 100%; min-height: 65px; max-height: 170px; padding: 13px 14px; resize: vertical; border: 1px solid #dce3df; border-radius: 12px; outline: none; background: #fcfdfb; color: var(--ink); font-size: 14px; line-height: 1.55; }
.chat-composer textarea:focus { border-color: #a2c346; box-shadow: 0 0 0 3px #eef6d6; }
.chat-composer textarea::placeholder { color: #93a0a1; }
.composer-footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 10px; }
.composer-left { display: flex; align-items: center; gap: 13px; }
.attach-button { display: inline-flex; align-items: center; gap: 7px; border: 1px solid #e0e6e2; padding: 9px 11px; border-radius: 9px; color: #59676b; background: #fff; cursor: pointer; font-size: 11px; font-weight: 700; }
.attach-button:hover { background: #f5f8ef; }
.attach-button .icon { width: 15px; height: 15px; }
.composer-count { color: #9ba4a7; font-size: 10px; }
.send-button, .primary-button { display: inline-flex; align-items: center; justify-content: center; gap: 9px; border: 0; border-radius: 10px; background: var(--green); color: #243019; padding: 11px 16px; font-size: 12px; font-weight: 850; text-decoration: none; }
.send-button .icon, .primary-button .icon { width: 16px; height: 16px; }
.composer-hint { margin: 9px 0 0; color: #929ca0; font-size: 10px; line-height: 1.45; }
.panel-eyebrow { margin: 0 0 7px; }
.panel-header h2 { margin: 0; font-size: 22px; letter-spacing: -.035em; }
.panel-subtitle { margin: 7px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.count-pill { display: inline-flex; align-items: center; padding: 8px 12px; border-radius: 999px; background: #eff6dc; color: #557625; font-size: 11px; font-weight: 750; white-space: nowrap; }
.knowledge-toolbar { padding: 23px 26px 0; }
.search-field { display: flex; align-items: center; gap: 10px; width: 100%; border: 1px solid #dce4df; border-radius: 12px; padding: 0 14px; background: #fafcfa; color: #89999a; }
.search-field:focus-within { border-color: #a2c346; box-shadow: 0 0 0 3px #eef6d6; }
.search-field input { width: 100%; height: 48px; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 13px; }
.knowledge-filters { display: flex; flex-wrap: wrap; gap: 8px; padding: 15px 26px; }
.filter-chip { border: 1px solid #e2e8e2; border-radius: 999px; padding: 8px 13px; background: #fff; color: #637177; font-size: 11px; font-weight: 700; }
.filter-chip.is-active { background: #eaf3d1; border-color: #d6e6b4; color: #507126; }
.knowledge-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 0 26px 28px; }
.knowledge-card { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; text-align: left; min-height: 170px; padding: 17px; border: 1px solid #e3e9e4; border-radius: 13px; background: #fff; }
.knowledge-card:hover { border-color: #c1d994; background: #fbfdf7; transform: translateY(-1px); }
.knowledge-card .category { color: #6f902d; font-size: 10px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.knowledge-card strong { font-size: 14px; line-height: 1.4; }
.knowledge-card .summary { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; color: var(--muted); font-size: 11px; line-height: 1.55; }
.knowledge-card .read-more { display: inline-flex; align-items: center; gap: 6px; margin-top: auto; color: #5d7c27; font-size: 11px; font-weight: 800; }
.knowledge-card .read-more .icon { width: 13px; height: 13px; }
.loading-text, .empty-text { grid-column: 1/-1; padding: 32px 0; color: var(--muted); text-align: center; font-size: 13px; }
.knowledge-detail { padding: 23px 27px 29px; }
.back-link { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 25px; padding: 0; border: 0; background: transparent; color: #5a7b2c; font-size: 12px; font-weight: 750; }
.back-link .icon { width: 14px; height: 14px; transform: rotate(180deg); }
.knowledge-detail h3 { margin: 0; font-size: 24px; letter-spacing: -.03em; }
.knowledge-intro { margin: 12px 0 22px; padding-bottom: 18px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 13px; line-height: 1.6; }
.knowledge-detail .markdown-content { font-size: 14px; }
.knowledge-detail .markdown-content h3 { margin-top: 22px; font-size: 17px; }
.knowledge-detail-footer { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--line); }
.knowledge-detail-footer p { color: var(--muted); font-size: 11px; line-height: 1.5; }
.support-badge { display: grid; place-items: center; flex: 0 0 50px; width: 50px; height: 50px; border-radius: 15px; background: #edf5dc; color: #72952c; }
.support-badge .icon { width: 26px; height: 26px; }
.demo-badge { background: #e8f3f3; color: #4a9191; }
.form-content { padding: 26px; }
.form-advice { display: flex; gap: 12px; padding: 15px 17px; margin-bottom: 22px; border: 1px solid #dfebc6; border-radius: 12px; background: #f5faeb; }
.form-advice .icon { width: 21px; height: 21px; color: #72952c; }
.form-advice p { margin: 0; color: #5c6b50; font-size: 12px; line-height: 1.6; }
.stack-form { display: grid; gap: 18px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.stack-form label:not(.checkbox-row) { display: block; color: #384951; font-size: 12px; font-weight: 700; }
.stack-form label > span[aria-hidden] { color: #a4483c; }
.stack-form input:not([type=checkbox]), .stack-form textarea { display: block; margin-top: 8px; width: 100%; min-height: 46px; padding: 12px 13px; border: 1px solid #dce4df; border-radius: 10px; background: #fff; color: var(--ink); font-size: 14px; font-weight: 450; line-height: 1.5; }
.stack-form textarea { min-height: 115px; resize: vertical; }
.stack-form input:focus, .stack-form textarea:focus { outline: 0; border-color: #9dbe44; box-shadow: 0 0 0 3px #edf5d8; }
.stack-form input::placeholder, .stack-form textarea::placeholder { color: #9ca7a7; }
.optional { color: #9aa4a6; font-weight: 500; }
.checkbox-row { display: flex; align-items: flex-start; gap: 11px; color: #53616b; font-size: 12px; line-height: 1.55; }
.checkbox-row input { flex: 0 0 auto; width: 17px; height: 17px; margin: 1px 0 0; accent-color: #8dad2c; }
.checkbox-row strong { color: #a4483c; }
.form-bottom { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 4px; padding-top: 19px; border-top: 1px solid var(--line); }
.form-bottom p { max-width: 390px; margin: 0; color: #859095; font-size: 11px; line-height: 1.5; }
.form-bottom .primary-button { flex-shrink: 0; }
.form-status { padding: 15px 18px; margin-top: 18px; border: 1px solid #d7e6c7; border-radius: 11px; background: #f2f8e8; color: #416a27; font-size: 13px; line-height: 1.6; }
.form-status.is-error { border-color: #efcfc9; background: #fff5f2; color: #a0443d; }
.form-status.is-pending { border-color: #f0e0b9; background: #fff9eb; color: #90651e; }
.demo-intro { padding: 20px 22px; margin-bottom: 24px; border-radius: 13px; background: linear-gradient(125deg,#edf6dc,#f8fbf2); }
.demo-intro strong { font-size: 14px; }
.demo-intro p { margin: 8px 0 0; color: #63765b; font-size: 12px; line-height: 1.65; }
.honeypot { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.success-next { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.secondary-button { border: 1px solid #dbe5d9; border-radius: 10px; padding: 11px 16px; background: #fff; color: #526a36; font-size: 12px; font-weight: 800; }
.site-footer { margin-top: auto; background: #fff; border-top: 1px solid var(--line); }
.footer-inner { width: min(1360px, calc(100% - 56px)); min-height: 70px; display: flex; justify-content: space-between; align-items: center; gap: 15px; margin: auto; color: #8b9699; font-size: 11px; }
.footer-inner > div { display: flex; gap: 22px; }
.footer-inner button, .footer-inner a { display: inline-flex; align-items: center; gap: 5px; padding: 0; border: 0; background: transparent; color: #60746a; font-size: 11px; font-weight: 650; text-decoration: none; }
.footer-inner .icon { width: 13px; height: 13px; }
.privacy-dialog { width: min(590px, calc(100% - 32px)); max-height: min(85vh, 700px); padding: 0; border: 1px solid #e1e8df; border-radius: 18px; box-shadow: 0 24px 70px rgba(24, 45, 43, .2); }
.privacy-dialog::backdrop { background: rgba(28,42,42,.55); }
.dialog-head, .dialog-foot { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 18px 23px; }
.dialog-head { border-bottom: 1px solid var(--line); }
.dialog-head h2 { margin: 0; font-size: 18px; }
.dialog-content { padding: 8px 23px; color: #53646a; font-size: 13px; line-height: 1.75; }
.dialog-content p { margin: 14px 0; }
.dialog-foot { justify-content: flex-end; border-top: 1px solid var(--line); }
.noscript-note { position: fixed; z-index: 200; bottom: 0; left: 0; right: 0; padding: 16px; background: #fff5e5; text-align: center; }
@media (max-width: 1150px) {
    .header-inner { gap: 16px; }
    .brand img { width: 125px; }
    .brand-subtitle { font-size: 16px; }
    .nav-link { padding: 10px; }
    .workspace { grid-template-columns: 254px minmax(0,1fr); gap: 17px; }
    .topic-button { gap: 8px; padding: 11px 8px; }
    .sidebar-help { padding: 17px; }
}
@media (max-width: 850px) {
    .header-inner, .page-content, .footer-inner { width: min(100% - 32px, 1360px); }
    .header-inner { flex-wrap: wrap; min-height: 76px; padding: 12px 0; gap: 10px; }
    .main-nav { order: 3; width: 100%; margin: 0; justify-content: flex-start; }
    .header-cta { margin-left: auto; }
    .hero { min-height: 195px; }
    .hero-art { flex-basis: 160px; }
    .hero-orbit-one { width: 145px; height: 145px; }
    .hero-orbit-two { width: 110px; height: 110px; }
    .hero-monogram { font-size: 65px; }
    .hero-art-label { right: -5px; }
    .workspace { grid-template-columns: minmax(0, 1fr); }
    .sidebar { gap: 12px; }
    .sidebar-section { padding: 13px; }
    .sidebar-label { margin: 0 4px 10px; }
    .topic-list { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
    .topic-button { flex: 0 0 208px; border: 1px solid #e9eee7; }
    .topic-arrow { display: none; }
    .sidebar-help, .sidebar-privacy { display: none; }
    .chat-panel { height: min(700px, 72dvh); min-height: 540px; }
}
@media (max-width: 600px) {
    .header-inner, .page-content, .footer-inner { width: min(100% - 24px, 1360px); }
    .brand { gap: 9px; }
    .brand img { width: 112px; }
    .brand-divider { height: 25px; }
    .brand-subtitle { font-size: 15px; }
    .brand-subtitle small { font-size: 9px; }
    .header-cta { padding: 9px 11px; font-size: 11px; }
    .header-cta .icon { display: none; }
    .main-nav { overflow-x: auto; gap: 4px; }
    .nav-link { padding: 9px 12px; font-size: 12px; }
    .hero { min-height: auto; padding: 26px 2px 24px; }
    .hero-art { display: none; }
    .hero h1 { font-size: clamp(29px, 8vw, 38px); }
    .hero-description { font-size: 13px; }
    .hero-points { gap: 11px; font-size: 10px; }
    .topic-button { flex-basis: 194px; }
    .chat-panel { min-height: 530px; height: min(670px, 73dvh); border-radius: 15px; }
    .chat-header { padding: 11px 13px; min-height: 70px; }
    .assistant-avatar { width: 38px; height: 38px; flex-basis: 38px; font-size: 23px; }
    .assistant-identity small { font-size: 10px; }
    .connection-state { padding: 6px 8px; font-size: 10px; }
    .panel-header-actions { gap: 6px; }
    .new-chat-button { width: 33px; height: 33px; }
    .chat-log { padding: 15px 12px; }
    .welcome { margin: 15px auto; }
    .welcome h2 { font-size: 19px; }
    .welcome p { font-size: 12px; }
    .message-body { max-width: 90%; }
    .chat-message.is-user .message-body { max-width: 85%; }
    .message-bubble { padding: 12px; font-size: 12px; }
    .chat-composer { padding: 11px 12px; }
    .chat-composer textarea { min-height: 60px; font-size: 16px; }
    .composer-hint { font-size: 9px; }
    .composer-count { display: none; }
    .panel-header { padding: 17px; }
    .panel-header h2 { font-size: 19px; }
    .panel-subtitle { font-size: 11px; }
    .knowledge-toolbar { padding: 16px 16px 0; }
    .knowledge-filters { padding: 13px 16px; }
    .knowledge-grid { grid-template-columns: minmax(0,1fr); padding: 0 16px 19px; }
    .knowledge-card { min-height: 135px; }
    .knowledge-detail { padding: 19px 17px; }
    .knowledge-detail h3 { font-size: 21px; }
    .knowledge-detail-footer { display: grid; }
    .form-content { padding: 17px; }
    .form-grid { grid-template-columns: minmax(0,1fr); }
    .stack-form input:not([type=checkbox]), .stack-form textarea { font-size: 16px; }
    .form-bottom { display: grid; }
    .form-bottom .primary-button { justify-self: start; }
    .footer-inner { flex-direction: column; align-items: flex-start; justify-content: center; padding: 18px 0; gap: 11px; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0s !important; animation-duration: 0s !important; }
}
@media print {
    .site-header, .sidebar, .chat-composer, .site-footer, .message-tools { display: none !important; }
    .workspace { display: block; }
    .panel { border: 0; box-shadow: none; }
    .chat-panel { height: auto; }
    .chat-log { overflow: visible; }
}

.support-attachment-hint { margin: -11px 0 0; color: #81908c; font-size: 11px; }

.vision-option { padding: 11px 23px; border-top: 1px solid #e5ebdd; background: #f8fbf1; }
.vision-option label { display: flex; align-items: center; gap: 9px; font-size: 12px; font-weight: 750; color: #4d6633; cursor: pointer; }
.vision-option input { width: 17px; height: 17px; accent-color: #8ead29; }
.vision-option p { margin: 5px 0 0 26px; font-size: 10px; line-height: 1.5; color: #78856c; }
/* Prevent the horizontally scrollable mobile topics from widening the grid. */
.workspace, .sidebar, .sidebar-section, .topic-list { min-width: 0; }
@media (max-width: 850px) {
    .sidebar-section { width: 100%; overflow: hidden; }
    .topic-list { max-width: 100%; }
}

.stack-form input[type=file] { border: 1px dashed #cfdbbf; background: #fafcf6; padding: 8px; font-size: 12px; }
.stack-form input[type=file]::file-selector-button { margin-right: 10px; padding: 8px 11px; border: 0; border-radius: 8px; background: #eaf3d1; color: #4f7125; font-weight: 750; cursor: pointer; }
.stack-form textarea[name=question] { min-height: 78px; }

/* Support receipt and retry states (2.5.0). */
.form-status.is-success { border-color: #d7e6c7; background: #f2f8e8; color: #416a27; }
.support-new-request { display: inline-flex; margin-top: 12px; padding: 9px 13px; border: 1px solid #d4dfc4; border-radius: 9px; background: #fff; color: #35502c; cursor: pointer; font: inherit; font-size: 13px; }
.support-new-request:hover, .support-new-request:focus-visible { border-color: #a8c736; outline-offset: 2px; }
.support-new-request[hidden] { display: none; }

/* Public knowledge: show whether articles are live or a local offline snapshot. */
.knowledge-source { margin: 0 0 14px; padding: 9px 12px; border-radius: 9px; background: #eef7e3; color: #2c5030; font-size: .86rem; line-height: 1.5; }
.knowledge-source.is-local { background: #fff4df; color: #674913; }


/* v2.5.2: Compact introduction. The advisor workspace, not a decorative hero,
   must be the first useful thing visible on desktop and mobile. */
.hero.hero-compact { min-height: 0; padding: 14px 2px 16px; gap: 0; }
.hero-compact .hero-content { max-width: 100%; }
.hero-compact .eyebrow { margin-bottom: 5px; font-size: 10px; letter-spacing: .09em; }
.hero-compact h1 { font-size: clamp(23px, 2.2vw, 31px); line-height: 1.14; letter-spacing: -.035em; }
.hero-compact .hero-description { max-width: 100%; margin: 5px 0 0; font-size: 13px; line-height: 1.4; }
.workspace { grid-template-columns: 250px minmax(0,1fr); gap: 17px; }
.chat-panel { height: min(730px, max(570px, calc(100dvh - 220px))); }
.chat-log { padding: 17px 20px; }
.message-body { max-width: min(96%, 940px); }
.message-bubble { line-height: 1.6; }
.sidebar { gap: 13px; }
.sidebar-section { padding: 14px 9px 10px; }
.sidebar-label { margin-bottom: 9px; }
.topic-button { padding: 9px 8px; }
.sidebar-help { padding: 15px; }
.sidebar-help-icon { margin-bottom: 8px; }
@media (max-width: 850px) {
  .hero.hero-compact { padding: 12px 0 13px; }
  .workspace { grid-template-columns: minmax(0,1fr); gap: 12px; }
  .sidebar-section { padding: 9px; }
  .sidebar-label { margin-bottom: 5px; }
  .chat-panel { height: min(700px, 72dvh); min-height: 530px; }
}
@media (max-width: 600px) {
  .hero.hero-compact { padding: 10px 0 12px; }
  .hero-compact .eyebrow { font-size: 9px; margin-bottom: 4px; }
  .hero-compact h1 { font-size: clamp(22px, 6.2vw, 27px); }
  .hero-compact .hero-description { font-size: 12px; line-height: 1.4; }
  .chat-panel { height: min(670px, 72dvh); min-height: 500px; }
  .message-body { max-width: 93%; }
  .sidebar-section { padding: 7px; }
  .topic-button { flex-basis: 170px; padding: 8px; }
  .topic-icon { flex-basis: 34px; width: 34px; height: 34px; }
}

/* Compact support connectivity status, including narrow screens. */
.support-connection { margin: 0 0 14px; padding: 10px 12px; border-radius: 9px; border: 1px solid #e1e9df; background: #f7faf5; color: #617169; font-size: 11px; line-height: 1.5; }
.support-connection.is-ready { border-color: #dce9c6; background: #f6faef; color: #4b6938; }
.support-connection.is-warning { border-color: #eddfbf; background: #fffaf0; color: #826b37; }
.support-connection.is-error { border-color: #edcfcb; background: #fff7f5; color: #9b4d44; }


/* Header contains both a direct online demo and a separate lead request. */
.header-actions { display: flex; gap: 9px; align-items: center; flex: 0 0 auto; }
.header-demo-link { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 750; color: #486d14; text-decoration: none; white-space: nowrap; border: 1px solid #d8e5c5; border-radius: 999px; background: #f7faef; padding: 11px 14px; }
.header-demo-link:hover { background: #edf5d7; }
.header-demo-link .icon { width: 14px; height: 14px; }
@media (max-width: 1150px) { .header-inner { gap: 12px; } .header-demo-link { padding: 10px; font-size: 12px; } .header-cta { padding: 10px 12px; } }
@media (max-width: 850px) { .header-actions { margin-left: auto; } }
@media (max-width: 600px) { .header-actions { gap: 5px; } .header-demo-link { padding: 9px 10px; font-size: 11px; } .header-demo-link .icon { display: none; } }
@media (max-width: 380px) { .brand img { width: 124px; } .brand-divider { display: none; } .brand-subtitle { font-size: 14px; } .header-demo-link { font-size: 10px; padding: 8px; } }

/* Compact content starts immediately after navigation; the duplicated hero is removed. */
.page-content { padding-top: 22px; }
.support-followup-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.stack-form input:not([type=checkbox]):not([type=file]), .stack-form textarea { pointer-events: auto; }
@media (max-width: 600px) { .page-content { padding-top: 12px; } }

/* The message avatar is the same Solvie favicon used in the chat header. */
.message-avatar { overflow: hidden; background: #fff; border: 1px solid #e4eade; }
.message-avatar img { display: block; width: 100%; height: 100%; object-fit: contain; padding: 3px; }

/* 2.5.8: no redundant hero inside the conversation; small question shortcuts. */
.chat-log .welcome {padding-top:16px;padding-bottom:16px}
.chat-log .welcome-shortcuts-label {font-size:12px;font-weight:700;letter-spacing:.025em;text-transform:uppercase;color:#6b7887;margin:3px 0 11px}
@media(max-width:640px){.chat-log .welcome{padding-top:10px}}

/* ---- v2.5.14: Mobile-first conversation, desktop preserved. ---- */
.nav-demo, .mobile-topics-toggle, .mobile-privacy-link { display: none; }
.active-topic { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.active-topic-label { display: block; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.active-topic-clear { display: inline-grid; flex: 0 0 25px; width: 25px; height: 25px; place-items: center; padding: 0; border: 0; border-radius: 7px; color: #587321; background: transparent; }
.active-topic-clear:hover { background: #e7f0d1; }
.active-topic-clear .icon { width: 14px; height: 14px; }

@media (max-width: 680px) {
    html { min-width: 320px; scroll-behavior: auto; }
    body { font-size: 14px; }
    body[data-active-tab="chat"] { overflow: hidden; }
    body[data-active-tab="chat"] .site-shell {
        height: var(--solvie-mobile-height, 100dvh);
        min-height: 0;
        overflow: hidden;
    }
    .site-header { position: relative; z-index: 10; flex: 0 0 auto; padding-top: env(safe-area-inset-top, 0px); }
    .header-inner { width: 100%; min-height: 0; padding: 8px 12px 0; gap: 0 10px; justify-content: space-between; }
    .brand { gap: 0; }
    .brand img { width: 112px; height: auto; }
    .brand-divider, .brand-subtitle { display: none; }
    .header-actions { margin-left: auto; gap: 0; }
    .header-demo-link { padding: 5px 7px; border: 0; background: transparent; color: #4c722a; font-size: 11px; font-weight: 730; }
    .header-demo-link .icon { display: inline-block; width: 13px; height: 13px; }
    .header-cta { display: none; }
    .main-nav { width: 100%; flex: 0 0 100%; order: 3; margin: 6px 0 0; padding: 0 0 2px; display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 2px; overflow: visible; }
    .main-nav .nav-link { min-width: 0; min-height: 40px; border: 0; border-bottom: 2px solid transparent; border-radius: 0; padding: 10px 2px 9px; font-size: 11px; font-weight: 700; background: transparent; color: #63717a; }
    .main-nav .nav-link.is-active { border-color: #99bd2a; background: transparent; color: #3d6021; }
    .main-nav .nav-demo { display: block; }
    .page-content { width: 100%; margin: 0; padding: 0; min-width: 0; }
    body[data-active-tab="chat"] .page-content { min-height: 0; flex: 1 1 auto; overflow: hidden; }
    .workspace { position: relative; display: block; width: 100%; margin: 0; min-width: 0; }
    body[data-active-tab="chat"] .workspace, body[data-active-tab="chat"] .main-panels { height: 100%; min-height: 0; }
    .sidebar { display: none; }
    .workspace.is-topics-open .sidebar {
        display: block; position: absolute; z-index: 12;
        top: 50px; left: 12px; right: 12px;
        border: 1px solid #dce6d6; border-radius: 14px; padding: 8px;
        background: #fff; box-shadow: 0 12px 40px rgba(32,49,39,.18);
    }
    .sidebar-section { padding: 7px; border: 0; box-shadow: none; }
    .sidebar-label { margin: 4px 6px 9px; font-size: 10px; }
    .topic-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 6px; overflow: visible; padding: 0; }
    .topic-button { min-width: 0; width: 100%; min-height: 48px; padding: 8px; border: 1px solid #e8eee5; border-radius: 10px; gap: 7px; background: #fff; }
    .topic-icon { flex: 0 0 27px; width: 27px; height: 27px; border-radius: 8px; }
    .topic-icon .icon { width: 15px; height: 15px; }
    .topic-button strong { font-size: 11px; line-height: 1.2; }
    .topic-button small, .topic-arrow { display: none; }
    .sidebar-help, .sidebar-privacy { display: none; }
    .mobile-privacy-link { display: flex; align-items: center; gap: 8px; margin: 8px 3px 2px; padding: 8px; border: 0; background: #f6f9f1; border-radius: 8px; color: #5b712f; font-size: 11px; }
    .mobile-privacy-link .icon { width: 16px; height: 16px; }
    .main-panels { min-width: 0; }
    .chat-panel { width: 100%; min-height: 0; height: calc(100dvh - 102px); border: 0; border-radius: 0; box-shadow: none; display: flex; flex-direction: column; }
    body[data-active-tab="chat"] .chat-panel { height: 100%; }
    .chat-header { min-height: 46px; padding: 6px 13px; border-bottom: 1px solid #eff1ed; }
    .assistant-identity { min-width: 0; gap: 8px; }
    .assistant-avatar { width: 29px; height: 29px; flex-basis: 29px; border-radius: 9px; }
    .assistant-avatar-image { padding: 3px; }
    .avatar-online { width: 9px; height: 9px; right: -2px; bottom: -2px; }
    .assistant-identity strong { font-size: 14px; }
    .assistant-identity small { display: none; }
    .panel-header-actions { flex-shrink: 0; gap: 5px; }
    .connection-state { display: inline-flex; width: 15px; height: 18px; padding: 0; margin-right: 3px; border-radius: 0; background: transparent; }
    .connection-state.is-local { background: transparent; }
    .connection-state #connection-label { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
    .status-dot { width: 9px; height: 9px; }
    .mobile-topics-toggle { display: inline-grid; }
    .new-chat-button, .mobile-topics-toggle { width: 34px; height: 34px; border-radius: 9px; }
    .new-chat-button .icon, .mobile-topics-toggle .icon { width: 17px; height: 17px; }
    .chat-log { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 12px 12px 16px; background: #fff; -webkit-overflow-scrolling: touch; overscroll-behavior-y: contain; }
    .welcome { margin: 20px auto 5px; padding: 0 4px; }
    .welcome-shortcuts-label { font-size: 11px; text-transform: none; }
    .welcome-questions { gap: 7px; }
    .welcome-questions button { min-height: 43px; padding: 10px 13px; font-size: 12px; }
    .chat-message { gap: 7px; margin-bottom: 14px; }
    .message-avatar { flex-basis: 23px; width: 23px; height: 23px; border-radius: 7px; }
    .message-avatar img { padding: 2px; }
    .message-body, .chat-message.is-user .message-body { max-width: calc(100% - 32px); }
    .chat-message.is-user .message-body { max-width: 90%; }
    .message-bubble { padding: 10px 12px; border-radius: 4px 12px 12px 12px; font-size: 13px; line-height: 1.48; }
    .chat-message.is-user .message-bubble { border-radius: 12px 4px 12px 12px; }
    .markdown-content { font-size: 13px; line-height: 1.52; }
    .markdown-content p { margin: 5px 0 8px; }
    .markdown-content h3 { margin: 12px 0 5px; font-size: 13px; }
    .markdown-content ol, .markdown-content ul { margin: 5px 0 8px; padding-left: 20px; }
    .markdown-content li { padding-left: 1px; margin-bottom: 4px; }
    .message-meta { gap: 4px; font-size: 10px; margin-top: 4px; }
    .message-sources { margin-top: 8px; padding-top: 7px; }
    .message-sources summary { padding: 2px 0; font-size: 11px; }
    .message-sources ul { margin-top: 6px; }
    .message-sources li { font-size: 11px; }
    .message-tools { margin-top: 4px; gap: 5px; }
    .message-tools button { width: 32px; height: 30px; display: inline-grid; place-items: center; padding: 0; border-color: transparent; background: transparent; color: #637879; }
    .message-tools button:hover { background: #f1f5ef; }
    .message-tools .icon { width: 16px; height: 16px; }
    .message-tool-label { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
    .inline-alert { padding: 9px 11px; font-size: 11px; }
    .attachment-preview { padding: 6px 10px; }
    .attachment-preview small { display: none; }
    .vision-option { padding: 7px 12px; }
    .chat-composer {
        flex: 0 0 auto; display: grid; grid-template-columns: 38px minmax(0,1fr) 40px;
        align-items: end; gap: 6px; padding: 8px 10px max(9px, env(safe-area-inset-bottom, 0px));
        border-top: 1px solid #e7ece5; background: #fff;
    }
    .chat-composer .active-topic { grid-column: 1/-1; grid-row: 1; margin: 0; padding: 5px 7px 5px 10px; font-size: 10px; border-radius: 7px; }
    .chat-composer textarea { grid-column: 2; grid-row: 2; min-height: 40px; max-height: 108px; height: 40px; padding: 9px 10px; border-radius: 11px; resize: none; font-size: 16px; line-height: 1.3; background: #f7f9f5; }
    .chat-composer textarea::placeholder { font-size: 13px; }
    .chat-composer textarea:focus { box-shadow: 0 0 0 2px #e4efbf; }
    .composer-footer, .composer-left { display: contents; }
    .attach-button { grid-column: 1; grid-row: 2; display: grid; width: 38px; height: 40px; place-items: center; padding: 0; margin: 0; border: 0; border-radius: 11px; background: #f2f6e9; color: #617a3e; }
    .attach-button .icon { width: 20px; height: 20px; }
    .attach-button span { display: none; }
    .send-button { grid-column: 3; grid-row: 2; width: 40px; height: 40px; padding: 0; border-radius: 11px; }
    .send-button span { display: none; }
    .send-button .icon { width: 19px; height: 19px; }
    .composer-count { display: none; }
    .composer-hint { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important; }
    body[data-active-tab="chat"] .site-footer { display: none; }
    body:not([data-active-tab="chat"]) .page-content { padding: 10px 10px 20px; }
    body:not([data-active-tab="chat"]) .panel { border-radius: 12px; }
    .panel-header { padding: 13px 14px; min-height: 0; gap: 8px; }
    .panel-header h2 { font-size: 18px; }
    .panel-subtitle { font-size: 11px; }
    .panel-eyebrow, .support-badge, .demo-badge { display: none; }
    .count-pill { padding: 5px 7px; font-size: 10px; }
    .knowledge-toolbar { padding: 12px 12px 0; }
    .knowledge-filters { display: flex; flex-wrap: nowrap; overflow-x: auto; gap: 5px; padding: 10px 12px; -webkit-overflow-scrolling: touch; }
    .filter-chip { flex: 0 0 auto; font-size: 11px; padding: 8px 10px; }
    .knowledge-grid { padding: 0 12px 16px; gap: 8px; }
    .knowledge-card { min-height: 0; padding: 12px; gap: 7px; }
    .knowledge-card .summary { -webkit-line-clamp: 2; }
    .knowledge-source { margin: 6px 12px 2px; padding: 8px; font-size: 11px; }
    .knowledge-detail { padding: 14px; }
    .form-content { padding: 12px; }
    .form-advice { padding: 10px; margin-bottom: 12px; }
    .stack-form { gap: 12px; }
    .footer-inner { width: calc(100% - 24px); padding: 12px 0; gap: 7px; font-size: 10px; }
    .footer-inner > div { gap: 12px; }
    .footer-inner button, .footer-inner a { font-size: 10px; }
    .privacy-dialog { max-height: min(80dvh,700px); }
}
@media (max-width: 360px) {
    .brand img { width: 97px; }
    .main-nav .nav-link { font-size: 10px; }
    .topic-list { grid-template-columns: 1fr; }
}
@media print {
    body[data-active-tab="chat"] { overflow: visible !important; }
    body[data-active-tab="chat"] .site-shell { height: auto !important; overflow: visible !important; }
    body[data-active-tab="chat"] .page-content { overflow: visible !important; }
    body[data-active-tab="chat"] .chat-panel { height: auto !important; }
    .mobile-topics-toggle, .mobile-privacy-link { display: none !important; }
}


/* 2.5.15 - iOS Safari keyboard-safe chat. Only the active conversation is
   viewport-locked; support, knowledge and demo pages keep normal scrolling. */
@media (max-width: 680px) {
  html.solvie-chat-lock, html.solvie-chat-lock body {
    width: 100%; height: 100%; overflow: hidden;
    overscroll-behavior: none;
  }
  body[data-active-tab="chat"] .site-shell {
    position: fixed;
    z-index: 2;
    left: 0; right: 0;
    top: var(--solvie-mobile-top, 0px);
    width: 100%;
    height: var(--solvie-mobile-height, 100dvh);
    min-height: 0;
    overflow: hidden;
    transition: none !important;
    transform: none !important;
  }
  body[data-active-tab="chat"] .site-header,
  body[data-active-tab="chat"] .page-content,
  body[data-active-tab="chat"] .workspace,
  body[data-active-tab="chat"] .main-panels,
  body[data-active-tab="chat"] .chat-panel { min-height: 0; }
  body[data-active-tab="chat"] .main-panels,
  body[data-active-tab="chat"] .chat-panel { overflow: hidden; }
  body[data-active-tab="chat"] .chat-log {
    flex: 1 1 0;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overflow-anchor: none;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
  }
  body[data-active-tab="chat"] .chat-composer {
    flex: 0 0 auto;
    position: relative;
    z-index: 3;
    padding-bottom: max(8px, env(safe-area-inset-bottom, 0px));
    transform: none !important;
  }
  body.solvie-keyboard-open .site-header { display: none; }
  body.solvie-keyboard-open .chat-composer { padding-bottom: 7px; }
  body.solvie-keyboard-open .chat-header { min-height: 43px; }
  body.solvie-keyboard-open #mobile-topics-panel { top: 45px; }
  body[data-active-tab="chat"] #message {
    font-size: 16px !important; /* prevent iOS automatic input zoom */
    scroll-margin-block: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-appearance: none;
  }
}
