:root {
  color-scheme: light;
  --bg: #f8f8f6;
  --sidebar: #f2f2ef;
  --surface: #ffffff;
  --surface-muted: #f3f4f1;
  --surface-hover: #eeefeb;
  --text: #20221f;
  --subtle: #70756f;
  --border: #e2e4df;
  --accent: #315e51;
  --accent-strong: #244b40;
  --accent-contrast: #ffffff;
  --user-bubble: #edf3f0;
  --danger: #a53d36;
  --shadow: 0 16px 44px rgb(21 28 24 / 12%);
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --app-height: 100dvh;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #171817;
  --sidebar: #1d1f1d;
  --surface: #222523;
  --surface-muted: #292d2a;
  --surface-hover: #303532;
  --text: #ecefeb;
  --subtle: #a0a8a1;
  --border: #363c37;
  --accent: #91c6b2;
  --accent-strong: #a9d5c4;
  --accent-contrast: #17221d;
  --user-bubble: #2b3932;
  --danger: #f1a19b;
  --shadow: 0 18px 48px rgb(0 0 0 / 34%);
}

* { box-sizing: border-box; }
html, body, #app { width: 100%; height: 100%; min-height: 0; margin: 0; }
body { overflow: hidden; color: var(--text); background: var(--bg); }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button:disabled { cursor: not-allowed; opacity: .52; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.boot { height: var(--app-height); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; color: var(--subtle); background: var(--bg); font-size: 14px; }
.brand-mark { width: 38px; height: 38px; display: block; object-fit: cover; border: 1px solid var(--border); border-radius: 12px; }
.boot-mark { width: 68px; height: 68px; border-radius: 20px; box-shadow: 0 8px 24px rgb(16 33 69 / 16%); }
.shell { position: relative; width: 100%; height: var(--app-height); min-height: 0; display: grid; grid-template-columns: minmax(248px, 296px) minmax(0, 1fr); overflow: hidden; background: var(--bg); }
.sidebar { height: 100%; min-width: 0; min-height: 0; display: flex; flex-direction: column; padding: max(14px, env(safe-area-inset-top)) 12px max(10px, env(safe-area-inset-bottom)); background: var(--sidebar); border-right: 1px solid var(--border); }
.side-head, .chat-top, .composer-actions, .section-head { display: flex; align-items: center; }
.side-head { flex: 0 0 auto; justify-content: space-between; padding: 4px 4px 16px; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 650; letter-spacing: -.02em; }
.brand-logo { width: 34px; height: 34px; border-radius: 11px; }
.icon-button, .quiet-button { min-width: 40px; min-height: 40px; display: inline-grid; place-items: center; padding: 0; border: 0; border-radius: 12px; background: transparent; color: var(--subtle); }
.icon-button:hover, .quiet-button:hover { background: var(--surface-hover); color: var(--text); }
.new-chat { flex: 0 0 auto; width: 100%; min-height: 44px; display: flex; align-items: center; justify-content: flex-start; gap: 10px; padding: 0 13px; border: 1px solid var(--border); border-radius: 13px; background: var(--surface); text-align: left; font-weight: 570; }
.new-chat svg { width: 18px; height: 18px; color: var(--accent); }
.search-wrap { position: relative; flex: 0 0 auto; margin: 14px 0 9px; }
.search-wrap input { width: 100%; height: 40px; padding: 0 12px 0 39px; border: 1px solid transparent; border-radius: 12px; background: var(--surface-muted); }
.search-wrap input::placeholder, .composer textarea::placeholder { color: var(--subtle); opacity: .88; }
.search-wrap .search-icon { position: absolute; left: 12px; top: 10px; color: var(--subtle); }
.search-icon svg { width: 18px; height: 18px; }
.chat-list { flex: 1 1 auto; min-height: 0; overflow-x: hidden; overflow-y: auto; display: flex; flex-direction: column; gap: 3px; padding: 2px 1px; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; scrollbar-gutter: stable; }
.chat-item { flex: 0 0 auto; width: 100%; min-height: 58px; display: block; padding: 10px 11px; border: 0; border-radius: 12px; background: transparent; text-align: left; overflow: hidden; }
.chat-item:hover { background: var(--surface-hover); }
.chat-item.active { background: var(--surface); box-shadow: 0 1px 2px rgb(0 0 0 / 5%); }
.chat-title { display: block; overflow: hidden; color: var(--text); font-size: 13px; font-weight: 560; line-height: 1.4; white-space: nowrap; text-overflow: ellipsis; }
.chat-date { display: block; padding-top: 3px; color: var(--subtle); font-size: 11px; line-height: 1.35; }
.sidebar-footer { flex: 0 0 auto; display: grid; gap: 5px; padding-top: 10px; border-top: 1px solid var(--border); }
.tools-entry, .profile-entry { width: 100%; display: flex; align-items: center; gap: 10px; min-width: 0; padding: 8px; border: 0; border-radius: 12px; background: transparent; text-align: left; }
.tools-entry:hover, .profile-entry:hover { background: var(--surface-hover); }
.tools-entry-icon, .profile-avatar { width: 34px; height: 34px; flex: 0 0 34px; display: grid; place-items: center; border-radius: 11px; background: var(--surface); color: var(--accent); font-size: 17px; font-weight: 650; }
.tools-entry-copy, .profile-copy { min-width: 0; display: grid; gap: 2px; flex: 1; }
.tools-entry-copy strong, .profile-copy strong { overflow: hidden; font-size: 12px; font-weight: 610; text-overflow: ellipsis; white-space: nowrap; }
.tools-entry-copy small, .profile-copy small { overflow: hidden; color: var(--subtle); font-size: 10px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.tools-entry-arrow, .profile-more { color: var(--subtle); font-size: 18px; }
.profile-avatar { border-radius: 50%; background: var(--accent); color: var(--accent-contrast); }

.main { position: relative; height: 100%; min-width: 0; min-height: 0; display: flex; flex-direction: column; overflow: hidden; background: var(--bg); }
.chat-top { z-index: 1; flex: 0 0 auto; min-height: 58px; padding: 0 clamp(14px, 2.5vw, 30px); gap: 12px; border-bottom: 1px solid var(--border); background: color-mix(in srgb, var(--bg) 92%, transparent); }
.mobile-menu { display: none; }
.current-title { min-width: 0; overflow: hidden; font-size: 14px; font-weight: 620; text-overflow: ellipsis; white-space: nowrap; }
.top-spacer { flex: 1; }
.top-hint { color: var(--subtle); font-size: 11px; white-space: nowrap; }
.toolbar { display: flex; align-items: center; gap: 5px; }
.toolbar button { min-height: 34px; padding: 6px 9px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--subtle); font-size: 12px; }
.install-cta { min-height: 36px; flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 0 13px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text); font-size: 12px; font-weight: 570; white-space: nowrap; transition: background .15s ease, border-color .15s ease, transform .15s ease; }
.install-cta:hover { transform: translateY(-1px); border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); background: var(--surface-hover); }
.install-cta:active { transform: scale(.98); }
.install-cta:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.install-cta svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
.install-label-short { display: none; }
#install-root { position: fixed; z-index: 40; inset: 0; pointer-events: none; }
.install-scrim { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: rgb(9 12 10 / 42%); pointer-events: auto; animation: install-fade-in .18s ease-out; }
.install-dialog { position: absolute; top: 50%; left: 50%; width: min(430px, calc(100vw - 32px)); max-height: min(82vh, 680px); overflow-y: auto; padding: 21px; transform: translate(-50%, -50%); border: 1px solid var(--border); border-radius: 22px; background: var(--surface); color: var(--text); box-shadow: var(--shadow); pointer-events: auto; animation: install-dialog-in .2s ease-out; }
.install-dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 17px; }
.install-brand { width: 46px; height: 46px; object-fit: cover; border: 1px solid var(--border); border-radius: 14px; }
.install-dialog h2 { margin: 0 0 8px; font-size: 21px; font-weight: 640; letter-spacing: -.035em; line-height: 1.22; }
.install-description { margin: 0 0 18px; color: var(--subtle); font-size: 13px; line-height: 1.55; }
.install-steps { display: grid; gap: 8px; padding: 0; margin: 0 0 16px; list-style: none; }
.install-step { min-width: 0; display: grid; grid-template-columns: 22px 34px minmax(0, 1fr); align-items: center; gap: 9px; padding: 9px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-muted); }
.install-step-number { color: var(--subtle); font-size: 11px; font-variant-numeric: tabular-nums; text-align: center; }
.install-step-icon { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 10px; background: var(--surface); color: var(--accent); }
.install-step-icon svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
.install-step-copy { min-width: 0; display: grid; gap: 3px; }
.install-step-copy strong { font-size: 12px; font-weight: 610; line-height: 1.35; }
.install-step-copy small { color: var(--subtle); font-size: 11px; line-height: 1.45; }
.install-note { margin: 0 0 16px; color: var(--subtle); font-size: 10px; line-height: 1.45; }
.install-actions { display: grid; gap: 8px; }
.install-actions button { min-height: 42px; padding: 9px 13px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--text); font-size: 13px; font-weight: 580; }
.install-actions .install-primary { border-color: transparent; background: var(--accent); color: var(--accent-contrast); }
.install-actions .install-primary:hover { background: var(--accent-strong); }
.install-actions .install-secondary, .install-actions .install-tertiary { background: transparent; color: var(--subtle); }
.install-actions button:hover { background: var(--surface-hover); }
.install-actions button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@keyframes install-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes install-dialog-in { from { opacity: 0; translate: 0 8px; } to { opacity: 1; translate: 0 0; } }
.messages { flex: 1 1 auto; min-height: 0; overflow-x: hidden; overflow-y: auto; padding: 26px max(20px, calc((100% - 800px) / 2)) 20px; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; scrollbar-gutter: stable; scroll-behavior: smooth; }
.empty-state { width: min(680px, 100%); margin: clamp(42px, 12vh, 132px) auto 30px; text-align: center; }
.empty-state h1 { margin: 0 0 10px; font-size: clamp(24px, 4vw, 34px); font-weight: 610; letter-spacing: -.04em; }
.empty-state p { margin: 0 0 26px; color: var(--subtle); font-size: 14px; line-height: 1.55; }
.suggestions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; text-align: left; }
.suggestion { min-width: 0; min-height: 68px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); text-align: left; transition: background .15s ease, border-color .15s ease, transform .15s ease; }
.suggestion:hover { transform: translateY(-1px); border-color: color-mix(in srgb, var(--accent) 30%, var(--border)); background: var(--surface-hover); }
.suggestion strong { display: block; font-size: 13px; font-weight: 600; line-height: 1.35; }
.suggestion small { display: block; margin-top: 4px; color: var(--subtle); font-size: 11px; line-height: 1.4; }

.message { display: flex; align-items: flex-start; gap: 10px; max-width: 800px; margin: 0 auto 20px; }
.message.user { justify-content: flex-end; }
.message-content { min-width: 0; max-width: min(92%, 700px); overflow-wrap: anywhere; font-size: 15px; line-height: 1.62; }
.message.user .message-content { padding: 10px 14px; border-radius: 16px 16px 5px 16px; background: var(--user-bubble); }
.message.assistant .message-content { padding: 3px 0; }
.message-avatar { width: 28px; height: 28px; flex: 0 0 28px; object-fit: cover; border: 1px solid var(--border); border-radius: 9px; }
.message.user .message-avatar { display: none; }
.message p { margin: 0 0 .7em; }
.message p:last-child { margin-bottom: 0; }
.message pre { max-width: 100%; overflow: auto; padding: 13px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-muted); font-size: 12px; }
.message code { padding: 1px 4px; border-radius: 5px; background: var(--surface-muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9em; }
.message pre code { padding: 0; background: transparent; }
.message a { color: var(--accent-strong); text-underline-offset: 2px; }
.message ul, .message ol { padding-left: 23px; }
.message li { padding-left: 2px; margin: 3px 0; }
.message h1, .message h2, .message h3 { margin: 1em 0 .45em; font-size: 1.1em; line-height: 1.35; }
.markdown-table { display: block; width: 100%; max-width: 100%; overflow-x: auto; border-collapse: collapse; font-size: 13px; }
.markdown-table th, .markdown-table td { padding: 7px 9px; border: 1px solid var(--border); text-align: left; vertical-align: top; }
.markdown-table th { background: var(--surface-muted); font-weight: 610; }
.message-artifact { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; margin-top: 10px; }
.message-artifact small { color: var(--subtle); font-size: 11px; }
.artifact-image-button { max-width: min(100%, 480px); padding: 0; overflow: hidden; border: 0; border-radius: 14px; background: var(--surface-muted); }
.artifact-image { display: block; max-width: 100%; max-height: 440px; object-fit: contain; }
.message-actions { display: flex; gap: 3px; margin-top: 5px; opacity: .58; }
.message:hover .message-actions, .message-actions:focus-within { opacity: 1; }
.message-actions .quiet-button { min-height: 30px; padding: 0 8px; font-size: 11px; }
.job-notice { max-width: 800px; margin: 10px auto; padding: 10px 13px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-muted); color: var(--subtle); font-size: 12px; line-height: 1.5; }

.composer-wrap { z-index: 2; flex: 0 0 auto; padding: 8px 16px max(12px, env(safe-area-inset-bottom)); background: linear-gradient(to bottom, transparent, var(--bg) 22%); }
.composer { width: min(850px, 100%); margin: 0 auto; padding: 8px 10px 8px; border: 1px solid var(--border); border-radius: 19px; background: var(--surface); box-shadow: 0 6px 24px rgb(18 25 21 / 7%); }
.composer textarea { display: block; width: 100%; min-height: 42px; max-height: min(180px, 28vh); padding: 9px 10px; resize: none; border: 0; outline: 0; background: transparent; line-height: 1.48; overflow-y: auto; }
.composer textarea:focus { outline: 0; }
.composer-actions { min-width: 0; gap: 4px; padding: 0 1px 1px; }
.attach-button { flex: 0 0 40px; }
.composer-note { flex: 1; min-width: 0; margin-left: 7px; overflow: hidden; color: var(--subtle); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.send-button { min-height: 38px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 0 13px; border: 0; border-radius: 12px; background: var(--accent); color: var(--accent-contrast); font-weight: 610; transition: background .15s ease, transform .15s ease; }
.send-button:hover:not(:disabled) { background: var(--accent-strong); transform: translateY(-1px); }
.send-button svg { width: 17px; height: 17px; }
.progress-row { width: min(850px, 100%); min-height: 36px; display: flex; align-items: center; gap: 9px; margin: 0 auto 7px; color: var(--subtle); font-size: 12px; }
.progress-label { flex: 1; }
.progress-spinner { width: 16px; height: 16px; flex: 0 0 16px; border: 2px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
.attachment-list { display: flex; flex-wrap: wrap; gap: 7px; margin: 0 2px 7px; }
.attachment-card { min-width: 0; max-width: 100%; min-height: 58px; display: flex; align-items: center; gap: 8px; padding: 6px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-muted); }
.attachment-preview { width: 42px; height: 42px; flex: 0 0 42px; object-fit: cover; border-radius: 8px; background: var(--surface); }
.attachment-details { min-width: 0; display: grid; gap: 2px; }
.attachment-name { max-width: min(48vw, 250px); overflow: hidden; font-size: 11px; font-weight: 570; text-overflow: ellipsis; white-space: nowrap; }
.attachment-status { max-width: min(48vw, 250px); overflow: hidden; color: var(--subtle); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.status-uploaded .attachment-status { color: var(--accent-strong); }
.status-failed .attachment-status, .status-cancelled .attachment-status { color: var(--danger); }
.attachment-remove { min-width: 30px; min-height: 30px; margin-left: auto; border: 0; border-radius: 8px; background: transparent; color: var(--subtle); font-size: 20px; }
.attachment-chip { max-width: min(100%, 280px); display: flex; align-items: center; gap: 7px; padding: 5px 8px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-muted); color: var(--subtle); font-size: 11px; }
.attachment-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attachment-chip button { min-width: 26px; min-height: 26px; border: 0; border-radius: 7px; background: transparent; color: inherit; }

.panel-scrim { display: none; }
#drawer-root { position: fixed; z-index: 20; inset: 0; pointer-events: none; }
.drawer-scrim { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: rgb(8 12 10 / 28%); pointer-events: auto; }
.drawer { position: absolute; top: 0; right: 0; bottom: 0; width: min(470px, 94vw); min-width: 0; display: flex; flex-direction: column; padding: max(18px, env(safe-area-inset-top)) 18px max(16px, env(safe-area-inset-bottom)); border-left: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow); pointer-events: auto; }
.drawer-head { flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 13px; border-bottom: 1px solid var(--border); }
.drawer-head h2 { min-width: 0; margin: 0; overflow: hidden; font-size: 17px; font-weight: 620; letter-spacing: -.02em; text-overflow: ellipsis; white-space: nowrap; }
.drawer-body { flex: 1 1 auto; min-height: 0; overflow-x: hidden; overflow-y: auto; padding: 14px 2px 6px; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.drawer-row, .preset-row, .admin-row { width: 100%; min-width: 0; display: block; margin: 0 0 8px; padding: 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); text-align: left; line-height: 1.4; overflow-wrap: anywhere; }
.drawer-row:hover, .preset-row:hover, .admin-row:hover { background: var(--surface-hover); }
.drawer-row small, .preset-row small { display: block; margin-top: 4px; color: var(--subtle); font-size: 11px; line-height: 1.45; }
.drawer-body > h3 { margin: 20px 2px 9px; color: var(--subtle); font-size: 11px; font-weight: 650; letter-spacing: .04em; text-transform: uppercase; }
.tools-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.tool-card { min-width: 0; min-height: 76px; display: flex; align-items: flex-start; gap: 10px; padding: 12px; border: 1px solid var(--border); border-radius: 13px; background: var(--surface); text-align: left; }
.tool-card:hover { background: var(--surface-hover); }
.tool-card-icon { width: 30px; height: 30px; flex: 0 0 30px; display: grid; place-items: center; border-radius: 9px; background: var(--surface-muted); color: var(--accent); }
.tool-card-icon svg { width: 17px; height: 17px; }
.tool-card-copy { min-width: 0; display: grid; gap: 4px; }
.tool-card-copy strong { font-size: 12px; font-weight: 610; line-height: 1.35; }
.tool-card-copy small { color: var(--subtle); font-size: 10px; line-height: 1.4; }
.form-field { display: grid; gap: 6px; margin: 0 0 14px; color: var(--subtle); font-size: 12px; }
.form-field input, .form-field textarea, .form-field select { width: 100%; min-height: 42px; padding: 10px 11px; border: 1px solid var(--border); border-radius: 11px; background: var(--bg); color: var(--text); }
.form-field textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
.settings-note { color: var(--subtle); font-size: 11px; line-height: 1.5; }
.file-row { margin: 0 0 11px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.file-row .drawer-row { margin: 0 0 6px; }
.file-row .toolbar { justify-content: flex-end; flex-wrap: wrap; }
.preview-image { display: block; width: 100%; max-height: 70vh; object-fit: contain; border-radius: 12px; background: var(--surface-muted); }
.auth-gate { width: min(440px, calc(100vw - 34px)); margin: max(8vh, 30px) auto 0; padding: 28px 22px; border: 1px solid var(--border); border-radius: 22px; background: var(--surface); box-shadow: var(--shadow); text-align: center; }
.auth-icon { width: 68px; height: 68px; display: block; margin: 0 auto 16px; object-fit: cover; border-radius: 19px; }
.auth-gate h1 { margin: 0 0 10px; font-size: 22px; letter-spacing: -.03em; }
.auth-gate p { color: var(--subtle); font-size: 13px; line-height: 1.55; }
.auth-login { width: 100%; min-height: 46px; margin: 12px 0; }
.auth-telegram-link { display: inline-block; margin: 8px 0; color: var(--accent-strong); font-weight: 650; }
.auth-wait { display: block; margin-top: 8px; }
.auth-install { margin-top: 24px; font-size: 11px; }
.toast { position: fixed; z-index: 30; left: 50%; bottom: max(82px, calc(env(safe-area-inset-bottom) + 72px)); max-width: calc(100vw - 32px); padding: 10px 15px; transform: translateX(-50%); border-radius: 12px; background: var(--text); color: var(--bg); box-shadow: var(--shadow); font-size: 12px; line-height: 1.45; }
.loading-dot { color: var(--accent); }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 760px) {
  .shell { display: block; }
  .main { width: 100%; height: 100%; }
  .sidebar { position: absolute; z-index: 8; inset: 0 auto 0 0; width: min(330px, 88vw); height: 100%; transform: translateX(-105%); transition: transform .2s ease; box-shadow: var(--shadow); }
  .shell.sidebar-open .sidebar { transform: translateX(0); }
  .shell.sidebar-open .panel-scrim { position: absolute; z-index: 7; inset: 0; display: block; border: 0; background: rgb(0 0 0 / 30%); }
  .chat-top { min-height: 54px; padding: 0 11px; gap: 9px; }
  .mobile-menu { display: inline-grid; width: 40px; height: 40px; }
  .top-hint { display: none; }
  .install-cta { min-height: 34px; gap: 6px; padding: 0 10px; font-size: 11px; }
  .install-label-long { display: none; }
  .install-label-short { display: inline; }
  .messages { padding: 18px 14px 14px; }
  .empty-state { margin: clamp(30px, 10vh, 88px) auto 24px; }
  .empty-state p { margin-bottom: 19px; }
  .suggestions { gap: 7px; }
  .suggestion { min-height: 64px; padding: 10px 11px; }
  .message { gap: 8px; margin-bottom: 17px; }
  .message-content { font-size: 14px; }
  .composer-wrap { padding: 6px 9px max(8px, env(safe-area-inset-bottom)); }
  .composer { padding: 6px 7px 7px; border-radius: 17px; }
  .composer-note { display: none; }
  .drawer { top: auto; bottom: 0; width: 100%; max-height: min(86%, calc(var(--app-height) - env(safe-area-inset-top) - 14px)); border: 1px solid var(--border); border-bottom: 0; border-radius: 20px 20px 0 0; padding: 12px 14px max(14px, env(safe-area-inset-bottom)); }
  .install-dialog { top: auto; bottom: max(10px, env(safe-area-inset-bottom)); width: calc(100vw - 20px); max-height: min(82vh, calc(var(--app-height) - env(safe-area-inset-top) - 18px)); padding: 18px 16px max(16px, env(safe-area-inset-bottom)); transform: translateX(-50%); border-radius: 21px; }
  .install-dialog h2 { font-size: 19px; }
  .drawer-head { padding-bottom: 10px; }
  .drawer-body { padding-top: 11px; }
  .tools-grid { gap: 7px; }
  .tool-card { min-height: 70px; padding: 10px; gap: 8px; }
  .tool-card-copy small { font-size: 9px; }
}

@media (max-width: 380px) {
  .suggestions { grid-template-columns: 1fr; }
  .suggestion { min-height: 56px; }
  .tools-grid { grid-template-columns: 1fr; }
  .tool-card { min-height: 58px; }
  .send-button { padding: 0 10px; }
  .send-button span { display: none; }
  .chat-top { gap: 6px; padding: 0 8px; }
  .install-cta { gap: 5px; padding: 0 8px; font-size: 10px; }
}

@media (min-width: 761px) and (max-height: 560px) {
  .sidebar { padding-top: 8px; padding-bottom: 7px; }
  .side-head { padding-bottom: 8px; }
  .search-wrap { margin: 8px 0 5px; }
  .chat-item { min-height: 50px; padding: 7px 10px; }
  .sidebar-footer { padding-top: 5px; }
}

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