/* ——— Токены ——— */
:root {
  --bg: #FAF9F6;
  --elev: #FFFFFF;
  --sidebar: #F3F1EC;
  --sb-hover: #E9E6DF;
  --sb-active: #E4E1D9;
  --search-bg: #E9E6DF;
  --text: #1D1C1A;
  --text-2: #5F5C55;
  --text-3: #8F8B82;
  --border: #E7E4DC;
  --border-strong: #D5D1C6;
  --user-bubble: #EFEDE7;
  --chip-bg: #F0EEE8;
  --chip-hover: #E8E5DE;
  --copy-head: #F3F1EC;
  --seg-thumb: #FFFFFF;
  --accent: #17785A;
  --accent-hover: #11664C;
  --accent-soft: #E2F0EA;
  --on-accent: #FFFFFF;
  --logo-fg: #FFFFFF;
  --yes: #188454;
  --yes-bg: #E3F3EA;
  --maybe: #B26B00;
  --maybe-bg: #FCF0D9;
  --no: #C2412D;
  --no-bg: #FBE6E2;
  --ask: #5F5C55;
  --ask-bg: #EFEDE7;
  --backdrop: rgba(20, 18, 14, .38);
  --shadow-sm: 0 1px 2px rgba(30, 25, 15, .05);
  --shadow-composer: 0 1px 2px rgba(30, 25, 15, .04), 0 6px 24px -6px rgba(30, 25, 15, .08);
  --shadow-pop: 0 12px 40px -12px rgba(30, 25, 15, .28), 0 4px 12px -6px rgba(30, 25, 15, .12);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: "Source Serif 4", "Iowan Old Style", Georgia, serif;
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ease-drawer: cubic-bezier(.32, .72, 0, 1);
  --sb-w: 272px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1C1B19; --elev: #262522; --sidebar: #151413; --sb-hover: #22211F; --sb-active: #2A2926; --search-bg: #22211F;
    --text: #EDEBE6; --text-2: #B5B1A8; --text-3: #85817A; --border: #33312D; --border-strong: #45423D;
    --user-bubble: #2F2D2A; --chip-bg: #2A2926; --chip-hover: #33312D; --copy-head: #2C2B28; --seg-thumb: #3D3B37;
    --accent: #3FBF8C; --accent-hover: #55CC9C; --accent-soft: #1D3A2F; --on-accent: #0C1F17; --logo-fg: #0C1F17;
    --yes: #4CC98F; --yes-bg: #1B3428; --maybe: #E8A93A; --maybe-bg: #3A2D14; --no: #F07A66; --no-bg: #3D211C; --ask: #B5B1A8; --ask-bg: #2F2D2A;
    --backdrop: rgba(0, 0, 0, .55);
    --shadow-composer: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 24px -6px rgba(0, 0, 0, .4);
    --shadow-pop: 0 12px 40px -12px rgba(0, 0, 0, .7), 0 4px 12px -6px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #1C1B19; --elev: #262522; --sidebar: #151413; --sb-hover: #22211F; --sb-active: #2A2926; --search-bg: #22211F;
  --text: #EDEBE6; --text-2: #B5B1A8; --text-3: #85817A; --border: #33312D; --border-strong: #45423D;
  --user-bubble: #2F2D2A; --chip-bg: #2A2926; --chip-hover: #33312D; --copy-head: #2C2B28; --seg-thumb: #3D3B37;
  --accent: #3FBF8C; --accent-hover: #55CC9C; --accent-soft: #1D3A2F; --on-accent: #0C1F17; --logo-fg: #0C1F17;
  --yes: #4CC98F; --yes-bg: #1B3428; --maybe: #E8A93A; --maybe-bg: #3A2D14; --no: #F07A66; --no-bg: #3D211C; --ask: #B5B1A8; --ask-bg: #2F2D2A;
  --backdrop: rgba(0, 0, 0, .55);
  --shadow-composer: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 24px -6px rgba(0, 0, 0, .4);
  --shadow-pop: 0 12px 40px -12px rgba(0, 0, 0, .7), 0 4px 12px -6px rgba(0, 0, 0, .5);
  color-scheme: dark;
}

/* ——— База ——— */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--text); }
body { font: 16px/1.5 var(--font); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; overscroll-behavior: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; touch-action: manipulation; }
input, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
#app { position: fixed; inset: 0; height: var(--app-h, 100dvh); display: flex; overflow: hidden; }
.serif { font-family: var(--serif); font-weight: 400; letter-spacing: -.01em; }
.i { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.i-sm { width: 16px; height: 16px; }
.icon-btn { width: 40px; height: 40px; border-radius: 12px; display: inline-grid; place-items: center; color: var(--text-2); transition: background-color .15s, color .15s, transform .15s var(--ease-out); flex: none; }
.icon-btn:hover { background: var(--chip-bg); color: var(--text); }
.icon-btn:active { transform: scale(.92); }
.icon-btn-sm { width: 32px; height: 32px; border-radius: 10px; }
.icon-btn .i { width: 22px; height: 22px; }

.logo { display: inline-block; flex: none; }
.logo svg { display: block; width: 100%; height: 100%; }
.logo-sm { width: 24px; height: 24px; }
.logo-md { width: 32px; height: 32px; }
.logo-lg { width: 56px; height: 56px; }

.btn-pill { height: 36px; padding: 0 16px; border-radius: 999px; font-size: 14.5px; font-weight: 600; white-space: nowrap; transition: background-color .15s, transform .15s var(--ease-out), opacity .15s; }
.btn-pill:active { transform: scale(.96); }
.btn-accent { background: var(--accent); color: var(--on-accent); }
.btn-accent:hover { background: var(--accent-hover); }
.btn-ghost { background: var(--chip-bg); color: var(--text); }
.btn-ghost:hover { background: var(--chip-hover); }
.btn-danger { background: var(--no); color: #fff; }
.link-btn { color: var(--text-3); font-size: 14px; text-decoration: underline; text-decoration-color: var(--border-strong); text-underline-offset: 3px; padding: 8px; border-radius: 8px; transition: color .15s; }
.link-btn:hover { color: var(--text-2); }

/* ——— Вход ——— */
.login { position: absolute; inset: 0; display: flex; flex-direction: column; padding: calc(12px + env(safe-area-inset-top)) 20px calc(20px + env(safe-area-inset-bottom)); background: var(--bg); z-index: 5; overflow-y: auto; }
.login.leaving { animation: fadeOut .35s var(--ease-out) forwards; pointer-events: none; }
.login-top { display: flex; justify-content: flex-end; }
.login-main { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 24px 0; max-width: 440px; width: 100%; margin: 0 auto; }
.login-main > * { animation: riseIn .6s var(--ease-out) both; }
.login-main > :nth-child(2) { animation-delay: .06s; }
.login-main > :nth-child(3) { animation-delay: .12s; }
.login-main > :nth-child(4) { animation-delay: .18s; }
.login-h { font-size: 34px; line-height: 1.15; margin: 22px 0 12px; white-space: pre-line; }
.login-sub { color: var(--text-2); font-size: 16px; margin: 0; max-width: 360px; }
.login-art { margin-top: 32px; width: 100%; max-width: 340px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.mini { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--elev); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-sm); text-align: left; animation: notifIn .7s var(--ease-out) both; }
.mini:nth-child(1) { animation-delay: .45s; }
.mini:nth-child(2) { animation-delay: .9s; }
.mini:nth-child(3) { animation-delay: 1.35s; }
.mini-ic { width: 34px; height: 34px; border-radius: 10px; background: var(--chip-bg); color: var(--text-2); display: grid; place-items: center; flex: none; }
.mini-t { flex: 1; min-width: 0; font-size: 14px; line-height: 1.3; }
.mini-t b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-t span { color: var(--text-3); font-size: 13px; }
.login-bottom { max-width: 400px; width: 100%; margin: 0 auto; text-align: center; animation: riseIn .6s .25s var(--ease-out) both; }
.btn-google { position: relative; width: 100%; height: 52px; border-radius: 999px; background: var(--elev); border: 1px solid var(--border-strong); display: flex; align-items: center; justify-content: center; gap: 12px; font-size: 16px; font-weight: 500; transition: background-color .15s, transform .15s var(--ease-out), box-shadow .15s; box-shadow: var(--shadow-sm); }
.btn-google:hover { background: var(--chip-bg); }
.btn-google:active { transform: scale(.98); }
.btn-google .g { width: 20px; height: 20px; }
.btn-google .spinner { position: absolute; right: 18px; opacity: 0; }
.btn-google.loading { pointer-events: none; }
.btn-google.loading .spinner { opacity: 1; }
.login-note { font-size: 13px; color: var(--text-3); margin: 14px 0 0; }

.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--border-strong); border-top-color: var(--text-2); animation: spin .7s linear infinite; transition: opacity .2s; }

/* ——— Сегментированный переключатель ——— */
.seg { position: relative; display: inline-flex; background: var(--chip-bg); border-radius: 12px; padding: 3px; }
.seg button { position: relative; z-index: 1; flex: 1; height: 34px; padding: 0 14px; border-radius: 9px; font-size: 14.5px; font-weight: 500; color: var(--text-2); transition: color .2s; white-space: nowrap; }
.seg button[aria-checked="true"] { color: var(--text); }
.seg-thumb { position: absolute; z-index: 0; top: 3px; bottom: 3px; left: 3px; border-radius: 9px; background: var(--seg-thumb); box-shadow: 0 1px 3px rgba(0,0,0,.1), 0 1px 1px rgba(0,0,0,.04); transition: transform .3s var(--ease-drawer), width .3s var(--ease-drawer); }
.seg-sm button { height: 28px; padding: 0 12px; font-size: 13px; }
.seg-full { display: flex; width: 100%; }

/* ——— Каркас ——— */
.shell { display: flex; width: 100%; height: 100%; }
.shell.entering { animation: fadeIn .45s var(--ease-out); }

.sidebar { position: fixed; z-index: 40; top: 0; bottom: 0; left: 0; width: min(var(--sb-w), 86vw); background: var(--sidebar); display: flex; flex-direction: column; padding-top: env(safe-area-inset-top); transform: translateX(-100%); transition: transform .4s var(--ease-drawer); will-change: transform; }
.shell.sb-open .sidebar { transform: translateX(0); box-shadow: 0 0 40px rgba(0,0,0,.12); }
.sidebar.dragging, .backdrop.dragging { transition: none !important; }
.backdrop { position: fixed; inset: 0; z-index: 39; background: var(--backdrop); opacity: 0; pointer-events: none; transition: opacity .4s var(--ease-drawer); }
.shell.sb-open .backdrop { opacity: 1; pointer-events: auto; }

.sb-top { display: flex; align-items: center; justify-content: space-between; padding: 8px 8px 4px 14px; height: 56px; }
.sb-brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 16px; }
.sb-search { display: flex; align-items: center; gap: 8px; margin: 4px 12px 6px; padding: 0 6px 0 12px; height: 40px; border-radius: 12px; background: var(--search-bg); color: var(--text-3); transition: box-shadow .15s; }
.sb-search:focus-within { box-shadow: 0 0 0 2px var(--accent-soft); }
.sb-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 16px; color: var(--text); height: 100%; }
.sb-search input::-webkit-search-cancel-button { display: none; }
.sb-search input::placeholder { color: var(--text-3); }
.sb-search-clear { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; color: var(--text-3); }
.sb-search-clear .i { width: 16px; height: 16px; }
.sb-item { display: flex; align-items: center; gap: 12px; margin: 0 8px; padding: 0 10px; height: 42px; border-radius: 10px; font-size: 15px; text-align: left; transition: background-color .12s; }
.sb-item:hover { background: var(--sb-hover); }
.sb-item:active { background: var(--sb-active); }
.sb-list { flex: 1; overflow-y: auto; padding: 4px 8px 12px; overscroll-behavior: contain; }
.sb-group { font-size: 12.5px; font-weight: 600; color: var(--text-3); padding: 16px 10px 6px; }
.sb-chat { position: relative; display: flex; align-items: center; height: 40px; border-radius: 10px; padding: 0 4px 0 10px; font-size: 15px; cursor: pointer; transition: background-color .12s; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.sb-chat:hover { background: var(--sb-hover); }
.sb-chat.active { background: var(--sb-active); }
.sb-chat.pressed { background: var(--sb-active); transform: scale(.98); transition: transform .2s var(--ease-out); }
.sb-chat-title { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-chat-title .caret { display: inline-block; width: 1px; }
.sb-chat .sb-more { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; color: var(--text-2); opacity: 0; transition: opacity .12s; }
.sb-chat:hover .sb-more, .sb-chat.active .sb-more, .sb-chat.menu-open .sb-more { opacity: 1; }
@media (pointer: coarse) { .sb-chat .sb-more { display: none; } }
.sb-res { display: block; height: auto; padding: 8px 10px; }
.sb-res .sb-chat-title { display: block; }
.sb-snip { display: block; font-size: 13px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.sb-snip mark, .sb-chat-title mark { background: var(--accent-soft); color: inherit; border-radius: 3px; padding: 0 1px; }
.sb-empty { text-align: center; color: var(--text-3); font-size: 14px; padding: 40px 16px; }
.sb-user { display: flex; align-items: center; gap: 10px; margin: 4px 8px calc(8px + env(safe-area-inset-bottom)); padding: 8px 10px; border-radius: 12px; text-align: left; transition: background-color .12s; }
.sb-user:hover, .sb-user.menu-open { background: var(--sb-hover); }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; font-weight: 600; font-size: 15px; flex: none; }
.sb-user-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.sb-user-name { font-size: 15px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-user-plan { font-size: 12.5px; color: var(--text-3); }
.sb-user-chev { color: var(--text-3); width: 18px; height: 18px; transition: transform .2s var(--ease-out); }
.sb-user.menu-open .sb-user-chev { transform: rotate(180deg); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; position: relative; background: var(--bg); }
.topbar { height: calc(56px + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 8px 0; display: flex; align-items: center; gap: 4px; flex: none; position: relative; z-index: 3; background: var(--bg); transition: box-shadow .2s; }
.topbar.scrolled { box-shadow: 0 1px 0 var(--border); }
.top-title { flex: 1; min-width: 0; display: flex; align-items: center; justify-content: center; gap: 4px; height: 40px; padding: 0 10px; border-radius: 12px; font-size: 16.5px; font-weight: 600; transition: background-color .15s; }
.top-title span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-title .i { color: var(--text-3); opacity: 0; transition: opacity .15s; }
.top-title.has-menu .i { opacity: 1; }
.top-title.has-menu:hover { background: var(--chip-bg); }
.top-title:not(.has-menu) { pointer-events: none; }
.top-title span.swap { animation: titleSwap .3s var(--ease-out); }
#newBtn { transition: opacity .2s, transform .2s var(--ease-out); }
#newBtn.away { opacity: 0; pointer-events: none; transform: scale(.8); }

.scroller { flex: 1; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; position: relative; scroll-behavior: auto; }

/* ——— Главный экран ——— */
.home { min-height: 100%; display: flex; flex-direction: column; padding: 8px 16px 24px; }
.home-center { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding-bottom: 4vh; }
.home.enter .home-center > * { animation: riseIn .55s var(--ease-out) both; }
.home.enter .home-center > :nth-child(2) { animation-delay: .05s; }
.home.enter .home-center > :nth-child(3) { animation-delay: .1s; }
.home.enter .home-center > :nth-child(4) { animation-delay: .15s; }
.greet { display: flex; align-items: center; justify-content: center; gap: 12px; font-size: 31px; line-height: 1.2; margin: 0; color: var(--text); }
.greet .logo { width: 30px; height: 30px; }
.home-sub { color: var(--text-2); font-size: 15.5px; margin: 10px 0 0; max-width: 340px; }
.big-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; width: 100%; max-width: 420px; margin-top: 28px; }
.big-btn { height: 136px; border-radius: 24px; background: var(--elev); border: 1px solid var(--border); box-shadow: var(--shadow-sm); display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; padding: 16px; text-align: left; transition: transform .18s var(--ease-out), background-color .15s, border-color .15s, box-shadow .15s; }
.big-btn:hover { border-color: var(--border-strong); box-shadow: var(--shadow-composer); }
.big-btn:active { transform: scale(.96); }
.big-ic { width: 46px; height: 46px; border-radius: 15px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; }
.big-ic .i { width: 24px; height: 24px; stroke-width: 1.9; }
.big-l { display: flex; flex-direction: column; line-height: 1.3; }
.big-l b { font-size: 16.5px; font-weight: 600; }
.big-l span { font-size: 13.5px; color: var(--text-3); margin-top: 2px; }
#demoLink { margin-top: 14px; }

.install-banner { display: flex; align-items: center; gap: 12px; max-width: 520px; width: 100%; margin: 4px auto 0; padding: 10px 6px 10px 12px; border-radius: 18px; background: var(--elev); border: 1px solid var(--border); box-shadow: var(--shadow-sm); animation: dropIn .5s var(--ease-out) both; }
.install-banner.leaving { animation: collapseUp .3s var(--ease-out) forwards; }
.ib-text { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 13.5px; line-height: 1.3; color: var(--text-3); text-align: left; }
.ib-text b { color: var(--text); font-size: 14.5px; font-weight: 600; }

/* ——— Лента ——— */
.thread { max-width: 768px; margin: 0 auto; padding: 0 16px 28px; }
.thread.enter { animation: fadeIn .25s var(--ease-out); }
.msg { margin-top: 26px; }
.msg:first-child { margin-top: 12px; }
.msg.user { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.msg.user.enter { animation: userIn .35s var(--ease-out) both; }
.bubble { background: var(--user-bubble); padding: 10px 16px; border-radius: 22px; max-width: 85%; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.5; }
.media { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; max-width: 85%; }
.media img { display: block; width: 116px; height: 140px; object-fit: cover; border-radius: 16px; border: 1px solid var(--border); background: var(--elev); cursor: zoom-in; transition: transform .2s var(--ease-out), opacity .2s; }
.media.single img { width: auto; height: auto; max-width: min(260px, 70vw); max-height: 300px; }
.media img:active { transform: scale(.97); }
.media .img-missing { width: 116px; height: 140px; border-radius: 16px; background: var(--chip-bg); display: grid; place-items: center; color: var(--text-3); }
.file-chip { display: flex; align-items: center; gap: 10px; padding: 8px 14px 8px 8px; border-radius: 16px; background: var(--elev); border: 1px solid var(--border); max-width: 260px; text-align: left; }
.file-ic { width: 38px; height: 38px; border-radius: 10px; background: #E5484D; color: #fff; display: grid; place-items: center; font-size: 10.5px; font-weight: 700; letter-spacing: .03em; flex: none; }
.file-t { min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.file-t b { font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-t span { font-size: 12.5px; color: var(--text-3); }

.msg.bot .body { min-height: 28px; }
.md { line-height: 1.68; overflow-wrap: anywhere; }
.md p { margin: 0 0 14px; }
.md ul, .md ol { margin: 0 0 14px; padding-left: 22px; }
.md li { margin: 6px 0; padding-left: 2px; }
.md li::marker { color: var(--text-3); }
.md strong { font-weight: 600; }
.md > :last-child { margin-bottom: 8px; }
.md .w { display: none; }
.md .w.on { display: inline; animation: wordIn .5s ease-out both; }
.md .pend { display: none !important; }

/* Думает */
.thinking { display: flex; align-items: center; gap: 12px; height: 28px; animation: fadeIn .2s ease-out; }
.pulse { width: 13px; height: 13px; border-radius: 50%; background: var(--text); animation: pulse 1.25s ease-in-out infinite; flex: none; }
.think-label { font-size: 15px; }
.shimmer { background: linear-gradient(90deg, var(--text-3) 0%, var(--text-3) 38%, var(--text) 50%, var(--text-3) 62%, var(--text-3) 100%); background-size: 250% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: shimmer 2s linear infinite; }
.think-label.swap { animation: shimmer 2s linear infinite, labelIn .3s var(--ease-out); }

/* Шаги («Прочитано и проверено») */
.steps { margin: 0 0 12px; font-size: 14.5px; color: var(--text-3); }
.steps.appear { animation: fadeIn .3s ease-out; }
.steps-head { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 8px 0 0; border-radius: 8px; color: var(--text-3); transition: color .15s; }
.steps-head:hover { color: var(--text-2); }
.steps-head .i { width: 16px; height: 16px; }
.steps-head .chev { transition: transform .25s var(--ease-out); }
.steps.open .steps-head .chev { transform: rotate(90deg); }
.steps-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .3s var(--ease-out); }
.steps.open .steps-body { grid-template-rows: 1fr; }
.steps-body > div { overflow: hidden; }
.steps-body ul { list-style: none; margin: 4px 0 4px 7px; padding: 0 0 0 14px; border-left: 1.5px solid var(--border); }
.steps-body li { display: flex; gap: 8px; align-items: center; padding: 3px 0; color: var(--text-2); }
.steps-body li .i { width: 15px; height: 15px; color: var(--yes); }

/* Части ответа: появление */
.appear { animation: partIn .4s var(--ease-out) both; }

/* Карточка документа */
.card { border: 1px solid var(--border); border-radius: 18px; background: var(--elev); overflow: hidden; margin: 0 0 14px; max-width: 460px; box-shadow: var(--shadow-sm); }
.card-head { display: flex; gap: 12px; align-items: center; padding: 12px 14px; }
.card-thumb { width: 44px; height: 54px; border-radius: 9px; border: 1px solid var(--border); object-fit: cover; flex: none; background: var(--chip-bg); cursor: zoom-in; }
.card-thumb.ph { display: grid; place-items: center; color: var(--text-3); cursor: default; }
.card-thumb.pdf { background: #E5484D; color: #fff; border: 0; font-size: 10.5px; font-weight: 700; display: grid; place-items: center; cursor: default; }
.card-ht { min-width: 0; flex: 1; line-height: 1.3; }
.card-ht b { display: block; font-weight: 600; font-size: 15.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-ht span { font-size: 13px; color: var(--text-3); }
.card-foot { border-top: 1px solid var(--border); padding: 10px 14px; display: flex; align-items: center; }
.verdict { display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 12px 0 8px; border-radius: 999px; font-size: 14px; font-weight: 600; transition: background-color .3s, color .3s; }
.verdict .i { width: 18px; height: 18px; }
.verdict.yes { background: var(--yes-bg); color: var(--yes); --on-verdict: var(--yes-bg); }
.verdict.maybe { background: var(--maybe-bg); color: var(--maybe); --on-verdict: var(--maybe-bg); }
.verdict.no { background: var(--no-bg); color: var(--no); --on-verdict: var(--no-bg); }
.verdict.ask { background: var(--ask-bg); color: var(--ask); --on-verdict: var(--ask-bg); }
.verdict.pop { animation: verdictPop .5s var(--ease-out); }

/* Блок «скопировать» */
.copybox { border: 1px solid var(--border); border-radius: 14px; overflow: hidden; margin: 0 0 14px; background: var(--elev); }
.copy-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 6px 0 14px; height: 38px; background: var(--copy-head); font-size: 13px; color: var(--text-2); }
.copy-btn { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 8px; font-size: 13px; color: var(--text-2); transition: background-color .15s, color .15s; }
.copy-btn:hover { background: var(--chip-hover); color: var(--text); }
.copy-btn .i { width: 16px; height: 16px; }
.copy-body { padding: 12px 14px; font-size: 15px; line-height: 1.55; white-space: pre-wrap; }

/* Кнопки-ответы */
.qr { display: flex; flex-wrap: wrap; gap: 8px; margin: 2px 0 10px; }
.qr button { height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--elev); font-size: 15px; transition: background-color .15s, border-color .15s, transform .15s var(--ease-out), opacity .2s; animation: chipIn .4s var(--ease-out) both; }
.qr button:hover { background: var(--chip-bg); }
.qr button:active { transform: scale(.95); }
.qr button.chosen { background: var(--text); color: var(--bg); border-color: var(--text); }
.qr.leaving { animation: collapse .35s var(--ease-out) forwards; pointer-events: none; }
.qr.disabled button { opacity: .45; pointer-events: none; }


/* Файл */
.filecard { display: flex; align-items: center; gap: 12px; padding: 10px 8px 10px 10px; border-radius: 16px; border: 1px solid var(--border); background: var(--elev); max-width: 380px; margin: 0 0 14px; }
.filecard-ic { width: 42px; height: 42px; border-radius: 11px; background: #1D7044; color: #fff; display: grid; place-items: center; flex: none; }
.filecard-ic .i { width: 22px; height: 22px; }

/* Заметка «Сохранено» */
.note { display: flex; align-items: flex-start; gap: 8px; font-size: 13.5px; line-height: 1.45; color: var(--text-3); margin: 0 0 8px; }
.note > span { flex: 1; min-width: 0; }
.note .i { width: 16px; height: 16px; margin-top: 2px; }
.note button, .note a { flex: none; color: var(--accent); font-weight: 500; padding: 0 4px; text-decoration: none; }


/* Кнопки под ответом */
.acts { display: flex; gap: 2px; margin: 0 0 0 -8px; height: 34px; opacity: 0; transition: opacity .3s; }
.msg.bot.done .acts { opacity: 1; }
.acts button { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; color: var(--text-3); transition: background-color .15s, color .15s, transform .15s var(--ease-out); }
.acts button:hover { background: var(--chip-bg); color: var(--text); }
.acts button:active { transform: scale(.88); }
.acts button.on { color: var(--text); }
.acts button.on .i { fill: currentColor; fill-opacity: .15; }
.acts .i { width: 18px; height: 18px; }
.swap-ic { animation: icSwap .25s var(--ease-out); }

/* ——— Кнопка «вниз» ——— */
.to-bottom { position: absolute; z-index: 4; left: 50%; bottom: calc(var(--composer-h, 120px) + 10px); width: 36px; height: 36px; border-radius: 50%; background: var(--elev); border: 1px solid var(--border); box-shadow: var(--shadow-composer); display: grid; place-items: center; color: var(--text-2); opacity: 0; transform: translate(-50%, 8px) scale(.9); pointer-events: none; transition: opacity .2s, transform .25s var(--ease-out); }
.to-bottom.show { opacity: 1; transform: translate(-50%, 0) scale(1); pointer-events: auto; }
.to-bottom .i { width: 18px; height: 18px; }

/* ——— Поле ввода ——— */
.composer-wrap { flex: none; position: relative; z-index: 3; padding: 0 12px calc(6px + env(safe-area-inset-bottom)); background: var(--bg); }
.composer-wrap::before { content: ""; position: absolute; left: 0; right: 0; top: -28px; height: 28px; background: linear-gradient(to bottom, transparent, var(--bg)); pointer-events: none; }

.composer { max-width: 768px; margin: 0 auto; background: var(--elev); border: 1px solid var(--border); border-radius: 28px; box-shadow: var(--shadow-composer); padding: 6px; transition: border-radius .2s var(--ease-out), border-color .15s, box-shadow .15s; }
.composer:focus-within { border-color: var(--border-strong); }
.composer.tall { border-radius: 24px; }
.composer.nudge { animation: nudge .5s var(--ease-out); }
.c-row { display: flex; align-items: flex-end; gap: 4px; }
.c-plus { border-radius: 50%; }
.c-plus .i { width: 22px; height: 22px; }
#input { flex: 1; min-width: 0; border: 0; outline: 0; resize: none; background: transparent; font-size: 16px; line-height: 24px; padding: 8px 4px; max-height: 192px; color: var(--text); }
#input::placeholder { color: var(--text-3); transition: opacity .2s; }
.send { position: relative; width: 40px; height: 40px; border-radius: 50%; flex: none; display: grid; place-items: center; transition: background-color .2s, color .2s, transform .15s var(--ease-out); }
.send:active { transform: scale(.9); }
.send .i { position: absolute; transition: opacity .2s, transform .25s var(--ease-out); opacity: 0; transform: scale(.6); }
.send .s-send { stroke-width: 2.2; }
.send[data-mode="camera"] { background: var(--chip-bg); color: var(--text); }
.send[data-mode="camera"]:hover { background: var(--chip-hover); }
.send[data-mode="camera"] .s-camera { opacity: 1; transform: none; }
.send[data-mode="send"] { background: var(--accent); color: var(--on-accent); }
.send[data-mode="send"]:hover { background: var(--accent-hover); }
.send[data-mode="send"] .s-send { opacity: 1; transform: none; }
.send[data-mode="wait"] { background: var(--chip-bg); color: var(--text-3); cursor: default; }
.send[data-mode="wait"] .s-send { opacity: 1; transform: none; }
.send[data-mode="stop"] { background: var(--text); color: var(--bg); }
.send[data-mode="stop"] .s-stop { opacity: 1; transform: none; }
.disclaimer { text-align: center; font-size: 12px; color: var(--text-3); margin: 8px auto 0; max-width: 768px; padding: 0 8px; }

.attachments { display: flex; gap: 8px; overflow-x: auto; padding: 4px 4px 8px; scrollbar-width: none; }
.attachments:empty { display: none; }
.att { position: relative; flex: none; width: 64px; height: 64px; border-radius: 14px; overflow: hidden; border: 1px solid var(--border); background: var(--chip-bg); animation: attIn .3s var(--ease-out) both; }
.att img { width: 100%; height: 100%; object-fit: cover; display: block; }
.att.pdf { width: auto; min-width: 180px; max-width: 220px; display: flex; align-items: center; gap: 8px; padding: 0 28px 0 10px; background: var(--elev); }
.att.pdf .file-ic { width: 36px; height: 36px; }
.att.leaving { animation: attOut .2s var(--ease-out) forwards; }
.att-x { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%; background: var(--text); color: var(--bg); display: grid; place-items: center; opacity: .9; }
.att-x .i { width: 13px; height: 13px; stroke-width: 2.4; }
/* ——— Шторки, меню, окна ——— */
.layer { position: fixed; inset: 0; z-index: 60; }
.layer-bg { position: absolute; inset: 0; background: var(--backdrop); opacity: 0; transition: opacity .4s var(--ease-drawer); }
.layer.open .layer-bg { opacity: 1; }
.sheet { position: absolute; left: 0; right: 0; bottom: 0; max-height: calc(100% - 40px - env(safe-area-inset-top)); background: var(--elev); border-radius: 22px 22px 0 0; display: flex; flex-direction: column; transform: translateY(100%); transition: transform .5s var(--ease-drawer); padding-bottom: env(safe-area-inset-bottom); will-change: transform; }
.layer.open .sheet { transform: translateY(0); }
.sheet.dragging { transition: none; }
.sheet-grab { padding: 8px 0 4px; touch-action: none; cursor: grab; }
.sheet-handle { width: 38px; height: 5px; border-radius: 99px; background: var(--border-strong); margin: 0 auto; }
.sheet-title { text-align: center; font-weight: 600; font-size: 17px; padding: 6px 48px 10px; position: relative; touch-action: none; }
.sheet-close { position: absolute; right: 8px; top: -2px; }
.sheet-body { overflow-y: auto; padding: 4px 16px 20px; overscroll-behavior: contain; }

@media (min-width: 640px) {
  .sheet { left: 50%; right: auto; top: 50%; bottom: auto; width: 480px; max-height: min(720px, calc(100% - 48px)); border-radius: 22px; transform: translate(-50%, -48%) scale(.96); opacity: 0; transition: transform .3s var(--ease-out), opacity .2s; box-shadow: var(--shadow-pop); padding-bottom: 0; }
  .layer.open .sheet { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  .sheet-grab { display: none; }
  .sheet-title { padding-top: 16px; }
  .sheet-close { top: 10px; }
  .layer-bg { transition: opacity .25s ease-out; }
}

.list { background: var(--chip-bg); border-radius: 16px; overflow: hidden; margin: 0 0 8px; }
.list-row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 50px; padding: 10px 14px; text-align: left; font-size: 15.5px; }
.list-row + .list-row { border-top: 1px solid var(--border); }
button.list-row { transition: background-color .12s; }
button.list-row:hover { background: var(--chip-hover); }
.list-row .i { color: var(--text-2); }
.list-row .lr-t { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.list-row .lr-sub { font-size: 13px; color: var(--text-3); }
.list-row .lr-v { color: var(--text-3); font-size: 14.5px; text-align: right; max-width: 55%; overflow-wrap: anywhere; }
.list-row.danger, .list-row.danger .i { color: var(--no); }
.list .btn-ghost { background: var(--elev); box-shadow: var(--shadow-sm); }
.list .btn-ghost:hover { background: var(--bg); }
.status-on { display: inline-flex; align-items: center; gap: 6px; color: var(--yes); font-size: 14px; font-weight: 500; }
.status-on .i { width: 16px; height: 16px; }
.sec-title { font-size: 13px; font-weight: 600; color: var(--text-3); margin: 18px 4px 8px; }
.sec-title:first-child { margin-top: 4px; }
.hint { font-size: 13px; color: var(--text-3); margin: 0 4px 6px; }

.attach-opts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.attach-opt { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; height: 92px; border-radius: 18px; background: var(--chip-bg); font-size: 14.5px; font-weight: 500; transition: background-color .15s, transform .15s var(--ease-out); }
.attach-opt:hover { background: var(--chip-hover); }
.attach-opt:active { transform: scale(.95); }
.attach-opt .i { width: 26px; height: 26px; }
.samples { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.sample { aspect-ratio: 3 / 4; border-radius: 12px; overflow: hidden; border: 1px solid var(--border); background: #fff; position: relative; transition: transform .15s var(--ease-out); }
.sample:active { transform: scale(.94); }
.sample img { width: 100%; height: 100%; object-fit: cover; object-position: left top; display: block; }
.sample.pdf { display: grid; place-items: center; background: var(--chip-bg); }
.sample.pdf .file-ic { width: 34px; height: 34px; }

.ios-steps { list-style: none; margin: 4px 0 16px; padding: 0; display: grid; gap: 10px; counter-reset: s; }
.ios-steps li { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--chip-bg); border-radius: 16px; font-size: 15.5px; }
.ios-steps li::before { counter-increment: s; content: counter(s); width: 26px; height: 26px; border-radius: 50%; background: var(--elev); display: grid; place-items: center; font-size: 13px; font-weight: 600; flex: none; }
.ios-steps .i { margin-left: auto; color: #0A84FF; width: 24px; height: 24px; }
.sheet-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px; }
.sheet-actions .btn-pill { height: 44px; padding: 0 20px; font-size: 15.5px; }
.sheet-actions.full .btn-pill { flex: 1; }

/* Поповер */
.pop { position: fixed; z-index: 70; min-width: 220px; max-width: calc(100vw - 16px); background: var(--elev); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-pop); padding: 6px; animation: popIn .16s var(--ease-out) both; }
.pop.leaving { animation: popOut .12s ease-in forwards; }
.pop-head { padding: 8px 12px 6px; font-size: 13px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pop-item { display: flex; align-items: center; gap: 12px; width: 100%; height: 42px; padding: 0 12px; border-radius: 10px; font-size: 15px; text-align: left; transition: background-color .1s; }
.pop-item:hover { background: var(--chip-bg); }
.pop-item .i { color: var(--text-2); }
.pop-item.danger, .pop-item.danger .i { color: var(--no); }
.pop-sep { height: 1px; background: var(--border); margin: 5px 6px; }
.pop-catch { position: fixed; inset: 0; z-index: 69; }

/* Диалог */
.dialog { position: absolute; left: 50%; top: 50%; width: min(400px, calc(100% - 32px)); background: var(--elev); border-radius: 22px; padding: 22px 20px 16px; box-shadow: var(--shadow-pop); transform: translate(-50%, -50%) scale(.95); opacity: 0; transition: transform .25s var(--ease-out), opacity .18s; }
.layer.open .dialog { transform: translate(-50%, -50%) scale(1); opacity: 1; }
.dialog h3 { margin: 0 0 8px; font-size: 18px; font-weight: 600; }
.dialog p { margin: 0; color: var(--text-2); font-size: 15px; }
.dialog input { width: 100%; height: 46px; border-radius: 12px; border: 1px solid var(--border-strong); background: var(--bg); padding: 0 14px; font-size: 16px; outline: 0; margin-top: 4px; transition: border-color .15s, box-shadow .15s; }
.dialog input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.dialog .sheet-actions { margin-top: 20px; }
.dialog .sheet-actions .btn-pill { height: 40px; font-size: 15px; }

/* Просмотр фото */
.lightbox { position: fixed; inset: 0; z-index: 80; background: rgba(0,0,0,0); display: grid; place-items: center; transition: background-color .3s; padding: 16px; }
.lightbox.open { background: rgba(0,0,0,.88); }
.lightbox img { max-width: 100%; max-height: 86%; border-radius: 12px; transform: scale(.88); opacity: 0; transition: transform .35s var(--ease-out), opacity .25s; background: #fff; }
.lightbox.open img { transform: scale(1); opacity: 1; }
.lightbox .icon-btn { position: absolute; top: calc(12px + env(safe-area-inset-top)); right: 12px; color: #fff; background: rgba(255,255,255,.12); border-radius: 50%; }

/* Тосты */
.toasts { position: fixed; z-index: 90; top: calc(12px + env(safe-area-inset-top)); left: 0; right: 0; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast { background: var(--text); color: var(--bg); font-size: 14.5px; font-weight: 500; padding: 10px 16px; border-radius: 999px; box-shadow: var(--shadow-pop); display: flex; align-items: center; gap: 8px; animation: toastIn .35s var(--ease-out) both; max-width: calc(100vw - 32px); }
.toast .i { width: 18px; height: 18px; }
.toast.leaving { animation: toastOut .25s ease-in forwards; }

/* Перетаскивание файлов */
.drop { position: fixed; inset: 0; z-index: 85; display: grid; place-items: center; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); animation: fadeIn .15s; padding: 24px; }
.drop-box { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 48px 40px; border: 2px dashed var(--accent); border-radius: 28px; color: var(--accent); font-size: 17px; font-weight: 600; text-align: center; }
.drop-box .i { width: 36px; height: 36px; }

/* ——— Компьютер ——— */
@media (min-width: 900px) {
  .sidebar { position: relative; transform: none; width: var(--sb-w); flex: none; transition: margin-left .35s var(--ease-drawer); box-shadow: none !important; }
  .shell.sb-collapsed .sidebar { margin-left: calc(-1 * var(--sb-w)); }
  .backdrop { display: none; }
  #menuBtn { display: none; }
  .shell.sb-collapsed #menuBtn { display: inline-grid; }
  .top-title { justify-content: flex-start; flex: 0 1 auto; }
  .topbar { justify-content: flex-start; padding-left: 12px; }
  #newBtn { margin-left: auto; }
  .shell:not(.sb-collapsed) #newBtn { visibility: hidden; }
  .greet { font-size: 40px; }
  .greet .logo { width: 36px; height: 36px; }
  .home-sub { font-size: 16.5px; max-width: 420px; }
  .big-actions { max-width: 460px; }
  .composer-wrap { padding-bottom: 10px; }
}
@media (max-width: 360px) {
  .greet { font-size: 26px; }
  .big-btn { height: 120px; padding: 14px; }
}

/* ——— Анимации ——— */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeOut { to { opacity: 0; } }
@keyframes riseIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes notifIn { from { opacity: 0; transform: translateY(-14px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes dropIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }
@keyframes collapseUp { to { opacity: 0; transform: translateY(-10px); height: 0; padding-top: 0; padding-bottom: 0; margin: 0; border-width: 0; } }
@keyframes userIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes wordIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes partIn { from { opacity: 0; transform: translateY(8px) scale(.99); } to { opacity: 1; transform: none; } }
@keyframes chipIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes collapse { to { opacity: 0; transform: translateY(-4px); height: 0; margin: 0; } }
@keyframes pulse { 0%, 100% { transform: scale(.72); opacity: .55; } 50% { transform: scale(1); opacity: 1; } }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: 0% 0; } }
@keyframes labelIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes popIn { from { opacity: 0; transform: scale(.95); } to { opacity: 1; transform: none; } }
@keyframes popOut { to { opacity: 0; transform: scale(.97); } }
@keyframes toastIn { from { opacity: 0; transform: translateY(-12px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-8px) scale(.98); } }
@keyframes attIn { from { opacity: 0; transform: scale(.8); } to { opacity: 1; transform: none; } }
@keyframes attOut { to { opacity: 0; transform: scale(.8); width: 0; margin-right: -8px; } }
@keyframes prog { to { stroke-dashoffset: 0; } }
@keyframes verdictPop { 0% { transform: scale(.85); } 60% { transform: scale(1.06); } 100% { transform: scale(1); } }
@keyframes icSwap { from { transform: scale(.5); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes titleSwap { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes nudge { 0%, 100% { transform: none; } 30% { transform: translateY(-3px); box-shadow: 0 0 0 3px var(--accent-soft), var(--shadow-composer); } }

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

/* ——— Подключение к бэкенду ——— */
.turn > .msg:first-child { margin-top: 26px; }
.later { display: none !important; }
.card-amt { margin-left: 8px; font-weight: 600; font-size: 15.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.verdict.deleted { background: var(--chip-bg); color: var(--text-3); }
.msg.flash .card { animation: flashCard 1.4s ease-out; }
.waiting-pill { display: inline-flex; align-items: center; gap: 8px; margin-top: 16px; height: 36px; padding: 0 12px 0 14px; border-radius: 999px; background: var(--maybe-bg); color: var(--maybe); font-size: 14.5px; font-weight: 600; transition: transform .15s var(--ease-out), filter .15s; }
.waiting-pill:active { transform: scale(.96); }
.waiting-pill:hover { filter: brightness(.97); }
.waiting-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--maybe); flex: none; animation: pulse 1.6s ease-in-out infinite; }
.list-row .waiting-dot { margin: 0 4px; }
.sb-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--maybe); flex: none; margin: 0 4px 0 8px; }
.connect-card { display: flex; align-items: center; gap: 12px; max-width: 440px; margin: 0 0 12px; padding: 12px 12px 12px 14px; border: 1px solid var(--border); border-radius: 18px; background: var(--elev); box-shadow: var(--shadow-sm); }
.cc-ic { width: 40px; height: 40px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex: none; }
.cc-t { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.cc-t b { font-weight: 600; font-size: 15.5px; }
.cc-t span { font-size: 13px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
a.btn-pill { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
a.filecard { color: inherit; text-decoration: none; transition: background-color .15s; }
a.filecard:hover { background: var(--chip-bg); }
.status-warn { color: var(--maybe); }
.err-note { display: flex; align-items: center; gap: 10px; color: var(--no); font-size: 14.5px; animation: partIn .3s var(--ease-out); }
.err-note > span { flex: 1; }
.err-note .i { width: 18px; height: 18px; }
.file-ic.img { background: var(--chip-bg); color: var(--text-2); }
.file-ic.img .i { width: 18px; height: 18px; }
.att-ph { display: grid; place-items: center; width: 100%; height: 100%; color: var(--text-3); }
.list-row .avatar { width: 36px; height: 36px; }
.thread-loading { display: grid; gap: 12px; padding: 36px 0; animation: fadeIn .3s .15s both; }
.thread-loading span { height: 14px; border-radius: 7px; background: linear-gradient(90deg, var(--chip-bg) 30%, var(--chip-hover) 50%, var(--chip-bg) 70%); background-size: 250% 100%; animation: skel 1.3s linear infinite; }
.thread-loading span:nth-child(1) { width: 72%; margin-left: auto; height: 40px; border-radius: 20px; }
.thread-loading span:nth-child(2) { width: 92%; }
.thread-loading span:nth-child(3) { width: 60%; }
.send .s-busy { position: absolute; width: 18px; height: 18px; border-radius: 50%; border: 2px solid currentColor; border-top-color: transparent; opacity: 0; transform: scale(.6); transition: opacity .2s, transform .25s var(--ease-out); animation: spin .8s linear infinite; }
.send[data-mode="busy"] { background: var(--chip-bg); color: var(--text-3); cursor: default; }
.send[data-mode="busy"] .s-busy { opacity: 1; transform: none; }
.md h3 { font-size: 17px; font-weight: 600; margin: 18px 0 8px; }
.md code { font: 13.5px ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--chip-bg); padding: 1px 5px; border-radius: 5px; }
.md a { color: var(--accent); }
.table-wrap { overflow-x: auto; margin: 0 0 14px; border: 1px solid var(--border); border-radius: 12px; }
.md table { border-collapse: collapse; width: 100%; font-size: 14.5px; }
.md th, .md td { padding: 8px 12px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
.md th { background: var(--copy-head); font-weight: 600; }
.md tr:last-child td { border-bottom: 0; }
@keyframes skel { from { background-position: 100% 0; } to { background-position: 0% 0; } }
@keyframes flashCard { 0%, 35% { box-shadow: 0 0 0 3px var(--maybe-bg), var(--shadow-sm); } 100% { box-shadow: var(--shadow-sm); } }
