/* ============================================================
   Frond — стили. Белый, тихий, быстрый.
   ============================================================ */

:root {
  --bg: #ffffff;
  --bg-soft: #f6f6f7;
  --bg-soft-2: #efeff1;
  --fg: #0b0b0c;
  --fg-2: #57575c;
  --fg-3: #8e8e94;
  --line: #e9e9ec;
  --line-2: #dcdce0;
  --accent: #0b0b0c;
  --green: #2f8f5b;
  --red: #d94b4b;
  --radius: 18px;
  --radius-lg: 26px;
  --sidebar: 288px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --serif: 'Instrument Serif', 'Iowan Old Style', 'Palatino Linotype', Georgia, serif;
  --mono: ui-monospace, 'JetBrains Mono', 'SF Mono', Menlo, Consolas, monospace;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.34, 1.4, .4, 1);
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html {
  height: 100%;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  touch-action: manipulation;
  overscroll-behavior: none;
}
body {
  margin: 0;
  height: 100%;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'cv11', 'ss01', 'calt';
  overflow: hidden;
  overscroll-behavior: none;
}
[hidden] { display: none !important; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, textarea { font: inherit; color: inherit; }
input, textarea, select { font-size: 16px; } /* iOS не зумит поля с 16px */
a { color: inherit; }
img { max-width: 100%; display: block; }
::selection { background: #dfe7ff; }

/* --------------------------------------------- базовые кнопки */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 46px; padding: 0 20px; border-radius: 14px;
  font-weight: 500; background: var(--bg-soft); color: var(--fg);
  transition: transform .15s var(--ease), background .2s, opacity .2s;
  position: relative;
}
.btn:active { transform: scale(.97); }
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: #222; }
.btn--block { width: 100%; }
.btn .btn__spinner { display: none; width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(255,255,255,.35); border-top-color: #fff; animation: spin .7s linear infinite; }
.btn.is-loading .btn__label { opacity: 0; }
.btn.is-loading .btn__spinner { display: block; position: absolute; }
@keyframes spin { to { transform: rotate(360deg); } }

.icon-btn {
  width: 40px; height: 40px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center;
  color: var(--fg-2); transition: background .15s, color .15s, transform .15s var(--ease);
}
.icon-btn:hover { background: var(--bg-soft); color: var(--fg); }
.icon-btn:active { transform: scale(.92); }

/* --------------------------------------------- вход */
.login {
  position: fixed; inset: 0; display: grid; place-items: center;
  padding: 24px; background: var(--bg); overflow: hidden;
  padding-top: calc(24px + var(--sat)); padding-bottom: calc(24px + var(--sab));
}
.login__card {
  position: relative; z-index: 1; width: 100%; max-width: 380px; text-align: center;
  animation: rise .7s var(--ease) both;
}
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
.login__logo img { margin: 0 auto 18px; width: 68px; height: 68px; border-radius: 18px; box-shadow: 0 18px 40px -18px rgba(0,0,0,.45); animation: float 5s ease-in-out infinite; }
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.login__title { margin: 0; font-family: var(--serif); font-weight: 400; font-size: 52px; line-height: 1; letter-spacing: -.02em; }
.login__sub { margin: 10px 0 28px; color: var(--fg-3); font-size: 15px; }
.login__form { display: grid; gap: 12px; }
.field { position: relative; }
.field__input {
  width: 100%; height: 52px; padding: 0 48px 0 18px; border-radius: 16px;
  border: 1.5px solid var(--line-2); background: var(--bg); outline: none;
  font-family: var(--mono); font-size: 16px; letter-spacing: .02em;
  transition: border-color .2s, box-shadow .2s;
}
.field__input::placeholder { font-family: var(--font); letter-spacing: 0; color: var(--fg-3); }
.field__input:focus { border-color: var(--fg); box-shadow: 0 0 0 4px rgba(11,11,12,.06); }
.field__eye { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border-radius: 10px; color: var(--fg-3); display: grid; place-items: center; }
.field__eye:hover { color: var(--fg); background: var(--bg-soft); }
.login__error { min-height: 20px; margin: 0; color: var(--red); font-size: 13.5px; }
.login__form.is-shake { animation: shake .45s var(--ease); }
@keyframes shake { 10%,90% { transform: translateX(-2px);} 20%,80% { transform: translateX(4px);} 30%,50%,70% { transform: translateX(-6px);} 40%,60% { transform: translateX(6px);} }
.login__hint { margin: 26px 0 0; font-size: 12.5px; color: var(--fg-3); line-height: 1.5; }
.login__bg { position: absolute; inset: 0; pointer-events: none; filter: blur(70px); opacity: .55; }
.login__bg span { position: absolute; border-radius: 50%; }
.login__bg span:nth-child(1) { width: 46vmax; height: 46vmax; left: -12vmax; top: -14vmax; background: #dfe9e2; animation: blob 18s ease-in-out infinite alternate; }
.login__bg span:nth-child(2) { width: 40vmax; height: 40vmax; right: -14vmax; bottom: -10vmax; background: #e6e6ec; animation: blob 22s ease-in-out infinite alternate-reverse; }
.login__bg span:nth-child(3) { width: 26vmax; height: 26vmax; left: 40%; bottom: -6vmax; background: #e9efe9; animation: blob 26s ease-in-out infinite alternate; }
@keyframes blob { to { transform: translate(6vmax, 4vmax) scale(1.08); } }

/* --------------------------------------------- каркас */
.app { display: flex; height: 100%; height: 100dvh; }
.sidebar {
  width: var(--sidebar); flex: none; display: flex; flex-direction: column;
  background: var(--bg-soft); border-right: 1px solid var(--line);
  padding-top: var(--sat);
}
.sidebar__top { display: flex; align-items: center; justify-content: space-between; padding: 14px 12px 8px 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 600; font-size: 17px; letter-spacing: -.01em; }
.brand img { border-radius: 8px; }
#closeSidebar { display: none; }

.newchat {
  margin: 4px 12px 10px; height: 42px; border-radius: 13px; padding: 0 12px;
  display: flex; align-items: center; gap: 10px; font-weight: 500;
  background: var(--bg); border: 1px solid var(--line); box-shadow: 0 1px 2px rgba(0,0,0,.03);
  transition: transform .15s var(--ease), box-shadow .2s;
}
.newchat:hover { box-shadow: 0 4px 14px -6px rgba(0,0,0,.2); }
.newchat:active { transform: scale(.98); }

.chatlist { flex: 1; overflow-y: auto; padding: 4px 8px 12px; overscroll-behavior: contain; }
.chatlist__group { margin: 12px 8px 4px; font-size: 11.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--fg-3); }
.chatitem {
  position: relative; display: flex; align-items: center;
  width: 100%; text-align: left; padding: 9px 12px; border-radius: 11px;
  color: var(--fg-2); transition: background .15s, color .15s;
  animation: fadein .3s var(--ease) both;
}
@keyframes fadein { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.chatitem span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chatitem:hover { background: var(--bg-soft-2); color: var(--fg); }
.chatitem.is-active { background: var(--bg); color: var(--fg); box-shadow: 0 1px 2px rgba(0,0,0,.05); font-weight: 500; }
.chatitem__more { flex: none; width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; opacity: 0; color: var(--fg-3); margin-right: -6px; }
.chatitem:hover .chatitem__more, .chatitem.is-active .chatitem__more { opacity: 1; }
.chatitem__more:hover { background: var(--line); color: var(--fg); }
.chatlist__empty { padding: 20px 12px; color: var(--fg-3); font-size: 13.5px; text-align: center; }

.sidebar__bottom { padding: 10px 12px calc(12px + var(--sab)); border-top: 1px solid var(--line); }
.balance { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 14px; background: var(--bg); border: 1px solid var(--line); }
.balance__ring { position: relative; width: 44px; height: 44px; flex: none; }
.balance__ring svg { transform: rotate(-90deg); }
.balance__track { fill: none; stroke: var(--bg-soft-2); stroke-width: 4; }
.balance__bar { fill: none; stroke: var(--fg); stroke-width: 4; stroke-linecap: round; stroke-dasharray: 113.1; stroke-dashoffset: 113.1; transition: stroke-dashoffset 1.2s var(--ease), stroke .3s; }
.balance.is-low .balance__bar { stroke: var(--red); }
.balance__pct { position: absolute; inset: 0; display: grid; place-items: center; font-size: 10.5px; font-weight: 600; letter-spacing: -.02em; }
.balance__text { min-width: 0; }
.balance__main { font-weight: 600; font-size: 14px; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.balance__of { color: var(--fg-3); font-weight: 500; }
.balance__sub { font-size: 12px; color: var(--fg-3); margin-top: 1px; }
.account { display: flex; align-items: center; justify-content: space-between; padding: 10px 4px 0; font-size: 12.5px; color: var(--fg-3); }
.account__key { font-variant-numeric: tabular-nums; }
.account__logout { padding: 6px 10px; border-radius: 8px; color: var(--fg-2); font-weight: 500; }
.account__logout:hover { background: var(--bg-soft-2); color: var(--fg); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; position: relative; background: var(--bg); }

.topbar {
  position: relative; display: flex; align-items: center; gap: 6px;
  height: calc(56px + var(--sat)); padding: var(--sat) 10px 0; flex: none;
}
.topbar__menu { display: none; }
.topbar__center { flex: 1; min-width: 0; padding: 0 6px; }
.topbar__title { font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: -.01em; }
.topbar__model { font-size: 12px; color: var(--fg-3); display: flex; align-items: center; gap: 6px; }
.topbar__model .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px rgba(47,143,91,.15); }
.topbar__actions { display: flex; gap: 2px; }
.topbar__new { display: none; }

.menu {
  position: absolute; right: 12px; top: calc(52px + var(--sat)); z-index: 30; min-width: 190px;
  background: var(--bg); border: 1px solid var(--line); border-radius: 14px; padding: 6px;
  box-shadow: 0 16px 40px -12px rgba(0,0,0,.25);
  animation: pop .18s var(--spring) both; transform-origin: top right;
}
@keyframes pop { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: scale(1); } }
.menu button { display: block; width: 100%; text-align: left; padding: 9px 12px; border-radius: 9px; font-size: 14px; }
.menu button:hover { background: var(--bg-soft); }
.menu button.danger { color: var(--red); }

/* --------------------------------------------- лента */
.thread { flex: 1; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; scroll-padding-bottom: 40px; position: relative; }
.thread__inner { max-width: 760px; margin: 0 auto; padding: 12px 20px 28px; }

.empty {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 24px 24px 90px; animation: fadein .5s var(--ease) both;
}
.empty__logo { border-radius: 14px; margin-bottom: 20px; animation: float 5s ease-in-out infinite; }
.empty__title { margin: 0; font-size: 32px; font-weight: 500; letter-spacing: -.02em; }
.empty__title em { font-family: var(--serif); font-style: italic; font-weight: 400; font-size: 1.15em; }
.empty__sub { margin: 10px 0 26px; color: var(--fg-3); max-width: 340px; }
.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; max-width: 560px; }
.chip {
  padding: 9px 14px; border-radius: 999px; border: 1px solid var(--line-2); font-size: 13.5px; color: var(--fg-2);
  transition: all .18s var(--ease); background: var(--bg);
}
.chip:hover { border-color: var(--fg); color: var(--fg); transform: translateY(-1px); }

/* сообщения */
.msg { display: flex; flex-direction: column; margin: 0 0 22px; }
.msg--user { align-items: flex-end; animation: sendin .55s var(--spring) both; }
@keyframes sendin { from { opacity: 0; transform: translateY(26px) scale(.96); } 60% { opacity: 1; } to { opacity: 1; transform: none; } }
.msg--user .bubble {
  max-width: 82%; padding: 11px 16px; border-radius: 20px; border-bottom-right-radius: 8px;
  background: var(--bg-soft-2); white-space: pre-wrap; word-wrap: break-word; overflow-wrap: anywhere;
}
.msg__images { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; margin-bottom: 6px; }
.msg__images img { width: 120px; height: 120px; object-fit: cover; border-radius: 14px; border: 1px solid var(--line); cursor: zoom-in; }
.msg--assistant { align-items: stretch; animation: fadein .4s var(--ease) both; }
.msg__head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 13px; color: var(--fg-3); }
.msg__head img { width: 22px; height: 22px; border-radius: 7px; }
.msg__body { min-width: 0; }
.msg__actions { display: flex; gap: 2px; margin-top: 4px; opacity: 0; transition: opacity .2s; }
.msg--assistant:hover .msg__actions, .msg--assistant.is-last .msg__actions { opacity: 1; }
.msg__actions button { height: 30px; padding: 0 9px; border-radius: 8px; display: inline-flex; align-items: center; gap: 6px; color: var(--fg-3); font-size: 12.5px; }
.msg__actions button:hover { background: var(--bg-soft); color: var(--fg); }
.msg__meta { font-size: 12px; color: var(--fg-3); margin-top: 6px; }
.msg__error { margin-top: 6px; padding: 10px 14px; border-radius: 12px; background: #fff4f4; color: var(--red); font-size: 14px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.msg__error button { padding: 4px 10px; border-radius: 8px; background: #fff; border: 1px solid #f3caca; font-size: 13px; }

/* «думает» */
.pending { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 2px; }
.pending i { width: 7px; height: 7px; border-radius: 50%; background: var(--fg); opacity: .25; animation: dots 1.2s ease-in-out infinite; }
.pending i:nth-child(2) { animation-delay: .15s; }
.pending i:nth-child(3) { animation-delay: .3s; }
@keyframes dots { 0%,80%,100% { opacity: .2; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

/* курсор печати */
.cursor { display: inline-block; width: 8px; height: 8px; margin-left: 3px; border-radius: 50%; background: var(--fg); vertical-align: -1px; animation: cursor 1s ease-in-out infinite; }
@keyframes cursor { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(.7); } }

/* рассуждения */
.reason { margin: 0 0 12px; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--bg); transition: border-color .2s; }
.reason.is-live { border-color: var(--line-2); }
.reason__head { display: flex; align-items: center; gap: 8px; width: 100%; padding: 9px 12px; font-size: 13px; color: var(--fg-2); font-weight: 500; text-align: left; }
.reason__head:hover { background: var(--bg-soft); }
.reason__head svg { flex: none; transition: transform .25s var(--ease); color: var(--fg-3); }
.reason.is-open .reason__head svg { transform: rotate(90deg); }
.reason__label { flex: 1; }
.reason.is-live .reason__label { background: linear-gradient(90deg, var(--fg-3) 0%, var(--fg) 40%, var(--fg-3) 80%); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: shimmer 1.6s linear infinite; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.reason__peek {
  position: relative; height: 4.3em; overflow: hidden; padding: 0 12px 8px; font-size: 13px; line-height: 1.5; color: var(--fg-3);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 45%, #000 100%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 45%, #000 100%);
}
.reason__peek .reason__text { position: absolute; left: 12px; right: 12px; bottom: 8px; transition: transform .35s var(--ease); }
.reason__full { display: none; padding: 0 14px 12px; font-size: 13.5px; line-height: 1.6; color: var(--fg-2); max-height: 60vh; overflow-y: auto; }
.reason.is-open .reason__full { display: block; animation: fadein .25s var(--ease); }
.reason.is-open .reason__peek { display: none; }
.reason:not(.is-live):not(.is-open) .reason__peek { display: none; }
.reason__text p, .reason__full p { margin: 0 0 .6em; }
.reason__full p:last-child { margin: 0; }

/* контент (markdown) */
.md { font-size: 15.5px; line-height: 1.65; overflow-wrap: anywhere; }
.md > :first-child { margin-top: 0; }
.md > :last-child { margin-bottom: 0; }
.md p { margin: 0 0 .9em; }
.md h1, .md h2, .md h3, .md h4 { margin: 1.3em 0 .5em; line-height: 1.3; letter-spacing: -.01em; font-weight: 600; }
.md h1 { font-size: 1.35em; } .md h2 { font-size: 1.2em; } .md h3 { font-size: 1.08em; } .md h4 { font-size: 1em; }
.md ul, .md ol { padding-left: 1.4em; margin: 0 0 .9em; }
.md li { margin: .25em 0; }
.md li > p { margin: .2em 0; }
.md blockquote { margin: 0 0 .9em; padding: .2em 0 .2em 14px; border-left: 3px solid var(--line-2); color: var(--fg-2); }
.md hr { border: 0; border-top: 1px solid var(--line); margin: 1.4em 0; }
.md code { font-family: var(--mono); font-size: .88em; background: var(--bg-soft-2); padding: .15em .4em; border-radius: 6px; }
.md a { color: var(--fg); text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
.md a:hover { text-decoration-color: var(--fg); }
.md img { border-radius: 12px; margin: .4em 0; }
.md .katex-display { margin: .8em 0; overflow-x: auto; overflow-y: hidden; padding: 4px 2px; }
.md .katex { font-size: 1.06em; }
.md .katex-display > .katex { white-space: normal; }
.tablewrap { overflow-x: auto; margin: 0 0 .9em; border: 1px solid var(--line); border-radius: 12px; }
.md table { border-collapse: collapse; width: 100%; font-size: .93em; }
.md th, .md td { padding: 8px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.md th { background: var(--bg-soft); font-weight: 600; }
.md tr:last-child td { border-bottom: 0; }

.codeblock { margin: 0 0 1em; border-radius: 14px; border: 1px solid var(--line); overflow: hidden; background: #fafafa; }
.codeblock__bar { display: flex; align-items: center; justify-content: space-between; padding: 6px 8px 6px 14px; background: var(--bg-soft); font-size: 12px; color: var(--fg-3); border-bottom: 1px solid var(--line); }
.codeblock__copy { padding: 4px 9px; border-radius: 7px; font-size: 12px; color: var(--fg-2); }
.codeblock__copy:hover { background: var(--bg); color: var(--fg); }
.codeblock pre { margin: 0; padding: 12px 14px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.codeblock pre code { display: block; background: none; padding: 0; font-size: 13px; line-height: 1.55; font-family: var(--mono); }
.hljs { background: transparent !important; }

/* --------------------------------------------- композер */
.composer-wrap { flex: none; padding: 6px 16px calc(8px + var(--sab)); background: linear-gradient(to top, var(--bg) 70%, rgba(255,255,255,0)); }
.composer {
  max-width: 760px; margin: 0 auto; border-radius: var(--radius-lg); border: 1px solid var(--line-2); background: var(--bg);
  box-shadow: 0 6px 24px -14px rgba(0,0,0,.25), 0 1px 2px rgba(0,0,0,.03);
  transition: border-color .2s, box-shadow .25s var(--ease), transform .25s var(--ease);
}
.composer:focus-within { border-color: #b9b9c0; box-shadow: 0 10px 34px -16px rgba(0,0,0,.35), 0 0 0 4px rgba(11,11,12,.04); }
.composer.is-sent { animation: sentpulse .45s var(--ease); }
@keyframes sentpulse { 0% { transform: scale(1); } 35% { transform: scale(.985); } 100% { transform: scale(1); } }
.composer__row { display: flex; align-items: flex-end; gap: 6px; padding: 8px 8px 8px 8px; }
.composer__attach { flex: none; width: 38px; height: 38px; border-radius: 12px; }
.composer__input {
  flex: 1; min-width: 0; resize: none; border: 0; outline: none; background: transparent;
  padding: 9px 4px; max-height: 200px; line-height: 1.4; font-size: 16px;
}
.composer__input::placeholder { color: var(--fg-3); }
.send {
  flex: none; width: 38px; height: 38px; border-radius: 50%; position: relative; overflow: hidden;
  background: var(--fg); color: #fff;
  transition: background .25s, transform .2s var(--spring), opacity .2s;
}
.send:disabled { background: var(--line-2); cursor: default; }
.send:not(:disabled):hover { transform: scale(1.06); }
.send:not(:disabled):active { transform: scale(.94); }
.send__icon { position: absolute; inset: 0; display: grid; place-items: center; transition: transform .3s var(--spring), opacity .2s; }
.send__icon--stop { opacity: 0; transform: scale(.4) rotate(-90deg); }
.send__icon--stop i { width: 12px; height: 12px; border-radius: 3px; background: #fff; display: block; }
.send.is-stop .send__icon--arrow { opacity: 0; transform: translateY(-14px) scale(.6); }
.send.is-stop .send__icon--stop { opacity: 1; transform: none; }
.send.is-stop { background: var(--fg); }
.send.is-stop::after { content: ''; position: absolute; inset: -3px; border-radius: 50%; border: 2px solid rgba(11,11,12,.25); animation: ring 1.4s ease-out infinite; }
@keyframes ring { from { transform: scale(.9); opacity: 1; } to { transform: scale(1.35); opacity: 0; } }
.composer__hint { margin: 8px 0 0; text-align: center; font-size: 11.5px; color: var(--fg-3); }

.attachments { display: flex; gap: 8px; padding: 10px 12px 0; flex-wrap: wrap; }
.attachment { position: relative; width: 64px; height: 64px; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); animation: pop .25s var(--spring) both; }
.attachment img { width: 100%; height: 100%; object-fit: cover; }
.attachment button { position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border-radius: 50%; background: rgba(0,0,0,.6); color: #fff; display: grid; place-items: center; font-size: 12px; }

.tobottom {
  position: absolute; left: 50%; bottom: 110px; transform: translateX(-50%); z-index: 5;
  width: 38px; height: 38px; border-radius: 50%; background: var(--bg); border: 1px solid var(--line-2); color: var(--fg-2);
  display: grid; place-items: center; box-shadow: 0 6px 18px -8px rgba(0,0,0,.3); animation: pop .2s var(--spring) both;
}

/* --------------------------------------------- модалка, тосты */
.modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 20px; background: rgba(11,11,12,.28); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: fadein .2s; }
.modal__box { width: 100%; max-width: 380px; background: var(--bg); border-radius: 22px; padding: 22px; box-shadow: 0 30px 80px -20px rgba(0,0,0,.4); animation: pop .25s var(--spring) both; }
.modal__title { margin: 0 0 6px; font-size: 18px; font-weight: 600; letter-spacing: -.01em; }
.modal__text { margin: 0 0 16px; color: var(--fg-2); font-size: 14.5px; }
.modal__input { width: 100%; height: 46px; padding: 0 14px; border-radius: 12px; border: 1.5px solid var(--line-2); outline: none; margin-bottom: 16px; }
.modal__input:focus { border-color: var(--fg); }
.modal__actions { display: flex; gap: 8px; justify-content: flex-end; }
.modal__actions .btn { height: 42px; padding: 0 16px; }
.btn--danger { background: var(--red); color: #fff; }

.toasts { position: fixed; left: 0; right: 0; bottom: calc(24px + var(--sab)); z-index: 70; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast { padding: 10px 16px; border-radius: 999px; background: var(--fg); color: #fff; font-size: 13.5px; box-shadow: 0 10px 30px -10px rgba(0,0,0,.5); animation: toastin .35s var(--spring) both; }
.toast.is-out { animation: toastout .25s var(--ease) both; }
@keyframes toastin { from { opacity: 0; transform: translateY(14px) scale(.95); } to { opacity: 1; transform: none; } }
@keyframes toastout { to { opacity: 0; transform: translateY(8px); } }

.lightbox { position: fixed; inset: 0; z-index: 80; background: rgba(0,0,0,.9); display: grid; place-items: center; padding: 16px; animation: fadein .2s; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 12px; object-fit: contain; }

/* --------------------------------------------- мобильная раскладка */
.scrim { position: fixed; inset: 0; z-index: 40; background: rgba(11,11,12,.35); opacity: 0; pointer-events: none; transition: opacity .3s; backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); }

@media (max-width: 860px) {
  .sidebar {
    position: fixed; z-index: 50; left: 0; top: 0; bottom: 0; width: min(86vw, 320px);
    transform: translateX(-104%); transition: transform .38s var(--ease); box-shadow: 0 0 60px rgba(0,0,0,.15);
  }
  .app.is-menu .sidebar { transform: none; }
  .app.is-menu .scrim { opacity: 1; pointer-events: auto; }
  #closeSidebar { display: inline-flex; }
  .topbar__menu { display: inline-flex; }
  .topbar__new { display: inline-flex; }
  .topbar__center { text-align: center; }
  .topbar__model { justify-content: center; }
  .thread__inner { padding: 8px 14px 20px; }
  .msg--user .bubble { max-width: 88%; }
  .msg--assistant .msg__actions { opacity: 1; }
  .composer-wrap { padding: 4px 10px calc(8px + var(--sab)); }
  .composer__hint { display: none; }
  .empty__title { font-size: 28px; }
  .chip { font-size: 13px; }
  .md { font-size: 15.5px; }
  .tobottom { bottom: 90px; }
}

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

/* --------------------------------------------- дополнения v1.1 */
.balance { width: 100%; text-align: left; cursor: pointer; transition: box-shadow .2s, transform .15s var(--ease); }
.balance:hover { box-shadow: 0 6px 18px -10px rgba(0,0,0,.25); }
.balance:active { transform: scale(.985); }
.balance__text { flex: 1; }
.balance__more { color: var(--fg-3); display: grid; place-items: center; flex: none; }

.pop {
  position: fixed; z-index: 65; min-width: 190px;
  background: var(--bg); border: 1px solid var(--line); border-radius: 14px; padding: 6px;
  box-shadow: 0 16px 40px -12px rgba(0,0,0,.25);
  animation: pop .18s var(--spring) both; transform-origin: top left;
}
.pop button { display: block; width: 100%; text-align: left; padding: 9px 12px; border-radius: 9px; font-size: 14px; }
.pop button:hover { background: var(--bg-soft); }
.pop button.danger { color: var(--red); }

.chatitem { cursor: pointer; user-select: none; -webkit-user-select: none; }
.chatitem:focus-visible { outline: 2px solid var(--fg); outline-offset: 2px; }
.chatitem__more { cursor: pointer; }

.msg__actions--user { justify-content: flex-end; opacity: 0; }
.msg--user:hover .msg__actions--user { opacity: 1; }

.modal__html { margin: 0 0 16px; }
.bal-detail__bar { height: 8px; border-radius: 4px; background: var(--bg-soft-2); overflow: hidden; margin: 4px 0 14px; }
.bal-detail__bar i { display: block; height: 100%; background: var(--fg); border-radius: 4px; transition: width .8s var(--ease); }
.bal-detail__rows { display: grid; gap: 6px; }
.bal-detail__rows > div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.bal-detail__rows > div:last-child { border-bottom: 0; }
.bal-detail__rows span { color: var(--fg-2); }
.bal-detail__rows b { font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -.01em; white-space: nowrap; }
.bal-detail__sub { margin: 14px 0 4px; font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--fg-3); }
.bal-detail__note { margin: 14px 0 0; font-size: 12.5px; color: var(--fg-3); line-height: 1.5; }
.bal-detail__empty { color: var(--fg-3); margin: 0; }

/* печать ответа: мягкое появление и живой курсор */
.md--in { animation: fadein .35s var(--ease) both; }
.msg.is-streaming .md > *:last-child { animation: lineIn .28s var(--ease) both; }
@keyframes lineIn { from { opacity: .35; transform: translateY(3px); } to { opacity: 1; transform: none; } }
.cursor { width: 9px; height: 9px; margin-left: 4px; background: var(--fg); animation: cursorPulse 1.1s ease-in-out infinite; }
@keyframes cursorPulse { 0%,100% { opacity: 1; transform: scale(1); box-shadow: 0 0 0 0 rgba(11,11,12,.25); } 50% { opacity: .55; transform: scale(.75); box-shadow: 0 0 0 5px rgba(11,11,12,0); } }
.reason__peek .reason__text p { animation: fadein .3s var(--ease) both; }

@media (max-width: 860px) {
  .msg__actions--user { opacity: .85; }
  .pop { min-width: 210px; }
}

/* --------------------------------------------- дополнения v1.2 */
.chip__math { display: inline-block; }
.chip__math .katex { font-size: 1em; }
.chip { display: inline-flex; align-items: center; gap: 5px; }

.msg__actions button.is-copied, .codeblock__copy.is-copied { color: var(--green); }
.msg__actions button .tick, .codeblock__copy .tick { animation: tickIn .3s var(--spring) both; }
@keyframes tickIn { from { opacity: 0; transform: scale(.4); } to { opacity: 1; transform: none; } }
.codeblock__copy { display: inline-flex; align-items: center; gap: 5px; }

/* --------------------------------------------- дополнения v1.3 */
/* кнопка диктовки — слева от отправки */
.mic {
  flex: none; width: 38px; height: 38px; border-radius: 50%; position: relative;
  display: grid; place-items: center; color: var(--fg-2);
  transition: background .18s, color .18s, transform .18s var(--spring);
}
.mic:hover { background: var(--bg-soft); color: var(--fg); }
.mic:active { transform: scale(.92); }
.mic.is-live { background: var(--red); color: #fff; }
.mic.is-live::after {
  content: ''; position: absolute; inset: -3px; border-radius: 50%;
  border: 2px solid rgba(217,75,75,.45); animation: ring 1.5s ease-out infinite;
}
.composer.is-listening { border-color: rgba(217,75,75,.55); box-shadow: 0 0 0 4px rgba(217,75,75,.08); }

/* чат, в котором прямо сейчас пишется ответ */
.chatitem__live { display: none; flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--green); margin-right: 8px; }
.chatitem.is-generating .chatitem__live { display: block; animation: livePulse 1.3s ease-in-out infinite; }
@keyframes livePulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(47,143,91,.45); }
  70% { opacity: .65; box-shadow: 0 0 0 5px rgba(47,143,91,0); }
}

/* --------------------------------------------- дополнения v1.4 */
.composer__attach.is-busy { pointer-events: none; opacity: .5; }
.composer__attach.is-busy svg { animation: spin .8s linear infinite; }
.composer.is-drop { border-color: var(--fg); box-shadow: 0 0 0 4px rgba(11,11,12,.07); }
.attachment { background: var(--bg-soft-2); }
.attachment img { background: #fff; }

/* --------------------------------------------- дополнения v1.5 */
/* Картинку показываем целиком, а не квадратным огрызком */
.msg__images img {
  width: auto; height: auto;
  max-width: min(240px, 70vw); max-height: 300px;
  object-fit: contain; background: var(--bg-soft);
}
.attachment img { object-fit: contain; background: var(--bg); }

/* ============================================================
   v1.6 — читаемость ответов
   Длинные строки, центрованные формулы и ровная серая лента
   тяжело читаются. Здесь короче строка, крупнее шрифт,
   формулы прижаты влево и видны опорные точки решения.
   ============================================================ */

/* строка короче: около 80 знаков вместо 95 */
.thread__inner { max-width: 700px; }
.composer { max-width: 700px; }

.md {
  font-size: 16px;
  line-height: 1.72;
  letter-spacing: -.003em;
}
.md p { margin: 0 0 1.05em; }
.md p + p { margin-top: -.05em; }

/* формулы: слева, с отступом — взгляд не прыгает от строки к строке,
   а широкие выражения видно с начала, а не с середины */
.md .katex-display {
  text-align: left;
  margin: 1.1em 0 1.2em;
  padding: 2px 4px 10px 20px;
  overflow-x: auto;
  overflow-y: hidden;
}
.md .katex-display > .katex { text-align: left; }
.md .katex-display::-webkit-scrollbar { height: 6px; }
.md .katex-display::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 3px; }
.md .katex { font-size: 1.05em; }
/* формула внутри строки не должна распирать межстрочный интервал */
.md p .katex { line-height: 1.2; }

/* опорные точки решения */
.md .md-label { margin-bottom: .9em; }
.md .md-label__word { font-weight: 600; letter-spacing: -.01em; }
.md .md-label--answer {
  margin: 1.3em 0 .4em;
  padding: 12px 16px 12px 15px;
  border-left: 3px solid var(--fg);
  border-radius: 0 12px 12px 0;
  background: var(--bg-soft);
  font-size: 1.02em;
}
.md .md-label--answer .katex-display { margin: .5em 0 .1em; padding-left: 0; border: 0; }

.md ul, .md ol { margin: 0 0 1.05em; padding-left: 1.5em; }
.md li { margin: .35em 0; }
.md li::marker { color: var(--fg-3); }

.md blockquote { margin: 0 0 1.05em; padding: .3em 0 .3em 16px; }
.md hr { margin: 1.6em 0; }
.codeblock { margin: 0 0 1.15em; }
.codeblock pre code { font-size: 13.5px; line-height: 1.6; }
.tablewrap { margin: 0 0 1.15em; }
.md th, .md td { padding: 9px 14px; }

/* сообщение пользователя в том же ритме */
.msg--user .bubble { font-size: 15.5px; line-height: 1.6; padding: 12px 17px; }
.msg { margin-bottom: 26px; }
.msg--assistant .msg__body > .reason { margin-bottom: 16px; }

@media (max-width: 860px) {
  .md { font-size: 16px; line-height: 1.7; }
  .md .katex-display { padding-left: 12px; }
  .md .md-label--answer { padding: 11px 14px; }
}

/* --------------------------------------------- v1.7 — точный счётчик токенов */
.balance__main {
  font-weight: 600; font-size: 15px; letter-spacing: -.02em;
  font-variant-numeric: tabular-nums; font-feature-settings: 'tnum';
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.balance__sub { font-size: 11.5px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.balance__pct { font-variant-numeric: tabular-nums; }
.balance.is-updating .balance__main { opacity: .55; transition: opacity .2s; }
.balance.is-stale .balance__sub { color: var(--red); }
.balance.is-stale .balance__bar { stroke: var(--line-2); }

/* ============================================================
   v1.8 — формулы на телефоне
   Длинная выносная формула переносится по знакам = + −, а не
   уезжает за край. Размер чуть больше, ничего не обрезается.
   ============================================================ */
.md .katex-display > .katex { white-space: normal; }
.md .katex-display .katex-html { white-space: normal; }
.md .katex-display .katex-html > .base { margin: .3em 0; }
.md .katex-display {
  padding: 8px 6px 12px 16px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
@media (max-width: 860px) {
  .md .katex { font-size: 1.1em; }
  .md .katex-display .katex { font-size: 1.15em; }
  .md .katex-display { padding: 8px 4px 10px 8px; margin: 1em 0 1.1em; }
  .md .md-label--answer .katex-display { padding-left: 0; }
}

/* --------------------------------------------- правка своего сообщения (стекло) */
.msg.is-editing { align-items: stretch; }
.edit {
  display: flex; flex-direction: column; gap: 10px; padding: 10px;
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(255,255,255,.72), rgba(255,255,255,.42));
  border: 1px solid rgba(255,255,255,.75);
  box-shadow: 0 1px 0 rgba(255,255,255,.9) inset, 0 18px 50px -22px rgba(0,0,0,.35), 0 0 0 1px rgba(11,11,12,.05);
  backdrop-filter: blur(22px) saturate(1.5); -webkit-backdrop-filter: blur(22px) saturate(1.5);
  animation: editIn .38s var(--spring) both;
  transform-origin: right top;
  position: relative; isolation: isolate;
}
/* мягкие цветные пятна позади стекла — без них на белом фоне размытие не видно */
.edit::before {
  content: ''; position: absolute; inset: -30px; z-index: -1; border-radius: 40px; pointer-events: none;
  background:
    radial-gradient(220px 140px at 12% 20%, rgba(255,196,150,.55), transparent 70%),
    radial-gradient(260px 160px at 88% 30%, rgba(160,190,255,.55), transparent 70%),
    radial-gradient(240px 160px at 55% 110%, rgba(190,230,190,.5), transparent 70%);
  filter: blur(18px);
  animation: blobs 6s ease-in-out infinite alternate;
}
@keyframes blobs { to { transform: translate(6px, -6px) scale(1.04); } }
@keyframes editIn { from { opacity: 0; transform: scale(.94) translateY(6px); } to { opacity: 1; transform: none; } }
.edit__input {
  width: 100%; resize: none; padding: 12px 16px; border-radius: 15px;
  border: 1px solid rgba(11,11,12,.08); background: rgba(255,255,255,.55); color: var(--fg);
  font: inherit; font-size: 15.5px; line-height: 1.55; outline: none;
  transition: background .2s, border-color .2s, box-shadow .2s;
}
.edit__input:focus { background: rgba(255,255,255,.85); border-color: rgba(11,11,12,.18); box-shadow: 0 0 0 4px rgba(11,11,12,.05); }
.edit__row { display: flex; justify-content: flex-end; gap: 8px; }
.edit__row .btn { height: 36px; padding: 0 14px; border-radius: 12px; font-size: 14px; }
.edit__row .btn:not(.btn--primary) { background: rgba(255,255,255,.55); border: 1px solid rgba(11,11,12,.08); }
.edit__row .btn:not(.btn--primary):hover { background: rgba(255,255,255,.9); }
.edit__row .btn--primary { box-shadow: 0 8px 20px -10px rgba(0,0,0,.6); }
.msg.is-editing .msg__actions { display: none; }
.msg__actions--user .msg__meta { margin: 0 6px 0 0; align-self: center; }

/* отправка правки: старое растворяется, новое расцветает */
.msg.is-vanish { animation: vanish .4s var(--ease) both; pointer-events: none; }
@keyframes vanish { to { opacity: 0; transform: translateY(10px) scale(.98); filter: blur(6px); } }
.msg.is-sending .edit { animation: editOut .42s var(--ease) both; }
@keyframes editOut { to { opacity: 0; transform: scale(.96); filter: blur(4px); } }
.msg.is-reborn { animation: reborn .6s var(--spring) both; }
@keyframes reborn { from { opacity: 0; transform: scale(.92); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }
.msg.is-reborn .bubble { animation: glow 1.2s var(--ease) both; }
@keyframes glow { 0% { box-shadow: 0 0 0 0 rgba(11,11,12,.18); } 100% { box-shadow: 0 0 0 14px rgba(11,11,12,0); } }

/* --------------------------------------------- документы во вложениях и сообщениях */
.filecard {
  display: inline-flex; align-items: center; gap: 10px; max-width: 280px; padding: 8px 12px 8px 8px;
  border-radius: 14px; background: var(--bg); border: 1px solid var(--line); color: var(--fg); text-decoration: none;
  position: relative; min-width: 0;
}
a.filecard:hover { border-color: var(--line-2); background: var(--bg-soft); }
.filecard__icon { position: relative; width: 38px; height: 38px; flex: none; border-radius: 10px; display: grid; place-items: center; background: var(--bg-soft-2); color: var(--fg-2); }
.filecard__icon b { position: absolute; left: 50%; bottom: -5px; transform: translateX(-50%); font-size: 8.5px; font-weight: 700; letter-spacing: .04em; padding: 1px 5px; border-radius: 5px; background: var(--fg); color: #fff; line-height: 1.3; }
.filecard--pdf .filecard__icon b { background: #d94b4b; }
.filecard--docx .filecard__icon b { background: #2b6cd9; }
.filecard--code .filecard__icon b { background: #7a4bd9; }
.filecard--data .filecard__icon b { background: #2f8f5b; }
.filecard__text { display: flex; flex-direction: column; min-width: 0; gap: 2px; }
.filecard__name { font-size: 13.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.filecard__meta { font-size: 11.5px; color: var(--fg-3); white-space: nowrap; }
.attachment--doc { animation: pop .25s var(--spring) both; padding-right: 34px; }
.attachment--doc button { position: absolute; top: 50%; right: 8px; transform: translateY(-50%); width: 22px; height: 22px; border-radius: 50%; background: var(--bg-soft-2); color: var(--fg-2); display: grid; place-items: center; font-size: 12px; }
.attachment--doc button:hover { background: var(--fg); color: #fff; }
.msg__files { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; margin-bottom: 6px; max-width: 82%; }

/* --------------------------------------------- аккаунт: докупить */
.account__btns { display: flex; align-items: center; gap: 4px; }
.account__buy {
  display: inline-flex; align-items: center; gap: 5px; padding: 6px 11px; border-radius: 9px;
  background: var(--fg); color: #fff; font-weight: 600; font-size: 12.5px;
  box-shadow: 0 6px 14px -8px rgba(0,0,0,.6); transition: transform .15s var(--ease), box-shadow .2s;
}
.account__buy:hover { transform: translateY(-1px); box-shadow: 0 10px 18px -8px rgba(0,0,0,.6); }
.account__buy:active { transform: scale(.97); }

/* --------------------------------------------- модалка-стекло: токены, тарифы */
.modal--glass { background: rgba(11,11,12,.22); backdrop-filter: blur(14px) saturate(1.3); -webkit-backdrop-filter: blur(14px) saturate(1.3); }
.modal--glass .modal__box {
  max-width: 420px; padding: 24px;
  background: linear-gradient(150deg, rgba(255,255,255,.88), rgba(255,255,255,.66));
  border: 1px solid rgba(255,255,255,.8);
  box-shadow: 0 1px 0 rgba(255,255,255,.9) inset, 0 40px 90px -30px rgba(0,0,0,.45), 0 0 0 1px rgba(11,11,12,.05);
  backdrop-filter: blur(30px) saturate(1.6); -webkit-backdrop-filter: blur(30px) saturate(1.6);
}
.modal--glass .modal__actions .btn:not(.btn--primary):not(.btn--danger) { background: rgba(255,255,255,.6); border: 1px solid rgba(11,11,12,.08); }

.bal-hero { display: flex; align-items: center; gap: 18px; margin: 2px 0 6px; }
.bal-ring { position: relative; width: 120px; height: 120px; flex: none; }
.bal-ring svg { transform: rotate(-90deg); display: block; }
.bal-ring__track { fill: none; stroke: rgba(11,11,12,.08); stroke-width: 10; }
.bal-ring__bar { fill: none; stroke: var(--fg); stroke-width: 10; stroke-linecap: round; transition: stroke-dashoffset 1s var(--ease); animation: ringIn 1.1s var(--ease) both; }
@keyframes ringIn { from { stroke-dashoffset: 326.7; } }
.bal-hero.is-low .bal-ring__bar { stroke: var(--red); }
.bal-ring__center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; }
.bal-ring__center b { font-size: 26px; font-weight: 600; letter-spacing: -.03em; font-variant-numeric: tabular-nums; line-height: 1; }
.bal-ring__center b i { font-style: normal; font-size: 14px; font-weight: 500; color: var(--fg-3); margin-left: 1px; }
.bal-ring__center span { font-size: 11px; color: var(--fg-3); }
.bal-hero__text { min-width: 0; }
.bal-hero__num { font-family: var(--serif); font-size: 34px; letter-spacing: -.02em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.bal-hero__sub { color: var(--fg-2); font-size: 14px; margin-top: 4px; }
.bal-hero__note { color: var(--fg-3); font-size: 12px; margin-top: 8px; }
.bal-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.bal-card {
  display: flex; flex-direction: column; gap: 3px; padding: 12px 12px 10px; border-radius: 16px; min-width: 0;
  background: rgba(255,255,255,.55); border: 1px solid rgba(11,11,12,.07);
  box-shadow: 0 1px 0 rgba(255,255,255,.8) inset;
}
.bal-card span { font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--fg-3); }
.bal-card b { font-size: 18px; font-weight: 600; letter-spacing: -.02em; white-space: nowrap; }
.bal-card small { font-size: 11px; color: var(--fg-3); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 400px) {
  .bal-hero { flex-direction: column; text-align: center; }
  .bal-cards { grid-template-columns: 1fr 1fr; }
}

.buy__lead { margin: 0 0 14px; color: var(--fg-2); font-size: 14.5px; }
.buy__plans { display: grid; gap: 8px; }
.buy__plan {
  display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto; column-gap: 12px; align-items: center;
  padding: 12px 14px; border-radius: 16px; background: rgba(255,255,255,.55); border: 1px solid rgba(11,11,12,.07);
  box-shadow: 0 1px 0 rgba(255,255,255,.8) inset; opacity: .85;
}
.buy__plan.is-hot { border-color: rgba(11,11,12,.35); opacity: 1; }
.buy__plan b { font-size: 15px; font-weight: 600; }
.buy__plan span { grid-column: 1; font-size: 12.5px; color: var(--fg-3); }
.buy__plan em { grid-column: 2; grid-row: 1 / span 2; font-style: normal; font-size: 11.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; padding: 5px 9px; border-radius: 8px; background: var(--bg-soft-2); color: var(--fg-2); }
.buy__note { margin: 14px 0 0; font-size: 12.5px; color: var(--fg-3); line-height: 1.5; }
