:root {
    color-scheme: dark;
    --bg: #060817;
    --bg-deep: #040512;
    --panel: rgba(13, 16, 38, .84);
    --panel-solid: #0d1026;
    --surface: rgba(255, 255, 255, .055);
    --surface-hover: rgba(255, 255, 255, .09);
    --text: #f7f7ff;
    --muted: #9298b5;
    --muted-2: #737a9b;
    --line: rgba(255, 255, 255, .085);
    --primary: #795cff;
    --primary-2: #a251ff;
    --cyan: #38d7ed;
    --green: #2ed39a;
    --danger: #ff6b91;
    --whatsapp: #20c875;
    --shadow: 0 30px 90px rgba(0, 0, 0, .38);
    --code: #060817;
}

html[data-theme="light"] {
    color-scheme: light;
    --bg: #eef2ff;
    --bg-deep: #f8f9ff;
    --panel: rgba(255, 255, 255, .83);
    --panel-solid: #ffffff;
    --surface: rgba(67, 58, 130, .055);
    --surface-hover: rgba(102, 78, 225, .09);
    --text: #191c36;
    --muted: #69708e;
    --muted-2: #8086a1;
    --line: rgba(43, 43, 81, .10);
    --primary: #6f4ef2;
    --primary-2: #963de1;
    --cyan: #079eb5;
    --shadow: 0 30px 80px rgba(70, 72, 115, .16);
    --code: #111528;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
    margin: 0;
    overflow: hidden;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
}
button, textarea, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
svg { width: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
[hidden] { display: none !important; }

.ambient { position: fixed; border-radius: 999px; filter: blur(95px); pointer-events: none; opacity: .32; }
.ambient-one { width: 430px; height: 430px; background: #6035ff; top: -210px; left: 24%; }
.ambient-two { width: 390px; height: 390px; background: #00b8d7; right: -180px; bottom: -210px; opacity: .20; }

.app-shell { position: relative; z-index: 1; display: grid; grid-template-columns: 292px minmax(0, 1fr); height: 100dvh; padding: 12px; gap: 12px; }
.sidebar, .main-panel { border: 1px solid var(--line); background: var(--panel); backdrop-filter: blur(28px); -webkit-backdrop-filter: blur(28px); box-shadow: var(--shadow); }
.sidebar { min-width: 0; border-radius: 25px; padding: 18px; display: flex; flex-direction: column; overflow: hidden; }
.main-panel { min-width: 0; border-radius: 25px; overflow: hidden; display: flex; flex-direction: column; }

.brand-row { display: flex; align-items: center; gap: 12px; padding: 2px 2px 20px; }
.brand-logo { position: relative; display: grid; place-items: center; width: 45px; height: 45px; border-radius: 15px; flex: 0 0 auto; color: white; background: linear-gradient(145deg, var(--primary), var(--primary-2) 58%, var(--cyan)); box-shadow: 0 13px 32px rgba(111, 72, 242, .34); }
.brand-logo span { font-size: 22px; font-weight: 900; letter-spacing: -.08em; transform: translateX(-1px); }
.brand-logo i, .agent-avatar i { position: absolute; width: 8px; height: 8px; border-radius: 99px; background: #65f1dc; border: 2px solid #14152c; right: -1px; bottom: 1px; box-shadow: 0 0 0 3px rgba(101, 241, 220, .13); }
.brand-copy { min-width: 0; }
.brand-copy strong { display: block; font-size: 15px; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-copy span { color: var(--muted); font-size: 11.5px; }

.icon-button { width: 41px; height: 41px; padding: 0; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); color: var(--muted); display: grid; place-items: center; cursor: pointer; transition: .2s ease; }
.icon-button:hover { color: var(--text); background: var(--surface-hover); transform: translateY(-1px); border-color: rgba(121, 92, 255, .4); }
.icon-button svg { width: 18px; }
.mobile-close, .mobile-menu { display: none; }

.new-chat-button { display: flex; align-items: center; gap: 11px; width: 100%; border: 1px solid rgba(125, 93, 255, .28); border-radius: 16px; padding: 10px; color: var(--text); background: linear-gradient(135deg, rgba(121, 92, 255, .14), rgba(56, 215, 237, .07)); cursor: pointer; text-align: left; transition: .2s ease; }
.new-chat-button:hover { border-color: rgba(125, 93, 255, .60); transform: translateY(-1px); }
.new-chat-icon { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; color: white; background: linear-gradient(145deg, var(--primary), var(--primary-2)); }
.new-chat-icon svg { width: 17px; }
.new-chat-button strong { display: block; font-size: 12.5px; }
.new-chat-button small { display: block; color: var(--muted); font-size: 10.5px; margin-top: 2px; }
.sidebar-label { margin: 23px 6px 9px; color: var(--muted-2); font-size: 10px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.mode-navigation { display: grid; gap: 7px; }
.mode-nav { position: relative; width: 100%; border: 1px solid transparent; border-radius: 15px; background: transparent; color: var(--muted); padding: 10px; display: flex; align-items: center; gap: 11px; cursor: pointer; text-align: left; transition: .2s ease; }
.mode-nav:hover { background: var(--surface); color: var(--text); }
.mode-nav.active { color: var(--text); border-color: rgba(121, 92, 255, .22); background: linear-gradient(135deg, rgba(121, 92, 255, .14), rgba(162, 81, 255, .07)); }
.nav-icon { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; color: var(--muted); background: var(--surface); flex: 0 0 auto; }
.mode-nav.active .nav-icon { color: #c4b7ff; background: rgba(121, 92, 255, .20); }
.nav-icon svg { width: 18px; }
.mode-nav strong { display: block; font-size: 12.5px; }
.mode-nav small { display: block; margin-top: 2px; font-size: 10.5px; color: var(--muted); }
.mode-nav em { position: absolute; right: 10px; top: 9px; padding: 3px 6px; border-radius: 99px; color: #c9fcff; background: rgba(32, 180, 201, .15); font-size: 7.5px; font-style: normal; font-weight: 900; letter-spacing: .08em; }
.sidebar-spacer { flex: 1; min-height: 20px; }

.credit-card { padding: 15px; border: 1px solid rgba(121, 92, 255, .20); border-radius: 17px; background: linear-gradient(145deg, rgba(121, 92, 255, .13), rgba(56, 215, 237, .055)); }
.credit-card-top { display: flex; align-items: center; gap: 10px; }
.credit-gem { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; color: #d2c9ff; background: rgba(121, 92, 255, .16); }
.credit-gem svg { width: 19px; }
.credit-card-top small { display: block; color: var(--muted); font-size: 10px; }
.credit-card-top strong { display: block; margin-top: 2px; font-size: 16px; }
.credit-track { height: 6px; margin: 12px 0 9px; border-radius: 99px; overflow: hidden; background: rgba(255,255,255,.08); }
.credit-track i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--primary), var(--cyan)); transition: width .35s ease; }
.credit-card p { color: var(--muted); font-size: 10.5px; line-height: 1.5; margin: 0; }
.sidebar-contact { display: flex; align-items: center; justify-content: center; gap: 7px; margin-top: 11px; padding: 9px 10px; border-radius: 11px; color: white; background: rgba(32, 200, 117, .88); text-decoration: none; font-size: 11px; font-weight: 800; transition: .2s ease; }
.sidebar-contact:hover { transform: translateY(-1px); filter: brightness(1.08); }
.sidebar-contact svg { width: 16px; }
.credit-id { margin-top: 9px; color: var(--muted-2); text-align: center; font-size: 9.5px; }
.credit-id button { border: 0; background: transparent; color: var(--muted); padding: 0; font-weight: 700; cursor: pointer; }
.credit-id button:hover { color: var(--text); }

.topbar { min-height: 72px; padding: 13px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.topbar-left, .topbar-actions { display: flex; align-items: center; gap: 10px; }
.agent-avatar { position: relative; width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; color: white; background: linear-gradient(145deg, var(--primary), var(--primary-2) 60%, var(--cyan)); box-shadow: 0 12px 28px rgba(111, 72, 242, .24); }
.agent-avatar span { font-weight: 900; font-size: 19px; }
.agent-status strong { display: block; font-size: 13px; }
.agent-status span { display: flex; align-items: center; gap: 6px; margin-top: 3px; color: var(--muted); font-size: 10.5px; }
.agent-status span i { width: 6px; height: 6px; border-radius: 99px; background: var(--green); box-shadow: 0 0 0 4px rgba(46, 211, 154, .11); }
.agent-status span b { font-weight: 500; }
.top-credit-pill { height: 38px; padding: 0 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 11px; }
.top-credit-pill svg { width: 15px; color: #b7a8ff; }
.top-credit-pill b { color: var(--text); font-size: 12px; }
.sun-icon { display: none; }
html[data-theme="light"] .sun-icon { display: block; }
html[data-theme="light"] .moon-icon { display: none; }

.workspace { min-height: 0; flex: 1; display: flex; flex-direction: column; position: relative; }
.messages { min-height: 0; flex: 1; overflow-y: auto; padding: 30px clamp(18px, 5vw, 74px) 28px; scroll-behavior: smooth; }
.messages::-webkit-scrollbar { width: 9px; }
.messages::-webkit-scrollbar-thumb { border: 3px solid transparent; border-radius: 99px; background: rgba(146, 152, 181, .24); background-clip: padding-box; }

.welcome { max-width: 840px; margin: clamp(45px, 9vh, 108px) auto 0; text-align: center; animation: rise .45s ease both; }
.welcome-mark { position: relative; width: 77px; height: 77px; margin: 0 auto 23px; display: grid; place-items: center; border-radius: 25px; color: white; background: linear-gradient(145deg, var(--primary), var(--primary-2) 56%, var(--cyan)); box-shadow: 0 23px 60px rgba(111, 72, 242, .29); }
.welcome-mark svg { width: 33px; }
.welcome-mark::after { content: ''; position: absolute; inset: -7px; border: 1px solid rgba(130, 100, 255, .18); border-radius: 30px; }
.welcome h1 { margin: 0; font-size: clamp(32px, 5vw, 54px); line-height: 1.04; letter-spacing: -.055em; }
.gradient-text { color: transparent; background: linear-gradient(95deg, #ad9cff, #e89eff 50%, #58def1); background-clip: text; -webkit-background-clip: text; }
html[data-theme="light"] .gradient-text { background: linear-gradient(95deg, #6644e8, #a638dc 55%, #028fa7); background-clip: text; -webkit-background-clip: text; }
.welcome > p { max-width: 610px; margin: 16px auto 27px; color: var(--muted); font-size: 14.5px; line-height: 1.7; }
.suggestion-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.suggestion-card { border: 1px solid var(--line); border-radius: 16px; background: var(--surface); color: var(--text); padding: 14px; cursor: pointer; text-align: left; display: flex; align-items: center; gap: 12px; transition: .2s ease; }
.suggestion-card:hover { transform: translateY(-2px); border-color: rgba(121, 92, 255, .40); background: var(--surface-hover); }
.suggestion-card > span:first-child { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; flex: 0 0 auto; color: #b9aaff; background: rgba(121, 92, 255, .13); }
.suggestion-card svg { width: 18px; }
.suggestion-card strong { display: block; font-size: 12.5px; }
.suggestion-card small { display: block; margin-top: 3px; color: var(--muted); font-size: 10.5px; line-height: 1.4; }

.message-row { max-width: 920px; margin: 0 auto 24px; display: flex; align-items: flex-start; gap: 11px; animation: rise .28s ease both; }
.message-row.user { justify-content: flex-end; }
.message-avatar { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; flex: 0 0 auto; }
.message-row.assistant .message-avatar { color: white; background: linear-gradient(145deg, var(--primary), var(--primary-2)); }
.message-row.user .message-avatar { order: 2; color: var(--muted); background: var(--surface); border: 1px solid var(--line); }
.message-avatar svg { width: 16px; }
.message-content { max-width: min(78%, 760px); min-width: 0; }
.message-row.user .message-content { display: flex; flex-direction: column; align-items: flex-end; }
.message-name { margin: 0 0 6px 3px; color: var(--muted-2); font-size: 10px; }
.message-bubble { max-width: 100%; padding: 13px 15px; border-radius: 17px; font-size: 13.5px; line-height: 1.68; overflow-wrap: anywhere; }
.message-row.assistant .message-bubble { border: 1px solid var(--line); border-top-left-radius: 5px; background: var(--surface); }
.message-row.user .message-bubble { border-top-right-radius: 5px; color: white; background: linear-gradient(135deg, #7657f5, #934bdd); box-shadow: 0 10px 25px rgba(111, 72, 242, .15); }
.message-text { white-space: pre-wrap; }
.message-tools { display: flex; gap: 4px; margin-top: 7px; }
.message-tool { padding: 5px; border: 0; border-radius: 7px; background: transparent; color: var(--muted-2); cursor: pointer; }
.message-tool:hover { color: var(--text); background: var(--surface); }
.message-tool svg { display: block; width: 14px; }

.code-block { margin: 11px 0; overflow: hidden; border: 1px solid rgba(255,255,255,.08); border-radius: 13px; color: #edf0ff; background: var(--code); }
.code-header { min-height: 33px; padding: 7px 10px; display: flex; align-items: center; justify-content: space-between; gap: 10px; color: #98a0bd; background: rgba(255,255,255,.055); font-size: 10px; }
.code-copy { border: 0; background: transparent; color: inherit; cursor: pointer; }
.code-block pre { margin: 0; padding: 13px; overflow-x: auto; font: 12px/1.65 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; white-space: pre; }
.typing { min-height: 20px; display: inline-flex; align-items: center; gap: 5px; }
.typing i { width: 6px; height: 6px; border-radius: 99px; background: var(--muted); animation: bounce 1.15s infinite; }
.typing i:nth-child(2) { animation-delay: .14s; }
.typing i:nth-child(3) { animation-delay: .28s; }

.generated-card { width: min(100%, 620px); overflow: hidden; border: 1px solid var(--line); border-radius: 19px; background: var(--surface); }
.generated-image-wrap { position: relative; aspect-ratio: 1 / 1; overflow: hidden; background: rgba(0,0,0,.15); cursor: zoom-in; }
.generated-image-wrap.portrait { aspect-ratio: 2 / 3; }
.generated-image-wrap.landscape { aspect-ratio: 3 / 2; }
.generated-image-wrap img { width: 100%; height: 100%; display: block; object-fit: cover; transition: transform .35s ease; }
.generated-image-wrap:hover img { transform: scale(1.018); }
.generated-image-actions { position: absolute; right: 11px; bottom: 11px; display: flex; gap: 7px; }
.image-action { width: 37px; height: 37px; border: 1px solid rgba(255,255,255,.19); border-radius: 11px; display: grid; place-items: center; color: white; background: rgba(10, 11, 24, .68); backdrop-filter: blur(10px); cursor: pointer; text-decoration: none; }
.image-action:hover { background: rgba(10, 11, 24, .86); }
.image-action svg { width: 16px; }
.generated-caption { padding: 12px 14px; }
.generated-caption strong { display: block; font-size: 11px; }
.generated-caption p { margin: 5px 0 0; color: var(--muted); font-size: 10.5px; line-height: 1.45; }

.composer-zone { position: relative; padding: 12px clamp(14px, 4vw, 62px) max(16px, env(safe-area-inset-bottom)); background: linear-gradient(to top, var(--panel-solid) 48%, transparent); }
.image-settings { max-width: 920px; margin: 0 auto 9px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 15px; background: var(--panel-solid); display: flex; align-items: center; justify-content: space-between; gap: 13px; animation: rise .22s ease both; }
.setting-group { display: flex; align-items: center; gap: 9px; min-width: 0; }
.setting-group > span { color: var(--muted-2); font-size: 9.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.segmented { padding: 3px; border-radius: 10px; background: var(--surface); display: flex; gap: 2px; }
.segmented button { min-height: 29px; padding: 5px 9px; border: 0; border-radius: 8px; color: var(--muted); background: transparent; display: flex; align-items: center; gap: 6px; cursor: pointer; font-size: 9.5px; }
.segmented button.active { color: var(--text); background: var(--panel-solid); box-shadow: 0 4px 13px rgba(0,0,0,.12); }
.shape { display: inline-block; border: 1.5px solid currentColor; border-radius: 2px; }
.shape.square { width: 10px; height: 10px; }
.shape.portrait { width: 8px; height: 11px; }
.shape.landscape { width: 12px; height: 8px; }
.composer { max-width: 920px; margin: 0 auto; min-height: 64px; padding: 9px 9px 9px 12px; border: 1px solid var(--line); border-radius: 20px; display: flex; align-items: flex-end; gap: 10px; background: var(--panel-solid); box-shadow: 0 16px 45px rgba(0,0,0,.17); transition: .2s ease; }
.composer:focus-within { border-color: rgba(121, 92, 255, .52); box-shadow: 0 16px 45px rgba(0,0,0,.17), 0 0 0 4px rgba(121, 92, 255, .075); }
.composer-icon { width: 36px; height: 36px; margin-bottom: 4px; border-radius: 11px; display: grid; place-items: center; flex: 0 0 auto; color: #b9abff; background: rgba(121, 92, 255, .11); }
.composer-icon svg { width: 17px; }
.image-compose-icon { display: none; }
body.image-mode .image-compose-icon { display: block; }
body.image-mode .chat-compose-icon { display: none; }
textarea { flex: 1; min-width: 0; min-height: 39px; max-height: 175px; padding: 10px 0 5px; resize: none; overflow-y: auto; border: 0; outline: 0; color: var(--text); background: transparent; line-height: 1.5; font-size: 13.5px; }
textarea::placeholder { color: var(--muted-2); }
.composer-actions { display: flex; align-items: center; gap: 7px; }
.key-hint { margin-bottom: 12px; color: var(--muted-2); font-size: 10px; }
.send-button { width: 44px; height: 44px; border: 0; border-radius: 14px; display: grid; place-items: center; flex: 0 0 auto; color: white; background: linear-gradient(145deg, var(--primary), var(--primary-2) 65%, var(--cyan)); box-shadow: 0 10px 25px rgba(111, 72, 242, .25); cursor: pointer; transition: .2s ease; }
.send-button:hover:not(:disabled) { transform: translateY(-1px) scale(1.02); filter: brightness(1.08); }
.send-button:disabled { opacity: .38; box-shadow: none; cursor: not-allowed; }
.send-button svg { width: 18px; }
.spark-icon { display: none; }
body.image-mode .spark-icon { display: block; }
body.image-mode .send-icon { display: none; }
.composer-note { max-width: 920px; margin: 8px auto 0; text-align: center; color: var(--muted-2); font-size: 9.5px; }

.toast { position: fixed; z-index: 100; left: 50%; bottom: 24px; max-width: min(92vw, 560px); padding: 12px 15px; border: 1px solid var(--line); border-radius: 13px; color: var(--text); background: var(--panel-solid); box-shadow: var(--shadow); transform: translate(-50%, 18px); opacity: 0; pointer-events: none; transition: .23s ease; font-size: 12px; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { border-color: rgba(255, 107, 145, .32); }

.modal-backdrop { position: fixed; z-index: 110; inset: 0; padding: 20px; display: grid; place-items: center; background: rgba(2, 3, 12, .74); backdrop-filter: blur(13px); opacity: 0; visibility: hidden; transition: .25s ease; }
.modal-backdrop.open { opacity: 1; visibility: visible; }
.limit-modal { position: relative; width: min(100%, 470px); padding: 34px; border: 1px solid rgba(165, 129, 255, .24); border-radius: 27px; text-align: center; background: linear-gradient(145deg, #151631, #0d1026); color: #f7f7ff; box-shadow: 0 35px 100px rgba(0,0,0,.55); transform: translateY(13px) scale(.97); transition: .25s ease; }
.modal-backdrop.open .limit-modal { transform: translateY(0) scale(1); }
.modal-close { position: absolute; right: 14px; top: 14px; width: 34px; height: 34px; border: 0; border-radius: 10px; display: grid; place-items: center; color: #9197b4; background: rgba(255,255,255,.06); cursor: pointer; }
.modal-close svg { width: 15px; }
.heart-orb { width: 68px; height: 68px; margin: 0 auto 18px; border-radius: 22px; display: grid; place-items: center; color: white; background: linear-gradient(145deg, #8d58ff, #ec5fba); box-shadow: 0 18px 50px rgba(199, 76, 194, .24); }
.heart-orb svg { width: 30px; }
.limit-kicker { color: #b7a8ff; font-size: 10px; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
.limit-modal h2 { margin: 10px 0 10px; font-size: 25px; letter-spacing: -.035em; }
.limit-modal p { margin: 0 auto; max-width: 385px; color: #a3a8c3; font-size: 13px; line-height: 1.65; }
.modal-credit-id { margin: 18px 0 13px; padding: 10px; border: 1px dashed rgba(180, 160, 255, .25); border-radius: 12px; color: #9298b5; font-size: 10px; }
.modal-credit-id strong { color: white; margin-left: 6px; letter-spacing: .08em; }
.whatsapp-button { min-height: 48px; padding: 11px 18px; border-radius: 14px; display: flex; align-items: center; justify-content: center; gap: 9px; color: white; background: linear-gradient(135deg, #1fc875, #10ae62); text-decoration: none; font-size: 12px; font-weight: 800; box-shadow: 0 13px 32px rgba(31, 200, 117, .18); transition: .2s ease; }
.whatsapp-button:hover { transform: translateY(-1px); filter: brightness(1.07); }
.whatsapp-button svg { width: 19px; }
.limit-modal > small { display: block; margin-top: 11px; color: #737a9b; font-size: 9.5px; }

.image-viewer { position: fixed; z-index: 120; inset: 0; padding: 35px; display: grid; place-items: center; background: rgba(0,0,0,.88); opacity: 0; visibility: hidden; transition: .22s ease; }
.image-viewer.open { opacity: 1; visibility: visible; }
.image-viewer img { max-width: 94vw; max-height: 90vh; object-fit: contain; border-radius: 16px; box-shadow: 0 25px 90px rgba(0,0,0,.55); }
.image-viewer button { position: absolute; right: 20px; top: 20px; width: 42px; height: 42px; border: 1px solid rgba(255,255,255,.15); border-radius: 13px; display: grid; place-items: center; color: white; background: rgba(255,255,255,.08); cursor: pointer; }

.sidebar-overlay { display: none; }
@keyframes rise { from { opacity: 0; transform: translateY(9px); } to { opacity: 1; transform: translateY(0); } }
@keyframes bounce { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-5px); opacity: 1; } }

@media (max-width: 900px) {
    .app-shell { grid-template-columns: 1fr; padding: 0; gap: 0; }
    .main-panel { border: 0; border-radius: 0; }
    .sidebar { position: fixed; z-index: 90; inset: 0 auto 0 0; width: min(86vw, 310px); border-radius: 0 24px 24px 0; transform: translateX(-105%); transition: transform .25s ease; }
    .sidebar.open { transform: translateX(0); }
    .sidebar-overlay { position: fixed; z-index: 80; inset: 0; display: block; background: rgba(2,3,12,.62); opacity: 0; visibility: hidden; transition: .25s ease; }
    .sidebar-overlay.open { opacity: 1; visibility: visible; }
    .mobile-menu, .mobile-close { display: grid; }
    .mobile-close { margin-left: auto; }
    .messages { padding-inline: 15px; }
}

@media (max-width: 640px) {
    .topbar { min-height: 64px; padding-inline: 11px; }
    .top-credit-pill span { display: none; }
    .top-credit-pill { padding-inline: 10px; }
    .agent-avatar { width: 38px; height: 38px; }
    .welcome { margin-top: 38px; }
    .welcome-mark { width: 65px; height: 65px; border-radius: 21px; }
    .welcome h1 { font-size: 33px; }
    .welcome > p { font-size: 13px; }
    .suggestion-grid { grid-template-columns: 1fr; }
    .suggestion-card:nth-child(n+4) { display: none; }
    .message-content { max-width: 84%; }
    .image-settings { align-items: stretch; flex-direction: column; }
    .setting-group { justify-content: space-between; }
    .quality-group { border-top: 1px solid var(--line); padding-top: 8px; }
    .segmented button { padding-inline: 8px; }
    .composer-zone { padding-inline: 9px; }
    .composer-icon { display: none; }
    .key-hint { display: none; }
    .composer { min-height: 59px; padding-left: 14px; }
    .limit-modal { padding: 30px 21px 24px; }
    .image-viewer { padding: 16px; }
}
