/* ==========================================================================
   AFINA "paper" skin — warm paper palette, serif answers, rounded surfaces.
   Loaded AFTER styles.css: it only overrides tokens and component looks.
   ========================================================================== */

:root {
  --ease: cubic-bezier(.32, .72, 0, 1);
  --spring: cubic-bezier(.34, 1.45, .64, 1);
  --brand: #e06a3a;
  --bg: #ebe8df;
  --bg-side: #e3dfd5;
  --bg-elev: #f5f3ec;
  --comp: #f5f3ec;
  --menu: #f5f3ec;
  --bg-hover: rgba(28, 27, 25, .06);
  --sel: rgba(28, 27, 25, .09);
  --bg-code: #f1efe8;
  --code-head: #e6e2d8;
  --bubble: #dfdbd0;
  --border: rgba(28, 27, 25, .12);
  --border-strong: rgba(28, 27, 25, .22);
  --ring: rgba(28, 27, 25, .3);
  --text: #1c1b19;
  --text-soft: #3a3833;
  --text-faint: #77736a;
  --accent: #b5532e;
  --accent-hover: #a04624;
  --accent-fg: #a04624;
  --accent-soft: rgba(181, 83, 46, .11);
  --danger: #c4372c;
  --ok: #4f8a4a;
  --shadow: 0 2px 16px rgba(28, 27, 25, .08);
  --sh: 0 2px 16px rgba(28, 27, 25, .06);
  --sh-f: 0 3px 22px rgba(28, 27, 25, .1);
  --radius: 14px;
  --radius-sm: 10px;
  --measure: 760px;
  --sidebar-w: 272px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Variable Text",
          "Segoe UI", "Inter", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: ui-serif, "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --t-c: #8a857a; --t-s: #59753f; --t-k: #a04624; --t-n: #8a6a2f;
  --logo-eye: var(--bg-side);
}

@media (prefers-color-scheme: dark) {
  :root:not(.theme-light) {
    --brand: #e8774a;
    --bg: #1b1a19;
    --bg-side: #141312;
    --bg-elev: #252422;
    --comp: #252422;
    --menu: #2a2927;
    --bg-hover: rgba(236, 233, 225, .06);
    --sel: rgba(236, 233, 225, .09);
    --bg-code: #121110;
    --code-head: #1b1a19;
    --bubble: #262523;
    --border: rgba(236, 233, 225, .09);
    --border-strong: rgba(236, 233, 225, .18);
    --ring: rgba(236, 233, 225, .28);
    --text: #ece9e1;
    --text-soft: #c5c1b6;
    --text-faint: #8d897e;
    --accent: #c9633a;
    --accent-hover: #d8704a;
    --accent-fg: #e49a76;
    --accent-soft: rgba(201, 99, 58, .17);
    --danger: #e5484d;
    --ok: #7fb069;
    --shadow: 0 2px 20px rgba(0, 0, 0, .35);
    --sh: 0 2px 20px rgba(0, 0, 0, .28);
    --sh-f: 0 3px 26px rgba(0, 0, 0, .4);
    --t-c: #6f6b62; --t-s: #a3bd8f; --t-k: #e49a76; --t-n: #d3b27a;
  }
}
:root.theme-dark {
  --brand: #e8774a;
  --bg: #1b1a19;
  --bg-side: #141312;
  --bg-elev: #252422;
  --comp: #252422;
  --menu: #2a2927;
  --bg-hover: rgba(236, 233, 225, .06);
  --sel: rgba(236, 233, 225, .09);
  --bg-code: #121110;
  --code-head: #1b1a19;
  --bubble: #262523;
  --border: rgba(236, 233, 225, .09);
  --border-strong: rgba(236, 233, 225, .18);
  --ring: rgba(236, 233, 225, .28);
  --text: #ece9e1;
  --text-soft: #c5c1b6;
  --text-faint: #8d897e;
  --accent: #c9633a;
  --accent-hover: #d8704a;
  --accent-fg: #e49a76;
  --accent-soft: rgba(201, 99, 58, .17);
  --danger: #e5484d;
  --ok: #7fb069;
  --shadow: 0 2px 20px rgba(0, 0, 0, .35);
  --sh: 0 2px 20px rgba(0, 0, 0, .28);
  --sh-f: 0 3px 26px rgba(0, 0, 0, .4);
  --t-c: #6f6b62; --t-s: #a3bd8f; --t-k: #e49a76; --t-n: #d3b27a;
}
:root.theme-light {
  --brand: #e06a3a;
  --bg: #ebe8df; --bg-side: #e3dfd5; --bg-elev: #f5f3ec; --comp: #f5f3ec; --menu: #f5f3ec;
  --bg-hover: rgba(28, 27, 25, .06); --sel: rgba(28, 27, 25, .09);
  --bg-code: #f1efe8; --code-head: #e6e2d8; --bubble: #dfdbd0;
  --border: rgba(28, 27, 25, .12); --border-strong: rgba(28, 27, 25, .22);
  --ring: rgba(28, 27, 25, .3);
  --text: #1c1b19; --text-soft: #3a3833; --text-faint: #77736a;
  --accent: #b5532e; --accent-hover: #a04624; --accent-fg: #a04624;
  --accent-soft: rgba(181, 83, 46, .11);
  --danger: #c4372c; --ok: #4f8a4a;
  --shadow: 0 2px 16px rgba(28, 27, 25, .08);
  --sh: 0 2px 16px rgba(28, 27, 25, .06); --sh-f: 0 3px 22px rgba(28, 27, 25, .1);
  --t-c: #8a857a; --t-s: #59753f; --t-k: #a04624; --t-n: #8a6a2f;
}

body { letter-spacing: -.006em; text-rendering: optimizeLegibility; }
::selection { background: var(--ring); }
:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
textarea:focus-visible, input:focus-visible { outline: none; }
a { color: var(--accent-fg); }

/* ---------------------------------------------------------------- sidebar */
.sidebar { background: var(--bg-side); --logo-eye: var(--bg-side); }
.brand { height: 56px; padding: 0 10px 0 14px; gap: 10px; }
/* AFINA pixel logo: wide lockup in the open sidebar, the cat alone in the rail.
   The lockup comes in a dark-background and a light-background version. */
.brand-logo { display: flex; align-items: center; height: 30px; flex: none; }
.brand-logo img, .bl-lock { width: auto; image-rendering: pixelated; }
.bl-mark { display: none; height: 30px; }
.bl-lock { display: block; height: 26px; }
.bl-light { display: none; }
:root.theme-light .bl-dark { display: none; }
:root.theme-light .bl-light { display: block; }
@media (prefers-color-scheme: light) {
  :root:not(.theme-dark):not(.theme-light) .bl-dark { display: none; }
  :root:not(.theme-dark):not(.theme-light) .bl-light { display: block; }
}
.app.side-collapsed .bl-mark { display: block; }
.app.side-collapsed .bl-lock { display: none !important; }
.brand-logo { margin-right: auto; }
.app.side-collapsed .brand-logo { margin: 0 auto; }
.login-title { margin: 14px 0 6px; line-height: 0; }
.login-title .bl-lock { height: 30px; margin: 0 auto; }
.login-mark { display: block; width: auto; height: 64px; margin: 0 auto; image-rendering: pixelated; }
.brand-name { font-weight: 650; font-size: 16px; letter-spacing: .02em; }
.icon-btn { width: 34px; height: 34px; border-radius: 10px; color: var(--text-faint); }
.icon-btn:hover { background: var(--bg-hover); color: var(--text); }

.new-btn {
  width: calc(100% - 12px); margin: 4px 6px 6px; height: 38px; padding: 0 13px; gap: 12px;
  background: none; color: var(--accent-fg); font-weight: 600; font-size: 14px;
  border-radius: 11px; transition: background .15s, transform .25s var(--ease);
}
.new-btn:hover { background: var(--bg-hover); }
.new-btn:active { transform: scale(.985); }
.new-btn .ic {
  display: grid; place-items: center; width: 24px; height: 24px; margin-left: -3px;
  border-radius: 50%; background: var(--accent); color: #fff; flex: none;
  transition: transform .5s var(--spring);
}
.new-btn:hover .ic { transform: rotate(90deg) scale(1.06); }
.new-btn .ic .ico { width: 15px; height: 15px; stroke-width: 2.2; }

.side-nav { padding: 0 6px; gap: 1px; }
.side-link { height: 38px; padding: 0 13px; gap: 12px; border-radius: 11px; font-size: 14px; color: var(--text-soft); }
.side-link .ico { width: 18px; height: 18px; stroke-width: 1.7; color: var(--text-faint); }
.side-link:hover { background: var(--bg-hover); color: var(--text); }
.side-link:hover .ico { color: var(--text-soft); }
.side-link.active { background: var(--sel); font-weight: 400; }

.hist-section { padding: 0 6px; }
.proj-header {
  padding: 18px 13px 6px; font-size: 12px; font-weight: 550; letter-spacing: .01em;
  text-transform: none; color: var(--text-faint);
}
.chat-group { padding: 14px 13px 4px; font-size: 12px; font-weight: 550; letter-spacing: .01em; color: var(--text-faint); }
.history .chat-group:first-child { padding-top: 4px; }
.history { display: flex; flex-direction: column; gap: 1px; }
.chat-item {
  height: 36px; padding: 0 6px 0 13px; border-radius: 11px; font-size: 14px; flex: none;
}
.chat-item:hover { background: var(--bg-hover); }
.chat-item.active { background: var(--sel); font-weight: 400; color: var(--text); }
.chat-item .row-act { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; }
.chat-item .row-act:hover { background: var(--bg-hover); }

.sidebar-bottom { padding: 8px 6px 10px; border-top: 1px solid var(--border); gap: 2px; }
.admin-bottom { height: 38px; padding: 0 13px; gap: 12px; border-radius: 11px; }
.account { height: 46px; padding: 0 13px; gap: 12px; border-radius: 11px; }
.acc-avatar { width: 28px; height: 28px; margin-left: -5px; background: var(--text-soft); color: var(--bg); font-size: 12px; font-weight: 700; }
.acc-text { line-height: 1.2; font-size: 14px; }
.acc-text small { display: block; font-size: 11.5px; color: var(--text-faint); }

/* ------------------------------------------------------------------ header */
.main { background: var(--bg); }
.topbar { height: 56px; flex-basis: 56px; padding: 0 14px; border-bottom: 0; gap: 6px; }
/* the panel is folded with the arrow in the sidebar and unfolded with its logo,
   so the extra "three lines" button next to the chat title is not needed */
.desktop-menu-btn { display: none !important; }
.session-title { font-size: 14.5px; max-width: min(52vw, 520px); flex: 0 1 auto; border-radius: 10px; }
.topbar-right { margin-left: auto; gap: 6px; }
#themeBtn .sun { display: none; }
#themeBtn .ico { width: 18px; height: 18px; stroke-width: 1.7; }
:root.theme-dark #themeBtn .sun { display: block; }
:root.theme-dark #themeBtn .moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not(.theme-light) #themeBtn .sun { display: block; }
  :root:not(.theme-light) #themeBtn .moon { display: none; }
}

/* --------------------------------------------------------------- messages */
.thread { max-width: var(--measure); padding: 16px 24px 34px; }
.msg { margin-bottom: 28px; animation: mrise .55s var(--ease) both; }
@keyframes mrise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.msg.user .body {
  max-width: 82%; padding: 10px 16px; background: var(--bubble); border: 0;
  border-radius: 19px 19px 6px 19px; font-size: 15.5px; line-height: 1.55;
}
.msg.user .content { line-height: 1.55; font-size: 15.5px; }
.msg.assistant .content { font-family: var(--serif); font-size: 16.5px; line-height: 1.7; }
.msg.assistant .content :is(table, th, td, pre, code, .code-head, button) { font-family: var(--font); }
.msg.assistant .content :is(pre, pre code, code) { font-family: ui-monospace, "SF Mono", "Cascadia Code", Consolas, monospace; }
.content p { margin: 0 0 12px; }
.content h1, .content h2, .content h3, .content h4 { font-family: var(--font); letter-spacing: -.02em; margin: 20px 0 10px; }
.content h1 { font-size: 22px; } .content h2 { font-size: 19px; } .content h3 { font-size: 18px; }
.content li::marker { color: var(--text-faint); }
.content strong { font-weight: 600; }
.content code { font-size: .88em; padding: 2px 6px; border-radius: 6px; background: var(--bg-hover); border: 1px solid var(--border); }
.content blockquote { border-left-color: var(--border-strong); }
.content table { font-size: 14.5px; }
.content th, .content td { border-color: var(--border); }
.content th { background: var(--bg-hover); }

/* code blocks */
/* overflow: clip (not hidden) keeps the rounded corners but does not turn the
   block into its own scroll container, so the header below can stay stuck */
.content pre { border-radius: 14px; background: var(--bg-code); border: 1px solid var(--border); margin: 0 0 12px; overflow: clip; }
/* long code: the header with the copy button follows you while you scroll the block */
.content pre .code-head { position: sticky; top: 0; z-index: 3; height: 36px; padding: 0 8px 0 14px; background: var(--code-head); border-bottom: 0; font-size: 12.5px; color: var(--text-faint); }
.content pre .code-lang { text-transform: none; }
.content pre .code-btn { border-radius: 7px; }
.content pre code { padding: 14px 16px; font-size: 13.5px; line-height: 1.65; background: none; border: 0; }
.content pre .code-gutter { background: var(--bg-code); font-size: 13.5px; line-height: 1.65; border-right-color: var(--border); padding: 14px 8px 14px 14px; }
html:root .content .hljs-comment, html:root .content .hljs-quote { color: var(--t-c); font-style: italic; }
html:root .content .hljs-keyword, html:root .content .hljs-selector-tag, html:root .content .hljs-built_in,
html:root .content .hljs-literal, html:root .content .hljs-type { color: var(--t-k); }
html:root .content .hljs-string, html:root .content .hljs-attr, html:root .content .hljs-template-tag,
html:root .content .hljs-addition, html:root .content .hljs-regexp { color: var(--t-s); }
html:root .content .hljs-number, html:root .content .hljs-symbol, html:root .content .hljs-bullet,
html:root .content .hljs-meta { color: var(--t-n); }
html:root .content .hljs-title, html:root .content .hljs-section, html:root .content .hljs-name,
html:root .content .hljs-variable, html:root .content .hljs-params, html:root .content .hljs-attribute,
html:root .content .hljs-tag, html:root .content .hljs-link, html:root .content .hljs-deletion { color: var(--text); }

/* thinking block: a small pill, body with a left rule */
.reasoning { border: 0; background: none; border-radius: 0; margin-bottom: 12px; overflow: visible; }
.reasoning summary {
  display: inline-flex; height: 30px; padding: 0 11px; gap: 7px; border-radius: 10px;
  border: 1px solid var(--border); font-size: 13px; color: var(--text-soft); font-family: var(--font);
  transition: background .15s;
}
.reasoning summary:hover { background: var(--bg-hover); }
.reasoning summary .rb-icon { color: var(--accent-fg); }
.reasoning .rlabel { font-weight: 400; }
.reasoning .rlabel.thinking {
  background: linear-gradient(90deg, var(--text-faint) 30%, var(--text) 50%, var(--text-faint) 70%);
  background-size: 200% 100%; -webkit-background-clip: text; background-clip: text;
  color: transparent; animation: shimmer 1.6s linear infinite;
}
.reasoning .rlabel.thinking::after { display: none; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.reasoning .rmeta { margin-left: 2px; }
.reasoning .rbody {
  margin: 10px 0 0; padding: 0 0 0 14px; border-top: 0; border-left: 2px solid var(--border-strong);
  font-family: var(--font); font-size: 14px; line-height: 1.7; color: var(--text-faint);
}

.ma-btn { width: 30px; height: 30px; border-radius: 8px; }
.msg-actions { margin-top: 10px; }
.found-chip { border-radius: 10px; background: var(--bg-hover); }
.caret-blink { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); vertical-align: middle; animation: caretpulse 1s ease-in-out infinite; }
@keyframes caretpulse { 50% { transform: scale(.55); opacity: .5; } }

/* ----------------------------------------------------------------- hero */
.empty-state { max-width: var(--measure); padding: 0 24px 26px; gap: 0; }
.greet { display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap; animation: hin .9s var(--ease) both; }
@keyframes hin { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.hero-logo { display: block; height: 54px; }
.hero-logo img { display: block; height: 100%; width: auto; image-rendering: pixelated; }
.greeting { font-family: var(--serif); font-size: clamp(30px, 3.8vw, 42px); font-weight: 400; letter-spacing: -.02em; line-height: 1.15; color: var(--text-soft); }
.greeting .nm { color: var(--text); }

/* empty chat: hero + composer + chips are centred as one group */
.main:has(#emptyState) { justify-content: center; }
.main:has(#emptyState) .topbar { position: absolute; top: 0; left: 0; right: 0; z-index: 4; }
.main:has(#emptyState) .chat { flex: 0 0 auto; overflow: visible; }
.main:has(#emptyState) .composer-wrap { padding-bottom: 0; }
.main:has(#emptyState) .composer .input { min-height: 52px; }
.main:has(#emptyState) .below { display: block; }
.main:has(#emptyState) .note { display: none; }
.main:has(#emptyState) { padding-bottom: 6vh; }

/* -------------------------------------------------------------- composer */
.composer-wrap { padding: 0 24px 6px; }
.attachments { max-width: var(--measure); }
.att-chip { background: var(--bg-hover); border-color: var(--border); }
.composer {
  display: block; max-width: var(--measure); margin: 0 auto; padding: 14px 12px 10px 18px;
  border-radius: 20px; background: var(--comp); border: 1px solid var(--border);
  box-shadow: var(--sh); cursor: text;
  transition: border-color .25s, box-shadow .4s var(--ease), background-color .3s;
}
.composer:focus-within { border-color: var(--ring); box-shadow: var(--sh-f); }
.composer .input {
  display: block; width: 100%; min-height: 30px; max-height: 240px; padding: 0;
  font-size: 16px; line-height: 24px; letter-spacing: inherit; background: none;
}
.composer .input::placeholder { color: var(--text-faint); }
.tools { display: flex; align-items: center; gap: 4px; margin: 8px 0 0 -6px; }
.tools .sp { flex: 1; }
.plus-btn { width: 32px; height: 32px; flex: 0 0 32px; border-radius: 10px; color: var(--text-faint); }
.plus-btn:hover { background: var(--bg-hover); color: var(--text); }
.plus-btn .ico { width: 18px; height: 18px; stroke-width: 1.8; }
.web-btn {
  width: auto; height: 32px; flex: none; padding: 0 10px; gap: 6px; border-radius: 10px;
  font-size: 13.5px; color: var(--text-soft); transition: background .15s, color .15s, transform .3s var(--spring);
}
.web-btn .ico { width: 17px; height: 17px; stroke-width: 1.7; }
.web-btn:hover { background: var(--bg-hover); color: var(--text); }
.web-btn:active { transform: scale(.95); }
.web-btn.active { background: var(--accent-soft); color: var(--accent-fg); }
.chip {
  display: inline-flex; align-items: center; gap: 5px; height: 32px; padding: 0 9px 0 10px;
  border-radius: 10px; font-size: 13.5px; color: var(--text-soft); border: 0; background: none;
}
.chip:hover { background: var(--bg-hover); }
.chip .caret { width: 14px; height: 14px; color: var(--text-faint); }
/* model button sits under the composer, right-aligned: "Core 2.1  Низкий ⌄" */
.composer-meta { display: flex; align-items: center; max-width: var(--measure); margin: 6px auto 0; padding: 0 4px; }
.composer-meta .sp { flex: 1; }
.composer-meta .model-chip { height: 34px; padding: 0 10px 0 12px; gap: 8px; font-size: 14px; color: var(--text); }
.composer-meta .model-chip[aria-expanded=true], .composer-meta .model-chip:hover { background: var(--bg-hover); }
.reason-chip { color: var(--text-faint); font-size: 14px; }
.main:has(#emptyState) .composer-meta + .below .chips { padding-top: 22px; }
.send-btn {
  width: 34px; height: 34px; flex: 0 0 34px; margin-left: 4px; border-radius: 50%;
  background: var(--accent); color: #fff;
  transition: background .25s, color .25s, transform .4s var(--spring);
}
.send-btn .ico { width: 18px; height: 18px; }
.send-btn:hover { background: var(--accent-hover); transform: scale(1.07); }
.send-btn:active { transform: scale(.9); }
.send-btn.idle { background: var(--bg-hover); color: var(--text-faint); cursor: default; transform: none; }
.send-btn.stop { background: var(--accent); color: #fff; }
.send-btn.stop:hover { background: var(--accent-hover); }

.below { display: none; position: relative; max-width: var(--measure); margin: 0 auto; min-height: 54px; }
.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; padding-top: 16px; }
.cat-chip {
  display: flex; align-items: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: 10px;
  border: 1px solid var(--border); font-size: 14px; color: var(--text-soft);
  transition: background .15s, color .15s, transform .3s var(--spring);
}
.cat-chip:hover { background: var(--bg-hover); color: var(--text); }
.cat-chip:active { transform: scale(.97); }
.cat-chip.on { background: var(--accent-soft); color: var(--accent-fg); border-color: transparent; }
.cat-chip .ico { width: 16px; height: 16px; stroke-width: 1.7; color: var(--text-faint); }
#sugg {
  position: absolute; left: 0; right: 0; top: 62px; z-index: 8; opacity: 0; visibility: hidden;
  transform: translateY(-6px) scale(.985); transform-origin: top center;
  transition: opacity .2s, transform .4s var(--spring), visibility 0s .4s;
}
#sugg.open { opacity: 1; visibility: visible; transform: none; transition: opacity .2s, transform .4s var(--spring), visibility 0s; }
#sugg .box { padding: 6px; border-radius: 16px; background: var(--menu); border: 1px solid var(--border); box-shadow: 0 20px 50px -16px rgba(0, 0, 0, .3); }
#sugg .box button {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%;
  padding: 11px 12px; border-radius: 10px; font-size: 14.5px; color: var(--text-soft); text-align: left;
  transition: background .15s, color .15s;
}
#sugg .box button .ico { width: 15px; height: 15px; color: var(--text-faint); opacity: 0; transform: translate(-4px, 4px); transition: all .3s var(--ease); }
#sugg .box button:hover { background: var(--bg-hover); color: var(--text); }
#sugg .box button:hover .ico { opacity: 1; transform: none; }
.note { max-width: var(--measure); margin: 0 auto; padding: 10px 0 8px; text-align: center; font-size: 12px; color: var(--text-faint); }

/* -------------------------------------------------- model / depth popover */
.popover {
  width: 330px; min-width: 0; max-width: calc(100vw - 20px); padding: 6px; border-radius: 16px;
  background: var(--menu); border: 1px solid var(--border); box-shadow: 0 24px 60px -14px rgba(0, 0, 0, .35);
}
.pop-title { padding: 7px 11px 5px; font-size: 12px; font-weight: 400; letter-spacing: 0; text-transform: none; color: var(--text-faint); }
.pop-item { flex-direction: row; align-items: center; padding: 9px 11px; border-radius: 10px; font-size: 14px; }
.pop-item .pi-left { gap: 1px; }
.pop-item .pi-title { font-weight: 550; font-size: 14px; }
.pop-item { padding: 7px 12px; }
.popover { padding: 4px; }
.popover .pop-title { padding: 6px 12px 3px; }
.popover .pop-sep { margin: 4px 4px; }
.reason-slider { padding: 2px 6px 4px; }
.reason-slider:not(.open) { display: none; }
.pop-row {
  display: flex; align-items: center; gap: 8px; width: 100%; padding: 10px 12px; border-radius: 10px;
  font-size: 14px; text-align: left; color: var(--text); transition: background .15s;
}
.pop-row:hover { background: var(--bg-hover); }
.pop-row .pr-name { flex: 1; }
.pop-row .pr-val { color: var(--text-faint); }
.pop-row .pr-chev { color: var(--text-faint); transition: transform .25s var(--ease); }
.pop-row.open .pr-chev { transform: rotate(90deg); }
.pop-row[hidden] { display: none !important; }
.pop-row .pr-name small { margin-left: 6px; font-size: 12px; color: var(--text-faint); }
.pop-row.on .pr-val { color: var(--accent-fg); font-weight: 600; }
#ensembleRow { margin-top: 2px; }
.pop-item .pi-desc { font-size: 12.5px; color: var(--text-faint); }
.pop-item.active { background: none; }
.pop-item .pi-check { margin-left: auto; color: var(--accent-fg); }
.pop-sep { margin: 6px 4px; }
.reason-slider { padding: 2px 6px 6px; }
.reason-slider input[type=range] { display: none; }
.reason-slider .rs-labels { display: flex; margin: 0; padding: 3px; border-radius: 11px; background: var(--bg-hover); }
.reason-slider .rs-tick {
  flex: 1; text-align: center; padding: 6px 0; border-radius: 8px; font-size: 12.5px; color: var(--text-faint);
  transition: color .25s, background .25s, box-shadow .25s;
}
.reason-slider .rs-tick:hover { color: var(--text-soft); }
.reason-slider .rs-tick.active { background: var(--comp); color: var(--text); font-weight: 550; box-shadow: 0 1px 3px rgba(0, 0, 0, .18); }
.pop-note { padding: 4px 11px 8px; }

/* --------------------------------------------------- panels, forms, misc */
.sources-panel { background: var(--bg-side); }
.modal { backdrop-filter: blur(4px); background: rgba(20, 18, 15, .4); }
.modal-card { border-radius: 18px; background: var(--menu); box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .55); }
.field input, .field select, .field textarea, .login-field input,
.set-row select, .set-row input[type=text], .set-row input[type=password] { background: var(--bg); border-radius: 10px; }
.btn-primary, .login-submit { border-radius: 10px; }
.btn-ghost, .btn-danger { border-radius: 10px; }
.toast { background: var(--text); color: var(--bg); border: 0; border-radius: 999px; padding: 10px 18px; }
.toast.err { background: var(--danger); color: #fff; }
.tool-card { border-radius: 12px; }
.login-body, body.landing { background: var(--bg); }
.login-card { background: var(--menu); border-radius: 20px; }
.login-logo { color: var(--brand); }
.stat-card, .list-item { border-radius: 14px; background: var(--comp); }
.scroll-down { background: var(--comp); border: 1px solid var(--border); box-shadow: var(--sh); }

/* ------------------------------------- icons: crisp, one size in the chat */
.ico { shape-rendering: geometricPrecision; stroke-width: 1.7; }
.msg .ico, .found-chip .ico, .sources-panel .ico { stroke-width: 1.65; }
.msg .ma-btn .ico { width: 20px; height: 20px; display: block; }   /* 20px viewBox -> 1:1, no resampling */
.content pre .code-btn .ico { width: 20px; height: 20px; }

/* --------------------------- actions under an answer: one even row */
.msg-actions { margin: 8px 0 0 -8px; gap: 10px; min-height: 32px; align-items: center; flex-wrap: nowrap; }
.ma-bar { display: flex; align-items: center; gap: 2px; }
.ma-btn { width: 32px; height: 32px; flex: 0 0 32px; padding: 0; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; color: var(--text-faint); }
.ma-btn:hover { background: var(--bg-hover); color: var(--text); }
.ma-btn.on { color: var(--accent-fg); }
/* speed / time / tokens: always small and grey, on the same line as the icons */
.ma-meta {
  margin-left: 8px; font-size: 12.5px; line-height: 1; color: var(--text-faint);
  white-space: nowrap; font-variant-numeric: tabular-nums; font-weight: 400; letter-spacing: 0;
}
.ma-meta:empty { display: none; }
/* one timer only: while thinking it is in the "Думает… 11 с" row, afterwards
   the speed/time/tokens line in .ma-meta; the second clock under the dot is gone */
.msg-stats { display: none !important; }

/* ------------------------------ thinking: a plain row, click to fold */
.reasoning summary {
  display: inline-flex; align-items: center; height: auto; padding: 4px 0; gap: 8px; border: 0;
  background: none; font-size: 14px; color: var(--text-soft); font-family: var(--font); border-radius: 8px;
}
.reasoning summary:hover { background: none; color: var(--text); }
.reasoning summary .rb-icon { width: 18px; height: 18px; color: var(--accent-fg); }
.reasoning .rchev { width: 16px; height: 16px; margin-left: 0; color: var(--text-faint); }
.reasoning .rlabel { font-weight: 400; }
.reasoning .rbody { margin-top: 8px; }

/* ------------------------------------- web search: chip + side panel */
.found-chip {
  display: inline-flex; align-items: center; gap: 8px; height: 34px; margin: 0 0 14px; padding: 0 12px 0 11px;
  border-radius: 999px; background: var(--bg-hover); border: 1px solid var(--border);
  font-size: 13.5px; color: var(--text-soft); font-family: var(--font); cursor: pointer;
}
.found-chip:hover { background: var(--sel); color: var(--text); }
.found-chip .ico { width: 18px; height: 18px; color: var(--text-soft); }
.found-chip .fc-favs { display: inline-flex; margin-left: 2px; }
.found-chip .fc-fav { width: 18px; height: 18px; margin-left: -6px; border-radius: 50%; background: var(--bg); border: 2px solid var(--bg-hover); object-fit: cover; box-sizing: content-box; }
.found-chip .fc-fav:first-child { margin-left: 0; }
.sources-panel { width: 400px; flex: 0 0 400px; border-left: 1px solid var(--border); background: var(--bg-side); }
.sp-head { height: 56px; padding: 0 12px 0 20px; border-bottom: 1px solid var(--border); }
.sp-title { font-size: 14.5px; font-weight: 600; }
.sp-body { padding: 8px 10px 20px; gap: 2px; }
.sp-item { padding: 12px 12px 12px; border-radius: 12px; }
.sp-item:hover { background: var(--bg-hover); }
.sp-src-head { gap: 8px; margin-bottom: 6px; }
.sp-fav { width: 18px; height: 18px; border-radius: 50%; object-fit: cover; }
.sp-src-name { font-size: 12.5px; }
.sp-idx { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--bg-hover); font-size: 11px; color: var(--text-faint); }
.sp-item .sp-title { font-size: 14.5px; font-weight: 600; line-height: 1.35; }
.sp-snippet { font-size: 13px; line-height: 1.5; -webkit-line-clamp: 3; }
@media (max-width: 860px) {
  .sources-panel { position: fixed; inset: 0 0 0 auto; z-index: 55; width: min(400px, 100vw); box-shadow: -20px 0 60px rgba(0, 0, 0, .35); }
}

/* ---------------- messages typed while an answer is being written */
.queue-box { max-width: var(--measure); margin: 0 auto 8px; display: flex; flex-direction: column; gap: 6px; }
.queue-box[hidden] { display: none !important; }
.q-item {
  display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 5px 6px 5px 12px;
  border-radius: 14px; background: var(--bg-hover); border: 1px solid var(--border); font-size: 14px;
  animation: hin .35s var(--ease) both;
}
.q-tag { flex: none; font-size: 11.5px; font-weight: 600; color: var(--accent-fg); background: var(--accent-soft); padding: 2px 9px; border-radius: 999px; }
.q-text { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-soft); }
.q-now { flex: none; height: 30px; padding: 0 11px; border-radius: 9px; font-size: 13px; color: var(--accent-fg); transition: background .15s; }
.q-now:hover { background: var(--accent-soft); }
.q-x { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; color: var(--text-faint); }
.q-x:hover { background: var(--sel); color: var(--text); }
.send-now-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; margin-left: 4px;
  border-radius: 10px; font-size: 13.5px; color: var(--accent-fg); background: var(--accent-soft);
  transition: background .15s, transform .3s var(--spring);
}
.send-now-btn .ico { width: 16px; height: 16px; }
.send-now-btn:hover { background: var(--sel); }
.send-now-btn:active { transform: scale(.95); }
.send-now-btn[hidden] { display: none !important; }
@media (max-width: 560px) { .send-now-btn span { display: none; } .send-now-btn { padding: 0 9px; } }

/* --------------------------- "Аудио": chat mode + voice picker card */
body.audio-mode .web-btn, body.audio-mode .composer-meta, body.audio-mode .below { display: none !important; }
.audio-sub { max-width: 520px; margin: 10px auto 0; text-align: center; font-size: 14.5px; line-height: 1.55; color: var(--text-faint); }
.vp-pending .msg-actions { display: none; }
.vp-card {
  width: 100%; max-width: 560px; padding: 14px 14px 12px; border-radius: 18px;
  background: var(--comp); border: 1px solid var(--border); box-shadow: var(--sh);
  font-family: var(--font); animation: hin .45s var(--ease) both;
}
.vp-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin: 0 2px 10px; }
.vp-title { font-size: 17px; font-weight: 650; letter-spacing: -.01em; }
.vp-sub { min-width: 0; font-size: 12.5px; color: var(--text-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vp-tabs { display: flex; gap: 4px; padding: 3px; border-radius: 12px; background: var(--bg-hover); margin-bottom: 10px; }
.vp-tab {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; height: 30px; border-radius: 9px;
  font-size: 13px; color: var(--text-faint); transition: background .2s, color .2s, box-shadow .2s;
}
.vp-tab:hover { color: var(--text-soft); }
.vp-tab.on { background: var(--comp); color: var(--text); font-weight: 600; box-shadow: 0 1px 3px rgba(0, 0, 0, .22); }
.vp-cnt { font-size: 11px; font-weight: 600; padding: 1px 6px; border-radius: 999px; background: var(--bg-hover); color: var(--text-faint); }
.vp-tab.on .vp-cnt { background: var(--accent-soft); color: var(--accent-fg); }
.vp-body { min-height: 0; }
.vp-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.vp-voice {
  display: flex; align-items: center; gap: 8px; min-width: 0; padding: 6px 6px 6px 6px; border-radius: 12px; text-align: left;
  border: 1px solid var(--border); background: var(--bg); color: var(--text);
  transition: border-color .15s, background .15s, transform .25s var(--spring), box-shadow .2s;
}
.vp-voice:hover { background: var(--bg-hover); }
.vp-voice:active { transform: scale(.97); }
.vp-voice.on { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 2px var(--accent-soft); }
.vp-av {
  position: relative; flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px;
  overflow: hidden; font-size: 14px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, hsl(var(--h) 78% 56%), hsl(calc(var(--h) + 24) 70% 42%));
}
.vp-av img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; opacity: 0; transition: opacity .25s; }
.vp-av.has-img { background: #1b1a19; color: transparent; }
.vp-av.has-img img { opacity: 1; }
.vp-name { flex: 1; min-width: 0; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vp-play {
  flex: none; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
  color: var(--text-soft); background: var(--bg-hover); transition: background .15s, color .15s, transform .25s var(--spring);
}
.vp-play .ico { width: 12px; height: 12px; }
.vp-play:hover { background: var(--accent); color: #fff; transform: scale(1.12); }
.vp-foot { display: flex; align-items: center; gap: 8px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border); }
.vp-speed { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; font-size: 12.5px; color: var(--text-soft); }
.vp-speed input { flex: 1; min-width: 60px; accent-color: var(--accent); }
.vp-speed-val { width: 36px; text-align: right; font-variant-numeric: tabular-nums; color: var(--text); }
.vp-foot .btn-ghost { padding: 7px 12px; font-size: 13px; }
.vp-go { padding: 8px 18px; font-size: 13.5px; }
@media (max-width: 560px) { .vp-grid { grid-template-columns: 1fr 1fr; } .vp-card { padding: 12px 10px; } .vp-sub { display: none; } }

.voice-pick { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.voice-pick select { min-width: 220px; max-width: 100%; }
.voice-pick .btn-ghost { padding: 7px 12px; }

/* -------------------------- pictures and speech made by AFINA (/media) */
.content img[src^="/media/"] {
  display: block; max-width: min(100%, 560px); height: auto; margin: 8px 0 10px;
  border-radius: 14px; border: 1px solid var(--border); background: var(--bg-hover); cursor: zoom-in;
}
.audio-card {
  display: flex; align-items: center; gap: 12px; max-width: 480px; margin: 8px 0 10px;
  padding: 8px 12px; border-radius: 14px; background: var(--bg-hover); border: 1px solid var(--border);
}
.audio-card audio { flex: 1; min-width: 0; height: 36px; }
.audio-dl { flex: none; font-size: 13px; color: var(--accent-fg); }
.img-viewer {
  position: fixed; inset: 0; z-index: 90; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 14px; padding: 24px; background: rgba(10, 9, 8, .86); backdrop-filter: blur(6px);
}
.img-viewer img { max-width: min(94vw, 1100px); max-height: 80vh; border-radius: 12px; box-shadow: 0 30px 80px rgba(0, 0, 0, .6); }
.iv-bar { display: flex; gap: 10px; }
.iv-btn { padding: 8px 16px; border-radius: 10px; background: rgba(255, 255, 255, .12); color: #fff; font-size: 14px; text-decoration: none; }
.iv-btn:hover { background: rgba(255, 255, 255, .2); text-decoration: none; }

/* ------------------------------------------- drag & drop zone for files */
.drop-zone {
  position: absolute; inset: 10px; z-index: 40; display: grid; place-items: center;
  border-radius: 24px; border: 2px dashed var(--accent); background: var(--accent-soft);
  backdrop-filter: blur(6px); opacity: 0; pointer-events: none; transition: opacity .2s;
}
.drop-zone.show { opacity: 1; }
.dz-box { display: flex; flex-direction: column; align-items: center; gap: 10px; color: var(--accent-fg); font-size: 16px; font-weight: 600; }
.dz-box .ico { width: 34px; height: 34px; stroke-width: 1.6; animation: dzbob 1.1s ease-in-out infinite; }
@keyframes dzbob { 50% { transform: translateY(-5px); } }
.composer.drag { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }

/* ------------------------------------- collapsed sidebar = icon rail (desktop) */
@media (min-width: 861px) {
  .sidebar { transition: width .35s var(--ease), flex-basis .35s var(--ease), margin-left .35s var(--ease); }
  .app.side-collapsed .sidebar { margin-left: 0; width: 56px; flex: 0 0 56px; overflow: visible; }
  .app.side-collapsed :is(.brand-name, .collapse-btn, .hist-section, .search-wrap, .acc-text, .acc-caret,
      .side-link span, .admin-bottom span, .new-btn > span:not(.ic)) { display: none; }
  .app.side-collapsed .brand { padding: 0; justify-content: center; }
  .app.side-collapsed .brand-logo { cursor: pointer; }
  .app.side-collapsed .side-nav { padding: 0; align-items: center; }
  .app.side-collapsed :is(.side-link, .admin-bottom, .account) { width: 44px; padding: 0; justify-content: center; margin: 0 auto; }
  .app.side-collapsed .new-btn { width: 44px; padding: 0; margin: 4px auto 6px; justify-content: center; }
  .app.side-collapsed .new-btn .ic { margin-left: 0; }
  .app.side-collapsed .sidebar-bottom { margin-top: auto; padding: 8px 0 10px; align-items: center; }
  .app.side-collapsed .acc-avatar { margin-left: 0; }
  .app.side-collapsed .desktop-menu-btn { display: none; }
}

/* --------------------------------------------------------------- mobile */
@media (max-width: 860px) {
  .sidebar { box-shadow: 0 0 60px rgba(0, 0, 0, .3); }
  .main:has(#emptyState) { padding-bottom: 0; }
}
@media (max-width: 560px) {
  .composer-wrap { padding: 0 12px 6px; }
  .thread { padding: 12px 16px 28px; }
  .empty-state { padding: 0 16px 20px; }
  .web-btn:not(.active) span { display: none; }
  .web-btn:not(.active) { width: 32px; padding: 0; justify-content: center; }
  .msg.user .body { max-width: 90%; }
  .popover { left: 10px; right: 10px; width: auto; }
}
@media (max-height: 620px) { .main:has(#emptyState) { padding-bottom: 0; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* speed / quality switch in the voice card */
.vp-mode { display: flex; gap: 6px; margin-bottom: 10px; }
.vp-mode:empty { display: none; }
.vp-m {
  flex: 1; display: flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 8px 12px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--bg); text-align: left;
  transition: border-color .15s, background .15s, box-shadow .2s, transform .25s var(--spring);
}
.vp-m:hover:not(:disabled) { background: var(--bg-hover); }
.vp-m:active:not(:disabled) { transform: scale(.98); }
.vp-m.on { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 2px var(--accent-soft); }
.vp-m:disabled { opacity: .5; cursor: default; }
.vp-m-t { font-size: 13.5px; font-weight: 650; color: var(--text); }
.vp-m-h { font-size: 11.5px; color: var(--text-faint); }
.vp-eta { flex: none; font-size: 12.5px; color: var(--text-faint); font-variant-numeric: tabular-nums; white-space: nowrap; }
.vp-tabs[hidden] { display: none !important; }

/* ---- Inter (self-hosted) for the sidebar ---- */
@font-face { font-family: "Inter UI"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url(/assets/fonts/inter-cyrillic.woff2) format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Inter UI"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url(/assets/fonts/inter-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
.sidebar, .sidebar :is(button, input, a, span, small) {
  font-family: "Inter UI", var(--font); font-feature-settings: "cv11", "ss03"; letter-spacing: -.005em; }
.sidebar .side-link, .sidebar .new-btn { font-weight: 500; font-size: 13.5px; }
.sidebar .side-link.active { font-weight: 600; }
.vp-m-t { display: inline-flex; align-items: center; gap: 6px; }
.vp-m-i { width: 15px; height: 15px; color: var(--accent); }

/* ---- brand lockup: mark + live wordmark with blinking cursor ---- */
.brand-logo { gap: 9px; }
.bl-mark { display: block !important; height: 28px; }
.bl-word { display: inline-flex; align-items: center; gap: 4px; height: 28px; }
.bl-t { font: 700 17px/1 "Inter UI", var(--font); letter-spacing: .16em; color: var(--text); padding-left: 1px; }
.bl-cur { width: 6px; height: 17px; border-radius: 1.5px; background: #EE7340; animation: blcur 1.05s steps(1, end) infinite; }
@keyframes blcur { 0%, 55% { opacity: 1; } 56%, 100% { opacity: 0; } }
.app.side-collapsed .bl-word { display: none; }
.login-title .bl-word, .login-title .bl-mark { display: inline-flex !important; }

/* ---- chat list skeleton ---- */
.sk-row { height: 34px; padding: 0 12px; display: flex; align-items: center; opacity: 0; animation: skin .3s ease forwards; }
.sk-row i { display: block; height: 11px; border-radius: 6px;
  background: linear-gradient(90deg, var(--bg-hover) 25%, var(--sel) 50%, var(--bg-hover) 75%); background-size: 220% 100%;
  animation: skshim 1.2s linear infinite; }
@keyframes skin { to { opacity: 1; } }
@keyframes skshim { from { background-position: 120% 0; } to { background-position: -120% 0; } }
#history.fade-in > * { animation: histin .35s var(--ease) both; }
@keyframes histin { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* the blinking cursor and skeleton are the page's "alive" signals: keep them even with reduced motion (soft, no movement) */
@media (prefers-reduced-motion: reduce) {
  .bl-cur { animation: blcur 1.05s steps(1, end) infinite !important; }
  .sk-row { animation: skin .3s ease forwards !important; animation-duration: .3s !important; animation-iteration-count: 1 !important; }
  .sk-row i { animation: skshim 1.6s linear infinite !important; animation-duration: 1.6s !important; animation-iteration-count: infinite !important; }
}

/* ---- "Прочее": collapsible group ---- */
.more-toggle { width: 100%; }
.more-toggle .more-caret { margin-left: auto; width: 14px; height: 14px; transition: transform .25s var(--ease); }
.side-more.open .more-caret { transform: rotate(90deg); }
.side-more-list { position: relative; margin-left: 22px; max-height: 0; overflow: hidden; transition: max-height .3s var(--ease); display: flex; flex-direction: column; gap: 1px; }
.side-more.open .side-more-list { max-height: 200px; }
.side-more-list .side-link { height: 34px; font-size: 13.5px; opacity: 0; transform: translateY(-4px); transition: opacity .2s, transform .25s var(--ease); }
.side-more.open .side-more-list .side-link { opacity: 1; transform: none; }
.side-more:not(.open) .side-more-list .side-link { pointer-events: none; }
.side-more.open .side-more-list::before { content: ""; position: absolute; left: -9px; top: 2px; bottom: 2px; width: 1px; background: var(--border); }
.app.side-collapsed .more-toggle .more-caret { display: none; }
.app.side-collapsed .side-more-list { margin-left: 0; }

/* ---- model menu: cards ---- */
#modelPop { width: 372px; padding: 8px; }
#modelPop .pop-title { padding: 4px 8px 8px; font-size: 11.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-faint); }
#modelList { display: flex; flex-direction: column; gap: 4px; }
.pop-item.mdl { display: flex; align-items: flex-start; gap: 12px; padding: 10px 12px; border-radius: 13px; text-align: left;
  border: 1px solid transparent; transition: background .15s, border-color .15s, transform .15s var(--ease); }
.pop-item.mdl:hover { background: var(--bg-hover); }
.pop-item.mdl:active { transform: scale(.99); }
.pop-item.mdl.active { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.mdl-ic { flex: none; width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center;
  background: color-mix(in srgb, var(--tone) 16%, transparent); color: var(--tone); }
.mdl-ic .ico { width: 19px; height: 19px; }
.tone-violet { --tone: #9b87f5; } .tone-blue { --tone: #5aa2f0; } .tone-green { --tone: #5cc08a; } .tone-amber { --tone: #e8a23c; }
.mdl-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.mdl-body .pi-title { font-size: 14.5px; font-weight: 600; }
.mdl-body .pi-desc { font-size: 12.5px; line-height: 1.35; color: var(--text-faint); }
.mdl-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 5px; }
.mdl-tag { font-style: normal; font-size: 11px; line-height: 1; padding: 4px 8px; border-radius: 999px;
  background: var(--bg-hover); color: var(--text-soft); border: 1px solid var(--border); }
.mdl-tag:first-child:not(:last-child), .active .mdl-tag:first-child { color: var(--tone); border-color: color-mix(in srgb, var(--tone) 35%, transparent); background: color-mix(in srgb, var(--tone) 10%, transparent); }
.mdl-chk { flex: none; width: 20px; height: 20px; margin-top: 2px; color: var(--accent); }
.mdl-chk .ico { width: 18px; height: 18px; stroke-width: 2.2; }
#modelPop .pop-sep { margin: 8px 2px; }
#modelPop #reasonRow { padding: 10px 12px; border-radius: 12px; }
#modelPop .pop-note { margin: 0 4px 4px; padding: 9px 12px; border-radius: 11px; background: var(--bg-hover); font-size: 12.5px; line-height: 1.4; }
@media (max-width: 400px) { #modelPop { width: auto; } }
/* tags: first tag keeps neutral style unless it's the model's accent tag */
.mdl-tag { color: var(--text-soft); }
