[hidden] { display: none !important; }
* { box-sizing: border-box; }
:root {
  color-scheme: dark;
  --bg: #080b14;
  --surface: #101726;
  --surface-soft: #0c1320;
  --border: rgba(148, 163, 184, .14);
  --text: #ecf2ff;
  --muted: #8492aa;
  --purple: #8b7cff;
  --cyan: #54d4e8;
  --green: #55d6a0;
  --font: var(--aira-persian-font, 'Vazirmatn', Tahoma, sans-serif);
}
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; background: var(--bg); }
body { color: var(--text); font-family: var(--font); -webkit-font-smoothing: antialiased; }
button, textarea { font: inherit; color: inherit; }
button { -webkit-tap-highlight-color: transparent; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; clip-path: inset(50%); }
.mobile-shell { position: relative; display: flex; width: min(100%, 980px); height: 100%; min-height: 0; flex-direction: column; margin: 0 auto; overflow: hidden; border-inline: 1px solid rgba(148,163,184,.08); background: radial-gradient(ellipse at 20% 0%, rgba(102,85,240,.12), transparent 32rem), #090e18; }
.mobile-topbar { z-index: 2; display: flex; height: 68px; flex: 0 0 68px; align-items: center; gap: 12px; padding: 0 18px; border-bottom: 1px solid var(--border); background: rgba(9,14,24,.95); }
.menu-btn { display: grid; width: 38px; height: 38px; flex: 0 0 38px; place-items: center; border: 1px solid var(--border); border-radius: 11px; color: #bac7dc; background: #101827; cursor: pointer; }
.mobile-brand { display: flex; min-width: 0; flex: 1; align-items: center; gap: 9px; }
.brand-logo-sm { display: grid; width: 37px; height: 37px; flex: 0 0 37px; place-items: center; border: 1px solid rgba(139,124,255,.28); border-radius: 12px; color: #c3baff; background: linear-gradient(145deg, rgba(124,105,255,.23), rgba(31,198,220,.08)); }
.brand-text { min-width: 0; }
.brand-text h1 { margin: 0; color: #e7edfb; font-size: .9rem; font-weight: 700; }
.brand-text p { max-width: 50vw; margin: 2px 0 0; overflow: hidden; color: var(--muted); font-size: .65rem; text-overflow: ellipsis; white-space: nowrap; }
.new-chat-btn { display: inline-flex; min-height: 36px; align-items: center; gap: 7px; padding: 0 11px; border: 1px solid rgba(139,124,255,.25); border-radius: 10px; color: #d2ccff; background: rgba(139,124,255,.1); cursor: pointer; font-size: .72rem; }
.new-chat-btn:disabled { opacity: .55; cursor: wait; }
.mobile-tabs { display: flex; flex: 0 0 48px; gap: 8px; padding: 7px 16px; border-bottom: 1px solid var(--border); background: rgba(12,18,30,.92); }
.mobile-tab { display: inline-flex; flex: 1; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 9px; color: #8491a8; background: transparent; cursor: pointer; font-size: .77rem; }
.mobile-tab.active { border-color: rgba(139,124,255,.18); color: #e7e4ff; background: rgba(139,124,255,.11); }
.tab-content { display: flex; min-height: 0; flex: 1; flex-direction: column; }
.tab-content[hidden] { display: none !important; }
.chat-panel-mobile { display: flex; width: 100%; max-width: 810px; height: 100%; min-height: 0; flex-direction: column; margin: 0 auto; }
.chat-panel-header-mobile { display: flex; min-height: 66px; flex: 0 0 auto; align-items: center; gap: 10px; padding: 10px 18px; border-bottom: 1px solid rgba(148,163,184,.08); background: rgba(14,21,34,.62); }
.chat-user-avatar-mobile, .msg-av-mobile { display: grid; width: 36px; height: 36px; flex: 0 0 36px; place-items: center; border: 1px solid rgba(139,124,255,.2); border-radius: 12px; color: #bcb2ff; background: rgba(113,94,232,.12); }
.chat-user-info-mobile { min-width: 0; flex: 1; }
.chat-user-info-mobile h3 { overflow: hidden; margin: 0; color: #dce5f4; font-size: .77rem; text-overflow: ellipsis; white-space: nowrap; }
.chat-user-info-mobile p { margin: 4px 0 0; color: var(--muted); font-size: .64rem; }
.chat-meta-mobile { display: flex; gap: 11px; color: #a3b1c7; font-size: .68rem; }
.chat-meta-mobile .item { display: inline-flex; align-items: center; gap: 5px; }
.chat-meta-mobile i { color: #8794ae; font-size: .66rem; }
.chat-scroll-mobile { display: flex; min-height: 0; flex: 1; flex-direction: column; gap: 16px; padding: 22px clamp(14px, 4vw, 34px); overflow: auto; overscroll-behavior: contain; scrollbar-color: #303a51 transparent; scrollbar-width: thin; }
.chat-welcome { display: flex; width: min(560px, 100%); flex-direction: column; align-items: center; justify-content: center; margin: auto; padding: 28px 12px; text-align: center; }
.welcome-icon { display: grid; width: 58px; height: 58px; place-items: center; border: 1px solid rgba(139,124,255,.28); border-radius: 19px; color: #bdb2ff; background: radial-gradient(circle at 30% 20%, rgba(139,124,255,.23), rgba(84,212,232,.07)); box-shadow: 0 0 35px rgba(119,98,255,.1); font-size: 1.2rem; }
.chat-welcome h2 { margin: 15px 0 5px; color: #edf1fd; font-size: 1.18rem; }
.chat-welcome p { max-width: 470px; margin: 0; color: #94a0b6; font-size: .79rem; line-height: 1.9; }
.suggestion-list { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 19px; }
.suggestion-chip { padding: 8px 11px; border: 1px solid var(--border); border-radius: 99px; color: #bac8dd; background: rgba(255,255,255,.025); cursor: pointer; font-size: .69rem; transition: .18s; }
.suggestion-chip:hover { border-color: rgba(139,124,255,.45); color: #e1ddff; background: rgba(139,124,255,.08); }
.msg-row-mobile { display: flex; width: 100%; align-items: flex-start; gap: 9px; animation: messageIn .24s ease-out both; }
.msg-row-mobile.user { flex-direction: row-reverse; }
.msg-row-mobile.ai { flex-direction: row; }
.msg-row-mobile.user .msg-av-mobile { border-color: rgba(84,212,232,.18); color: #8bd9e7; background: rgba(84,212,232,.08); }
.msg-content-mobile { display: flex; max-width: min(78%, 620px); flex-direction: column; gap: 5px; }
.msg-row-mobile.user .msg-content-mobile { align-items: flex-start; }
.msg-row-mobile.ai .msg-content-mobile { align-items: flex-end; }
.msg-bubble-mobile { padding: 12px 15px; border: 1px solid rgba(148,163,184,.12); border-radius: 16px; color: #e0e8f5; background: #141d2c; font-size: .83rem; line-height: 1.95; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg-row-mobile.user .msg-bubble-mobile { border-color: rgba(95,114,220,.2); border-start-end-radius: 5px; background: linear-gradient(145deg, rgba(74,83,164,.23), rgba(37,51,77,.53)); }
.msg-row-mobile.ai .msg-bubble-mobile { border-start-start-radius: 5px; background: rgba(18,27,41,.92); }
.msg-meta { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 4px; color: #748198; font-size: .59rem; }
.message-analysis-tag { color: #a99fff; }
.typing-bubble-mobile { display: flex; align-items: center; gap: 9px; animation: messageIn .2s ease-out both; }
.typing-bubble-body-mobile { display: flex; min-height: 41px; align-items: center; padding: 0 14px; border: 1px solid var(--border); border-radius: 14px; background: #121a29; }
.typing-dots-mobile { display: flex; gap: 5px; }
.typing-dots-mobile i { width: 6px; height: 6px; border-radius: 50%; background: #9b8dff; animation: dotPulse 1s infinite ease-in-out; }
.typing-dots-mobile i:nth-child(2) { animation-delay: .15s; }
.typing-dots-mobile i:nth-child(3) { animation-delay: .3s; }
@keyframes dotPulse { 0%, 60%, 100% { transform: translateY(0); opacity: .45; } 30% { transform: translateY(-4px); opacity: 1; } }
@keyframes messageIn { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }
.chat-composer { width: min(100%, 810px); flex: 0 0 auto; margin: 0 auto; padding: 14px clamp(14px, 4vw, 34px) max(16px, env(safe-area-inset-bottom)); border-top: 1px solid rgba(148,163,184,.08); background: linear-gradient(180deg, rgba(9,14,24,.2), #090e18 26%); }
.composer-input-wrap { display: flex; direction: ltr; align-items: flex-end; gap: 10px; min-height: 62px; padding: 8px; border: 1px solid rgba(148,163,184,.2); border-radius: 18px; background: linear-gradient(145deg, rgba(19,28,45,.98), rgba(13,20,33,.98)); box-shadow: 0 8px 28px rgba(0,0,0,.18), inset 0 1px 0 rgba(255,255,255,.025); transition: border-color .2s ease, box-shadow .2s ease; }
.composer-input-wrap:focus-within { border-color: rgba(143,128,255,.62); box-shadow: 0 0 0 3px rgba(139,124,255,.1), 0 10px 30px rgba(0,0,0,.2); }
.chat-composer textarea { display: block; width: 100%; min-height: 44px; max-height: 150px; flex: 1; resize: none; padding: 11px 8px; border: 0; border-radius: 10px; outline: none; direction: rtl; color: #eef2fc; background: transparent; font-size: .83rem; line-height: 1.7; }
.chat-composer textarea::placeholder { color: #8995aa; }
.chat-composer textarea:disabled { opacity: .65; }
.send-btn-mobile { display: grid; width: 42px; height: 42px; flex: 0 0 42px; place-items: center; border: 1px solid rgba(196,188,255,.28); border-radius: 13px; color: #101421; background: linear-gradient(145deg, #b6aaff, #68d9e8); box-shadow: 0 4px 14px rgba(116,100,230,.22); cursor: pointer; font-size: .95rem; transition: transform .16s ease, filter .16s ease, opacity .16s ease; }
.send-btn-mobile:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.08); }
.send-btn-mobile:disabled { cursor: wait; opacity: .45; }

.analysis-panel-mobile { display: flex; width: min(100%, 810px); height: 100%; min-height: 0; flex-direction: column; margin: 0 auto; }
.analysis-header-mobile { display: flex; min-height: 60px; flex: 0 0 auto; align-items: center; gap: 10px; padding: 10px 18px; border-bottom: 1px solid var(--border); color: #a99dff; }
.analysis-header-mobile h2 { flex: 1; margin: 0; color: #e0e8f5; font-size: .87rem; }
.analysis-status { color: var(--muted); font-size: .65rem; }
.analysis-scroll-mobile { display: flex; min-height: 0; flex: 1; flex-direction: column; gap: 12px; padding: 16px; overflow-y: auto; }
.a-card-mobile { padding: 15px; border: 1px solid var(--border); border-radius: 14px; background: linear-gradient(145deg, rgba(19,27,43,.95), rgba(13,19,31,.95)); }
.a-card-title-mobile { display: flex; align-items: center; gap: 8px; margin-bottom: 11px; color: #dde6f5; font-size: .79rem; font-weight: 600; }
.a-card-title-mobile i { color: #a99dff; }
.analysis-caveat { display: flex; align-items: flex-start; gap: 9px; color: #b8b0ff; }
.analysis-caveat p { margin: 0; color: #a8b3c8; font-size: .71rem; line-height: 1.8; }
.analysis-caveat > i { margin-top: 3px; }
.analysis-tone { display: flex; align-items: center; gap: 10px; color: #d5def0; font-size: .76rem; }
.analysis-tone strong { color: #9fded5; font-size: .7rem; }
.tone-meter { height: 7px; flex: 1; overflow: hidden; border-radius: 9px; background: #252d40; }
.tone-meter > span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #6bcbad, #9c8dff); transition: width .35s ease; }
.analysis-observation { margin: 12px 0 0; color: #aebbd0; font-size: .75rem; line-height: 1.85; }
.analysis-signals { display: grid; gap: 6px; margin: 10px 0 0; padding-inline-start: 20px; color: #b6c3d7; font-size: .72rem; line-height: 1.8; }
.final-analysis { color: #bcc8da; font-size: .75rem; line-height: 1.9; }
.final-analysis h3 { margin: 14px 0 5px; color: #dce5f4; font-size: .75rem; }
.final-analysis ul { display: grid; gap: 4px; margin: 5px 0; padding-inline-start: 21px; }
.final-summary { margin: 0; color: #d5def0; }
.analysis-placeholder { margin: 0; color: #8794aa; }
.final-disclaimer { margin: 13px 0 0; padding-top: 10px; border-top: 1px solid var(--border); color: #8390a6; font-size: .67rem; }
.pdf-export-button { display: flex; width: 100%; min-height: 44px; align-items: center; justify-content: center; gap: 9px; margin-top: 14px; padding: 10px 13px; border: 1px solid rgba(99,86,200,.25); border-radius: 11px; color: #d9d4ff; background: linear-gradient(105deg, rgba(111,97,216,.2), rgba(57,176,171,.1)); cursor: pointer; font: inherit; font-size: .73rem; font-weight: 600; transition: .18s ease; }
.pdf-export-button:hover { transform: translateY(-1px); border-color: rgba(139,124,255,.52); background: linear-gradient(105deg, rgba(111,97,216,.28), rgba(57,176,171,.16)); }
.pdf-export-button i { color: #ff999f; font-size: .95rem; }
.emotion-list-live { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 18px; margin-bottom: 16px; }
.emotion-row-live { min-width: 0; }
.emotion-row-header { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 6px; color: #c0ccdf; font-size: .71rem; }
.emotion-row-header strong { font-size: .7rem; }
.emotion-track-live { height: 6px; overflow: hidden; border-radius: 8px; background: #252d40; }
.emotion-track-live span { display: block; height: 100%; border-radius: inherit; box-shadow: 0 0 10px currentColor; transition: width .4s ease; }
.confidence-note { margin: 10px 0 0; color: #76849a; font-size: .64rem; }
.depression-summary { display: flex; align-items: center; gap: 19px; }
.depression-gauge { position: relative; width: 124px; height: 124px; flex: 0 0 124px; }
.depression-gauge svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.gauge-track, .gauge-value { fill: none; stroke-width: 9; }
.gauge-track { stroke: #242d40; }
.gauge-value { stroke: #8b7cff; stroke-linecap: round; stroke-dasharray: 301.59; stroke-dashoffset: 301.59; transition: stroke-dashoffset .5s ease, stroke .3s ease; filter: drop-shadow(0 0 5px rgba(139,124,255,.3)); }
.gauge-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.gauge-center strong { color: #e9e5ff; font-size: 1.45rem; line-height: 1; }
.gauge-center span { margin-top: 6px; color: #8492aa; font-size: .61rem; }
.depression-copy { min-width: 0; }
.depression-copy > strong { color: #d9d3ff; font-size: .87rem; }
.depression-copy p { margin: 7px 0 0; color: #a9b6ca; font-size: .72rem; line-height: 1.85; }
.metric-disclaimer { margin: 11px 0 0; padding-top: 9px; border-top: 1px solid rgba(148,163,184,.09); color: #748198; font-size: .63rem; line-height: 1.8; }
.mental-status-mobile { padding: 11px 12px; border: 1px solid rgba(139,124,255,.16); border-radius: 11px; background: rgba(139,124,255,.045); }
.mental-status-mobile[data-level="moderate"] { border-color: rgba(241,190,87,.2); background: rgba(241,190,87,.045); }
.mental-status-mobile[data-level="elevated"] { border-color: rgba(255,132,145,.22); background: rgba(255,132,145,.045); }
.status-line { display: flex; align-items: center; gap: 8px; color: #d9d4ff; font-size: .77rem; font-weight: 600; }
.mental-status-mobile[data-level="moderate"] .status-line { color: #f0d69c; }
.mental-status-mobile[data-level="elevated"] .status-line { color: #ffb4bc; }
.status-desc, .mental-insight { margin: 7px 0 0; color: #aab7ca; font-size: .71rem; line-height: 1.85; }
.mental-insight { color: #c1cbe0; }
.warning-grid-live { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; }
.warning-item-live { display: flex; min-width: 0; align-items: center; justify-content: space-between; gap: 7px; padding: 10px; border: 1px solid rgba(148,163,184,.09); border-radius: 10px; background: rgba(255,255,255,.022); }
.warning-item-live span { display: flex; min-width: 0; align-items: center; gap: 6px; color: #98a6bb; font-size: .68rem; }
.warning-item-live span i { color: #a699ff; }
.warning-item-live strong { overflow-wrap: anywhere; color: #d9e3f3; font-size: .7rem; text-align: left; }
.event-log-live { display: grid; gap: 0; }
.event-log-entry { display: grid; grid-template-columns: 48px minmax(0,1fr); gap: 9px; padding: 8px 2px; border-bottom: 1px solid rgba(148,163,184,.08); color: #afbdd1; font-size: .68rem; line-height: 1.8; }
.event-log-entry:last-child { border-bottom: 0; }
.event-log-entry time { color: #7f8da4; font-family: ui-monospace, Consolas, monospace; font-size: .62rem; direction: ltr; }
.finish-chat-button, .button-secondary { display: flex; width: 100%; min-height: 45px; align-items: center; justify-content: center; gap: 8px; padding: 10px 14px; border: 1px solid rgba(110,210,183,.18); border-radius: 12px; color: #b9f0df; background: rgba(63,173,141,.11); cursor: pointer; font-size: .76rem; font-weight: 600; }
.finish-chat-button:disabled { cursor: not-allowed; opacity: .42; }
.logout-button { border-color: var(--border); color: #aebbd0; background: rgba(255,255,255,.025); }

.drawer-overlay { position: fixed; z-index: 20; inset: 0; background: rgba(0,0,0,.62); opacity: 0; transition: opacity .24s; }
.drawer-overlay.open { opacity: 1; }
.drawer { position: fixed; z-index: 21; inset-block: 0; inset-inline-start: 0; display: flex; width: min(320px, 86vw); flex-direction: column; padding-top: env(safe-area-inset-top); border-inline-end: 1px solid var(--border); background: #0d1421; transform: translateX(105%); transition: transform .25s ease; }
html[dir="rtl"] .drawer { transform: translateX(105%); }
html[dir="ltr"] .drawer { transform: translateX(-105%); }
.drawer.open { transform: translateX(0) !important; }
.drawer-header { display: flex; align-items: center; gap: 10px; padding: 19px 16px; border-bottom: 1px solid var(--border); }
.drawer-brand-logo { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 12px; color: #c2baff; background: rgba(139,124,255,.13); }
.drawer-brand-text h3 { margin: 0; font-size: .86rem; }
.drawer-brand-text p { margin: 3px 0 0; color: var(--muted); font-size: .65rem; }
.drawer-nav { flex: 1; padding: 12px; overflow-y: auto; }
.drawer-label { margin: 13px 8px 8px; color: #76839a; font-size: .66rem; }
.drawer-item { display: flex; width: 100%; align-items: center; gap: 9px; padding: 10px; border: 1px solid transparent; border-radius: 9px; color: #c0cce0; background: transparent; cursor: pointer; text-align: right; font-size: .75rem; }
.drawer-item > i { width: 18px; color: #9a8eff; text-align: center; }
.drawer-item.active, .drawer-item:hover { border-color: rgba(139,124,255,.16); background: rgba(139,124,255,.08); }
.drawer-badge { margin-inline-start: auto; padding: 2px 6px; border: 1px solid rgba(96,139,244,.2); border-radius: 20px; color: #a9c4ff; background: rgba(77,125,233,.14); font-size: .58rem; line-height: 1.35; }
.conversation-history-list { display: grid; gap: 3px; }
.history-conversation-row { display: flex; min-width: 0; align-items: stretch; gap: 3px; border: 1px solid transparent; border-radius: 9px; }
.history-conversation-row.active { border-color: rgba(139,124,255,.16); background: rgba(139,124,255,.08); }
.history-conversation-open { display: flex; min-width: 0; flex: 1; align-items: center; gap: 8px; padding: 9px 8px; border: 0; border-radius: 8px; color: #b9c6da; background: transparent; cursor: pointer; text-align: right; font: inherit; font-size: .69rem; }
.history-conversation-open > i { width: 17px; flex: 0 0 17px; color: #9a8eff; text-align: center; }
.history-conversation-open:hover { color: #eef0ff; }
.history-conversation-text { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-conversation-open small { flex: 0 0 auto; color: #7c89a0; font-size: .61rem; }
.history-conversation-delete { display: grid; width: 31px; flex: 0 0 31px; place-items: center; margin: 3px; border: 1px solid transparent; border-radius: 8px; color: #8995aa; background: transparent; cursor: pointer; opacity: .7; transition: .16s ease; }
.history-conversation-row:hover .history-conversation-delete, .history-conversation-delete:focus-visible { opacity: 1; }
.history-conversation-delete:hover { border-color: rgba(255,119,133,.18); color: #ff9ba5; background: rgba(255,119,133,.09); }
.history-conversation-delete:disabled { cursor: wait; opacity: .4; }
.history-empty { padding: 7px 9px; color: #7f8ca2; font-size: .68rem; }
.drawer-footer { padding: 13px; border-top: 1px solid var(--border); }
.drawer-install-button { display: flex; width: 100%; min-height: 48px; align-items: center; gap: 10px; margin-bottom: 10px; padding: 8px 11px; border: 1px solid rgba(139,124,255,.24); border-radius: 12px; color: #e5e1ff; background: linear-gradient(110deg, rgba(139,124,255,.14), rgba(84,212,232,.08)); cursor: pointer; text-align: right; font: inherit; }
.drawer-install-button > i { display: grid; width: 30px; height: 30px; flex: 0 0 30px; place-items: center; border-radius: 9px; color: #c3baff; background: rgba(139,124,255,.13); }
.drawer-install-button span { flex: 1; font-size: .73rem; font-weight: 700; }
.drawer-install-button small { color: #91a0b7; font-size: .59rem; }
.drawer-install-button:hover { border-color: rgba(139,124,255,.48); background: linear-gradient(110deg, rgba(139,124,255,.2), rgba(84,212,232,.12)); }
.drawer-install-button[hidden] { display: none !important; }
.agent-card-drawer { display: flex; align-items: center; gap: 9px; padding: 10px; border: 1px solid var(--border); border-radius: 11px; background: rgba(255,255,255,.025); }
.agent-avatar-drawer { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 10px; color: #a9e9dc; background: rgba(85,214,160,.09); }
.agent-info-drawer h4 { margin: 0; font-size: .73rem; }
.agent-info-drawer p { display: flex; align-items: center; gap: 5px; margin: 4px 0 0; color: #8190a7; font-size: .63rem; }
.online-dot { width: 6px; height: 6px; border-radius: 50%; background: #54d49c; box-shadow: 0 0 8px #54d49c; }
.feature-sheet { position: fixed; z-index: 30; inset: 0; display: flex; justify-content: center; align-items: flex-end; padding: 16px; background: rgba(4,8,17,.52); }
.feature-sheet[hidden] { display: none !important; }
.feature-sheet-panel { width: min(560px, 100%); max-height: min(84vh, 760px); display: flex; flex-direction: column; border: 1px solid rgba(148,163,184,.12); border-radius: 20px 20px 14px 14px; background: rgba(10,15,24,.98); box-shadow: 0 20px 50px rgba(0,0,0,.35); overflow: hidden; }
.feature-sheet-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px 12px; border-bottom: 1px solid var(--border); }
.feature-sheet-kicker { margin: 0 0 4px; color: #7d8aa2; font-size: .62rem; letter-spacing: .08em; text-transform: uppercase; }
.feature-sheet-header h3 { margin: 0; font-size: 1rem; }
.feature-sheet-close { display: grid; width: 36px; height: 36px; place-items: center; border: 1px solid var(--border); border-radius: 10px; color: #c9d5ee; background: rgba(255,255,255,.02); cursor: pointer; }
.feature-sheet-body { padding: 18px; overflow-y: auto; }
.sheet-section { display: grid; gap: 12px; margin-bottom: 18px; }
.sheet-section:last-child { margin-bottom: 0; }
.sheet-title { margin: 0; color: #dfe8fb; font-size: .78rem; }
.sheet-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
.sheet-card { padding: 12px 10px; border: 1px solid var(--border); border-radius: 12px; background: linear-gradient(145deg, rgba(17,24,36,.95), rgba(12,18,30,.95)); }
.sheet-card strong { display: block; color: #eef4ff; font-size: .8rem; }
.sheet-card span { display: block; margin-top: 6px; color: #8a9ab0; font-size: .68rem; line-height: 1.8; }
.sheet-card .trend { margin-top: 8px; font-size: .62rem; color: #77d5b9; }
.sheet-list { display: grid; gap: 8px; padding: 0; margin: 0; list-style: none; }
.sheet-list li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: rgba(255,255,255,.02); color: #c7d3e7; font-size: .72rem; }
.sheet-list li small { color: #7c8ca3; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 11px; border: 1px solid var(--border); border-radius: 10px; background: rgba(255,255,255,.02); }
.setting-row strong { color: #ecf2ff; font-size: .73rem; }
.setting-row span { color: #8d9bb4; font-size: .62rem; }
.toggle-chip { position: relative; width: 52px; height: 30px; border: 1px solid rgba(139,124,255,.2); border-radius: 999px; background: rgba(139,124,255,.08); cursor: pointer; transition: background .18s ease; }
.toggle-chip::after { content: ''; position: absolute; top: 3px; left: 4px; width: 20px; height: 20px; border-radius: 50%; background: #dfe6ff; box-shadow: 0 3px 8px rgba(0,0,0,.15); transition: transform .18s ease; }
.toggle-chip.active { background: rgba(85,214,160,.18); }
.toggle-chip.active::after { transform: translateX(22px); background: #90efd1; }
.range-wrap { display: grid; gap: 6px; }
.range-wrap input[type="range"] { width: 100%; accent-color: #8b7cff; }
.range-value { color: #c7d4ee; font-size: .7rem; }
.sheet-actions { display: flex; gap: 8px; margin-top: 14px; }
.primary-sheet-btn, .secondary-sheet-btn { min-height: 40px; padding: 0 12px; border-radius: 10px; cursor: pointer; font-size: .72rem; }
.primary-sheet-btn { border: 1px solid rgba(120,111,255,.28); background: rgba(120,111,255,.14); color: #ece7ff; }
.secondary-sheet-btn { border: 1px solid var(--border); background: rgba(255,255,255,.02); color: #dfe9f9; }
.app-dialog-overlay { position: fixed; z-index: 50; inset: 0; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(4,9,17,.7); }
.app-dialog-overlay[hidden] { display: none !important; }
.app-dialog { width: min(420px, 100%); border: 1px solid rgba(148,163,184,.14); border-radius: 18px; background: linear-gradient(145deg, rgba(12,18,30,.98), rgba(16,23,36,.98)); box-shadow: 0 22px 50px rgba(0,0,0,.42); overflow: hidden; }
.app-dialog-header { display: flex; align-items: center; gap: 12px; padding: 16px 18px 12px; border-bottom: 1px solid var(--border); }
.app-dialog-icon { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 12px; color: #cdf6ea; background: rgba(89,213,167,.12); }
.app-dialog-kicker { margin: 0 0 4px; color: #8ea0ba; font-size: .6rem; letter-spacing: .08em; text-transform: uppercase; }
.app-dialog-header h3 { margin: 0; color: #edf3ff; font-size: .97rem; }
.app-dialog-body { padding: 18px; color: #c9d7ef; font-size: .8rem; line-height: 1.9; }
.app-dialog-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 0 18px 18px; }
.app-dialog-primary, .app-dialog-secondary { min-height: 40px; padding: 0 14px; border-radius: 10px; cursor: pointer; font-size: .72rem; }
.app-dialog-primary { border: 1px solid rgba(120,104,255,.22); background: linear-gradient(145deg, rgba(139,124,255,.18), rgba(84,212,232,.12)); color: #f0eeff; }
.app-dialog-secondary { border: 1px solid var(--border); background: rgba(255,255,255,.02); color: #dce6f7; }
.app-dialog-danger { border-color: rgba(255,119,133,.22); background: linear-gradient(145deg, rgba(255,119,133,.12), rgba(190,96,110,.08)); color: #ffdce2; }
.chat-notice { z-index: 10; margin: 10px 14px 0; padding: 10px 13px; border: 1px solid rgba(255,132,145,.23); border-radius: 11px; color: #ffc1c8; background: #291820; font-size: .74rem; line-height: 1.7; }
.chat-notice.success { border-color: rgba(85,214,160,.22); color: #adedd0; background: #11231f; }
.install-suggestion { position: fixed; z-index: 15; top: calc(env(safe-area-inset-top) + 78px); left: 50%; display: flex; width: min(560px, calc(100vw - 28px)); align-items: center; gap: 11px; padding: 11px; border: 1px solid rgba(139,124,255,.3); border-radius: 15px; background: linear-gradient(115deg, rgba(20,27,46,.98), rgba(15,29,39,.98)); box-shadow: 0 12px 36px rgba(0,0,0,.32), 0 0 28px rgba(139,124,255,.08); transform: translateX(-50%); animation: installSuggestionIn .32s ease-out both; }
.install-suggestion[hidden] { display: none !important; }
.install-suggestion-icon { display: grid; width: 38px; height: 38px; flex: 0 0 38px; place-items: center; border: 1px solid rgba(139,124,255,.23); border-radius: 12px; color: #c9c0ff; background: rgba(139,124,255,.13); }
.install-suggestion-copy { display: grid; min-width: 0; flex: 1; gap: 3px; }
.install-suggestion-copy strong { color: #edf1ff; font-size: .72rem; }
.install-suggestion-copy span { color: #98a6bd; font-size: .61rem; line-height: 1.6; }
.install-suggestion-action { min-height: 34px; flex: 0 0 auto; padding: 0 11px; border: 1px solid rgba(120,111,255,.3); border-radius: 9px; color: #eeeaff; background: rgba(139,124,255,.17); cursor: pointer; font: inherit; font-size: .66rem; font-weight: 700; }
.install-suggestion-action:hover { background: rgba(139,124,255,.28); }
.install-suggestion-dismiss { display: grid; width: 30px; height: 30px; flex: 0 0 30px; place-items: center; border: 0; border-radius: 8px; color: #8b9ab1; background: transparent; cursor: pointer; }
.install-suggestion-dismiss:hover { color: #edf1ff; background: rgba(255,255,255,.06); }
@keyframes installSuggestionIn { from { opacity: 0; transform: translate(-50%, -8px); } to { opacity: 1; transform: translate(-50%, 0); } }

@media (min-width: 760px) {
  .mobile-shell { width: min(100%, 1060px); }
  .chat-panel-mobile, .analysis-panel-mobile { max-width: 900px; }
  .chat-composer { max-width: 900px; }
  .msg-content-mobile { max-width: min(75%, 680px); }
}
@media (max-width: 520px) {
  .install-suggestion { top: calc(env(safe-area-inset-top) + 68px); gap: 8px; padding: 9px; }
  .install-suggestion-icon { width: 33px; height: 33px; flex-basis: 33px; }
  .install-suggestion-copy strong { font-size: .66rem; }
  .install-suggestion-copy span { font-size: .56rem; }
  .install-suggestion-action { min-height: 32px; padding-inline: 8px; font-size: .61rem; }
  .install-suggestion-dismiss { width: 26px; height: 26px; flex-basis: 26px; }
  .mobile-topbar { height: 60px; flex-basis: 60px; gap: 8px; padding-inline: 10px; }
  .new-chat-btn { width: 36px; height: 36px; justify-content: center; padding: 0; }
  .new-chat-btn span { display: none; }
  .chat-panel-header-mobile { min-height: 58px; padding-inline: 11px; }
  .chat-meta-mobile { gap: 8px; font-size: .62rem; }
  .chat-scroll-mobile { gap: 13px; padding: 15px 11px; }
  .msg-content-mobile { max-width: 84%; }
  .msg-av-mobile, .chat-user-avatar-mobile { width: 32px; height: 32px; flex-basis: 32px; border-radius: 10px; }
  .msg-bubble-mobile { padding: 10px 12px; font-size: .77rem; }
  .chat-composer { padding-inline: 10px; }
  .composer-input-wrap { min-height: 58px; gap: 7px; padding: 6px; border-radius: 15px; }
  .chat-composer textarea { min-height: 44px; font-size: .78rem; }
  .send-btn-mobile { width: 40px; height: 40px; flex-basis: 40px; border-radius: 12px; }
  .analysis-scroll-mobile { padding: 11px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .01ms !important; }
}