/* Claudes Mini App — тёмная тема в фирменных цветах Claude.
   Важно: никаких анимированных filter/backdrop-filter — на мобильных
   они вызывают перерисовку всего слоя и картинка "дрожит". */

:root {
  --copper: #D97757;
  --copper-lo: #BE5F3F;
  --copper-hi: #EFA184;
  --cream: #FBF3E4;

  --bg: #0F0E0D;
  --surface: #1A1817;
  --surface-2: #232020;
  --line: rgba(251, 243, 228, .09);
  --text: #F3EEE7;
  --muted: #9C918A;

  --ease: cubic-bezier(.22, 1, .36, 1);
  /* Переливающийся градиент для акцентов. */
  --iri: linear-gradient(120deg, #E8845F, #F0BE5A 28%, #D97757 46%, #C86B8A 64%, #8FA6A0 82%, #E8845F);
  --top: max(env(safe-area-inset-top, 0px), var(--tg-safe-area-inset-top, 0px));
  --bottom: max(env(safe-area-inset-bottom, 0px), var(--tg-safe-area-inset-bottom, 0px));
  --result-panel: clamp(380px, 42vw, 620px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

@keyframes iriShift { from { background-position: 0% 50%; } to { background-position: 300% 50%; } }
@keyframes spinSlow { to { transform: rotate(360deg); } }

html, body {
  height: 100%;
  margin: 0;
  overscroll-behavior: none;
}

body {
  /* Базовый слой не меняется при скролле; движение вынесено в ambient. */
  background:
    radial-gradient(120% 70% at 50% -10%, rgba(217, 119, 87, .20) 0%, transparent 60%),
    radial-gradient(90% 50% at 100% 100%, rgba(190, 95, 63, .12) 0%, transparent 65%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ─── Живой фон ─── */
.ambient {
  position: fixed; inset: 0; z-index: 0;
  overflow: hidden; pointer-events: none;
}
.ambient-grid {
  position: absolute; inset: 0; opacity: .2;
  background-image:
    linear-gradient(rgba(239, 161, 132, .08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(239, 161, 132, .08) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: radial-gradient(ellipse 72% 60% at 50% 48%, black, transparent 82%);
}
.ambient-glow {
  position: absolute; width: 78vmax; height: 78vmax;
  border-radius: 50%; opacity: .34;
  will-change: transform;
}
.glow-one {
  top: -42vmax; left: -28vmax;
  background: radial-gradient(circle, rgba(239, 161, 132, .48), rgba(217, 119, 87, .13) 36%, transparent 68%);
  animation: ambientDriftOne 22s ease-in-out infinite alternate;
}
.glow-two {
  right: -37vmax; bottom: -45vmax;
  background: radial-gradient(circle, rgba(240, 190, 90, .28), rgba(200, 107, 138, .14) 38%, transparent 68%);
  animation: ambientDriftTwo 27s ease-in-out infinite alternate;
}
@keyframes ambientDriftOne { to { transform: translate(13vmax, 9vmax) scale(1.13); } }
@keyframes ambientDriftTwo { to { transform: translate(-14vmax, -10vmax) scale(1.16); } }
.star {
  position: absolute; width: 3px; height: 3px; border-radius: 50%;
  background: #FBE8BC; box-shadow: 0 0 9px rgba(240, 190, 90, .7);
  opacity: .24; animation: starTwinkle 4.8s ease-in-out infinite;
}
.star::after {
  content: ""; position: absolute; top: 50%; left: 50%; width: 1px; height: 9px;
  background: linear-gradient(transparent, rgba(251, 243, 228, .85), transparent);
  transform: translate(-50%, -50%) rotate(45deg);
}
@keyframes starTwinkle {
  0%, 100% { opacity: .18; transform: scale(.65); }
  50% { opacity: .92; transform: scale(1.35); }
}
.star-1 { top: 13%; left: 9%; animation-delay: -.8s; }
.star-2 { top: 22%; left: 79%; animation-delay: -3.1s; }
.star-3 { top: 37%; left: 17%; animation-delay: -4.4s; }
.star-4 { top: 49%; left: 89%; animation-delay: -1.9s; }
.star-5 { top: 64%; left: 7%; animation-delay: -2.8s; }
.star-6 { top: 76%; left: 73%; animation-delay: -.4s; }
.star-7 { top: 85%; left: 31%; animation-delay: -3.7s; }
.star-8 { top: 31%; left: 61%; animation-delay: -1.2s; }
.star-9 { top: 57%; left: 42%; animation-delay: -4s; }
.star-10 { top: 17%; left: 44%; animation-delay: -2.2s; }
.star-11 { top: 72%; left: 56%; animation-delay: -5.1s; }
.star-12 { top: 42%; left: 95%; animation-delay: -3.4s; }

/* ─── Splash ─── */
.splash {
  position: fixed; inset: 0; z-index: 90;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 20px;
  background: var(--bg);
  transition: opacity .45s var(--ease), visibility .45s;
}
.splash.hide { opacity: 0; visibility: hidden; }
.splash-glyph {
  width: 82px; height: 82px; color: var(--copper);
  animation: spinIn .9s var(--ease) both;
}
.splash-glyph svg { width: 100%; height: 100%; display: block; }
.splash-title {
  font-size: 25px; font-weight: 660; letter-spacing: .3px;
  animation: rise .6s var(--ease) .16s both;
}
.splash-bar {
  width: 120px; height: 3px; border-radius: 3px;
  background: rgba(251, 243, 228, .12); overflow: hidden;
  animation: rise .6s var(--ease) .24s both;
}
.splash-bar i {
  display: block; height: 100%; width: 38%; border-radius: 3px;
  background: var(--copper);
  animation: slide 1.1s var(--ease) infinite;
}

@keyframes spinIn { from { transform: rotate(-120deg) scale(.5); opacity: 0; } }
@keyframes slide  { from { transform: translateX(-110%); } to { transform: translateX(300%); } }
@keyframes rise   { from { opacity: 0; transform: translateY(10px); } }

/* ─── Шапка ─── */
.topbar {
  position: relative; z-index: 5;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  padding: calc(var(--top) + 11px) 15px 11px;
  background: linear-gradient(90deg, rgba(15, 14, 13, .94), rgba(29, 20, 18, .82), rgba(15, 14, 13, .94));
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 11px; min-width: 0; }
.brand-mark {
  width: 36px; height: 36px; flex: none;
  display: grid; place-items: center;
  border-radius: 11px;
  background: linear-gradient(145deg, #F19A76, #C85B3D);
  box-shadow: 0 8px 24px rgba(217, 119, 87, .24);
  color: var(--cream);
}
.brand-mark svg { width: 23px; height: 23px; display: block; }
.brand-text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.brand-text b { font-size: 15.5px; font-weight: 650; }
.brand-text small { font-size: 12px; color: var(--muted); }

.pro-badge {
  padding: 4px 9px;
  border-radius: 7px;
  background: linear-gradient(135deg, #F0BE5A, #D9924A);
  color: #2A1B06;
  font-size: 10.5px; font-weight: 800; letter-spacing: .7px;
}
.credit-badge {
  margin-left: 4px;
  padding: 4px 8px;
  border: 1px solid rgba(255, 255, 255, .11);
  border-radius: 7px;
  color: #D5D0CA;
  background: rgba(255, 255, 255, .045);
  font-size: 10.5px; font-weight: 650;
  letter-spacing: .2px;
  white-space: nowrap;
}
.canvas-toggle {
  display: inline-flex; align-items: center; gap: 7px;
  min-height: 34px; padding: 6px 10px;
  border: 1px solid rgba(211, 163, 124, .14); border-radius: 10px;
  background: rgba(255, 255, 255, .035); color: #C9C3BD;
  font: inherit; font-size: 12.5px; cursor: pointer;
}
.canvas-toggle svg { width: 17px; height: 17px; }
.canvas-toggle.on { border-color: rgba(217, 119, 87, .48); color: #F0B093; background: rgba(217, 119, 87, .1); }
.canvas-toggle i {
  min-width: 17px; height: 17px; padding: 0 4px;
  display: grid; place-items: center;
  border-radius: 9px; background: #D97757; color: #fff;
  font: normal 9px/1 inherit;
}
.canvas-toggle i[hidden] { display: none; }
.top-actions { display: flex; align-items: center; gap: 7px; }

/* ─── История чатов ─── */
.chat-drawer-scrim {
  position: fixed; z-index: 68; inset: 0;
  background: rgba(0, 0, 0, .68);
  opacity: 0; visibility: hidden;
  transition: opacity .25s var(--ease), visibility .25s;
}
.chat-drawer-scrim.on { opacity: 1; visibility: visible; }
.chat-drawer {
  position: fixed; z-index: 69;
  top: 0; bottom: 0; left: 0;
  width: min(88vw, 380px);
  display: flex; flex-direction: column;
  padding: calc(var(--top) + 22px) 14px calc(var(--bottom) + 18px);
  border-right: 1px solid rgba(211, 163, 124, .13);
  background: linear-gradient(165deg, #1B1917 0%, #141311 72%);
  box-shadow: 22px 0 70px rgba(0, 0, 0, .46);
  transform: translateX(-104%);
  transition: transform .34s var(--ease);
}
.chat-drawer.on { transform: translateX(0); }
.chat-drawer-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 14px; padding: 0 3px 16px;
}
.chat-drawer-head span {
  display: block; margin-bottom: 3px;
  color: #A67860; font-size: 9px; font-weight: 760; letter-spacing: 1.7px;
}
.chat-drawer-head h2 {
  margin: 0; color: #F1ECE6;
  font: 400 28px/1.1 Georgia, "Times New Roman", serif;
  letter-spacing: -.6px;
}
.chat-drawer-close {
  width: 34px; height: 34px; flex: none;
  display: grid; place-items: center;
  border: 1px solid rgba(255,255,255,.08); border-radius: 10px;
  background: #24211E; color: #BEB6AF; cursor: pointer;
}
.chat-drawer-close svg { width: 18px; height: 18px; }
.chat-drawer-close:hover { color: #F0E9E3; background: #2C2926; }
.sidebar-reopen { display: none; }
.new-chat-button {
  display: flex; align-items: center; gap: 10px;
  width: 100%; min-height: 47px; padding: 9px 12px; margin-bottom: 13px;
  border: 1px solid rgba(217, 119, 87, .27); border-radius: 13px;
  background: rgba(217, 119, 87, .095); color: #F0DCD1;
  font: inherit; text-align: left; cursor: pointer;
}
.new-chat-button span {
  width: 27px; height: 27px; display: grid; place-items: center;
  border-radius: 8px; background: #D97757; color: white; font-size: 17px;
}
.new-chat-button b { font-size: 13.5px; font-weight: 590; }
.new-chat-button:active { transform: scale(.985); }
.chat-list {
  min-height: 0; flex: 1; overflow-y: auto;
  display: flex; flex-direction: column; gap: 6px;
  padding-right: 2px;
}
.chat-list::-webkit-scrollbar { width: 4px; }
.chat-list::-webkit-scrollbar-thumb { border-radius: 4px; background: rgba(255,255,255,.1); }
.chat-item {
  display: grid; grid-template-columns: minmax(0, 1fr) auto;
  align-items: center; gap: 4px;
  padding: 5px; border: 1px solid transparent; border-radius: 12px;
  background: transparent;
}
.chat-item:hover { background: rgba(255,255,255,.025); }
.chat-item.active {
  border-color: rgba(211, 163, 124, .15);
  background: #24211E;
}
.chat-main {
  min-width: 0; padding: 7px 8px;
  border: 0; background: none; color: #EAE4DE;
  font: inherit; text-align: left; cursor: pointer;
}
.chat-main b, .chat-main small {
  display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.chat-main b { font-size: 13.5px; font-weight: 570; }
.chat-main small { margin-top: 2px; color: #817B75; font-size: 11px; }
.chat-actions { display: flex; gap: 1px; opacity: .62; }
.chat-item:hover .chat-actions, .chat-item.active .chat-actions { opacity: 1; }
.chat-actions button, .chat-rename-actions button {
  width: 29px; height: 29px; display: grid; place-items: center;
  border: 0; border-radius: 8px;
  background: transparent; color: #958D87; cursor: pointer;
}
.chat-actions button:hover, .chat-rename-actions button:hover { background: #332E2A; color: #E5DCD4; }
.chat-actions svg { width: 15px; height: 15px; }
.chat-actions .delete-chat:hover { color: #E79A8C; }
.chat-rename {
  grid-column: 1 / -1;
  display: grid; grid-template-columns: minmax(0, 1fr) auto;
  align-items: center; gap: 6px; padding: 4px;
}
.chat-rename input {
  width: 100%; min-width: 0; padding: 9px 10px;
  border: 1px solid rgba(217, 119, 87, .35); border-radius: 9px;
  outline: none; background: #161412; color: #EEE7E0;
  font: inherit; font-size: 13px;
}
.chat-rename-actions { display: flex; }
.chat-list-empty {
  margin: auto 0; padding: 24px 15px;
  color: #817A73; font-size: 12.5px; text-align: center;
}

.icon-btn {
  width: 38px; height: 38px; flex: none;
  display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface); color: var(--text);
  cursor: pointer;
  transition: transform .18s var(--ease), background .18s, color .18s;
}
.icon-btn svg { width: 20px; height: 20px; display: block; }
.icon-btn:active { transform: scale(.92); background: var(--surface-2); }
.icon-btn.slim { width: 36px; height: 36px; border-radius: 50%; }
.icon-btn.on { color: var(--copper); border-color: var(--copper); }

/* ─── Чат ─── */
.chat {
  position: relative; z-index: 2;
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 24px 15px 12px;
  display: flex; flex-direction: column; gap: 10px;
}
.chat::-webkit-scrollbar { width: 0; }

.hero {
  position: relative;
  width: min(100%, 530px);
  margin: auto; text-align: center; padding: 54px 4px;
}
.hero.gone { animation: heroOut .3s var(--ease) forwards; }
@keyframes heroOut { to { opacity: 0; transform: translateY(-10px); } }

.hero::before {
  content: ""; position: absolute; z-index: 0;
  width: 540px; height: 540px; top: 50%; left: 50%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(217, 119, 87, .26), rgba(240, 190, 90, .12) 34%, transparent 70%);
  transform: translate(-50%, -54%);
  animation: heroAura 7s ease-in-out infinite alternate;
}
@keyframes heroAura { to { transform: translate(-50%, -54%) scale(1.18); opacity: .72; } }
.hero-stars { position: absolute; z-index: 0; inset: 0; pointer-events: none; }
.hero-orbit {
  position: absolute; z-index: 0; top: 50%; left: 50%;
  border: 1px solid rgba(240, 190, 90, .16); border-radius: 50%;
  pointer-events: none;
}
.orbit-one { width: 360px; height: 150px; transform: translate(-50%, -50%) rotate(-15deg); animation: orbitFloatOne 10s ease-in-out infinite alternate; }
.orbit-two { width: 280px; height: 220px; border-color: rgba(239, 161, 132, .14); transform: translate(-50%, -50%) rotate(47deg); animation: orbitFloatTwo 13s ease-in-out infinite alternate; }
@keyframes orbitFloatOne { to { transform: translate(-50%, -50%) rotate(-7deg) scale(1.06); } }
@keyframes orbitFloatTwo { to { transform: translate(-50%, -50%) rotate(56deg) scale(.93); } }
.hero-star {
  position: absolute; width: 5px; height: 5px; border-radius: 50%;
  background: #FFF0C8; box-shadow: 0 0 12px 2px rgba(240, 190, 90, .75);
  animation: heroStar 3.6s ease-in-out infinite;
}
.hero-star::before, .hero-star::after {
  content: ""; position: absolute; top: 50%; left: 50%;
  width: 1px; height: 19px;
  background: linear-gradient(transparent, rgba(255, 240, 200, .95), transparent);
  transform: translate(-50%, -50%);
}
.hero-star::after { transform: translate(-50%, -50%) rotate(90deg); }
@keyframes heroStar {
  0%, 100% { opacity: .24; transform: scale(.6) rotate(0); }
  50% { opacity: 1; transform: scale(1.12) rotate(45deg); }
}
.hs-1 { top: 3%; left: 28%; animation-delay: -.5s; }
.hs-2 { top: 17%; left: 68%; animation-delay: -2.2s; }
.hs-3 { top: 39%; left: 12%; animation-delay: -1.2s; }
.hs-4 { top: 62%; left: 80%; animation-delay: -2.9s; }
.hs-5 { top: 84%; left: 31%; animation-delay: -3.4s; }
.hs-6 { top: 78%; left: 68%; animation-delay: -.9s; }
.hs-7 { top: 28%; left: 84%; animation-delay: -1.8s; }
.hs-8 { top: 54%; left: 24%; animation-delay: -2.6s; }

.hero-mark {
  position: relative; z-index: 1;
  width: 76px; height: 76px; margin: 0 auto 17px;
  display: grid; place-items: center;
  border-radius: 25px;
  background: linear-gradient(145deg, #F19A76, #C85B3D 74%); color: var(--cream);
  box-shadow: 0 18px 44px rgba(217, 119, 87, .38), inset 0 1px rgba(255,255,255,.24);
  animation: rise .5s var(--ease) both;
}
.hero-mark svg { width: 45px; height: 45px; display: block; }

.hero-panel {
  position: relative; z-index: 1;
  padding: 36px 22px 23px;
  overflow: hidden;
  border: 1px solid rgba(251, 243, 228, .13); border-radius: 30px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .07), transparent 38%),
    linear-gradient(145deg, rgba(43, 31, 27, .82), rgba(18, 16, 15, .74));
  box-shadow: 0 28px 80px rgba(0, 0, 0, .34), inset 0 1px rgba(255,255,255,.06);
}
.hero-panel::after {
  content: ""; position: absolute; top: -130px; left: -60px; width: 220px; height: 220px;
  border-radius: 50%; background: radial-gradient(circle, rgba(240, 190, 90, .15), transparent 67%);
  pointer-events: none;
}
.hero-kicker {
  position: relative; z-index: 1; display: block; margin-bottom: 7px;
  color: #EFC08E; font-size: 10px; font-weight: 760; letter-spacing: 1.8px;
}

.hero h1 {
  position: relative; z-index: 1;
  margin: 0 0 6px;
  font-size: clamp(26px, 5vw, 34px); font-weight: 720; letter-spacing: -.8px;
  animation: rise .5s var(--ease) .05s both;
}
.hero p {
  position: relative; z-index: 1;
  margin: 0 0 22px; color: #BFB3AA; font-size: 14.5px;
  animation: rise .5s var(--ease) .1s both;
}

.starters { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.starter {
  display: flex; flex-direction: column; align-items: flex-start; gap: 10px;
  min-height: 92px; padding: 12px;
  border: 1px solid rgba(251, 243, 228, .1); border-radius: 16px;
  background: rgba(251, 243, 228, .045); color: var(--text);
  font: inherit; text-align: left; cursor: pointer;
  transition: transform .22s var(--ease), border-color .22s, background .22s;
}
.starter:hover { border-color: rgba(239, 161, 132, .48); background: rgba(217, 119, 87, .12); transform: translateY(-3px); }
.starter:active { transform: scale(.96); }
.starter span { color: #F0BE5A; font-size: 17px; line-height: 1; }
.starter b { font-size: 12px; font-weight: 590; line-height: 1.25; }

.chips {
  display: flex; flex-direction: column; gap: 8px;
  max-width: 330px; margin: 0 auto;
}
.chip {
  display: flex; align-items: center; gap: 11px;
  width: 100%; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: 14px;
  background: var(--surface); color: var(--text);
  font: inherit; font-size: 14.5px; text-align: left;
  cursor: pointer;
  animation: rise .5s var(--ease) both;
  transition: transform .18s var(--ease), background .18s;
}
.chip:active { transform: scale(.975); background: var(--surface-2); }
.chip svg { width: 17px; height: 17px; flex: none; color: var(--copper-hi); display: block; }

/* Сообщения */
.msg {
  max-width: 85%;
  padding: 10px 14px;
  font-size: 15.2px;
  border-radius: 18px;
  white-space: pre-wrap;
  word-wrap: break-word;
  animation: pop .26s var(--ease) both;
}
@keyframes pop { from { opacity: 0; transform: translateY(8px); } }

.msg.me {
  align-self: flex-end;
  max-width: min(76%, 620px); padding: 9px 13px;
  border: 1px solid rgba(255,255,255,.035); border-radius: 15px;
  background: #252525; color: #E1DDD8;
}
.msg.ai {
  align-self: flex-start;
  width: min(100%, 820px);
  max-width: 100%;
  padding: 7px 4px 13px;
  background: none;
  border: 0;
  border-radius: 0;
  color: #E7E2DC;
  line-height: 1.65;
}
.msg.err {
  align-self: center;
  background: rgba(226, 92, 74, .12);
  border: 1px solid rgba(226, 92, 74, .32);
  color: #EFAFA3; font-size: 13.8px;
}
.msg code { background: rgba(251,243,228,.08); padding: 1px 5px; border-radius: 5px; font-size: 13.4px; }
.msg pre {
  margin: 8px 0 2px; padding: 11px 13px;
  background: #0B0A0A; border: 1px solid var(--line); border-radius: 12px;
  overflow-x: auto; font-size: 12.8px; line-height: 1.5;
}
.msg pre code { background: none; padding: 0; }
.code-block {
  width: min(100%, 820px); margin: 12px 0 5px; overflow: hidden;
  border: 1px solid rgba(255,255,255,.09); border-radius: 13px;
  background: #0E0E0E; box-shadow: 0 14px 34px rgba(0,0,0,.2);
}
.code-block-head {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 36px; padding: 0 11px 0 14px;
  border-bottom: 1px solid rgba(255,255,255,.07); background: #191918;
  color: #8F8B86; font-size: 11px; text-transform: lowercase;
}
.code-copy {
  padding: 5px 9px; border: 1px solid rgba(255,255,255,.09); border-radius: 7px;
  background: #252422; color: #D8D3CD; font: inherit; cursor: pointer;
}
.code-copy:hover { background: #302E2B; color: #FFF; }
.msg .code-block pre {
  width: 100%; max-width: 100%; margin: 0; padding: 14px 16px;
  border: 0; border-radius: 0; overflow-x: auto; box-sizing: border-box;
  scrollbar-width: thin; scrollbar-color: #514D48 #111;
}
.msg .code-block pre::-webkit-scrollbar { height: 7px; }
.msg .code-block pre::-webkit-scrollbar-track { background: #111; }
.msg .code-block pre::-webkit-scrollbar-thumb {
  border-radius: 999px; background: #514D48;
}
.msg.ai a { color: #DFA17A; text-decoration-color: rgba(223, 161, 122, .45); }
.msg.ai a:hover { text-decoration-color: currentColor; }

/* Созданные ИИ файлы */
.artifact-card {
  align-self: flex-start;
  display: flex; align-items: center; gap: 11px;
  min-width: 220px; max-width: min(100%, 430px);
  padding: 11px 13px;
  border: 1px solid rgba(211, 163, 124, .16); border-radius: 13px;
  background: #201D1A; color: #E7E2DC;
  font: inherit; text-align: left; cursor: pointer;
}
.artifact-card:active { transform: scale(.985); }
.artifact-icon {
  width: 34px; height: 34px; flex: none;
  display: grid; place-items: center;
  border-radius: 10px;
  background: #302720; color: #DFA17A;
  font-size: 18px;
}
.artifact-card > span:last-child { min-width: 0; }
.artifact-card b {
  display: block; overflow: hidden;
  font-size: 13.5px; font-weight: 590;
  text-overflow: ellipsis; white-space: nowrap;
}
.artifact-card small { display: block; margin-top: 2px; color: #928A83; font-size: 11.5px; }
.msg.ai { position: relative; }
.msg-content { min-width: 0; }
.msg-speak {
  width: 28px; height: 28px; margin-top: 5px;
  display: grid; place-items: center;
  border: 0; border-radius: 8px;
  background: transparent; color: #77736F; cursor: pointer;
}
.msg-speak svg { width: 17px; height: 17px; }
.msg-speak:hover, .msg-speak.on { background: #292623; color: #DFA17A; }
.msg-actions {
  display: flex; align-items: center; gap: 2px;
  min-height: 28px; margin-top: 5px;
  opacity: .55; transition: opacity .18s;
}
.msg:hover .msg-actions, .msg:focus-within .msg-actions { opacity: 1; }
.msg.me .msg-actions {
  justify-content: flex-end; margin: 6px -6px -5px;
  opacity: .72;
}
.msg-action {
  width: 28px; height: 28px; display: grid; place-items: center;
  border: 0; border-radius: 8px;
  background: transparent; color: #77736F;
  font: 15px/1 sans-serif; cursor: pointer;
}
.msg-action svg { width: 16px; height: 16px; display: block; }
.msg.me .msg-action { color: rgba(255,255,255,.76); }
.msg-action:hover, .msg-action.on { background: #292623; color: #DFA17A; }
.msg.me .msg-action:hover { background: rgba(0,0,0,.14); color: #fff; }
.msg.streaming .msg-content::after {
  content: ""; display: inline-block;
  width: 2px; height: 1.05em; margin-left: 3px;
  background: #DFA17A; vertical-align: -.15em;
  animation: streamCursor .75s step-end infinite;
}
@keyframes streamCursor { 50% { opacity: 0; } }
.msg.streaming .msg-content::after { display: none !important; }
@media (prefers-reduced-motion: reduce) {
  .msg.streaming .msg-content::after { animation: none; }
}

/* ─── Индикатор мышления ─── */
.msg.thinking {
  align-self: flex-start;
  display: inline-flex; flex-direction: row; align-items: center; gap: 8px;
  width: auto; min-width: 0;
  padding: 8px 5px;
  background: none; border: 0; border-radius: 0;
  animation: thinkingEnter .3s cubic-bezier(.22,.75,.3,1) both;
}
@keyframes thinkingPulse { 70% { box-shadow: 0 0 0 7px transparent; } }
.think-text {
  color: #D8D3CD;
  font: 14px/1.2 Georgia, "Times New Roman", serif;
  letter-spacing: -.01em;
}
.thinking-glyph {
  width: 15px; height: 15px; flex: 0 0 15px;
  color: #D97757;
  filter: drop-shadow(0 0 7px rgba(217,119,87,.22));
  animation: thinkingGlyphIn .32s ease both, thinkingGlyphTurn 2.8s linear .32s infinite;
}
.thinking-glyph svg { display: block; width: 100%; height: 100%; }
.thinking-elapsed {
  color: #9C9690; font-size: 12px;
}
.thinking-divider {
  display: block;
  width: 100%; height: 1px;
  background: rgba(255, 255, 255, .075);
}
.thinking-elapsed[hidden], .thinking-divider[hidden] { display: none; }
@keyframes thinkingEnter {
  from { opacity: 0; transform: translateY(4px); filter: blur(2px); }
  to { opacity: 1; transform: translateY(0); filter: blur(0); }
}
@keyframes thinkingGlyphIn {
  from { opacity: 0; transform: scale(.72) rotate(-18deg); }
  to { opacity: 1; transform: scale(1) rotate(0); }
}
@keyframes thinkingGlyphTurn { to { transform: rotate(360deg); } }

/* ─── Поле ввода ─── */
.composer {
  position: relative; z-index: 5;
  padding: 9px 11px calc(var(--bottom) + 11px);
  background: linear-gradient(180deg, rgba(15, 14, 13, .78), rgba(15, 14, 13, .96));
  border-top: 1px solid var(--line);
}
.composer-inner {
  position: relative;
  display: flex; align-items: flex-end; gap: 8px;
  padding: 5px 5px 5px 8px;
  background: rgba(31, 28, 27, .88);
  border: 1px solid rgba(239, 161, 132, .22);
  border-radius: 22px;
  transition: border-color .2s var(--ease);
}
.attachment-tray {
  order: -2;
  display: none;
  flex-basis: 100%;
  gap: 7px;
  overflow-x: auto;
  padding: 0 1px 7px;
}
.attachment-tray.on { display: flex; }
.attachment-tray::-webkit-scrollbar { height: 0; }
.attachment-chip {
  flex: none;
  display: flex; align-items: center; gap: 8px;
  max-width: 220px;
  padding: 7px 8px 7px 10px;
  border: 1px solid rgba(211, 163, 124, .14); border-radius: 10px;
  background: #29241F;
}
.attachment-chip > img {
  width: 34px; height: 34px; flex: none;
  border-radius: 8px; object-fit: cover;
}
.attachment-chip > span { min-width: 0; }
.attachment-chip b {
  display: block; overflow: hidden;
  color: #DED7D0; font-size: 11.5px; font-weight: 570;
  text-overflow: ellipsis; white-space: nowrap;
}
.attachment-chip small { display: block; color: #8F8881; font-size: 10px; }
.attachment-chip button {
  width: 24px; height: 24px; flex: none;
  border: 0; border-radius: 7px;
  background: transparent; color: #A8A09A;
  font: 18px/1 sans-serif; cursor: pointer;
}
.attachment-chip button:hover { background: rgba(255,255,255,.06); }
.composer-inner:focus-within { border-color: var(--copper); }
/* Перелив включается только при фокусе: градиентный слой плавно проявляется
   под внутренней поверхностью — без масок, поэтому края идеально гладкие. */
.composer-inner::before,
.composer-inner::after {
  content: ""; position: absolute;
  pointer-events: none;
}
.composer-inner::before {
  inset: -1px;
  border-radius: 22.5px;
  background: var(--iri);
  background-size: 420%;
  background-position: 0% 50%;
  opacity: 0;
  transition: opacity .45s var(--ease);
}
.composer-inner:focus-within::before {
  opacity: .85;
  animation: iriShift 16s linear infinite;
}
.composer-inner::after {
  inset: 1px;
  border-radius: 19.5px;
  background:
    radial-gradient(120% 100% at 50% 0%, rgba(251, 243, 228, .05) 0%, transparent 60%),
    var(--surface);
}
.composer-inner > * { position: relative; z-index: 2; }
.composer-inner:focus-within::after { background: var(--surface); }
.composer-inner .icon-btn { margin-bottom: 0; }

#input {
  flex: 1; min-height: 26px; max-height: 120px;
  padding: 7px 0;
  border: 0; outline: 0; resize: none;
  background: none; color: var(--text);
  font: inherit; font-size: 15.5px; line-height: 1.45;
}
.context-counter {
  order: -1;
  margin: 0 4px 1px auto;
  color: #847F79;
  font-size: 10px;
  line-height: 1;
  white-space: nowrap;
}
.context-counter.near-limit { color: #D98A69; }
.context-counter[hidden] { display: none; }
#input::placeholder { color: var(--muted); }

.send {
  width: 38px; height: 38px; flex: none;
  display: grid; place-items: center;
  border: 0; border-radius: 50%;
  background: linear-gradient(145deg, #EF9B77, #B95138); color: #fff;
  box-shadow: 0 6px 16px rgba(217, 119, 87, .28);
  cursor: pointer;
  transition: transform .18s var(--ease), opacity .18s;
}
.send svg { width: 20px; height: 20px; display: block; }
.send:disabled { opacity: .3; }
.send:not(:disabled):active { transform: scale(.9); }

/* ─── Canvas ─── */
.canvas-view {
  position: fixed; z-index: 8;
  top: calc(var(--top) + 59px); right: 0; bottom: 0;
  width: var(--result-panel); min-height: 0;
  display: flex; flex-direction: column;
  padding: 14px;
  background:
    radial-gradient(85% 45% at 100% 0%, rgba(217, 119, 87, .045), transparent 72%),
    #151412;
  border-left: 1px solid rgba(255, 255, 255, .07);
  box-shadow: -18px 0 52px rgba(0, 0, 0, .24);
  opacity: 0; visibility: hidden; pointer-events: none;
  transform: translateX(24px);
  transition: transform .36s var(--ease), opacity .26s ease, visibility .26s;
}
.canvas-mode .chat, .canvas-mode .composer { display: none; }
.canvas-mode .canvas-view {
  opacity: 1; visibility: visible; pointer-events: auto; transform: translateX(0);
}
.canvas-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: min(100%, 1180px); margin: 0 auto 13px;
}
.canvas-head-copy { min-width: 0; }
.canvas-title-line { display: flex; align-items: center; gap: 10px; }
.canvas-head h1 {
  margin: 0; color: #E9E4DE;
  font-family: inherit; font-size: 18px; font-weight: 620; line-height: 1.25;
  letter-spacing: -.2px;
}
.canvas-head p { margin: 3px 0 0; color: #8F8983; font-size: 12.5px; }
.canvas-live {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 7px;
  border: 1px solid rgba(255,255,255,.08); border-radius: 999px;
  color: #8C8782; background: rgba(255,255,255,.025);
  font-size: 9.5px; font-weight: 680; letter-spacing: .55px; text-transform: uppercase;
}
.canvas-live i { width: 5px; height: 5px; border-radius: 50%; background: #68635F; }
.canvas-live.ready { color: #A9C9B1; border-color: rgba(143,183,154,.16); }
.canvas-live.ready i { background: #8FB79A; box-shadow: 0 0 8px rgba(143,183,154,.38); }
.canvas-live.working { color: #D8AA8E; border-color: rgba(217,119,87,.2); }
.canvas-live.working i { background: #D97757; animation: thinkingPulse 1.8s ease-out infinite; }
.canvas-head-actions { display: flex; align-items: center; gap: 6px; flex: none; }
.canvas-back, .canvas-collapse {
  width: 36px; height: 36px; flex: none;
  display: grid; place-items: center;
  border: 1px solid rgba(255,255,255,.075); border-radius: 10px;
  background: #1D1C1A; color: #9F9993; font: 21px/1 inherit; cursor: pointer;
}
.canvas-back:hover, .canvas-collapse:hover { background: #252320; color: #DED8D2; }
.canvas-collapse svg { width: 17px; height: 17px; }
.canvas-body {
  display: grid; grid-template-columns: minmax(190px, 260px) minmax(0, 1fr);
  gap: 12px; flex: 1; min-height: 0;
  width: min(100%, 1180px); margin: 0 auto;
}
.canvas-body.no-files { grid-template-columns: minmax(0, 1fr); }
.canvas-files[hidden] { display: none; }
.canvas-files {
  min-height: 0; overflow-y: auto;
  padding: 6px;
  border: 1px solid rgba(211, 163, 124, .1); border-radius: 15px;
  background: #191816;
}
.canvas-file {
  width: 100%; display: flex; align-items: center; gap: 9px;
  padding: 9px; margin-bottom: 4px;
  border: 1px solid transparent; border-radius: 10px;
  background: transparent; color: #DCD6CF; text-align: left; cursor: pointer;
}
.canvas-file:hover { background: #22201E; }
.canvas-file.on { border-color: rgba(217, 119, 87, .28); background: #28231F; }
.canvas-file > span:first-child {
  width: 31px; height: 31px; flex: none; display: grid; place-items: center;
  border-radius: 9px; background: #302A25; color: #DFA17A;
}
.canvas-file > span:last-child { min-width: 0; }
.canvas-file b { display: block; overflow: hidden; font-size: 12px; font-weight: 570; text-overflow: ellipsis; white-space: nowrap; }
.canvas-file small { color: #817B76; font-size: 10.5px; }
.canvas-preview {
  position: relative; min-width: 0; min-height: 260px; overflow: hidden;
  display: flex; flex-direction: column;
  border: 1px solid rgba(255,255,255,.075); border-radius: 13px;
  background: #171614;
}
.canvas-preview-bar {
  min-height: 47px; padding: 8px 10px 8px 14px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  border-bottom: 1px solid rgba(211, 163, 124, .1);
}
.canvas-preview-title { min-width: 0; }
.canvas-preview-title b { display: block; overflow: hidden; color: #DCD6CF; font-size: 12.5px; font-weight: 570; text-overflow: ellipsis; white-space: nowrap; }
.canvas-preview-title small { display: block; margin-top: 1px; color: #77716C; font-size: 9.5px; letter-spacing: .35px; }
.canvas-preview-actions { display: flex; align-items: center; gap: 6px; flex: none; }
.canvas-preview-bar button {
  flex: none; padding: 6px 10px;
  border: 1px solid rgba(217, 119, 87, .25); border-radius: 8px;
  background: #2B2420; color: #E6AA8D; font: inherit; font-size: 11.5px; cursor: pointer;
}
.canvas-preview-bar button.canvas-copy { border-color: rgba(255,255,255,.09); background: #232220; color: #BEB8B2; }
.canvas-stage { flex: 1; min-height: 0; overflow: auto; display: grid; place-items: center; background: #10100F; }
.canvas-stage > img { display: block; max-width: 100%; max-height: 100%; object-fit: contain; }
.canvas-stage > iframe { width: 100%; height: 100%; min-height: 360px; border: 0; background: #fff; }
.canvas-stage > video { display: block; max-width: 100%; max-height: 100%; }
.canvas-stage > audio { width: min(90%, 520px); }
.canvas-stage > pre {
  width: 100%; height: 100%; margin: 0; padding: 17px;
  overflow: auto; align-self: stretch;
  color: #D7D2CC; background: #121210;
  font: 12.5px/1.6 ui-monospace, "SFMono-Regular", Consolas, monospace;
  white-space: pre-wrap; word-break: break-word;
}
.canvas-empty {
  width: min(100%, 340px); margin: auto; padding: 26px 20px;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  border: 1px solid rgba(255,255,255,.065); border-radius: 15px;
  background: rgba(255,255,255,.018);
}
.canvas-empty-icon {
  width: 38px; height: 38px; display: grid; place-items: center;
  border: 1px solid rgba(217,119,87,.18); border-radius: 11px;
  color: #BE765D; background: rgba(217,119,87,.055);
}
.canvas-empty-icon svg { width: 21px; height: 21px; }
.canvas-empty b { margin-top: 8px; color: #DCD6CF; font-size: 14px; font-weight: 570; }
.canvas-empty small { max-width: 340px; margin-top: 5px; color: #7F7A75; font-size: 12px; }
.canvas-empty.compact span { font-size: 25px; }
.canvas-body.no-files .canvas-preview { border: 0; background: transparent; }
.canvas-loading { color: #817B76; font-size: 13px; }

/* ─── Умная камера ─── */
.camera-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: #050505; color: #fff;
}
.camera-overlay[hidden] { display: none; }
.camera-overlay video { width: 100%; height: 100%; display: block; object-fit: cover; }
.camera-top {
  position: absolute; top: calc(var(--top) + 12px); left: 14px; right: 14px;
  display: flex; align-items: center; justify-content: space-between;
}
.camera-top span { padding: 6px 10px; border-radius: 10px; background: rgba(0,0,0,.48); font-size: 12.5px; }
.camera-top button {
  width: 40px; height: 40px; display: grid; place-items: center;
  border: 1px solid rgba(255,255,255,.16); border-radius: 50%;
  background: rgba(0,0,0,.48); color: #fff; font: 24px/1 inherit; cursor: pointer;
}
.camera-shot {
  position: absolute; left: 50%; bottom: calc(var(--bottom) + 24px);
  width: 72px; height: 72px; padding: 5px; transform: translateX(-50%);
  border: 3px solid rgba(255,255,255,.88); border-radius: 50%; background: transparent; cursor: pointer;
}
.camera-shot i { display: block; width: 100%; height: 100%; border-radius: 50%; background: #F2EEE9; }
#voiceBtn.recording { color: #F19A76; background: rgba(217, 119, 87, .13); animation: voicePulse 1.2s ease-in-out infinite; }
@keyframes voicePulse { 50% { transform: scale(.9); opacity: .72; } }

/* ─── Шторка ─── */
.scrim {
  position: fixed; inset: 0; z-index: 40;
  background: rgba(0, 0, 0, .6);
  opacity: 0; visibility: hidden;
  transition: opacity .3s var(--ease), visibility .3s;
}
.scrim.on { opacity: 1; visibility: visible; }

.sheet {
  position: fixed; z-index: 50;
  left: 0; right: 0; bottom: 0;
  max-height: 90vh; overflow-y: auto;
  padding: 8px 16px calc(var(--bottom) + 22px);
  background: var(--surface);
  border-top: 1px solid var(--line);
  border-radius: 24px 24px 0 0;
  transform: translateY(101%);
  transition: transform .36s var(--ease);
}
.sheet.on { transform: translateY(0); }
.sheet::-webkit-scrollbar { width: 0; }
.sheet-grip {
  width: 38px; height: 4px; margin: 4px auto 14px;
  border-radius: 4px; background: rgba(251, 243, 228, .2);
}
.sheet h2 { margin: 0 0 18px; font-size: 20px; font-weight: 670; }
.sheet-sub { margin: -10px 0 16px; color: var(--muted); font-size: 13.8px; }

.group { margin-bottom: 20px; }
.group-head {
  margin-bottom: 9px;
  font-size: 11.5px; font-weight: 640; letter-spacing: .9px; text-transform: uppercase;
  color: var(--muted);
}

/* Карточки глубины */
.options { display: flex; flex-direction: column; gap: 7px; }
.opt {
  display: flex; align-items: center; gap: 12px;
  width: 100%; padding: 12px 14px;
  text-align: left;
  border: 1.5px solid var(--line); border-radius: 14px;
  background: var(--surface-2); color: var(--text);
  font: inherit; cursor: pointer;
  transition: transform .18s var(--ease), border-color .2s, background .2s;
}
.opt:active { transform: scale(.98); }
.opt.on { border-color: var(--copper); background: rgba(217, 119, 87, .12); }
.opt-body { flex: 1; min-width: 0; }
.opt b { display: block; font-size: 14.5px; font-weight: 620; }
.opt span { font-size: 12.2px; color: var(--muted); }
.opt .dot {
  width: 19px; height: 19px; flex: none;
  border: 2px solid rgba(251, 243, 228, .22); border-radius: 50%;
  position: relative;
  transition: border-color .2s;
}
.opt.on .dot { border-color: var(--copper); }
.opt .dot::after {
  content: ""; position: absolute; inset: 3px;
  border-radius: 50%; background: var(--copper);
  transform: scale(0); transition: transform .2s var(--ease);
}
.opt.on .dot::after { transform: scale(1); }

/* Язык */
.segmented {
  position: relative;
  display: grid; grid-template-columns: 1fr 1fr;
  padding: 4px;
  background: var(--surface-2);
  border: 1px solid var(--line); border-radius: 14px;
}
.segmented button {
  position: relative; z-index: 2;
  padding: 11px 0;
  border: 0; background: none; color: var(--muted);
  font: inherit; font-size: 14.2px; font-weight: 600;
  cursor: pointer;
  transition: color .24s var(--ease);
}
.segmented button.on { color: #fff; }
.segmented .thumb {
  position: absolute; z-index: 1;
  top: 4px; bottom: 4px; left: 4px;
  width: calc(50% - 4px);
  border-radius: 11px;
  background: var(--copper);
  transition: transform .3s var(--ease);
}
.segmented.right .thumb { transform: translateX(100%); }

/* Строки */
.rows { display: flex; flex-direction: column; gap: 7px; }
.row {
  display: flex; align-items: center; gap: 12px;
  width: 100%; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: 14px;
  background: var(--surface-2); color: var(--text);
  font: inherit; font-size: 14.8px; text-align: left;
  cursor: pointer;
  transition: transform .18s var(--ease), background .18s;
}
.row:active { transform: scale(.98); background: #2B2726; }
.row-ic {
  width: 32px; height: 32px; flex: none;
  display: grid; place-items: center;
  border-radius: 10px;
  background: rgba(217, 119, 87, .14);
  color: var(--copper-hi);
}
.row-ic svg { width: 17px; height: 17px; display: block; }
.row-ic.star { background: rgba(240, 190, 90, .14); color: #EFBE5A; }
.row-note { margin-left: auto; font-size: 13px; color: var(--muted); }

/* Заблокированные режимы */
.opt.locked { opacity: .62; }
.opt.locked .dot { opacity: .4; }
.opt .lock { flex: none; color: var(--muted); }
.opt .lock svg { width: 15px; height: 15px; display: block; }

/* Экран подписки */
.pro-head { text-align: center; margin-bottom: 18px; }
.pro-icon {
  width: 58px; height: 58px; margin: 0 auto 12px;
  display: grid; place-items: center;
  border-radius: 18px;
  background: linear-gradient(135deg, #F0BE5A, #D9924A);
  color: #2A1B06;
}
.pro-icon svg { width: 32px; height: 32px; display: block; }
.pro-head h2 { margin: 0 0 5px; }
.pro-head .sheet-sub { margin: 0; }

.perks { display: flex; flex-direction: column; gap: 9px; margin-bottom: 20px; }
.perk { display: flex; align-items: center; gap: 10px; font-size: 14.4px; }
.perk svg { width: 17px; height: 17px; flex: none; color: var(--copper-hi); display: block; }

.plans { display: flex; flex-direction: column; gap: 8px; }
.plan {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; padding: 14px 16px;
  border: 1.5px solid var(--line); border-radius: 15px;
  background: var(--surface-2); color: var(--text);
  font: inherit; cursor: pointer;
  transition: transform .18s var(--ease), border-color .2s;
}
.plan:active { transform: scale(.98); }
.plan.featured { border-color: var(--copper); background: rgba(217, 119, 87, .12); }
.plan-info { display: flex; align-items: baseline; gap: 8px; }
.plan-info b { font-size: 15.5px; font-weight: 640; }
.plan-info span { font-size: 12.5px; color: #7BE0A8; font-weight: 640; }
.plan-price { font-size: 15.5px; font-weight: 680; color: #F0BE5A; }

.pro-note {
  margin: 14px 0 0; text-align: center;
  font-size: 12.2px; color: var(--muted);
}

/* Ежедневная рулетка */
.roulette-odds {
  max-width: 520px; margin: 0 auto;
  color: #817B75; font-size: 11.5px; line-height: 1.55; text-align: center;
}
.roulette-stage {
  position: relative;
  width: 238px; height: 238px;
  margin: 24px auto 18px;
}
.roulette-pointer {
  position: absolute; z-index: 3;
  top: -7px; left: 50%;
  width: 0; height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-top: 20px solid #D9D4CE;
  transform: translateX(-50%);
}
.roulette-wheel {
  position: relative;
  width: 100%; height: 100%;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 50%;
  background: conic-gradient(
    #2C2B2A 0deg 45deg,
    #1F1F1E 45deg 90deg,
    #343230 90deg 135deg,
    #222120 135deg 180deg,
    #302E2D 180deg 225deg,
    #1D1D1C 225deg 270deg,
    #383532 270deg 315deg,
    #252423 315deg 360deg
  );
  box-shadow: inset 0 0 0 8px #181818;
  transition: transform 3.35s cubic-bezier(.12, .72, .1, 1);
}
.roulette-wheel::before {
  content: ""; position: absolute; inset: 8px;
  border: 1px solid rgba(255, 255, 255, .09); border-radius: 50%;
  background: repeating-conic-gradient(
    from -1deg,
    transparent 0deg 44deg,
    rgba(255, 255, 255, .13) 44deg 45deg
  );
}
.roulette-wheel span {
  position: absolute; z-index: 2;
  top: 50%; left: 50%;
  color: #E4DED7;
  font-size: 14px; font-weight: 650;
  transform: translate(-50%, -50%) rotate(var(--angle)) translateY(-86px);
}
.roulette-wheel > i {
  position: absolute; z-index: 3;
  top: 50%; left: 50%; width: 55px; height: 55px;
  border: 1px solid rgba(255, 255, 255, .14); border-radius: 50%;
  background: #181818;
  transform: translate(-50%, -50%);
}
.roulette-wheel > i::after {
  content: "C"; position: absolute; inset: 0;
  display: grid; place-items: center;
  color: #CFC8C0; font: 22px Georgia, "Times New Roman", serif;
}
.roulette-result {
  min-height: 27px; margin-bottom: 10px;
  color: #ECE6DF; font-size: 16px; font-weight: 620; text-align: center;
}
.roulette-spin { max-width: 360px; display: block; margin: 0 auto; }
.roulette-spin:disabled { background: #353331; color: #817B75; cursor: default; }

/* Карточка рефералки */
.ref-stat {
  display: flex; gap: 9px; margin-bottom: 10px;
}
.ref-card {
  flex: 1; padding: 14px 12px;
  border: 1px solid var(--line); border-radius: 14px;
  background: var(--surface-2); text-align: center;
}
.ref-card b { display: block; font-size: 23px; font-weight: 680; color: var(--copper-hi); }
.ref-card span { font-size: 11.5px; color: var(--muted); }
.ref-link {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; margin-bottom: 8px;
  border: 1px solid var(--line); border-radius: 14px;
  background: var(--surface-2);
  font-size: 13px; color: var(--muted);
  word-break: break-all;
}

/* Рабочее пространство агента */
.agent-section { margin-top: 22px; }
.project-create {
  display: flex; gap: 8px;
  margin-bottom: 9px;
}
.project-create input {
  flex: 1; min-width: 0;
  padding: 11px 13px;
  border: 1px solid rgba(211, 163, 124, .13); border-radius: 12px;
  outline: none;
  background: #22201E; color: #E9E3DC;
  font: inherit; font-size: 13.5px;
}
.project-create input:focus { border-color: rgba(217, 158, 113, .34); }
.project-create button {
  width: 43px; flex: none;
  border: 1px solid rgba(211, 163, 124, .17); border-radius: 12px;
  background: #302720; color: #DFA17A;
  font: 22px/1 sans-serif; cursor: pointer;
}
.agent-list { display: flex; flex-direction: column; gap: 7px; }
.agent-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  width: 100%; padding: 11px 13px;
  border: 1px solid rgba(211, 163, 124, .1); border-radius: 12px;
  background: #22201E; color: #E6DFD8;
  font: inherit; text-align: left;
}
button.agent-item { cursor: pointer; }
.agent-item.active { border-color: rgba(217, 158, 113, .3); background: #28231F; }
.agent-item > span { min-width: 0; }
.agent-item b { display: block; font-size: 13.5px; font-weight: 610; }
.agent-item small {
  display: block; overflow: hidden;
  margin-top: 2px;
  color: #938B84; font-size: 11.5px;
  text-overflow: ellipsis; white-space: nowrap;
}
.memory-item button {
  width: 28px; height: 28px; flex: none;
  border: 0; border-radius: 8px;
  background: transparent; color: #9F9690;
  font: 18px/1 sans-serif; cursor: pointer;
}
.memory-item button:hover { background: rgba(255,255,255,.05); }
.agent-hint { margin: -4px 0 9px; color: #8F8881; font-size: 12px; }
.agent-empty {
  padding: 16px;
  border: 1px dashed rgba(211, 163, 124, .12); border-radius: 12px;
  color: #837D77; font-size: 12.5px; text-align: center;
}
.btn-primary {
  width: 100%; padding: 14px;
  border: 0; border-radius: 14px;
  background: var(--copper); color: #fff;
  font: inherit; font-size: 15px; font-weight: 620;
  cursor: pointer;
  transition: transform .18s var(--ease);
}
.btn-primary:active { transform: scale(.98); }

/* Тост */
.toast {
  position: fixed; z-index: 80;
  left: 50%; bottom: calc(var(--bottom) + 88px);
  padding: 11px 18px;
  border-radius: 12px;
  background: #2B2726;
  border: 1px solid var(--line);
  font-size: 13.8px; white-space: nowrap;
  opacity: 0; visibility: hidden;
  transform: translate(-50%, 10px);
  transition: opacity .26s var(--ease), transform .26s var(--ease), visibility .26s;
}
.toast.on { opacity: 1; visibility: visible; transform: translate(-50%, 0); }

/* Команды, которые появляются при вводе /. */
.command-menu {
  position: absolute; z-index: 20;
  left: 0; right: 0; bottom: calc(100% + 9px);
  display: none;
  max-height: min(48vh, 350px);
  overflow-y: auto;
  padding: 6px;
  border: 1px solid rgba(211, 163, 124, .16);
  border-radius: 16px;
  background: #1D1A17;
  box-shadow: 0 18px 48px rgba(0, 0, 0, .38);
}
.command-menu.on { display: block; }
.command-menu::-webkit-scrollbar { width: 0; }
.command-item {
  display: grid;
  grid-template-columns: minmax(150px, .7fr) 1fr;
  align-items: center;
  width: 100%;
  padding: 10px 11px;
  border: 0; border-radius: 10px;
  background: transparent; color: #EAE2D9;
  font: inherit; text-align: left;
  cursor: pointer;
}
.command-item:hover, .command-item:focus-visible { background: #2A2520; outline: none; }
.command-item code {
  overflow: hidden;
  color: #DFA17A;
  font: 12.5px ui-monospace, "SFMono-Regular", Consolas, monospace;
  text-overflow: ellipsis; white-space: nowrap;
}
.command-item span { color: #A69B90; font-size: 12.5px; }

/* ─── Строгий стартовый экран в стиле Claude ─── */
body {
  background:
    radial-gradient(ellipse 70% 48% at 6% 100%, rgba(138, 67, 31, .11), transparent 72%),
    radial-gradient(ellipse 58% 42% at 96% 4%, rgba(174, 110, 55, .065), transparent 70%),
    linear-gradient(145deg, #151513 0%, #151515 48%, #171411 100%);
}
.topbar {
  background: linear-gradient(90deg, #111110, #17130F 52%, #111110);
  border-bottom-color: rgba(210, 157, 116, .1);
}
.brand-mark {
  background: #D97757;
  box-shadow: none;
}
.chat { padding: 16px 15px; }
.hero {
  width: min(100%, 640px);
  padding: 0 4px 128px;
}
.hero::before { display: none; }
.hero-panel {
  overflow: visible;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
}
.hero-panel::after { display: none; }
.hero-mark {
  width: 44px; height: 44px; margin: 0 auto 10px;
  border-radius: 14px;
  background: none;
  box-shadow: none;
  color: var(--copper);
  animation: none;
}
.hero-mark svg { width: 42px; height: 42px; }
.hero-kicker { display: none; }
.hero h1 {
  margin: 0 0 7px;
  color: #F2EDE7;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(31px, 4.2vw, 42px);
  font-weight: 400;
  letter-spacing: -1.7px;
  animation: none;
}
.hero p {
  margin: 0;
  color: #99938D;
  font-size: 14px;
  animation: none;
}
.starters {
  position: fixed;
  z-index: 7;
  top: calc(50% + 139px);
  left: 50%;
  width: min(calc(100% - 32px), 610px);
  transform: translateX(-50%);
  display: flex;
  justify-content: center;
  gap: 8px;
}
.starters { scrollbar-width: none; }
.starters::-webkit-scrollbar { display: none; }
.starter {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  min-height: 0;
  padding: 7px 11px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 8px;
  background: #2A2928;
  color: #DFDAD4;
  white-space: nowrap;
}
.starter:hover { border-color: rgba(255, 255, 255, .18); background: #353331; transform: none; }
.starter span { color: #B6AFA7; font-size: 14px; }
.starter b { font-size: 12px; font-weight: 500; }
.composer {
  position: fixed;
  z-index: 6;
  top: calc(50% + 12px);
  left: 50%;
  width: min(calc(100% - 32px), 610px);
  padding: 0;
  transform: translateX(-50%);
  background: none;
  border: 0;
}
.composer-inner {
  min-height: 112px;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 6px;
  padding: 13px 12px 11px;
  border-color: rgba(211, 163, 124, .17);
  border-radius: 20px;
  background: #211E1B;
  box-shadow: 0 10px 32px rgba(0, 0, 0, .18), inset 0 1px rgba(255,255,255,.025);
}
.composer-inner::before, .composer-inner::after { display: none; }
.composer-inner:focus-within { border-color: rgba(217, 158, 113, .34); }
#input {
  order: -1;
  flex-basis: 100%;
  min-height: 54px;
  padding: 3px 5px;
  font-size: 15px;
}
.icon-btn {
  width: 32px; height: 32px;
  border-color: transparent;
  background: transparent;
  color: #C9C3BD;
}
.icon-btn.slim { width: 32px; height: 32px; }
.icon-btn:hover { background: #302E2D; }
.icon-btn.on { color: #C9C3BD; border-color: transparent; }
.send {
  width: 34px; height: 34px;
  margin-left: auto;
  background: #D97757;
  box-shadow: none;
}
.send:disabled { background: #4B3028; opacity: 1; }
.send.stop { background: #3A3531; }
.send.stop svg { display: none; }
.send.stop::before {
  content: ""; width: 10px; height: 10px;
  border-radius: 2px; background: #E8E1DA;
}
.has-chat .composer {
  top: auto;
  bottom: 0;
  width: 100%;
  padding: 9px 11px calc(var(--bottom) + 11px);
  transform: translateX(-50%);
  background: #151412;
  border-top: 1px solid rgba(211, 163, 124, .09);
}
.has-chat .composer-inner { min-height: 0; }
.has-chat #input { flex-basis: 0; min-height: 26px; padding: 7px 0; }
.has-chat .chat { padding-bottom: 88px; }
.has-chat .starters { display: none; }

/* Единая графитовая тема для шторок настроек и подписки. */
.scrim { background: rgba(0, 0, 0, .72); }
.sheet {
  background: #191816;
  border-top-color: rgba(211, 163, 124, .13);
  box-shadow: 0 -20px 60px rgba(0, 0, 0, .35);
}
.sheet-grip { background: rgba(255, 255, 255, .22); }
.sheet h2 { color: #F0ECE7; }
.sheet-sub, .group-head, .row-note { color: #99938D; }
.opt, .row, .plan, .ref-card, .ref-link, .segmented {
  border-color: rgba(211, 163, 124, .11);
  background: #22201E;
}
.opt.on, .plan.featured {
  border-color: rgba(255, 255, 255, .32);
  background: #2B2A29;
}
.opt.on .dot { border-color: #E7E1DA; }
.opt.on .dot::after { background: #E7E1DA; }
.opt.locked { opacity: .5; }
.segmented .thumb { background: #3A3937; }
.segmented button.on { color: #F3EEE7; }
.row:active { background: #2C2A28; }
.row-ic { background: #302F2D; color: #C9C3BD; }
.row-ic.star { background: #302F2D; color: #C9C3BD; }
.pro-icon { background: #D97757; color: #FFF8F1; }
.perk svg, .ref-card b { color: #E39A80; }
.plan-price { color: #EAB08F; }
.plan-info span { color: #9CC8A9; }
.btn-primary { background: #D97757; }

.canvas-rail {
  position: fixed; z-index: 9; top: 50%; right: 7px;
  width: 42px; height: 54px;
  display: none; place-items: center;
  border: 1px solid rgba(255,255,255,.1); border-radius: 13px 4px 4px 13px;
  background: #211F1C; color: #C9C2BB;
  box-shadow: -10px 10px 28px rgba(0,0,0,.28);
  transform: translateY(-50%); cursor: pointer;
}
.canvas-rail svg { width: 19px; height: 19px; }
.canvas-rail i {
  position: absolute; top: -5px; left: -4px;
  min-width: 17px; height: 17px; padding: 0 4px;
  display: grid; place-items: center;
  border-radius: 9px; background: #B96044; color: #fff;
  font: normal 9px/1 inherit;
}
.canvas-rail i[hidden] { display: none; }
.canvas-collapsed .canvas-view {
  opacity: 0; visibility: hidden; pointer-events: none;
  transform: translateX(100%);
}
.canvas-mode.canvas-collapsed .canvas-rail { display: grid; }

/* На широком экране результат живёт рядом с чатом. */
@media (min-width: 681px) {
  .canvas-mode .chat {
    display: flex; align-self: flex-start;
    width: calc(100% - var(--result-panel));
  }
  .canvas-mode.has-chat .composer {
    display: block; left: 0; right: auto;
    width: calc(100% - var(--result-panel));
    transform: none;
  }
  .canvas-mode:not(.has-chat) .composer {
    display: block;
    left: calc((100% - var(--result-panel)) / 2);
    width: min(calc(100% - var(--result-panel) - 24px), 610px);
  }
  .canvas-mode:not(.has-chat) .starters {
    left: calc((100% - var(--result-panel)) / 2);
    width: min(calc(100% - var(--result-panel) - 24px), 610px);
  }
  .canvas-mode .msg.ai { width: min(100%, 720px); }
  .canvas-mode.canvas-collapsed .chat { width: 100%; }
  .canvas-mode.canvas-collapsed.has-chat .composer {
    left: 0; width: 100%; transform: none;
  }
  .canvas-mode.canvas-collapsed:not(.has-chat) .composer,
  .canvas-mode.canvas-collapsed:not(.has-chat) .starters {
    left: 50%;
    width: min(calc(100% - 32px), 610px);
  }
}

/* На телефоне Live result становится самостоятельным экраном. */
@media (max-width: 680px) {
  .canvas-view {
    left: 0; width: 100%;
    border-left: 0; box-shadow: 0 -18px 48px rgba(0,0,0,.24);
    transform: translateY(18px);
  }
  .canvas-mode .canvas-view { transform: translateY(0); }
  .canvas-mode.canvas-collapsed .canvas-view { transform: translateX(100%); }
  .canvas-mode.canvas-collapsed .chat { display: flex; }
  .canvas-mode.canvas-collapsed .composer { display: block; }
  .canvas-mode.canvas-collapsed.has-chat .composer {
    left: 50%; width: 100%; transform: translateX(-50%);
  }
}

@media (min-width: 681px) and (max-width: 1100px) {
  .canvas-body { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); }
  .canvas-files {
    display: flex; gap: 5px; overflow-x: auto; overflow-y: hidden;
    min-height: 61px; padding: 5px;
  }
  .canvas-file { width: 154px; flex: none; margin: 0; padding: 7px; }
  .canvas-file > span:first-child { width: 29px; height: 29px; }
}

@media (max-width: 520px) {
  .hero { padding-bottom: 116px; }
  .starters { top: calc(50% + 133px); justify-content: flex-start; overflow-x: auto; }
  .starter { flex: none; }
  .command-item { grid-template-columns: 1fr; gap: 2px; }
  .command-item span { font-size: 11.5px; }
  .canvas-toggle span { display: none; }
  .canvas-toggle { padding: 7px 9px; }
  .canvas-view { padding: 12px 10px 9px; }
  .canvas-head { margin-bottom: 9px; }
  .canvas-title-line { gap: 7px; }
  .canvas-head h1 { font-size: 18px; }
  .canvas-head p { font-size: 11px; }
  .canvas-live { padding: 3px 6px; font-size: 8.5px; }
  .canvas-body { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); }
  .canvas-files {
    display: flex; gap: 5px; overflow-x: auto; overflow-y: hidden;
    min-height: 61px; padding: 5px;
  }
  .canvas-file { width: 154px; flex: none; margin: 0; padding: 7px; }
  .canvas-file > span:first-child { width: 29px; height: 29px; }
  .canvas-preview { min-height: 0; }
  .canvas-stage > iframe { min-height: 280px; }
  .canvas-preview-actions button { padding: 6px 8px; }
  .canvas-preview-bar button.canvas-copy { display: none; }
}

@media (max-width: 370px) {
  #fsBtn { display: none; }
  .composer-inner { gap: 4px; padding-left: 7px; padding-right: 7px; }
}

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

/* ─── Спокойная навигация и полноценные настройки ─── */
.drawer-nav {
  display: grid;
  gap: 4px;
  margin: 0 0 16px;
  padding-bottom: 15px;
  border-bottom: 1px solid rgba(255, 255, 255, .065);
}
.drawer-nav-item {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #A9A39D;
  font: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}
.drawer-nav-item svg { width: 18px; height: 18px; }
.drawer-nav-item:hover { color: #ECE7E1; background: rgba(255, 255, 255, .045); }
.drawer-nav-item.on { color: #F0EAE4; background: #2B2927; }
.drawer-nav-item i {
  min-width: 18px; height: 18px; padding: 0 5px;
  display: grid; place-items: center;
  border-radius: 9px; background: #B96044; color: white;
  font: normal 9px/1 inherit;
}
.drawer-nav-item i[hidden] { display: none; }
.drawer-section-label {
  margin: 0 5px 9px;
  color: #77716C;
  font-size: 10px;
  font-weight: 650;
  letter-spacing: .9px;
  text-transform: uppercase;
}

.settings-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 14px;
  padding: 0 2px 14px;
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.settings-head > div > span {
  display: block; margin-bottom: 2px;
  color: #8F7162; font-size: 9px; font-weight: 760; letter-spacing: 1.6px;
}
.settings-head h2 { margin: 0; font: 400 27px/1.1 Georgia, "Times New Roman", serif; }
.settings-close {
  width: 34px; height: 34px; flex: none;
  border: 1px solid rgba(255,255,255,.08); border-radius: 10px;
  background: #242220; color: #AAA39D; font: 21px/1 sans-serif; cursor: pointer;
}
.settings-layout { display: grid; grid-template-columns: 190px minmax(0, 1fr); min-height: 0; }
.settings-nav {
  display: flex; flex-direction: column; gap: 4px;
  padding: 4px 14px 4px 0;
  border-right: 1px solid rgba(255,255,255,.065);
}
.settings-nav button {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 10px 11px;
  border: 0; border-radius: 9px;
  background: transparent; color: #958F89;
  font: inherit; text-align: left; cursor: pointer;
}
.settings-nav button:hover { background: rgba(255,255,255,.035); color: #DCD6D0; }
.settings-nav button.on { background: #2C2A28; color: #F0EAE4; }
.settings-nav button span { width: 18px; text-align: center; color: #B98068; }
.settings-nav button b { font-size: 12.5px; font-weight: 560; }
.settings-content { min-height: 0; overflow-y: auto; padding: 3px 3px 3px 20px; }
.settings-content::-webkit-scrollbar { width: 4px; }
.settings-content::-webkit-scrollbar-thumb { border-radius: 5px; background: rgba(255,255,255,.1); }
.settings-panel { display: none; }
.settings-panel.on { display: block; }
.instructions-intro { margin: -3px 0 13px; color: #918B85; font-size: 12px; line-height: 1.5; }
.instructions-input {
  width: 100%; min-height: 230px; resize: vertical; padding: 15px 16px;
  border: 1px solid rgba(255,255,255,.11); border-radius: 13px;
  background: linear-gradient(145deg, rgba(39,37,35,.94), rgba(27,26,25,.96));
  color: #EEE8E2; font: 13px/1.55 inherit; outline: none;
  box-shadow: inset 0 1px rgba(255,255,255,.035), 0 12px 30px rgba(0,0,0,.14);
}
.instructions-input:focus { border-color: rgba(113,157,220,.72); box-shadow: 0 0 0 3px rgba(70,126,208,.11), inset 0 1px rgba(255,255,255,.04); }
.instructions-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 11px; }
.instructions-footer > span { color: #77726D; font-size: 10.5px; }
.instructions-footer > span.invalid { color: #D78476; }
.instructions-footer div { display: flex; gap: 8px; }
.instructions-footer button { padding: 8px 12px; border-radius: 9px; font: 600 11.5px/1 inherit; cursor: pointer; }
.instructions-secondary { border: 1px solid rgba(255,255,255,.09); background: transparent; color: #AAA49E; }
.instructions-primary { border: 1px solid rgba(255,255,255,.1); background: #E9E3DD; color: #171615; }
.instructions-primary:disabled { opacity: .42; cursor: default; }
.response-status-static { animation: responseStatusIn .32s ease-out both; }
.settings-panel-title {
  margin: 0 0 15px; color: #EDE7E1;
  font-size: 14px; font-weight: 640;
}
.settings-panel .group:last-child { margin-bottom: 0; }
.danger-row { color: #D6A398; }

@media (min-width: 900px) {
  :root { --app-sidebar: 268px; }
  body { --active-sidebar: var(--app-sidebar); }
  body.sidebar-closed { --active-sidebar: 0px; }
  .chat-drawer {
    z-index: 12;
    width: var(--app-sidebar);
    padding: 20px 12px 14px;
    background: #111110;
    box-shadow: none;
    transform: none !important;
  }
  body.sidebar-closed .chat-drawer { transform: translateX(-100%) !important; }
  .chat-drawer-scrim { display: none !important; }
  .chat-drawer-close { display: grid; }
  .chat-drawer-head { padding: 0 7px 18px; }
  .chat-drawer-head span { margin-bottom: 1px; color: #786B64; }
  .chat-drawer-head h2 { font-family: inherit; font-size: 18px; font-weight: 650; letter-spacing: -.2px; }
  .new-chat-button { min-height: 41px; margin-bottom: 11px; border: 0; border-radius: 9px; background: #2C2B2A; }
  .new-chat-button span { width: 23px; height: 23px; border-radius: 7px; background: transparent; }
  .topbar { margin-left: var(--active-sidebar); padding-right: 66px; transition: margin-left .3s var(--ease); }
  .top-actions { display: none; }
  .chat { margin-left: var(--active-sidebar); transition: margin-left .3s var(--ease), width .3s var(--ease); }
  .composer { left: calc(50% + (var(--active-sidebar) / 2)); transition: left .3s var(--ease), width .3s var(--ease); }
  .starters { left: calc(50% + (var(--active-sidebar) / 2)); transition: left .3s var(--ease); }
  .has-chat .composer {
    left: var(--active-sidebar); right: 0;
    width: auto; transform: none;
  }
  .canvas-view { top: 0; }
  .canvas-mode .canvas-view { right: 0; }
  .canvas-mode .chat { margin-left: var(--active-sidebar); width: calc(100% - var(--active-sidebar) - var(--result-panel)); }
  .canvas-mode.has-chat .composer {
    left: var(--active-sidebar);
    width: calc(100% - var(--active-sidebar) - var(--result-panel));
  }
  .canvas-mode:not(.has-chat) .composer,
  .canvas-mode:not(.has-chat) .starters {
    left: calc(var(--active-sidebar) + (100% - var(--active-sidebar) - var(--result-panel)) / 2);
  }
  .canvas-mode.canvas-collapsed .chat { width: calc(100% - var(--active-sidebar)); }
  .canvas-mode.canvas-collapsed.has-chat .composer { left: var(--active-sidebar); width: calc(100% - var(--active-sidebar)); }
  .canvas-mode.canvas-collapsed:not(.has-chat) .composer,
  .canvas-mode.canvas-collapsed:not(.has-chat) .starters {
    left: calc(var(--active-sidebar) + (100% - var(--active-sidebar)) / 2);
  }
  .sidebar-reopen {
    position: fixed; z-index: 18; top: calc(var(--top) + 12px); left: 12px;
    width: 38px; height: 38px; place-items: center;
    border: 1px solid rgba(255,255,255,.1); border-radius: 11px;
    background: #211F1D; color: #C8C1BA; cursor: pointer;
    box-shadow: 0 10px 28px rgba(0,0,0,.28);
    opacity: 0; visibility: hidden; transform: translateX(-8px);
    transition: opacity .2s, visibility .2s, transform .28s var(--ease), background .18s;
  }
  .sidebar-reopen svg { width: 19px; height: 19px; }
  .sidebar-reopen:hover { color: #F1EAE4; background: #2B2825; }
  body.sidebar-closed .sidebar-reopen { display: grid; opacity: 1; visibility: visible; transform: translateX(0); }
  body.sidebar-closed .brand { margin-left: 45px; }
  #sheet.sheet {
    top: 50%; left: 50%; right: auto; bottom: auto;
    width: min(860px, calc(100vw - 64px));
    height: min(650px, calc(100vh - 64px));
    max-height: none;
    padding: 18px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.09);
    border-radius: 16px;
    box-shadow: 0 30px 100px rgba(0,0,0,.58);
    transform: translate(-50%, -47%) scale(.985);
    opacity: 0; visibility: hidden;
    transition: transform .25s var(--ease), opacity .2s, visibility .2s;
  }
  #sheet.sheet.on { transform: translate(-50%, -50%) scale(1); opacity: 1; visibility: visible; }
  #sheet .sheet-grip { display: none; }
  #sheet .settings-layout { height: calc(100% - 67px); }
  #sheet .options { display: grid; grid-template-columns: 1fr 1fr; }
  #sheet .opt { min-height: 66px; }
}

@media (max-width: 899px) {
  .topbar { padding-right: 62px; }
  .top-actions .canvas-toggle:not(.chat-toggle) { display: none; }
  .chat-toggle span { display: none; }
  .chat-toggle { width: 36px; padding: 7px; justify-content: center; }
  .settings-layout { grid-template-columns: 1fr; }
  .settings-nav {
    flex-direction: row; padding: 0 0 12px; margin-bottom: 15px;
    border-right: 0; border-bottom: 1px solid rgba(255,255,255,.065);
  }
  .settings-nav button { justify-content: center; }
  .settings-content { padding: 0; overflow: visible; }
  .settings-head { margin-top: 0; }
}

/* Спокойный премиальный центр пустого чата без тяжёлой карточки. */
body:not(.has-chat) .hero-panel { isolation: isolate; }
body:not(.has-chat) .hero-panel::before {
  content: "" !important; display: block !important; position: absolute; z-index: -1;
  width: 320px; height: 190px; left: 50%; top: 49%; transform: translate(-50%, -50%);
  border-radius: 50%; pointer-events: none;
  background: radial-gradient(ellipse, rgba(222,133,96,.11), rgba(105,137,143,.04) 46%, transparent 73%);
  filter: blur(25px);
}
body:not(.has-chat) .hero-mark {
  box-shadow: 0 18px 48px rgba(225,116,75,.2), inset 0 1px rgba(255,255,255,.2);
}
body:not(.has-chat) .hero h1 { text-shadow: 0 1px 18px rgba(255,245,235,.09); letter-spacing: .015em; }

/* ─── Персональный интерфейс: план, фон, плотность и время суток ─── */
body { --plan-accent: #8F9296; --plan-soft: rgba(143,146,150,.13); --time-tint: rgba(148,151,155,.018); --plan-pattern: linear-gradient(transparent,transparent); }
body[data-plan="plus"] { --plan-accent: #6EA8FF; --plan-soft: rgba(73,132,218,.15); }
body[data-plan="pro"] { --plan-accent: #D9B45B; --plan-soft: rgba(217,180,91,.14); }
body[data-plan="plus"] { --plan-pattern: repeating-linear-gradient(90deg, transparent 0 54px, rgba(110,168,255,.012) 55px 56px); }
body[data-plan="pro"] { --plan-pattern: repeating-linear-gradient(135deg, transparent 0 72px, rgba(217,180,91,.012) 73px 74px); }
body.time-morning { --time-tint: rgba(165,165,160,.018); }
body.time-day { --time-tint: rgba(170,176,182,.012); }
body.time-evening { --time-tint: rgba(92,94,98,.025); }
body.time-night { --time-tint: rgba(70,73,80,.035); }

.chat {
  background-color: #151514;
  background-image: var(--plan-pattern), linear-gradient(var(--time-tint), var(--time-tint));
  transition: background-color .55s ease, background-image .55s ease;
}
body.time-evening .chat { background-color: #131313; }
body.time-night .chat { background-color: #111212; }
body[data-wallpaper="linen"] .chat {
  background-image:
    var(--plan-pattern), linear-gradient(var(--time-tint), var(--time-tint)),
    repeating-linear-gradient(0deg, rgba(255,255,255,.018) 0 1px, transparent 1px 4px),
    repeating-linear-gradient(90deg, rgba(255,255,255,.012) 0 1px, transparent 1px 5px);
}
body[data-wallpaper="contour"] .chat {
  background-image:
    var(--plan-pattern), linear-gradient(var(--time-tint), var(--time-tint)),
    radial-gradient(ellipse at 20% 16%, transparent 0 42px, rgba(255,255,255,.025) 43px 44px, transparent 45px 74px, rgba(255,255,255,.018) 75px 76px, transparent 77px),
    radial-gradient(ellipse at 82% 71%, transparent 0 55px, rgba(255,255,255,.023) 56px 57px, transparent 58px 94px, rgba(255,255,255,.016) 95px 96px, transparent 97px);
  background-size: auto, 240px 190px, 280px 220px;
}
body[data-wallpaper="dusk"] .chat {
  background-image:
    var(--plan-pattern),
    radial-gradient(80% 62% at 12% 100%, rgba(122,126,132,.075), transparent 68%),
    radial-gradient(70% 58% at 92% 0%, rgba(77,80,98,.065), transparent 68%),
    linear-gradient(var(--time-tint), var(--time-tint));
}

.header-plan-badge {
  min-width: 36px; padding: 3px 7px;
  border: 1px solid color-mix(in srgb, var(--plan-accent) 45%, transparent);
  border-radius: 999px; background: var(--plan-soft); color: var(--plan-accent);
  font-size: 9px; font-weight: 700; letter-spacing: .2px; text-align: center;
  animation: planBadgeIn .38s var(--ease) both;
}
@keyframes planBadgeIn { from { opacity: 0; transform: translateY(-3px) scale(.9); } }
body[data-plan="plus"] .credit-badge,
body[data-plan="pro"] .credit-badge { border-color: color-mix(in srgb, var(--plan-accent) 32%, transparent); }
body[data-plan="plus"] .brand-mark { box-shadow: 0 8px 24px rgba(74,132,218,.2); }
body[data-plan="pro"] .brand-mark { box-shadow: 0 8px 24px rgba(217,180,91,.22); }

.new-feature-badge {
  margin-left: auto; padding: 2px 5px; border-radius: 999px;
  background: #20374B; color: #86BAE6;
  font: normal 7.5px/1.35 inherit; letter-spacing: .45px;
}
.new-feature-badge[hidden] { display: none; }

.appearance-note { margin: -3px 0 11px; color: #85807A; font-size: 11px; }
.wallpaper-picker { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; }
.wallpaper-option {
  min-width: 0; padding: 5px; border: 1px solid rgba(255,255,255,.075); border-radius: 11px;
  background: #20201F; color: #9B9690; font: inherit; font-size: 9.5px; cursor: pointer;
}
.wallpaper-option i { display: block; height: 47px; margin-bottom: 5px; border-radius: 7px; background-color: #171716; }
.wallpaper-option.on { border-color: var(--plan-accent); color: #EEE8E2; box-shadow: 0 0 0 2px var(--plan-soft); }
.wallpaper-graphite i { background: #151514; }
.wallpaper-linen i { background: repeating-linear-gradient(0deg,#1C1C1B 0 1px,#171716 1px 4px); }
.wallpaper-contour i { background: radial-gradient(circle at 35% 45%,transparent 0 9px,#2F2E2C 10px 11px,transparent 12px 18px,#292826 19px 20px,transparent 21px),#171716; }
.wallpaper-dusk i { background: radial-gradient(circle at 10% 100%,#323437,transparent 60%),radial-gradient(circle at 100% 0%,#292B35,transparent 62%),#171716; }
.density-control {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 11px; padding: 9px 10px; border: 1px solid rgba(255,255,255,.07); border-radius: 10px;
  background: #20201F; color: #AAA59F; font-size: 11px;
}
.density-options { display: flex; padding: 2px; border-radius: 8px; background: #171716; }
.density-options button { padding: 5px 8px; border: 0; border-radius: 6px; background: transparent; color: #827D78; font: inherit; font-size: 9.5px; cursor: pointer; }
.density-options button.on { background: #343331; color: #F0EAE4; }

.profile-plan-card {
  display: flex; align-items: center; gap: 10px; margin-bottom: 13px; padding: 11px;
  border: 1px solid rgba(255,255,255,.08); border-radius: 12px; background: #20201F;
}
.profile-avatar { width: 35px; height: 35px; display: grid; place-items: center; border-radius: 11px; background: var(--plan-soft); color: var(--plan-accent); font-size: 14px; font-weight: 700; }
.profile-avatar.has-photo { background-color: #282725; background-position: center; background-size: cover; color: transparent; }
.profile-plan-card > span:nth-child(2) { min-width: 0; display: grid; }
.profile-plan-card b { overflow: hidden; color: #EDE8E2; font-size: 12.5px; text-overflow: ellipsis; white-space: nowrap; }
.profile-plan-card small { color: #85807A; font-size: 10px; }
.profile-plan-card em { margin-left: auto; padding: 3px 7px; border-radius: 999px; background: var(--plan-soft); color: var(--plan-accent); font-size: 9px; font-style: normal; font-weight: 700; }

.settings-referral-card {
  display: grid; grid-template-columns: 96px minmax(0,1fr); gap: 13px; margin-top: 13px; padding: 12px;
  border: 1px solid rgba(255,255,255,.08); border-radius: 13px;
  background: linear-gradient(135deg, rgba(255,255,255,.035), transparent), #1E1E1D;
}
.settings-referral-card img { width: 96px; height: 96px; padding: 5px; border-radius: 10px; background: #F1ECE6; object-fit: contain; }
.settings-referral-card img:not([src]) { opacity: .08; }
.settings-referral-copy { min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 4px; }
.settings-referral-copy b { color: #EDE8E2; font-size: 12.5px; }
.settings-referral-copy small { color: #8D8882; font-size: 9.5px; line-height: 1.35; }
.settings-referral-copy > span { overflow: hidden; color: #A9A49E; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.settings-referral-copy div { display: flex; gap: 6px; margin-top: 4px; }
.settings-referral-copy button { padding: 5px 9px; border: 1px solid rgba(255,255,255,.09); border-radius: 7px; background: #2B2A28; color: #D9D3CD; font: inherit; font-size: 9px; cursor: pointer; }

.memory-guide { grid-template-columns: 28px 1fr !important; align-items: center !important; justify-items: start !important; text-align: left !important; }
.memory-guide i { grid-row: 1 / 3; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 9px; background: var(--plan-soft); color: var(--plan-accent); font-style: normal; }
.memory-guide b { color: #CFC9C3; font-size: 11.5px; }
.memory-guide span { color: #817C77; font-size: 10px; line-height: 1.4; }

.roulette-ready .roulette-status-icon { background: rgba(91,151,112,.14); color: #8FC39F; }
.roulette-used .roulette-status-icon { background: rgba(255,255,255,.045); color: #75716D; }
.roulette-ready:hover .roulette-status-icon svg { animation: rouletteIconTurn .8s var(--ease); }
@keyframes rouletteIconTurn { to { transform: rotate(180deg); } }

.plan.current { position: relative; border-color: color-mix(in srgb, var(--plan-accent) 52%, transparent); box-shadow: 0 0 0 1px var(--plan-soft), 0 0 24px var(--plan-soft); }
.plan-plus.current { --plan-accent: #6EA8FF; --plan-soft: rgba(73,132,218,.15); }
.plan-pro.current { --plan-accent: #D9B45B; --plan-soft: rgba(217,180,91,.14); }
.plan-free.current { --plan-accent: #92969B; --plan-soft: rgba(143,146,150,.1); }
.plan.current-arrive .plan-name em { animation: currentPlanIn .55s var(--ease) both; }
@keyframes currentPlanIn { 0% { opacity: 0; transform: scale(.65); } 65% { transform: scale(1.08); } }

.model-trigger::before { content: ""; width: 6px; height: 6px; flex: none; border-radius: 50%; background: #8AAFEA; box-shadow: 0 0 9px rgba(112,167,255,.6); transition: background .25s, box-shadow .25s; }
.model-trigger[data-effort="medium"]::before { background: #B3A0E9; box-shadow: 0 0 9px rgba(179,160,233,.52); }
.model-trigger[data-effort="high"]::before { background: #9B7EE4; box-shadow: 0 0 10px rgba(155,126,228,.65); }
.model-trigger[data-effort="xhigh"]::before { background: #C29CFF; box-shadow: 0 0 12px rgba(194,156,255,.82); }

body.density-compact .chat { gap: 5px; padding-top: 12px; }
body.density-compact .msg { font-size: 13.8px; }
body.density-compact .msg.me { padding: 7px 11px; }
body.density-compact .msg.ai { padding-top: 4px; padding-bottom: 7px; line-height: 1.52; }
body.density-compact .chat-item { min-height: 45px; padding-top: 7px; padding-bottom: 7px; }
body.density-compact .row { padding-top: 9px; padding-bottom: 9px; }
body.density-compact .has-chat .composer { padding-top: 5px; padding-bottom: calc(var(--bottom) + 6px); }

@media (max-width: 560px) {
  .header-plan-badge { min-width: 31px; padding: 2px 5px; font-size: 7.5px; }
  .brand-text small { display: none; }
  .wallpaper-picker { grid-template-columns: repeat(2, 1fr); }
  .settings-referral-card { grid-template-columns: 74px minmax(0,1fr); }
  .settings-referral-card img { width: 74px; height: 74px; }
  .density-control { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 430px) {
  .brand { gap: 8px; }
  .brand-mark { width: 33px; height: 33px; }
  .credit-badge { padding: 4px 6px; }
  .settings-nav button { padding: 9px 7px; }
  .settings-nav button span { display: none; }
  .settings-nav button b { font-size: 11.5px; }
}

/* ─── Typography, navigation labels and live chat status ─── */
body[data-font="humanist"] { font-family: Inter, "Segoe UI", Arial, sans-serif; }
body[data-font="mono"] { font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; }
body[data-font="classic"] { font-family: Georgia, "Times New Roman", serif; }
body[data-font="classic"] textarea,
body[data-font="classic"] button,
body[data-font="classic"] input { font-family: Georgia, "Times New Roman", serif; }
.font-control .density-options { flex-wrap: wrap; justify-content: flex-end; }

.chat-item[data-label]:not([data-label="none"])::before {
  content: ""; align-self: stretch; width: 3px; flex: none; margin: 6px 1px 6px 3px; border-radius: 5px;
  background: var(--chat-label); box-shadow: 0 0 10px color-mix(in srgb, var(--chat-label) 35%, transparent);
}
.chat-item[data-label="red"] { --chat-label: #C66D70; }
.chat-item[data-label="orange"] { --chat-label: #CC8B5A; }
.chat-item[data-label="green"] { --chat-label: #67A77B; }
.chat-item[data-label="blue"] { --chat-label: #6396D8; }
.chat-item[data-label="purple"] { --chat-label: #9A7DCF; }
.color-chat svg { width: 15px; height: 15px; }

.chat-minimap {
  position: fixed; z-index: 11; top: 86px; right: 8px; bottom: 118px; width: 25px;
  border-left: 1px solid rgba(255,255,255,.055); opacity: .58; cursor: pointer;
  transition: opacity .2s, width .2s;
}
.chat-minimap:hover { width: 31px; opacity: 1; }
.chat-minimap > div { position: absolute; inset: 0; }
.chat-minimap > div i { position: absolute; right: 3px; width: 12px; min-height: 2px; border-radius: 2px; background: #696A66; transition: width .16s, background .16s; }
.chat-minimap > div i.me { width: 8px; background: color-mix(in srgb, var(--plan-accent) 72%, #777); }
.chat-minimap:hover > div i { width: 17px; background: #8A8A86; }
.chat-minimap:hover > div i.me { width: 12px; background: var(--plan-accent); }
.chat-minimap > i { position: absolute; right: 0; left: 1px; min-height: 14px; border-left: 2px solid #D5D2CC; border-radius: 2px; background: rgba(255,255,255,.055); box-shadow: 0 0 12px rgba(255,255,255,.07); pointer-events: none; }
.chat-minimap-preview {
  position: absolute; right: 35px; width: min(320px, 52vw); max-height: 84px; overflow: hidden;
  padding: 10px 12px; border: 1px solid rgba(255,255,255,.1); border-radius: 11px;
  background: rgba(29,29,28,.96); color: #D5D1CB; box-shadow: 0 12px 34px rgba(0,0,0,.38);
  backdrop-filter: blur(18px); font-size: 11px; line-height: 1.45; text-align: left; pointer-events: none;
}
.chat-minimap-preview.me { border-color: color-mix(in srgb, var(--plan-accent) 30%, rgba(255,255,255,.1)); }

/* Одинаковая геометрия пустого и активного чата. */
.has-chat .composer {
  left: 50%; right: auto; bottom: calc(var(--bottom) + 8px);
  width: min(calc(100% - 32px), 768px);
  padding: 0; transform: translateX(-50%);
  background: transparent; border: 0;
}
.has-chat .composer-inner {
  min-height: 0; padding: 7px 8px 7px 12px;
  border: 1px solid rgba(211,163,124,.17); border-radius: 17px;
  background: rgba(30,29,27,.9); backdrop-filter: blur(18px);
}
.has-chat #input { min-height: 30px; padding: 6px 2px; }
.has-chat .chat { padding: 82px max(18px, calc((100% - 900px) / 2)) 96px; }
.has-chat #chat > .msg.ai { width: min(100%, var(--chat-content-width)); margin-right: auto; }
.has-chat #chat > .msg.me { margin-left: auto; }

/* Мини-карта истории: спокойная линейка слева с карточкой предпросмотра. */
.chat-minimap {
  left: 10px; right: auto; top: 78px; bottom: 106px; width: 34px;
  border: 0; opacity: .7; transition: opacity .2s ease, width .2s ease;
}
.chat-minimap::before {
  content: ""; position: absolute; left: 9px; top: 0; bottom: 0; width: 6px;
  background: repeating-linear-gradient(to bottom, rgba(199,199,194,.3) 0 2px, transparent 2px 10px);
  mask-image: linear-gradient(to bottom, transparent, #000 3%, #000 97%, transparent);
}
.chat-minimap:hover { width: 40px; opacity: 1; }
.chat-minimap > div i {
  display: none;
}
.chat-minimap > i {
  left: 7px; right: auto; width: 18px; height: 3px !important; min-height: 3px;
  border: 0; border-radius: 2px; background: #E2E0DA;
  box-shadow: 0 0 9px rgba(255,255,255,.17);
}
.chat-minimap-preview {
  left: 43px; right: auto; width: min(320px, 48vw); max-height: 96px;
  padding: 11px 13px; border-color: rgba(255,255,255,.075); border-radius: 13px;
  background: rgba(29,29,28,.88); backdrop-filter: blur(22px) saturate(115%);
  box-shadow: 0 14px 38px rgba(0,0,0,.42), inset 0 1px rgba(255,255,255,.025);
}

@media (min-width: 761px) {
  .has-chat .composer {
    left: calc(var(--active-sidebar) + (100% - var(--active-sidebar)) / 2);
  }
  .has-chat .chat {
    padding-left: max(44px, calc((100% - var(--active-sidebar) - 900px) / 2));
    padding-right: max(18px, calc((100% - var(--active-sidebar) - 900px) / 2));
  }
  .chat-minimap { left: calc(var(--active-sidebar) + 9px); }
  .canvas-mode.has-chat .composer {
    left: calc(var(--active-sidebar) + (100% - var(--active-sidebar) - var(--result-panel)) / 2);
    width: min(calc(100% - var(--active-sidebar) - var(--result-panel) - 32px), 768px);
  }
  .canvas-mode.canvas-collapsed.has-chat .composer {
    left: calc(var(--active-sidebar) + (100% - var(--active-sidebar)) / 2);
    width: min(calc(100% - var(--active-sidebar) - 32px), 768px);
  }
}

@media (max-width: 760px) {
  .chat-minimap { left: 3px; width: 25px; }
  .chat-minimap-preview { left: 31px; width: min(300px, calc(100vw - 44px)); }
}

.floating-plan-status {
  position: fixed; z-index: 15; top: calc(var(--top) + 64px); right: 20px; min-width: 112px;
  display: grid; gap: 5px; padding: 7px 9px; border: 1px solid color-mix(in srgb, var(--plan-accent) 32%, rgba(255,255,255,.08));
  border-radius: 10px; background: rgba(25,25,24,.86); color: #D9D5D0; backdrop-filter: blur(16px);
  box-shadow: 0 10px 28px rgba(0,0,0,.28); font: inherit; text-align: left; cursor: pointer;
  animation: floatStatusIn .25s var(--ease) both;
}
.floating-plan-status span { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.floating-plan-status b { color: var(--plan-accent); font-size: 9px; }
.floating-plan-status small { font-size: 8px; color: #8E8B87; }
.floating-plan-status > i { height: 2px; border-radius: 3px; background: linear-gradient(90deg, var(--balance-color) var(--balance), rgba(255,255,255,.07) var(--balance)); }
@keyframes floatStatusIn { from { opacity: 0; transform: translateY(-5px); } }

body { --balance-color: #67A77B; }
body[data-balance="warn"] { --balance-color: #C9A558; }
body[data-balance="low"] { --balance-color: #C76565; }
.credit-badge { position: relative; overflow: hidden; }
.credit-badge::after { content: ""; position: absolute; right: 0; bottom: 0; left: 0; height: 2px; background: linear-gradient(90deg, var(--balance-color) var(--balance), transparent var(--balance)); transition: background .35s; }
.credits-half { animation: halfCreditPulse .6s var(--ease) !important; }
@keyframes halfCreditPulse { 35% { transform: scale(.86, .96); color: var(--balance-color); } 70% { transform: scale(1.04); } }

.response-effort-badge {
  display: inline-flex; align-items: center; gap: 3px; width: max-content; margin: 0 0 5px;
  padding: 2px 5px; border: 1px solid rgba(255,255,255,.055); border-radius: 999px;
  color: #7E8FA6; background: rgba(87,115,148,.07); font-size: 8px; line-height: 1.2;
}
.response-effort-badge.max { color: #A996D7; background: rgba(145,119,197,.07); }
.memory-guide i { width: 46px; height: 46px; border-radius: 14px; }
.memory-guide i svg { width: 36px; height: 36px; }

.plan { transform: perspective(700px) rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg)); transform-style: preserve-3d; transition: transform .18s ease, border-color .4s, background .4s, box-shadow .4s; overflow: hidden; isolation: isolate; }
.plan > * { position: relative; z-index: 2; }
.plan-pro::before {
  content: ""; position: absolute; z-index: 0; inset: -180%; opacity: 0; pointer-events: none;
  background: conic-gradient(from 0deg, transparent 0 43%, rgba(238,204,116,.68) 49%, transparent 55% 100%);
}
.plan-pro:hover::before, .plan-pro.current::before { opacity: .72; animation: proShimmer 4.2s linear infinite; }
.plan-pro::after { content: ""; position: absolute; z-index: 1; inset: 1px; border-radius: inherit; background: #242423; pointer-events: none; }
@keyframes proShimmer { to { transform: rotate(360deg); } }

.model-menu { border-color: rgba(255,255,255,.105); background: #1D1D1C; }
.model-menu-list { padding-bottom: 7px; border-bottom: 1px solid rgba(255,255,255,.065); }
.model-option { background: transparent !important; border-color: transparent !important; }
.model-option.on { background: #282827 !important; }
.thinking-control { margin-top: 7px; background: #20201F; }
.thinking-dots i.locked { opacity: .2; }

@media (max-width: 700px) {
  .chat-minimap { right: 3px; width: 12px; }
  .floating-plan-status { right: 11px; min-width: 96px; }
}

/* ─── Быстрые действия, компактная панель и управляемые анимации ─── */
.top-actions { margin-left: auto; }
.quick-actions-trigger {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 34px; padding: 6px 10px;
  border: 1px solid rgba(255,255,255,.09); border-radius: 10px;
  background: #242220; color: #D8D2CC;
  font: inherit; font-size: 12px; cursor: pointer;
  transition: background .18s, border-color .18s, transform .18s var(--ease);
}
.quick-actions-trigger:hover { border-color: rgba(255,255,255,.16); background: #302D2A; }
.quick-actions-trigger:active { transform: scale(.96); }
.quick-actions-trigger svg { width: 16px; height: 16px; color: #D78A6C; }
.quick-actions-trigger kbd {
  padding: 2px 5px; border: 1px solid rgba(255,255,255,.09); border-radius: 5px;
  color: #87817B; background: #1A1917; font: 9px/1.2 ui-monospace, monospace;
}
.action-hub-scrim {
  position: fixed; z-index: 76; inset: 0;
  background: rgba(5,5,5,.72);
  opacity: 0; visibility: hidden;
  transition: opacity .25s, visibility .25s;
}
.action-hub-scrim.on { opacity: 1; visibility: visible; }
.action-hub {
  position: fixed; z-index: 77;
  top: 50%; left: 50%;
  width: min(680px, calc(100vw - 32px));
  padding: 25px;
  border: 1px solid rgba(255,255,255,.11); border-radius: 20px;
  background:
    radial-gradient(70% 60% at 50% 0%, rgba(217,119,87,.09), transparent 74%),
    #191816;
  box-shadow: 0 34px 110px rgba(0,0,0,.62);
  opacity: 0; visibility: hidden; pointer-events: none;
  transform: translate(-50%, -46%) scale(.9);
  transition: opacity .24s, visibility .24s, transform .38s var(--ease);
}
.action-hub.on {
  opacity: 1; visibility: visible; pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}
.action-hub-close {
  position: absolute; top: 15px; right: 15px;
  width: 34px; height: 34px;
  border: 1px solid rgba(255,255,255,.09); border-radius: 50%;
  background: #282624; color: #B9B2AC; font: 20px/1 sans-serif; cursor: pointer;
  transition: transform .18s var(--ease), background .18s;
}
.action-hub-close:hover { background: #35322F; transform: rotate(6deg); }
.action-hub-mark {
  width: 48px; height: 48px; margin: 0 auto 8px;
  color: #D97757;
  transform: rotate(-45deg) scale(.6);
  opacity: 0;
}
.action-hub-mark svg { display: block; width: 100%; height: 100%; }
.action-hub.on .action-hub-mark { animation: hubMarkIn .62s var(--ease) .05s forwards; }
@keyframes hubMarkIn { to { opacity: 1; transform: rotate(0) scale(1); } }
.action-hub-kicker {
  display: block; color: #8F7162;
  font-size: 8.5px; font-weight: 760; letter-spacing: 1.5px; text-align: center;
}
.action-hub h2 {
  margin: 3px 0 20px; color: #F0EBE5;
  font: 400 29px/1.2 Georgia, "Times New Roman", serif; text-align: center;
}
.action-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.action-grid button {
  display: grid; grid-template-columns: 34px minmax(0,1fr);
  grid-template-rows: auto auto; column-gap: 10px;
  align-items: center;
  min-height: 76px; padding: 11px;
  border: 1px solid rgba(255,255,255,.075); border-radius: 12px;
  background: #22201E; color: #EAE4DE;
  font: inherit; text-align: left; cursor: pointer;
  opacity: 0; transform: translateY(10px);
  transition: border-color .18s, background .18s, transform .18s var(--ease);
}
.action-hub.on .action-grid button { animation: hubItemIn .38s var(--ease) forwards; }
.action-hub.on .action-grid button:nth-child(1) { animation-delay: .12s; }
.action-hub.on .action-grid button:nth-child(2) { animation-delay: .16s; }
.action-hub.on .action-grid button:nth-child(3) { animation-delay: .20s; }
.action-hub.on .action-grid button:nth-child(4) { animation-delay: .24s; }
.action-hub.on .action-grid button:nth-child(5) { animation-delay: .28s; }
.action-hub.on .action-grid button:nth-child(6) { animation-delay: .32s; }
@keyframes hubItemIn { to { opacity: 1; transform: translateY(0); } }
.action-grid button:hover { border-color: rgba(217,119,87,.32); background: #2B2825; transform: translateY(-2px); }
.action-grid button > span {
  grid-row: 1 / 3;
  width: 34px; height: 34px; display: grid; place-items: center;
  border-radius: 9px; background: #302C29; color: #E09172; font-size: 17px;
}
.action-grid button b { overflow: hidden; font-size: 12.5px; font-weight: 590; text-overflow: ellipsis; white-space: nowrap; }
.action-grid button small { overflow: hidden; color: #88817B; font-size: 10.5px; text-overflow: ellipsis; white-space: nowrap; }
.action-hub-hint {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  margin-top: 16px; color: #77716C; font-size: 10.5px;
}
.action-hub-hint kbd { padding: 2px 6px; border: 1px solid rgba(255,255,255,.1); border-radius: 5px; background: #22201E; }

@media (max-width: 899px) {
  .quick-actions-trigger { width: 36px; padding: 7px; justify-content: center; }
  .quick-actions-trigger span, .quick-actions-trigger kbd { display: none; }
  .action-hub { padding: 22px 14px 17px; }
  .action-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 430px) {
  .action-hub { width: calc(100vw - 20px); }
  .action-hub h2 { margin-bottom: 15px; font-size: 25px; }
  .action-grid button { min-height: 68px; padding: 9px; }
  .action-grid button small { display: none; }
}

/* ─── Выбор модели в поле ввода ─── */
.model-control { position: relative; z-index: 12; margin-left: auto; }
.model-control ~ .send { margin-left: 0; }
.model-trigger {
  display: inline-flex; align-items: center; gap: 5px;
  min-height: 32px; max-width: 190px; padding: 6px 8px;
  border: 0; border-radius: 9px;
  background: #302E2C; color: #EEE8E2;
  font: inherit; cursor: pointer;
  transition: background .18s, transform .18s var(--ease);
}
.model-trigger:hover { background: #3A3734; }
.model-trigger:active { transform: scale(.97); }
.model-trigger span { overflow: hidden; font-size: 11.5px; text-overflow: ellipsis; white-space: nowrap; }
.model-trigger small { color: #928B84; font-size: 10px; white-space: nowrap; }
.model-trigger .model-ai-badge {
  position: relative; width: 23px; height: 18px; flex: 0 0 23px;
  display: inline-flex; align-items: center; justify-content: center; gap: 0; overflow: visible;
  border: 0; border-radius: 0; background: transparent;
  color: #EEECEA; box-shadow: none;
  font-family: Arial, Helvetica, sans-serif; font-size: 15px; font-weight: 900;
  line-height: 1; letter-spacing: -2.4px; text-overflow: clip;
}
.model-trigger .model-ai-badge b,
.model-trigger .model-ai-badge i { font: inherit; color: inherit; }
.model-trigger .model-ai-badge b { transform: scaleX(1.04); }
.model-trigger .model-ai-badge i { margin-left: 2px; font-style: normal; transform: skewX(18deg); }
.model-trigger .model-ai-badge::after { display: none; }
.model-trigger svg { width: 14px; height: 14px; flex: none; transition: transform .2s var(--ease); }
.model-trigger[aria-expanded="true"] svg { transform: rotate(180deg); }
.model-menu {
  position: absolute; z-index: 40; right: 0; bottom: calc(100% + 10px);
  width: 250px; padding: 0;
  border: 0; border-radius: 14px;
  background: transparent;
  box-shadow: 0 18px 48px rgba(0,0,0,.52);
  opacity: 0; visibility: hidden; pointer-events: none;
  transform: translateY(7px) scale(.98);
  transform-origin: bottom right;
  transition: opacity .18s, visibility .18s, transform .22s var(--ease);
}
.model-menu.on { opacity: 1; visibility: visible; pointer-events: auto; transform: translateY(0) scale(1); }
.model-menu-list {
  display: grid; gap: 2px; padding: 6px;
  border: 1px solid rgba(255,255,255,.13); border-radius: 13px;
  background: #1F1F1E;
}
.model-option, .effort-option {
  display: grid; grid-template-columns: minmax(0,1fr) 18px;
  align-items: center; gap: 8px;
  width: 100%; padding: 8px 9px;
  border: 0; border-radius: 8px; background: transparent; color: #E9E3DD;
  font: inherit; text-align: left; cursor: pointer;
}
.model-option:hover, .effort-option:hover { background: #2B2927; }
.model-option > span, .effort-option > span { min-width: 0; }
.model-option b, .model-option small, .effort-option b, .effort-option small { display: block; }
.model-option .model-credit-rate {
  margin-top: 3px;
  color: #c7a89c;
  font-size: 9.5px;
  letter-spacing: .01em;
}
.model-option b, .effort-option b { font-size: 12.5px; font-weight: 570; }
.model-option small, .effort-option small {
  overflow: hidden; margin-top: 1px; color: #8E8882;
  font-size: 10.5px; text-overflow: ellipsis; white-space: nowrap;
}
.model-option > i, .effort-option > i { color: #D98061; font: normal 13px/1 inherit; opacity: 0; }
.model-option.on > i, .effort-option.on > i { opacity: 1; }
.thinking-control {
  width: 100%; margin-top: 6px; padding: 10px 10px 11px;
  border: 1px solid rgba(255,255,255,.13); border-radius: 14px;
  background: #1F1F1E;
}
.thinking-head {
  display: flex; align-items: center; gap: 5px;
  color: #AAA6A1; font-size: 11.5px;
}
.thinking-head b { color: #C8C4BF; font-size: 11.5px; font-weight: 450; }
.thinking-scale-labels {
  display: flex; justify-content: space-between;
  margin: 11px 1px 6px; color: #99948E; font-size: 10.5px;
}
.thinking-range-wrap { position: relative; height: 20px; }
.thinking-range-wrap input {
  --effort-progress: 50%;
  --effort-thumb: #B9B9B4;
  position: absolute; z-index: 2; inset: 0;
  width: 100%; height: 20px; margin: 0;
  appearance: none; -webkit-appearance: none;
  outline: none; background: transparent; cursor: pointer;
}
.thinking-range-wrap input::-webkit-slider-runnable-track {
  height: 20px; border-radius: 6px;
  background: linear-gradient(90deg, #50504E 0 var(--effort-progress), #2A2928 var(--effort-progress) 100%);
}
.thinking-range-wrap input::-webkit-slider-thumb {
  width: 16px; height: 20px; margin-top: 0;
  appearance: none; -webkit-appearance: none;
  border: 0; border-radius: 6px; background: var(--effort-thumb);
  box-shadow: 0 1px 6px rgba(0,0,0,.32);
}
.thinking-range-wrap input::-moz-range-track { height: 20px; border: 0; border-radius: 6px; background: #2A2928; }
.thinking-range-wrap input::-moz-range-progress { height: 20px; border-radius: 6px; background: #50504E; }
.thinking-range-wrap input::-moz-range-thumb { width: 16px; height: 20px; border: 0; border-radius: 6px; background: var(--effort-thumb); }
.thinking-dots {
  position: absolute; z-index: 3; inset: 9px 8px auto;
  display: flex; justify-content: space-between; pointer-events: none;
}
.thinking-dots i { width: 3px; height: 3px; border-radius: 50%; background: #77716B; }
.thinking-dots i.selected { opacity: 0; }
.thinking-dots i:last-child { background: #8261D6; box-shadow: 0 0 7px rgba(130,97,214,.7); }
.model-submenu-trigger {
  display: grid; grid-template-columns: minmax(0,1fr) auto 14px;
  align-items: center; gap: 7px;
  width: 100%; min-height: 36px; padding: 7px 9px;
  border: 0; border-radius: 8px; background: transparent; color: #E3DDD7;
  font: inherit; font-size: 12px; text-align: left; cursor: pointer;
}
.model-submenu-trigger:hover { background: #302E2C; }
.model-submenu-trigger b { color: #918A83; font-size: 10.5px; font-weight: 450; }
.model-submenu-trigger i { color: #827B74; font: normal 18px/1 inherit; }
.model-submenu {
  position: absolute; left: calc(100% + 8px);
  width: 270px; padding: 7px;
  border: 1px solid rgba(255,255,255,.11); border-radius: 13px;
  background: #1D1C1A; box-shadow: 0 20px 55px rgba(0,0,0,.48);
  opacity: 0; visibility: hidden; pointer-events: none;
  transform: translateX(-5px);
  transition: opacity .16s, visibility .16s, transform .2s var(--ease);
}
.model-submenu.on { opacity: 1; visibility: visible; pointer-events: auto; transform: translateX(0); }
.effort-submenu { bottom: 34px; }

@media (min-width: 900px) {
  #sheet.sheet { height: min(510px, calc(100vh - 64px)); }
}

@media (max-width: 680px) {
  .model-trigger { max-width: 116px; }
  .model-trigger span { max-width: 64px; }
  .model-trigger small { display: none; }
  .model-menu { position: fixed; right: 10px; bottom: calc(var(--bottom) + 82px); width: min(250px, calc(100vw - 20px)); }
  .model-submenu {
    left: 7px; right: 7px; bottom: 7px; width: auto;
    max-height: calc(100% - 14px); overflow-y: auto;
    transform: translateY(6px);
  }
  .model-submenu.on { transform: translateY(0); }
}

@media (max-width: 390px) {
  #fsBtn { display: none; }
  .model-trigger { max-width: 96px; padding-left: 7px; padding-right: 6px; }
  .model-trigger span { max-width: 58px; }
}

/* ─── Стартовый рабочий экран: свободный центр и нижняя консоль ─── */
.launch-context, .launch-manual { display: none; }
body:not(.has-chat) { background: #151515; }

body:not(.has-chat) .hero {
  width: min(100%, 760px);
  margin: 0 auto;
  padding: clamp(30px, 6vh, 68px) 12px 0;
  text-align: center;
}
body:not(.has-chat) .hero-panel {
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
body:not(.has-chat) .hero-mark {
  width: 24px; height: 24px; margin: 0;
  color: #D97757;
}
body:not(.has-chat) .hero-mark svg { width: 23px; height: 23px; }
body:not(.has-chat) .hero h1 {
  margin: 0; font-family: inherit;
  font-size: clamp(17px, 2vw, 20px); font-weight: 430;
  letter-spacing: -.25px;
}
body:not(.has-chat) .hero p,
body:not(.has-chat) .starters { display: none; }

body:not(.has-chat) .composer {
  top: auto; bottom: calc(var(--bottom) + 46px);
  width: min(calc(100% - 32px), 768px);
}
body:not(.has-chat) .launch-context {
  display: flex; align-items: center; gap: 6px;
  margin: 0 0 7px;
}
.launch-context button {
  min-height: 27px; padding: 4px 8px;
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid rgba(255,255,255,.08); border-radius: 7px;
  background: #292928; color: #C8C4BF;
  font: inherit; font-size: 11px; cursor: pointer;
}
.launch-context button:hover { background: #333331; color: #EEE9E3; }
.launch-context button svg { width: 14px; height: 14px; }
.launch-context .launch-icon { width: 28px; padding: 5px; justify-content: center; }

body:not(.has-chat) .composer-inner {
  min-height: 46px; padding: 4px 48px 4px 10px;
  flex-wrap: wrap; align-items: center; gap: 4px;
  border: 1px solid rgba(255,255,255,.12); border-radius: 10px;
  background: #232322; box-shadow: 0 12px 30px rgba(0,0,0,.22);
}
body:not(.has-chat) .composer-inner:focus-within { border-color: rgba(255,255,255,.2); }
body:not(.has-chat) #input {
  order: -2; flex-basis: 100%; min-height: 36px;
  padding: 7px 4px; font-size: 13px;
}
body:not(.has-chat) .send {
  position: absolute; top: 6px; right: 7px;
  width: 34px; height: 34px; border-radius: 8px;
  background: transparent; color: #8D8984;
}
body:not(.has-chat) .send:not(:disabled) { color: #E2DDD7; background: #353432; }
body:not(.has-chat) .launch-manual {
  position: absolute; left: 2px; bottom: -34px;
  display: inline-flex; align-items: center; gap: 10px;
  padding: 4px 5px; border: 0; background: transparent;
  color: #D3CEC8; font: inherit; font-size: 11.5px; cursor: pointer;
}
body:not(.has-chat) .launch-manual b { font-size: 16px; font-weight: 400; }
.agent-mode-menu {
  position: absolute; z-index: 45; left: 0; bottom: 42px; width: min(292px, calc(100vw - 30px));
  display: grid; gap: 1px; padding: 7px;
  border: 1px solid rgba(255,255,255,.11); border-radius: 12px;
  background: rgba(29,29,28,.98); box-shadow: 0 18px 48px rgba(0,0,0,.48);
  opacity: 0; visibility: hidden; pointer-events: none;
  transform: translateY(6px) scale(.985); transform-origin: left bottom;
  transition: opacity .15s ease, visibility .15s, transform .2s var(--ease);
}
.agent-mode-menu.on { opacity: 1; visibility: visible; pointer-events: auto; transform: none; }
.agent-mode-option {
  width: 100%; min-height: 46px; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 7px 8px; border: 0; border-radius: 8px; background: transparent; color: #E5E0DA;
  font: inherit; text-align: left; cursor: pointer;
}
.agent-mode-option:hover, .agent-mode-option.on { background: #292927; }
.agent-mode-option span { min-width: 0; display: grid; gap: 2px; }
.agent-mode-option b { font-size: 12px; font-weight: 520; }
.agent-mode-option small { color: #89847E; font-size: 9.5px; line-height: 1.3; }
.agent-mode-option i { flex: none; color: #8C8781; font: normal 10px/1 ui-monospace, monospace; }
.agent-mode-option.on i { color: #6EA4F0; font-size: 13px; }
.provider-head { display: flex; align-items: center; gap: 12px; margin: 4px 0 16px; }
.provider-head .row-ic { width: 42px; height: 42px; border-radius: 12px; background: #252A31; color: #76A7E8; font-size: 22px; }
.provider-head h2 { margin: 0; font: 22px/1.1 var(--serif); }
.provider-head p { margin: 5px 0 0; color: #88847E; font-size: 10px; }
.provider-lock { padding: 22px; border: 1px solid rgba(255,255,255,.08); border-radius: 13px; background: #20201F; color: #A9A49E; text-align: center; }
.provider-content { display: grid; gap: 14px; }
.provider-content[hidden], .provider-lock[hidden] { display: none !important; }
.provider-content label { display: grid; gap: 6px; color: #98938D; font-size: 10px; }
.provider-content input, .provider-content textarea {
  width: 100%; padding: 10px 11px; border: 1px solid rgba(255,255,255,.09); border-radius: 9px;
  background: #20201F; color: #DCD7D1; font: 10px/1.45 ui-monospace, monospace; resize: none;
}
.provider-key-line, .provider-actions { display: flex; gap: 7px; }
.provider-key-line input { min-width: 0; }
.provider-key-line button, .provider-actions button, #providerCopyConfig { white-space: nowrap; }
.provider-warning { margin: 0; color: #817C76; font-size: 9px; line-height: 1.45; }
body:not(.has-chat) .composer-inner > .icon-btn { position: absolute; bottom: -34px; }
body:not(.has-chat) #fsBtn, body:not(.has-chat) #settingsBtn { display: none; }
body:not(.has-chat) #attachBtn { left: 78px; }
body:not(.has-chat) #cameraBtn { left: 110px; }
body:not(.has-chat) #voiceBtn { left: 142px; }
body:not(.has-chat) .composer-inner > .icon-btn {
  width: 28px; height: 28px; color: #8F8B86;
}
body:not(.has-chat) .model-control {
  position: absolute; right: 0; bottom: -33px; margin: 0;
}
body:not(.has-chat) .model-trigger {
  min-height: 28px; padding: 4px 7px;
  background: transparent; color: #D5D0CA;
}
body:not(.has-chat) .model-trigger:hover { background: #292927; }
body:not(.has-chat) .attachment-tray.on {
  order: -3; flex-basis: 100%; padding-top: 3px;
}

@media (min-width: 900px) {
  body:not(.has-chat) .topbar { display: none; }
  body:not(.has-chat) .chat { min-height: 100vh; }
}

@media (max-width: 680px) {
  body:not(.has-chat) .hero { padding-top: 38px; }
  body:not(.has-chat) .composer { bottom: calc(var(--bottom) + 54px); }
  body:not(.has-chat) .launch-context { overflow-x: auto; scrollbar-width: none; }
  body:not(.has-chat) .launch-context::-webkit-scrollbar { display: none; }
  body:not(.has-chat) #attachBtn { left: 75px; }
  body:not(.has-chat) #cameraBtn { left: 105px; }
  body:not(.has-chat) #voiceBtn { left: 135px; }
}

/* ─── Компактная боковая навигация ─── */
body:not(.has-chat) .hero { display: none; }
.drawer-hidden-heading { display: none; }
#drawerNavWorkspace { display: none; }
#drawerNavChats { grid-column: 1 / -1; justify-content: flex-start; padding-left: 10px; }
.drawer-toolbar {
  display: flex; align-items: center; gap: 5px;
  min-height: 34px; margin: 0 0 12px; padding: 0 1px;
}
.drawer-toolbar button,
.drawer-toolbar-logo {
  width: 31px; height: 31px; flex: none;
  display: grid; place-items: center;
  border: 0; border-radius: 8px;
  background: transparent; color: #AAA6A1;
}
.drawer-toolbar button { font: inherit; cursor: pointer; }
.drawer-toolbar button:hover { background: #272726; color: #EEEAE5; }
.drawer-toolbar button:active { transform: scale(.93); }
.drawer-toolbar svg { width: 16px; height: 16px; }
.drawer-toolbar-logo {
  color: #E8E3DE; background: #292928;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.08);
}
.drawer-toolbar .drawer-tool:nth-last-child(2) { margin-left: auto; }
.drawer-search {
  align-items: center; gap: 8px;
  margin: -3px 0 10px; padding: 0 9px;
  min-height: 36px;
  border: 1px solid rgba(255,255,255,.09); border-radius: 8px;
  background: #1C1C1B;
}
.drawer-search:not([hidden]) { display: flex; }
.drawer-search svg { width: 15px; height: 15px; color: #76726E; }
.drawer-search input {
  width: 100%; min-width: 0; padding: 8px 0;
  border: 0; outline: 0; background: transparent; color: #E5E1DC;
  font: inherit; font-size: 12px;
}
.drawer-search input::placeholder { color: #716D69; }

.sidebar-collapsed-tools { display: none; }

@media (min-width: 900px) {
  :root { --app-sidebar: 286px; }
  .chat-drawer {
    padding: 9px 8px 13px;
    border-right-color: rgba(255,255,255,.075);
    background: #121212;
  }
  .chat-drawer-head { display: none; }
  .chat-drawer-close {
    display: grid; width: 31px; height: 31px;
    border: 0; border-radius: 8px; background: transparent; box-shadow: none;
  }
  .drawer-nav {
    grid-template-columns: 1fr 1fr; gap: 4px;
    margin: 0 0 8px; padding: 0; border: 0;
  }
  .drawer-nav-item {
    display: flex; justify-content: center; gap: 7px;
    min-height: 32px; padding: 6px 8px;
    border-radius: 7px; color: #96928E; font-size: 11.5px;
  }
  .drawer-nav-item svg { width: 14px; height: 14px; }
  .drawer-nav-item.on { background: #30302F; color: #F1ECE7; }
  .drawer-nav-item:nth-child(3) {
    grid-column: 1 / -1; justify-content: flex-start;
    margin-top: 1px; padding-left: 10px;
  }
  .new-chat-button {
    min-height: 34px; margin: 0 0 17px; padding: 5px 9px;
    border: 0; border-radius: 7px; background: #292928; color: #E7E2DD;
  }
  .new-chat-button:hover { background: #323231; }
  .new-chat-button span {
    width: 18px; height: 18px; border-radius: 0;
    background: transparent; font-size: 16px;
  }
  .new-chat-button b { font-size: 11.5px; font-weight: 500; }
  .drawer-section-label {
    margin: 0 6px 8px; color: #726E6A;
    font-size: 9px; font-weight: 520; letter-spacing: .8px;
  }
  .chat-list { gap: 1px; padding: 0; }
  .chat-item { padding: 1px; border: 0; border-radius: 7px; }
  .chat-item.active { border: 0; background: #242423; }
  .chat-main { padding: 7px 8px; }
  .chat-main b { font-size: 11.5px; font-weight: 480; }
  .chat-main small { margin-top: 1px; font-size: 9.5px; }
  .chat-actions { opacity: 0; }
  .chat-actions button { width: 25px; height: 25px; border-radius: 6px; }

  .sidebar-collapsed-tools {
    position: fixed; z-index: 18;
    top: calc(var(--top) + 7px); left: 9px;
    align-items: center; gap: 3px;
    padding: 3px; border-radius: 9px;
    background: rgba(21,21,21,.88); backdrop-filter: blur(12px);
  }
  body.sidebar-closed .sidebar-collapsed-tools { display: flex; }
  .sidebar-collapsed-tools button {
    position: static; width: 30px; height: 30px;
    display: grid; place-items: center;
    border: 0; border-radius: 7px;
    background: transparent; color: #B0ACA7; cursor: pointer;
    opacity: 1; visibility: visible; transform: none; box-shadow: none;
  }
  .sidebar-collapsed-tools button:hover { background: #292928; color: #F0ECE7; }
  .sidebar-collapsed-tools svg { width: 15px; height: 15px; }
  body.sidebar-closed .brand { margin-left: 134px; }
}

@media (max-width: 899px) {
  .drawer-toolbar { margin-top: 3px; }
  .drawer-toolbar-logo { display: none; }
  .drawer-toolbar .drawer-tool:nth-last-child(2) { margin-left: auto; }
  .chat-drawer {
    width: min(82vw, 286px); padding: calc(var(--top) + 9px) 8px calc(var(--bottom) + 12px);
    border-right-color: rgba(255,255,255,.075); background: #121212;
  }
  .chat-drawer-head { display: none; }
  .drawer-nav {
    grid-template-columns: 1fr 1fr; gap: 4px;
    margin: 0 0 8px; padding: 0; border: 0;
  }
  .drawer-nav-item {
    display: flex; justify-content: center; gap: 7px;
    min-height: 32px; padding: 6px 8px;
    border-radius: 7px; font-size: 11.5px;
  }
  .drawer-nav-item svg { width: 14px; height: 14px; }
  .drawer-nav-item:nth-child(3) {
    grid-column: 1 / -1; justify-content: flex-start;
    margin-top: 1px; padding-left: 10px;
  }
  .new-chat-button {
    min-height: 34px; margin: 0 0 17px; padding: 5px 9px;
    border: 0; border-radius: 7px; background: #292928; color: #E7E2DD;
  }
  .new-chat-button span { width: 18px; height: 18px; border-radius: 0; background: transparent; font-size: 16px; }
  .new-chat-button b { font-size: 11.5px; font-weight: 500; }
  .drawer-section-label { margin: 0 6px 8px; font-size: 9px; font-weight: 520; }
  .chat-list { gap: 1px; padding: 0; }
  .chat-item { padding: 1px; border: 0; border-radius: 7px; }
  .chat-item.active { border: 0; background: #242423; }
  .chat-main { padding: 7px 8px; }
  .chat-main b { font-size: 11.5px; font-weight: 480; }
  .chat-main small { margin-top: 1px; font-size: 9.5px; }
}

/* ─── Живое приветствие на стартовом экране ─── */
body:not(.has-chat) .hero {
  display: block;
  width: min(calc(100% - 32px), 520px);
  margin: auto;
  padding: 0 0 84px;
  text-align: center;
}
body:not(.has-chat) .hero-panel {
  display: flex; flex-direction: column; align-items: center;
  gap: 0; padding: 0;
}
body:not(.has-chat) .hero-mark {
  width: 58px; height: 58px; margin: 0 0 11px;
  overflow: hidden; border-radius: 18px;
  background: #D97757;
  box-shadow: 0 10px 28px rgba(0,0,0,.25), inset 0 0 0 1px rgba(255,255,255,.1);
}
body:not(.has-chat) .hero-mark svg {
  width: 34px; height: 34px; display: block; color: #FFF5E8;
}
body:not(.has-chat) .hero-kicker {
  display: block; margin: 0 0 13px;
  color: #EDE8E2; font-size: 14px; font-weight: 620;
  letter-spacing: .1px; text-transform: none;
}
body:not(.has-chat) .hero h1 {
  margin: 0 0 7px;
  color: #E9E4DE; font-family: inherit;
  font-size: clamp(20px, 2.4vw, 25px); font-weight: 450;
  letter-spacing: -.45px;
}
body:not(.has-chat) .hero p {
  display: block; margin: 0;
  color: #817D78; font-size: 12px;
}

@media (max-width: 680px) {
  body:not(.has-chat) .hero { padding-bottom: 96px; }
  body:not(.has-chat) .hero-mark { width: 52px; height: 52px; border-radius: 16px; }
  body:not(.has-chat) .hero-kicker { margin-bottom: 11px; font-size: 13px; }
  body:not(.has-chat) .hero h1 { font-size: 20px; }
  body:not(.has-chat) .hero p { max-width: 290px; line-height: 1.45; }
}

/* ─── Баланс кредитов в навигации ─── */
.drawer-balance {
  width: 100%; min-height: 49px; flex: none;
  display: grid; grid-template-columns: 32px minmax(0,1fr) 25px;
  align-items: center; gap: 9px;
  margin-top: 10px; padding: 7px 8px;
  border: 1px solid rgba(255,255,255,.075); border-radius: 10px;
  background: #1A1A19; color: #E8E3DD;
  font: inherit; text-align: left; cursor: pointer;
  transition: background .18s, border-color .18s, transform .18s;
}
.drawer-balance:hover { background: #222220; border-color: rgba(255,255,255,.12); }
.drawer-balance:active { transform: scale(.985); }
.drawer-balance-mark {
  width: 32px; height: 32px; display: grid; place-items: center;
  border-radius: 9px; background: rgba(217,119,87,.14); color: #DD8060;
}
.drawer-balance-mark svg { width: 17px; height: 17px; }
.drawer-balance-copy { min-width: 0; }
.drawer-balance-copy small,
.drawer-balance-copy b { display: block; }
.drawer-balance-copy small { color: #817D78; font-size: 9.5px; font-weight: 450; }
.drawer-balance-copy b { margin-top: 1px; color: #EAE5DF; font-size: 13px; font-weight: 560; }
.drawer-balance-add {
  width: 24px; height: 24px; display: grid; place-items: center;
  border-radius: 7px; background: #292927; color: #AAA59F; font-size: 15px;
}
.drawer-balance:hover .drawer-balance-add { color: #F0EAE4; background: #323230; }

@media (min-width: 900px) {
  .sidebar-collapsed-tools .collapsed-balance {
    width: auto; min-width: 44px; padding: 0 7px; display: inline-flex; gap: 5px;
    color: #C5BFB9; background: #232322;
  }
  .sidebar-collapsed-tools .collapsed-balance svg { width: 13px; height: 13px; color: #D97757; }
  .sidebar-collapsed-tools .collapsed-balance b { font-size: 10px; font-weight: 560; }
  body.sidebar-closed .brand { margin-left: 182px; }
}

/* Final overrides for the personalized controls. */
.chat-minimap[hidden], .floating-plan-status[hidden] { display: none !important; }
.plan {
  overflow: hidden; isolation: isolate;
  transform: perspective(700px) rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg));
  transform-style: preserve-3d;
  transition: transform .18s ease, border-color .4s, background .4s, box-shadow .4s;
}
.plan:active { transform: perspective(700px) scale(.988) rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg)); }
.plan > * { position: relative; z-index: 2; }
.plan-pro::before {
  content: ""; position: absolute; z-index: 0; inset: -180%; opacity: 0; pointer-events: none;
  background: conic-gradient(from 0deg, transparent 0 43%, rgba(238,204,116,.7) 49%, transparent 55% 100%);
}
.plan-pro:hover::before, .plan-pro.current::before { opacity: .72; animation: proShimmer 4.2s linear infinite; }
.plan-pro::after { content: ""; position: absolute; z-index: 1; inset: 1px; border-radius: inherit; background: #242423; pointer-events: none; }
.model-menu { border-color: rgba(255,255,255,.105); background: #1D1D1C; }
.model-menu-list { padding-bottom: 7px; border-bottom: 1px solid rgba(255,255,255,.065); }
.model-option { background: transparent !important; border-color: transparent !important; }
.model-option.on { background: #282827 !important; }
.thinking-control { margin-top: 7px; background: #20201F; }
.thinking-dots i.locked { opacity: .18; }

/* ─── Планы, память и спокойные системные анимации ─── */
.settings-status-row {
  cursor: default;
}
.settings-status-row:hover,
.settings-status-row:active {
  transform: none;
}
.settings-status-row .status-ready {
  color: #9DBEA8;
}
.settings-memory-title {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.settings-memory-title b {
  min-width: 26px; padding: 3px 8px;
  border: 1px solid rgba(255,255,255,.08); border-radius: 999px;
  background: #232321; color: #A9A49E;
  font-size: 10px; font-weight: 560; text-align: center;
}
.settings-memory-intro,
.settings-memory-hint {
  margin: 0; color: #8D8882; font-size: 11.5px; line-height: 1.55;
}
.settings-memory-list {
  display: grid; gap: 7px;
  max-height: min(48vh, 390px); overflow-y: auto;
  margin: 14px 0; padding-right: 3px;
  scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.1) transparent;
}
.settings-memory-list .agent-item {
  padding: 10px 11px; border-color: rgba(255,255,255,.075);
  background: #20201F;
}
.settings-memory-list .agent-item b { font-size: 12.5px; }
.settings-memory-list .agent-item small {
  max-width: 58ch; color: #95908A; white-space: normal; line-height: 1.4;
}
.settings-memory-list .memory-empty {
  min-height: 112px; display: grid; place-items: center;
  padding: 20px; border: 1px dashed rgba(255,255,255,.09); border-radius: 12px;
  color: #77736E; font-size: 11.5px; text-align: center;
}

.plan {
  gap: 16px; min-height: 67px;
  padding: 12px 14px; text-align: left;
  transition: background .18s, border-color .18s, transform .18s;
}
.plan-copy { min-width: 0; display: grid; gap: 5px; }
.plan-name { display: flex; align-items: center; gap: 7px; }
.plan-name b { color: #EDE8E2; font-size: 13px; font-weight: 590; }
.plan-name em {
  padding: 2px 6px; border-radius: 999px;
  background: rgba(217,119,87,.13); color: #D98A6D;
  font-size: 8.5px; font-style: normal; font-weight: 620; letter-spacing: .15px;
}
.plan-name em:empty { display: none; }
.plan-copy small { color: #8F8A84; font-size: 10.5px; line-height: 1.35; }
.plan-copy small:empty { display: none; }
.plan-copy ul {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 13px;
  margin: 5px 0 0; padding: 0; list-style: none;
}
.plan-copy li {
  position: relative; padding-left: 11px;
  color: #A49F99; font-size: 10px; line-height: 1.35;
}
.plan-copy li::before {
  content: ""; position: absolute; left: 0; top: .52em;
  width: 4px; height: 4px; border-radius: 50%; background: #8E8983;
}
.plan-price { flex: none; color: #D9A486; font-size: 12.5px; font-weight: 610; }
.plan.current {
  border-color: rgba(255,255,255,.19); background: #292827;
}
.plan:disabled {
  opacity: 1; cursor: default;
}
.plan:disabled:active { transform: none; }
.plan-section-label {
  margin: 4px 2px 8px; color: #77726D;
  font-size: 9px; font-weight: 570; letter-spacing: .75px; text-transform: uppercase;
}
.pack-section-label { margin-top: 18px; }
.credit-packs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.credit-pack {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  min-height: 52px; padding: 9px 10px;
  border: 1px solid rgba(255,255,255,.08); border-radius: 11px;
  background: #20201F; color: #EAE5DF; font: inherit; text-align: left; cursor: pointer;
  transition: background .18s, border-color .18s, transform .18s;
}
.credit-pack:hover { background: #292827; border-color: rgba(255,255,255,.15); }
.credit-pack:active { transform: scale(.975); }
.credit-pack span { display: grid; gap: 1px; }
.credit-pack b { font-size: 14px; font-weight: 650; }
.credit-pack small { color: #85807A; font-size: 9px; }
.credit-pack strong { color: #D9A486; font-size: 10.5px; font-weight: 620; white-space: nowrap; }
.credit-pack.popular { border-color: rgba(217,119,87,.25); }
.thinking-dots i.locked { opacity: .2; }

body:not(.has-chat) .hero-mark,
body:not(.has-chat) .hero-kicker,
body:not(.has-chat) .hero h1,
body:not(.has-chat) .hero p {
  opacity: 0; animation: welcomeIn .48s cubic-bezier(.22,.8,.24,1) forwards;
}
body:not(.has-chat) .hero-mark { animation-delay: .04s; }
body:not(.has-chat) .hero-kicker { animation-delay: .11s; }
body:not(.has-chat) .hero h1 { animation-delay: .17s; }
body:not(.has-chat) .hero p { animation-delay: .23s; }
body:not(.has-chat) .hero-mark svg {
  animation: avatarBreathe 9s ease-in-out 1.1s infinite;
  transform-origin: center;
}
@keyframes welcomeIn {
  from { opacity: 0; transform: translateY(7px); filter: blur(3px); }
  to { opacity: 1; transform: translateY(0); filter: blur(0); }
}
@keyframes avatarBreathe {
  0%, 88%, 100% { transform: scale(1); opacity: 1; }
  93% { transform: scale(1.055); opacity: .9; }
}

.msg {
  animation: messageIn .22s cubic-bezier(.22,.75,.3,1) both;
}
@keyframes messageIn {
  from { opacity: 0; transform: translateY(5px); filter: blur(2px); }
  to { opacity: 1; transform: translateY(0); filter: blur(0); }
}
.msg.thinking {
  position: relative; overflow: visible;
  transition: opacity .2s, transform .2s;
}
.msg.thinking::after {
  display: none;
}
.think-text { transition: opacity .15s, transform .15s; }
.think-text.changing { opacity: 0; transform: translateY(2px); }
.msg.thinking.done { opacity: .58; transform: translateY(-1px); }
.msg.thinking.done::after { animation: none; opacity: 0; }
@keyframes thinkingSweep {
  0% { transform: translateX(-72%); opacity: 0; }
  25% { opacity: .8; }
  100% { transform: translateX(72%); opacity: 0; }
}

.agent-item,
.artifact-card,
.chat-item {
  animation: quietItemIn .24s cubic-bezier(.22,.75,.3,1) both;
}
@keyframes quietItemIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
.credits-added { animation: balanceAdded .5s ease both; }
.credits-used { animation: balanceUsed .42s ease both; }
@keyframes balanceAdded {
  0%, 100% { transform: scale(1); }
  42% { transform: scale(1.07); color: #A7C8B0; }
}
@keyframes balanceUsed {
  0%, 100% { transform: translateX(0); }
  35% { transform: translateX(-2px); }
  68% { transform: translateX(2px); }
}

@media (max-width: 899px) {
  .settings-memory-list { max-height: 38vh; }
  .plan { min-height: 64px; }
  .plan-copy ul { grid-template-columns: 1fr; }
  .credit-packs { grid-template-columns: 1fr; }
}

/* ─── Stable illustrated subscription cards ─── */
.plans {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px;
}
.plan {
  min-height: 210px; display: grid;
  grid-template-columns: 58px minmax(0, 1fr); grid-template-rows: auto 1fr auto;
  align-items: start; column-gap: 13px; row-gap: 9px;
  padding: 14px; border-width: 1px; border-color: rgba(255,255,255,.09);
  border-radius: 15px; transform: none !important; transform-style: flat;
  background: linear-gradient(145deg, rgba(255,255,255,.025), transparent 48%), #20201F;
  box-shadow: 0 12px 30px rgba(0,0,0,.1);
  transition: border-color .32s ease, background-color .32s ease, box-shadow .32s ease, filter .32s ease;
}
.plan:hover {
  transform: none !important; filter: brightness(1.045);
  border-color: color-mix(in srgb, var(--card-accent) 44%, rgba(255,255,255,.08));
  box-shadow: 0 16px 38px rgba(0,0,0,.2), 0 0 24px var(--card-glow);
}
.plan:active { transform: none !important; filter: brightness(.98); }
.plan-free { --card-accent: #9A9DA1; --card-glow: rgba(154,157,161,.07); }
.plan-plus { --card-accent: #72A8EB; --card-glow: rgba(75,137,218,.12); }
.plan-pro { --card-accent: #D7B45F; --card-glow: rgba(215,180,95,.13); }
.plan-art {
  grid-column: 1; grid-row: 1 / 3; width: 58px; height: 58px;
  display: grid; place-items: center; border: 1px solid color-mix(in srgb, var(--card-accent) 28%, transparent);
  border-radius: 17px; color: var(--card-accent);
  background: radial-gradient(circle at 35% 24%, color-mix(in srgb, var(--card-accent) 18%, transparent), transparent 65%), #181818;
  box-shadow: inset 0 0 18px color-mix(in srgb, var(--card-accent) 7%, transparent), 0 9px 22px rgba(0,0,0,.2);
}
.plan-art svg { width: 39px; height: 39px; filter: drop-shadow(0 0 7px color-mix(in srgb, var(--card-accent) 26%, transparent)); }
.plan-copy { grid-column: 2; grid-row: 1 / 3; align-self: stretch; }
.plan-copy ul { grid-template-columns: 1fr; gap: 5px; }
.plan-copy li::before { background: var(--card-accent); opacity: .72; }
.plan-price {
  grid-column: 1 / 3; grid-row: 3; width: 100%; box-sizing: border-box;
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 10px; border-top: 1px solid rgba(255,255,255,.065); color: var(--card-accent);
}
.plan-price::before { content: ""; width: 24px; height: 2px; border-radius: 2px; background: var(--card-accent); opacity: .55; }
.plan-name em { background: color-mix(in srgb, var(--card-accent) 13%, transparent); color: var(--card-accent); }
.plan.current { border-color: color-mix(in srgb, var(--card-accent) 58%, transparent); box-shadow: 0 0 0 1px color-mix(in srgb, var(--card-accent) 12%, transparent), 0 14px 34px rgba(0,0,0,.18); }
.plan-pro::after { background: linear-gradient(145deg, rgba(215,180,95,.035), transparent 55%), #20201F; }

@media (max-width: 1040px) {
  .plans { grid-template-columns: 1fr; }
  .plan { min-height: 132px; grid-template-columns: 54px minmax(0,1fr) auto; grid-template-rows: 1fr; }
  .plan-art { width: 54px; height: 54px; grid-row: 1; }
  .plan-copy { grid-column: 2; grid-row: 1; }
  .plan-copy ul { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .plan-price { grid-column: 3; grid-row: 1; width: auto; align-self: center; padding: 0; border: 0; }
  .plan-price::before { display: none; }
}

@media (max-width: 620px) {
  .plan { min-height: 0; grid-template-columns: 46px minmax(0,1fr); grid-template-rows: auto auto; }
  .plan-art { width: 46px; height: 46px; }
  .plan-art svg { width: 32px; height: 32px; }
  .plan-copy ul { grid-template-columns: 1fr; }
  .plan-price { grid-column: 1 / 3; grid-row: 2; width: 100%; justify-content: flex-end; padding-top: 9px; border-top: 1px solid rgba(255,255,255,.06); }
}

/* ─── Compact chat rows and responsive plan cards ─── */
.chat-list { gap: 3px; overflow-x: hidden; }
.chat-item {
  position: relative; min-height: 34px; display: grid;
  grid-template-columns: minmax(0, 1fr) 28px; align-items: center; gap: 2px;
  padding: 2px 3px 2px 5px; border: 0; border-radius: 7px;
  background: transparent; overflow: visible;
}
.chat-item:hover { background: #252524; }
.chat-item.active { border: 0; background: #30302F; }
.chat-item::before,
.chat-item[data-label]:not([data-label="none"])::before {
  content: ""; position: absolute; left: 9px; top: 50%; width: 5px; height: 5px;
  margin: 0; border: 1px solid color-mix(in srgb, var(--chat-label, #77736F) 70%, transparent);
  border-radius: 50%; background: color-mix(in srgb, var(--chat-label, #77736F) 26%, transparent);
  box-shadow: none; transform: translateY(-50%);
}
.chat-main { min-width: 0; padding: 6px 6px 6px 23px; }
.chat-main b { font-size: 11.5px; font-weight: 520; }
.chat-main small { display: none; }
.chat-actions { opacity: 0; }
.chat-item:hover .chat-actions,
.chat-item.active .chat-actions,
.chat-item.menu-open .chat-actions { opacity: 1; }
.chat-actions button.chat-more {
  width: 25px; height: 25px; border-radius: 6px; color: #AAA59F;
}
.chat-actions button.chat-more:hover,
.chat-item.menu-open .chat-more { background: #454442; color: #F0EBE6; }
.chat-actions .chat-more svg { width: 14px; height: 14px; }
.chat-context-menu {
  position: absolute; z-index: 30; top: 31px; right: 2px; width: 174px;
  display: none; padding: 5px; border: 1px solid rgba(255,255,255,.105); border-radius: 10px;
  background: #20201F; box-shadow: 0 16px 34px rgba(0,0,0,.46);
}
.chat-item.menu-open { z-index: 31; }
.chat-item.menu-open .chat-context-menu { display: grid; animation: chatMenuIn .16s var(--ease) both; }
.chat-context-menu button {
  width: 100%; display: flex; align-items: center; gap: 9px; padding: 8px;
  border: 0; border-radius: 7px; background: transparent; color: #D5D0CA;
  font: inherit; font-size: 10.5px; text-align: left; cursor: pointer;
}
.chat-context-menu button:hover { background: #30302E; }
.chat-context-menu button.danger { margin-top: 3px; border-top: 1px solid rgba(255,255,255,.06); color: #E77D76; }
.chat-context-menu svg { width: 15px; height: 15px; flex: none; }
@keyframes chatMenuIn { from { opacity: 0; transform: translateY(-4px) scale(.98); } }

.plan {
  --card-tilt-x: 0deg; --card-tilt-y: 0deg;
  transform: perspective(900px) rotateX(var(--card-tilt-x)) rotateY(var(--card-tilt-y)) translateY(0) !important;
  transform-style: preserve-3d; will-change: transform;
  transition: transform .2s cubic-bezier(.22,.75,.3,1), border-color .3s ease, box-shadow .3s ease, filter .3s ease;
}
.plan:hover {
  transform: perspective(900px) rotateX(var(--card-tilt-x)) rotateY(var(--card-tilt-y)) translateY(-4px) scale(1.006) !important;
}
.plan:active {
  transform: perspective(900px) rotateX(var(--card-tilt-x)) rotateY(var(--card-tilt-y)) translateY(-1px) scale(.995) !important;
}
.plan-photo { overflow: hidden; transition: filter .35s ease, transform .45s cubic-bezier(.22,.75,.3,1); }
.plan:hover .plan-photo { transform: scale(1.035); filter: brightness(1.09) saturate(1.08); }
.plan::after {
  content: ""; position: absolute; z-index: 1; inset: 0; pointer-events: none;
  border-radius: inherit; opacity: 0;
  background: radial-gradient(260px circle at var(--card-light-x, 50%) var(--card-light-y, 30%), rgba(255,255,255,.075), transparent 62%);
  transition: opacity .25s ease;
}
.plan:hover::after { display: block !important; content: "" !important; opacity: 1; background: radial-gradient(260px circle at var(--card-light-x, 50%) var(--card-light-y, 30%), rgba(255,255,255,.075), transparent 62%); }
.plan-pro::before { content: none !important; display: none !important; }
.plan-art { overflow: hidden; background-position: center; background-size: cover; }
.plan-art svg { display: none; }
.plan-free .plan-art {
  background-image: radial-gradient(circle at 52% 42%, rgba(205,209,212,.24), transparent 20%), repeating-radial-gradient(circle at 50% 50%, transparent 0 7px, rgba(205,209,212,.12) 8px 9px), linear-gradient(145deg,#272827,#151616);
}
.plan-plus .plan-art { background-image: linear-gradient(rgba(4,8,14,.04),rgba(4,8,14,.24)), url("./assets/plan-plus-v1.png"); }
.plan-pro .plan-art { background-image: linear-gradient(rgba(12,8,2,.02),rgba(12,8,2,.22)), url("./assets/plan-pro-v1.png"); }
.plan-art::after {
  content: ""; position: absolute; inset: 1px; border-radius: inherit; pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.055), inset 0 -14px 20px rgba(0,0,0,.2);
}
@media (prefers-reduced-motion: reduce) {
  .plan, .plan:hover, .plan:active { transform: none !important; transition: none; }
  .plan:hover .plan-photo { transform: none; }
}

/* ─── Rich appearance, memory and stable plan previews ─── */
.wallpaper-picker {
  grid-template-columns: repeat(auto-fit, minmax(106px, 1fr));
}
.wallpaper-option i {
  height: 58px; background-position: center; background-size: cover;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.035), inset 0 -18px 24px rgba(0,0,0,.18);
}
.wallpaper-forest i { background-image: linear-gradient(rgba(8,12,13,.1), rgba(5,7,8,.28)), url("./assets/wallpaper-forest-v1.png"); }
.wallpaper-crystal i { background-image: linear-gradient(rgba(8,12,18,.08), rgba(5,7,10,.3)), url("./assets/plan-plus-v1.png"); }
.wallpaper-gold i { background-image: linear-gradient(rgba(18,13,5,.05), rgba(8,7,5,.34)), url("./assets/plan-pro-v1.png"); }
body[data-wallpaper="forest"] .chat,
body[data-wallpaper="crystal"] .chat,
body[data-wallpaper="gold"] .chat {
  background-position: center; background-size: cover; background-attachment: local;
}
body[data-wallpaper="forest"] .chat {
  background-image: linear-gradient(rgba(12,14,14,.76), rgba(8,10,10,.84)), url("./assets/wallpaper-forest-v1.png");
}
body[data-wallpaper="crystal"] .chat {
  background-image: linear-gradient(rgba(10,13,18,.78), rgba(8,10,14,.88)), url("./assets/plan-plus-v1.png");
}
body[data-wallpaper="gold"] .chat {
  background-image: linear-gradient(rgba(17,14,10,.78), rgba(10,9,8,.89)), url("./assets/plan-pro-v1.png");
}

.account-capabilities,
.memory-examples {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px;
  margin: 0 0 13px;
}
.account-capabilities > div,
.memory-examples > div {
  min-width: 0; min-height: 54px; display: flex; align-items: center; gap: 9px;
  padding: 9px 10px; border: 1px solid rgba(255,255,255,.065); border-radius: 11px;
  background: linear-gradient(145deg, rgba(255,255,255,.025), transparent 65%), #1E1E1D;
}
.account-capabilities i,
.memory-examples i {
  width: 28px; height: 28px; flex: none; display: grid; place-items: center;
  border-radius: 9px; background: var(--plan-soft); color: var(--plan-accent); font-style: normal;
}
.account-capabilities span,
.memory-examples span { min-width: 0; display: grid; gap: 2px; }
.account-capabilities b,
.memory-examples b { color: #D9D4CE; font-size: 10.5px; }
.account-capabilities small,
.memory-examples small { color: #817D78; font-size: 8.7px; line-height: 1.35; }
.memory-examples { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 12px; }

.settings-memory-list .memory-empty.memory-guide {
  min-height: 112px; display: grid !important;
  grid-template-columns: 58px minmax(0, 1fr) !important;
  grid-template-rows: auto auto; column-gap: 12px; align-content: center;
  place-items: center start !important; padding: 16px 18px !important; text-align: left !important;
}
.settings-memory-list .memory-empty.memory-guide i {
  grid-column: 1; grid-row: 1 / 3; width: 46px; height: 46px; margin: 0;
}
.settings-memory-list .memory-empty.memory-guide b,
.settings-memory-list .memory-empty.memory-guide span {
  grid-column: 2; min-width: 0; margin: 0; overflow-wrap: anywhere;
}
.settings-memory-list .memory-empty.memory-guide b { align-self: end; }
.settings-memory-list .memory-empty.memory-guide span { align-self: start; }

/* Старый conic-псевдоэлемент раздувал Pro-карточку на весь экран. */
.plan-pro::before,
.plan-pro::after { content: none !important; display: none !important; }
.plan {
  position: relative; min-height: 268px; padding-top: 104px;
  contain: layout paint; transform: none !important;
}
.plan-photo {
  position: absolute !important; z-index: 0 !important; inset: 0 0 auto 0;
  width: 100%; height: 92px; display: block; pointer-events: none;
  background-color: #181818; background-position: center; background-size: cover;
  border-bottom: 1px solid rgba(255,255,255,.055);
  opacity: .88;
}
.plan-photo::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(16,16,16,.1), transparent 48%, rgba(16,16,16,.08)), linear-gradient(transparent 45%, #20201F 100%);
}
.plan-free .plan-photo {
  background-image: radial-gradient(circle at 78% 38%, rgba(170,174,178,.16), transparent 22%), repeating-linear-gradient(135deg, transparent 0 15px, rgba(255,255,255,.025) 16px 17px), linear-gradient(120deg,#161616,#282929);
}
.plan-plus .plan-photo { background-image: url("./assets/plan-plus-v1.png"); }
.plan-pro .plan-photo { background-image: url("./assets/plan-pro-v1.png"); }
.plan-art {
  margin-top: -39px; z-index: 3 !important; backdrop-filter: blur(8px);
}
.plan-copy { z-index: 3 !important; }
.plan-price { z-index: 3 !important; }
.plan-pro.current .plan-photo { animation: proPhotoGlow 4s ease-in-out infinite; }
@keyframes proPhotoGlow { 0%,100% { filter: brightness(.92) saturate(.9); } 50% { filter: brightness(1.1) saturate(1.12); } }

@media (max-width: 1040px) {
  .plan { min-height: 176px; padding-top: 86px; }
  .plan-photo { height: 76px; }
  .plan-art { margin-top: -30px; }
}
@media (max-width: 620px) {
  .wallpaper-picker { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .memory-examples, .account-capabilities { grid-template-columns: 1fr; }
  .plan { min-height: 0; padding-top: 82px; }
}

/* Keep the pointer response after the stable plan-layout overrides above. */
.plan {
  --card-tilt-x: 0deg; --card-tilt-y: 0deg;
  transform: perspective(900px) rotateX(var(--card-tilt-x)) rotateY(var(--card-tilt-y)) translateY(0) !important;
  transform-style: preserve-3d; will-change: transform;
}
.plan:hover {
  transform: perspective(900px) rotateX(var(--card-tilt-x)) rotateY(var(--card-tilt-y)) translateY(-4px) scale(1.006) !important;
}
.plan:active {
  transform: perspective(900px) rotateX(var(--card-tilt-x)) rotateY(var(--card-tilt-y)) translateY(-1px) scale(.995) !important;
}
.plan:hover .plan-photo { transform: scale(1.035); filter: brightness(1.09) saturate(1.08); }
.plan:hover::after {
  content: "" !important; display: block !important; opacity: 1;
  background: radial-gradient(260px circle at var(--card-light-x, 50%) var(--card-light-y, 30%), rgba(255,255,255,.075), transparent 62%) !important;
}
.plan-pro::before { content: none !important; display: none !important; }
.plan-art { overflow: hidden; background-position: center !important; background-size: cover !important; }
.plan-art svg { display: none !important; }
.plan-free .plan-art {
  background-image: radial-gradient(circle at 52% 42%, rgba(205,209,212,.24), transparent 20%), repeating-radial-gradient(circle at 50% 50%, transparent 0 7px, rgba(205,209,212,.12) 8px 9px), linear-gradient(145deg,#272827,#151616) !important;
}
.plan-plus .plan-art { background-image: linear-gradient(rgba(4,8,14,.04),rgba(4,8,14,.24)), url("./assets/plan-plus-v1.png") !important; }
.plan-pro .plan-art { background-image: linear-gradient(rgba(12,8,2,.02),rgba(12,8,2,.22)), url("./assets/plan-pro-v1.png") !important; }
@media (prefers-reduced-motion: reduce) {
  .plan, .plan:hover, .plan:active { transform: none !important; }
  .plan:hover .plan-photo { transform: none; }
}

/* ─── Procedural wallpaper gallery and unified plan identity ─── */
.wallpaper-option i { background-image: none; }
.wallpaper-graphite i {
  background: radial-gradient(circle at 18% 18%, rgba(255,255,255,.055) 0 1px, transparent 2px), linear-gradient(145deg,#202120,#111212);
  background-size: 16px 16px, auto;
}
.wallpaper-aurora i {
  background: radial-gradient(90% 120% at 15% 110%, rgba(73,112,119,.55), transparent 58%), radial-gradient(90% 110% at 92% -12%, rgba(95,68,119,.48), transparent 60%), #111415;
}
.wallpaper-mesh i {
  background: linear-gradient(30deg, transparent 46%, rgba(117,139,146,.2) 47% 49%, transparent 50%), linear-gradient(-30deg, transparent 46%, rgba(117,139,146,.13) 47% 49%, transparent 50%), #121515;
  background-size: 18px 30px;
}
.wallpaper-waves i {
  background: repeating-radial-gradient(ellipse at 0 100%, transparent 0 12px, rgba(103,132,139,.21) 13px 14px, transparent 15px 25px), #111414;
}
.wallpaper-orbit i {
  background: radial-gradient(circle at 58% 52%, transparent 0 8px, rgba(149,116,172,.24) 9px 10px, transparent 11px 18px, rgba(95,129,151,.21) 19px 20px, transparent 21px 29px, rgba(149,116,172,.14) 30px 31px, transparent 32px), #121314;
}
.wallpaper-topography i {
  background: repeating-radial-gradient(ellipse at 34% 62%, transparent 0 8px, rgba(155,132,104,.16) 9px 10px, transparent 11px 17px), linear-gradient(135deg,#181715,#111212);
}
body[data-wallpaper="aurora"] .chat {
  background-image: radial-gradient(80% 75% at 8% 100%, rgba(50,90,94,.13), transparent 70%), radial-gradient(75% 70% at 100% 0%, rgba(76,52,92,.12), transparent 70%), linear-gradient(var(--time-tint),var(--time-tint));
}
body[data-wallpaper="mesh"] .chat {
  background-image: linear-gradient(30deg, transparent 48%, rgba(132,153,158,.025) 49% 50%, transparent 51%), linear-gradient(-30deg, transparent 48%, rgba(132,153,158,.02) 49% 50%, transparent 51%);
  background-size: 42px 70px;
}
body[data-wallpaper="waves"] .chat {
  background-image: repeating-radial-gradient(ellipse at 0 100%, transparent 0 34px, rgba(113,143,148,.035) 35px 36px, transparent 37px 66px);
}
body[data-wallpaper="orbit"] .chat {
  background-image: radial-gradient(circle at 71% 28%, transparent 0 80px, rgba(140,112,161,.04) 81px 82px, transparent 83px 132px, rgba(102,137,158,.03) 133px 134px, transparent 135px), linear-gradient(var(--time-tint),var(--time-tint));
}
body[data-wallpaper="topography"] .chat {
  background-image: repeating-radial-gradient(ellipse at 28% 70%, transparent 0 24px, rgba(158,135,108,.028) 25px 26px, transparent 27px 45px);
}

body { --answer-size: 15.2px; --chat-content-width: 820px; }
body[data-text-size="small"] { --answer-size: 13.8px; }
body[data-text-size="large"] { --answer-size: 16.8px; }
body[data-chat-width="narrow"] { --chat-content-width: 650px; }
body[data-chat-width="wide"] { --chat-content-width: 1040px; }
#chat > .msg { font-size: var(--answer-size); }
#chat > .msg.ai { width: min(100%, var(--chat-content-width)); }
#chat > .msg.me { max-width: min(85%, var(--chat-content-width)); }

.plan-photo,
.plan-art {
  --pattern-accent: 150,154,158;
  background-image:
    radial-gradient(circle at 22% 32%, rgba(var(--pattern-accent),.22) 0 1px, transparent 2px),
    radial-gradient(circle at 76% 68%, rgba(var(--pattern-accent),.16) 0 1px, transparent 2px),
    linear-gradient(32deg, transparent 46%, rgba(var(--pattern-accent),.11) 47% 48%, transparent 49%),
    linear-gradient(-32deg, transparent 46%, rgba(var(--pattern-accent),.065) 47% 48%, transparent 49%),
    radial-gradient(90% 140% at 50% 110%, rgba(var(--pattern-accent),.11), transparent 65%),
    #171818 !important;
  background-size: 22px 22px, 31px 31px, 42px 72px, 42px 72px, auto, auto !important;
}
.plan-plus .plan-photo,
.plan-plus .plan-art { --pattern-accent: 78,145,226; }
.plan-pro .plan-photo,
.plan-pro .plan-art { --pattern-accent: 215,180,95; }
.plan-plus .plan-photo { background-size: 17px 17px, 25px 25px, 34px 58px, 34px 58px, auto, auto !important; }
.plan-pro .plan-photo { background-size: 13px 13px, 21px 21px, 29px 49px, 29px 49px, auto, auto !important; }

/* Тёплое многослойное стекло: туман, сетка с зерном и редкий блик. */
.wallpaper-picker { grid-template-columns: minmax(160px, 230px); }
.wallpaper-graphite i {
  height: 72px;
  position: relative;
  overflow: hidden;
  background-color: #211E1D;
  background-image:
    radial-gradient(95% 140% at -5% -15%, rgba(197, 132, 120, .43), transparent 68%),
    radial-gradient(70% 110% at 105% -5%, rgba(86, 105, 107, .2), transparent 72%),
    linear-gradient(112deg, #3A2E2D, #1A1C1C 76%);
  box-shadow:
    inset 0 1px rgba(255,255,255,.12),
    inset 0 -20px 34px rgba(3,5,6,.22),
    0 8px 18px rgba(0,0,0,.2);
}
.wallpaper-graphite i::before {
  content: "";
  position: absolute; inset: -20%;
  background-image:
    linear-gradient(rgba(242, 229, 222, .095) 1px, transparent 1px),
    linear-gradient(90deg, rgba(242, 229, 222, .095) 1px, transparent 1px);
  background-size: 15px 15px;
  transform: perspective(360px) rotateX(3deg) rotateZ(-.35deg) scale(1.025);
  filter: blur(.3px);
  opacity: .68;
}
body[data-wallpaper="graphite"] .chat {
  isolation: isolate;
  background: #191918;
  box-shadow:
    inset 0 1px rgba(255,255,255,.042),
    inset 0 -150px 190px rgba(3,5,6,.29);
}

body[data-wallpaper="graphite"] .wallpaper-scene {
  position: absolute !important;
  z-index: 0 !important;
  top: 0;
  right: 0;
  left: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  pointer-events: none;
  contain: strict;
  background:
    linear-gradient(var(--time-tint), var(--time-tint)),
    linear-gradient(90deg, rgba(176,105,91,.16) 0%, rgba(132,91,83,.085) 22%, transparent 43%),
    linear-gradient(270deg, rgba(83,119,119,.105) 0%, rgba(71,96,97,.052) 25%, transparent 45%),
    linear-gradient(180deg, rgba(241,225,216,.055) 0%, transparent 30%),
    linear-gradient(116deg, #211E1D 0%, #1B1B1A 49%, #191D1D 100%);
}

body[data-wallpaper="graphite"] .wallpaper-scene::after {
  content: "";
  position: absolute;
  z-index: 4;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255,255,255,.05), transparent 17%),
    linear-gradient(90deg, rgba(255,224,212,.03), transparent 23%, transparent 76%, rgba(215,237,234,.028));
  box-shadow:
    inset 0 1px rgba(255,255,255,.065),
    inset 20px 0 70px rgba(255,220,207,.018),
    inset -20px 0 70px rgba(212,238,236,.016);
}

body[data-wallpaper="graphite"] .wallpaper-fog {
  display: none;
}

body[data-wallpaper="graphite"] .wallpaper-fog-a {
  width: 66vw;
  height: 72vh;
  left: -25vw;
  top: -31vh;
  background: radial-gradient(ellipse at 44% 46%, rgba(190,126,114,.48) 0%, rgba(158,116,108,.34) 35%, rgba(104,94,91,.17) 63%, transparent 80%);
  animation: wallpaperFogA 47s ease-in-out infinite alternate;
}
body[data-wallpaper="graphite"] .wallpaper-fog-b {
  width: 58vw;
  height: 64vh;
  right: -23vw;
  top: 3vh;
  opacity: .5;
  filter: blur(98px);
  background: radial-gradient(ellipse at 52% 46%, rgba(104,120,120,.28) 0%, rgba(91,101,102,.2) 38%, rgba(81,75,74,.095) 68%, transparent 82%);
  animation: wallpaperFogB 59s ease-in-out infinite alternate;
}
body[data-wallpaper="graphite"] .wallpaper-fog-c {
  width: 72vw;
  height: 54vh;
  left: 13vw;
  bottom: -34vh;
  opacity: .42;
  filter: blur(76px);
  background: radial-gradient(ellipse at 50% 50%, rgba(137,102,95,.25) 0%, rgba(102,91,88,.16) 44%, rgba(74,77,77,.08) 68%, transparent 82%);
  animation: wallpaperFogC 53s ease-in-out infinite alternate;
}

body[data-wallpaper="graphite"] .wallpaper-grid {
  --grid-shift-x: 0px;
  --grid-shift-y: 0px;
  position: absolute;
  z-index: 1;
  inset: -3%;
  display: block;
  background-image:
    linear-gradient(rgba(238,229,223,.072) 1px, transparent 1px),
    linear-gradient(90deg, rgba(238,229,223,.072) 1px, transparent 1px);
  background-size: 24px 24px;
  opacity: .48;
  filter: blur(.22px);
  transform: translate3d(var(--grid-shift-x), var(--grid-shift-y), 0) perspective(1500px) rotateX(1.2deg) rotateZ(-.12deg) scale(1.015);
  transform-origin: 50% 15%;
  transition: transform 380ms cubic-bezier(.22,.68,.2,1);
  will-change: transform;
  -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,.82) 0%, #000 16%, #000 78%, rgba(0,0,0,.64) 100%);
  mask-image: linear-gradient(to bottom, rgba(0,0,0,.82) 0%, #000 16%, #000 78%, rgba(0,0,0,.64) 100%);
}
body[data-wallpaper="graphite"] .wallpaper-grid::after {
  display: none;
}

body[data-wallpaper="graphite"] .wallpaper-grain {
  position: absolute;
  z-index: 2;
  inset: 0;
  display: block;
  opacity: .026;
  mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.9'/%3E%3C/svg%3E");
  background-size: 180px 180px;
}

body[data-wallpaper="graphite"] .wallpaper-glare {
  position: absolute;
  z-index: 3;
  display: block;
  inset: -8%;
  width: auto;
  height: auto;
  opacity: .46;
  filter: blur(15px) saturate(1.16);
  mix-blend-mode: screen;
  background:
    linear-gradient(103deg, transparent 0 7%, rgba(255,241,232,.135) 10%, rgba(255,241,232,.045) 13%, transparent 18%),
    linear-gradient(101deg, transparent 0 17%, rgba(229,239,235,.085) 20%, rgba(229,239,235,.028) 23%, transparent 28%),
    linear-gradient(78deg, transparent 0 66%, rgba(232,241,237,.075) 70%, rgba(232,241,237,.025) 74%, transparent 79%),
    linear-gradient(76deg, transparent 0 77%, rgba(244,233,227,.06) 81%, transparent 86%),
    linear-gradient(108deg, transparent 18%, rgba(255,244,236,.038) 34%, transparent 50%);
  transform: translate3d(-.7vw,-.5vh,0) rotate(-.25deg);
  transform-origin: center;
  will-change: transform, opacity;
  animation: wallpaperGlare 24s ease-in-out infinite alternate;
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, rgba(0,0,0,.9) 44%, transparent 82%);
  mask-image: linear-gradient(to bottom, #000 0%, rgba(0,0,0,.9) 44%, transparent 82%);
}
body[data-wallpaper="graphite"] .wallpaper-glare::before,
body[data-wallpaper="graphite"] .wallpaper-glare::after {
  content: "";
  display: block;
  position: absolute;
  inset: -15%;
  border-radius: 40%;
  filter: blur(38px);
  opacity: .38;
}
body[data-wallpaper="graphite"] .wallpaper-glare::before {
  background: linear-gradient(105deg, transparent 34%, rgba(255,235,225,.14) 48%, transparent 62%);
  transform: translate3d(-21%, -8%, 0);
}
body[data-wallpaper="graphite"] .wallpaper-glare::after {
  background: linear-gradient(74deg, transparent 37%, rgba(211,235,234,.095) 50%, transparent 63%);
  transform: translate3d(23%, 5%, 0);
}

body[data-wallpaper="graphite"] .chat > :not(.wallpaper-scene) {
  position: relative;
  z-index: 1;
}

/* ─── Composer polish: stable tools, clean model mark and workspace cards ─── */
.launch-context,
body:not(.has-chat) .launch-context {
  display: none !important;
}

body:not(.has-chat) .launch-manual {
  width: 154px;
  max-width: 154px;
  gap: 7px;
  overflow: hidden;
}
body:not(.has-chat) .launch-manual span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
body:not(.has-chat) .launch-manual b { margin-left: auto; flex: none; }
body:not(.has-chat) #attachBtn { left: 164px; }
body:not(.has-chat) #cameraBtn { left: 196px; }
body:not(.has-chat) #voiceBtn { left: 228px; }

.memory-guide {
  display: grid !important;
  grid-template-columns: 42px minmax(0, 1fr) !important;
  grid-template-rows: auto auto !important;
  column-gap: 11px !important;
  row-gap: 4px !important;
  align-content: center !important;
  padding: 15px 16px !important;
}
.memory-guide i {
  grid-column: 1 !important;
  grid-row: 1 / 3 !important;
  width: 38px !important;
  height: 38px !important;
}
.memory-guide b {
  grid-column: 2 !important;
  grid-row: 1 !important;
  align-self: end;
  min-width: 0;
  margin: 0;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.memory-guide span {
  grid-column: 2 !important;
  grid-row: 2 !important;
  align-self: start;
  min-width: 0;
  margin: 0;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.model-trigger::before {
  width: 3px;
  height: 17px;
  border-radius: 999px;
  background: linear-gradient(180deg, #BAA6F1, #7661BE);
  box-shadow: 0 0 9px rgba(151,126,224,.32);
}
.model-trigger[data-effort="medium"]::before {
  background: linear-gradient(180deg, #C1B3F2, #8D76D7);
  box-shadow: 0 0 9px rgba(166,143,229,.32);
}
.model-trigger[data-effort="high"]::before {
  background: linear-gradient(180deg, #B999F3, #7650C5);
  box-shadow: 0 0 10px rgba(147,105,222,.38);
}
.model-trigger[data-effort="xhigh"]::before {
  background: linear-gradient(180deg, #D5BCFF, #9366E8);
  box-shadow: 0 0 11px rgba(173,123,242,.44);
}

@media (max-width: 680px) {
  body:not(.has-chat) .launch-manual { width: 136px; max-width: 136px; }
  body:not(.has-chat) #attachBtn { left: 144px; }
  body:not(.has-chat) #cameraBtn { left: 174px; }
  body:not(.has-chat) #voiceBtn { left: 204px; }
}

@keyframes wallpaperFogA {
  from { transform: translate3d(-2vw,-1vh,0) scale(1); }
  to { transform: translate3d(10vw,8vh,0) scale(1.09); }
}
@keyframes wallpaperFogB {
  from { transform: translate3d(2vw,-2vh,0) scale(1.04); }
  to { transform: translate3d(-11vw,10vh,0) scale(.96); }
}
@keyframes wallpaperFogC {
  from { transform: translate3d(-5vw,3vh,0) scale(.96); }
  to { transform: translate3d(9vw,-8vh,0) scale(1.07); }
}
@keyframes wallpaperGlare {
  0% { opacity: .25; transform: translate3d(-.7vw,-.5vh,0) rotate(-.25deg); }
  48% { opacity: .37; transform: translate3d(1.2vw,.8vh,0) rotate(.15deg); }
  100% { opacity: .29; transform: translate3d(2.4vw,-.2vh,0) rotate(.35deg); }
}

@media (prefers-reduced-motion: reduce) {
  body[data-wallpaper="graphite"] .wallpaper-fog,
  body[data-wallpaper="graphite"] .wallpaper-glare { animation: none; }
  body[data-wallpaper="graphite"] .wallpaper-grid { transition: none; transform: perspective(1500px) rotateX(1.2deg) rotateZ(-.12deg) scale(1.015); }
}

/* Спокойная мини-карта: только пунктирная шкала и один плавный индикатор. */
.chat-minimap {
  width: 18px;
  opacity: .48;
  transition: opacity .2s ease;
}
.chat-minimap::before {
  left: 7px;
  width: 4px;
  background: repeating-linear-gradient(to bottom, rgba(199,199,194,.24) 0 1px, transparent 1px 9px);
}
.chat-minimap:hover { width: 18px; opacity: .9; }
.chat-minimap > i {
  left: 6px;
  right: auto;
  width: 5px;
  min-height: 18px;
  height: auto !important;
  border: 0;
  border-radius: 999px;
  background: rgba(224,222,216,.8);
  box-shadow: 0 0 8px rgba(255,255,255,.12);
  transition: top .16s ease-out, height .16s ease-out, opacity .16s ease;
}
.chat-minimap-preview { left: 29px; }
@media (min-width: 761px) { .chat-minimap { left: calc(var(--active-sidebar) + 10px); } }
@media (max-width: 760px) {
  .chat-minimap { left: 4px; width: 16px; }
  .chat-minimap-preview { left: 25px; width: min(300px, calc(100vw - 36px)); }
}
/* На пустом экране декоративный фон не должен создавать прокрутку. */
body:not(.has-chat) .chat {
  overflow-y: hidden;
  overscroll-behavior: none;
}
.chat.chat-empty {
  overflow-y: hidden !important;
  overscroll-behavior: none;
  touch-action: pan-x;
}

/* Цвет чата — тонкая световая полоса и мягкая тонировка вместо точки. */
.chat-item::before { display: none; }
.chat-item[data-label]:not([data-label="none"]) {
  background-image: linear-gradient(90deg, color-mix(in srgb, var(--chat-label) 14%, transparent), transparent 58%);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--chat-label) 12%, transparent);
}
.chat-item[data-label]:not([data-label="none"])::before {
  display: block; content: ""; position: absolute;
  left: 0; top: 6px; bottom: 6px; width: 3px; height: auto; margin: 0;
  border: 0; border-radius: 0 4px 4px 0; background: var(--chat-label);
  box-shadow: 0 0 12px color-mix(in srgb, var(--chat-label) 42%, transparent);
  transform: none;
}
.chat-item[data-label]:not([data-label="none"]) .chat-main { padding-left: 12px; }
.chat-item.active[data-label]:not([data-label="none"]) {
  background-image: linear-gradient(90deg, color-mix(in srgb, var(--chat-label) 22%, #30302F), #30302F 68%);
}
.plan-photo {
  left: -8px !important; right: -8px !important; width: calc(100% + 16px);
  transform: translate3d(var(--card-parallax-x,0), var(--card-parallax-y,0), 0) scale(1.06);
  transition: transform .14s ease-out, filter .3s ease;
}
.plan:hover .plan-photo {
  transform: translate3d(var(--card-parallax-x,0), var(--card-parallax-y,0), 0) scale(1.1);
}
.plan-art { box-shadow: inset 0 0 22px rgba(var(--pattern-accent),.09), 0 9px 22px rgba(0,0,0,.2); }
@media (prefers-reduced-motion: reduce) {
  .plan-photo, .plan:hover .plan-photo { transform: scale(1.06); transition: none; }
}

/* ─── Deliberate 3D plan motion: responsive while tracking, soft on release ─── */
.plan {
  transform-origin: 50% 50%; backface-visibility: hidden;
  transform: perspective(850px) rotateX(var(--card-tilt-x, 0deg)) rotateY(var(--card-tilt-y, 0deg));
  transition: transform 360ms cubic-bezier(.2,.75,.25,1), border-color 300ms ease, box-shadow 300ms ease, filter 300ms ease;
  will-change: transform;
}
.plan.is-tilting { transition-duration: 90ms, 300ms, 300ms, 300ms; transition-timing-function: linear, ease, ease, ease; }
.plan-photo {
  transform-style: preserve-3d; translate: 0 0 2px;
  transition: transform 380ms cubic-bezier(.2,.75,.25,1), filter 300ms ease;
}
.plan.is-tilting .plan-photo { transition-duration: 170ms, 300ms; transition-timing-function: ease-out, ease; }
.plan-art { transform: translateZ(24px); }
.plan-copy { transform: translateZ(15px); }
.plan-price { transform: translateZ(12px); }
@media (prefers-reduced-motion: reduce) {
  .plan-art, .plan-copy, .plan-price { transform: none; }
}

/* Mini App сама удерживает полноэкранный режим; закрытие — крестиком Telegram. */

/* Standalone web authentication */
.web-auth {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 18% 12%, rgba(191, 111, 73, .18), transparent 34%),
    radial-gradient(circle at 84% 80%, rgba(78, 105, 92, .16), transparent 38%),
    rgba(25, 24, 21, .92);
  backdrop-filter: blur(18px);
}

.web-auth[hidden] { display: none; }

.web-auth-card {
  width: min(430px, 100%);
  padding: 42px 38px 38px;
  text-align: center;
  color: #f2eee6;
  background: linear-gradient(150deg, rgba(52, 49, 43, .98), rgba(32, 31, 28, .98));
  border: 1px solid rgba(238, 224, 203, .14);
  border-radius: 28px;
  box-shadow: 0 28px 90px rgba(0, 0, 0, .46), inset 0 1px rgba(255, 255, 255, .04);
}

.web-auth-mark {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  margin: 0 auto 24px;
  color: #e3b49d;
  background: rgba(181, 102, 67, .16);
  border: 1px solid rgba(227, 180, 157, .24);
  border-radius: 19px;
}

.web-auth-mark svg { width: 29px; height: 29px; }
.web-auth-kicker { margin: 0 0 10px; color: #c99a82; font-size: 11px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; }
.web-auth-card h1 { margin: 0; font-size: clamp(28px, 6vw, 38px); line-height: 1.08; letter-spacing: -.035em; }
.web-auth-card > p:not(.web-auth-kicker) { margin: 16px auto 26px; max-width: 330px; color: #b9b1a5; font-size: 14px; line-height: 1.55; }
.google-sign-in { min-height: 44px; display: flex; justify-content: center; }
.web-auth-error { margin-top: 16px; padding: 11px 13px; color: #ffd5cf; background: rgba(154, 52, 43, .18); border: 1px solid rgba(255, 132, 120, .2); border-radius: 12px; font-size: 13px; }

@media (max-width: 520px) {
  .web-auth { padding: 14px; }
  .web-auth-card { padding: 34px 20px 30px; border-radius: 22px; }
}
#fsBtn { display: none !important; }

/* Ровная шапка чата: навигация, бренд и счётчики не соприкасаются. */
.topbar .brand {
  min-height: 38px;
  gap: 10px;
}
.topbar .brand-mark {
  width: 36px;
  height: 36px;
}
.topbar .brand-text {
  justify-content: center;
  min-height: 36px;
}
.topbar .header-plan-badge,
.topbar .credit-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  height: 22px;
  margin: 0;
  line-height: 1;
}
@media (min-width: 900px) {
  body.sidebar-closed .brand { margin-left: 194px; }
}

/* В активном чате сохраняем широкий нейтрально-серый композер. */
.has-chat .composer {
  width: min(calc(100% - 32px), 768px);
}
.has-chat .composer-inner {
  min-height: 78px;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  padding: 8px 9px;
  border-color: rgba(255,255,255,.10);
  background: rgba(27,27,26,.96);
  box-shadow: 0 12px 34px rgba(0,0,0,.28), inset 0 1px rgba(255,255,255,.025);
}
.has-chat #input {
  order: -1;
  flex: 1 0 100%;
  min-height: 32px;
  padding: 5px 6px;
}
.has-chat .launch-manual {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: auto;
  max-width: 150px;
  min-height: 30px;
  padding: 5px 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #C7C2BC;
}
.has-chat .launch-manual:hover { background: #2B2B29; color: #F0ECE7; }
.has-chat .launch-manual b { font-size: 15px; font-weight: 400; }

/* The fixed composer must never cover the last answer. */
.has-chat .chat {
  padding-bottom: calc(var(--bottom) + 154px) !important;
  scroll-padding-bottom: calc(var(--bottom) + 154px);
}
.canvas-mode.has-chat .chat {
  padding-bottom: calc(var(--bottom) + 164px) !important;
}

/* Downloadable result instead of a blank white HTML iframe. */
.canvas-stage.artifact-download-stage {
  padding: 22px;
  background:
    radial-gradient(80% 110% at 0 0, rgba(217,119,87,.08), transparent 66%),
    linear-gradient(145deg, #171716, #111211);
}
.artifact-download-card {
  width: min(100%, 440px);
  display: grid;
  grid-template-columns: 48px minmax(0,1fr);
  align-items: center;
  gap: 13px;
  padding: 16px;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 16px;
  background: rgba(35,34,32,.82);
  box-shadow: 0 18px 55px rgba(0,0,0,.28), inset 0 1px rgba(255,255,255,.035);
}
.artifact-download-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(217,119,87,.22);
  border-radius: 13px;
  background: rgba(217,119,87,.08);
  color: #E0997E;
  font: 600 13px/1 ui-monospace, Consolas, monospace;
}
.artifact-download-copy { min-width: 0; }
.artifact-download-copy b,
.artifact-download-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.artifact-download-copy b { color: #EEE9E3; font-size: 14px; }
.artifact-download-copy small { margin-top: 4px; color: #8E8984; font-size: 11px; }
.artifact-download-buttons {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 8px;
  margin-top: 3px;
}
.artifact-download-buttons button {
  min-height: 38px;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 10px;
  background: #2A2927;
  color: #D8D3CD;
  font: inherit;
  cursor: pointer;
}
.artifact-download-buttons button.primary {
  border-color: rgba(217,119,87,.28);
  background: #3A2923;
  color: #F0B099;
}
.artifact-download-buttons button:active { transform: scale(.98); }

/* Thinking is the header of the future answer, not a separate chat message. */
.msg.ai.thinking,
.msg.ai.response-message {
  display: block;
  width: min(100%, 880px);
  padding: 0;
  background: transparent;
  border: 0;
}
.msg.ai.thinking {
  min-height: 26px;
}
.msg.ai .response-status {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 7px;
  width: 100%;
  min-height: 22px;
  overflow: hidden;
}
.msg.ai .response-status .thinking-glyph {
  display: block;
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  margin: 0;
  animation: responseGlyphIn .46s cubic-bezier(.16,.82,.24,1) both;
}
.msg.ai .response-status .think-text {
  display: block;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  color: #E7E2DC;
  font: 600 14px/1.35 Georgia, "Times New Roman", serif;
  animation: responseLabelIn .42s cubic-bezier(.2,.75,.25,1) .18s both;
}
.msg.ai.response-message > .msg-content {
  margin-top: 9px;
  animation: responseBodyIn .24s ease-out both;
}
.msg.ai.response-message.model-ready .response-status .think-text {
  animation: modelLabelIn .36s cubic-bezier(.2,.75,.25,1) both;
}
@keyframes responseGlyphIn {
  from { opacity: 0; transform: scale(.58) rotate(-24deg); filter: blur(2px); }
  to { opacity: 1; transform: scale(1) rotate(0); filter: blur(0) drop-shadow(0 0 7px rgba(217,119,87,.22)); }
}
@keyframes responseLabelIn {
  from { opacity: 0; max-width: 0; transform: translateX(-5px); filter: blur(2px); }
  to { opacity: 1; max-width: 220px; transform: translateX(0); filter: blur(0); }
}
@keyframes modelLabelIn {
  from { opacity: .2; transform: translateY(3px); filter: blur(2px); }
  to { opacity: 1; transform: translateY(0); filter: blur(0); }
}
@keyframes responseBodyIn {
  from { opacity: 0; transform: translateY(3px); }
  to { opacity: 1; transform: translateY(0); }
}

/* The header belongs to the same glass surface as the chat background. */
.topbar {
  background: linear-gradient(90deg, rgba(31,27,25,.88), rgba(28,28,27,.86) 52%, rgba(25,30,29,.88)) !important;
  border-bottom-color: transparent !important;
  box-shadow: 0 10px 28px rgba(0,0,0,.10), inset 0 -1px rgba(255,255,255,.025) !important;
  backdrop-filter: blur(22px) saturate(108%);
  -webkit-backdrop-filter: blur(22px) saturate(108%);
}

/* Stable chat surface: the wallpaper belongs to the scroll viewport, not its content. */
body[data-wallpaper="graphite"] .chat {
  isolation: isolate;
  background-color: #191A19 !important;
  background-image:
    linear-gradient(var(--time-tint), var(--time-tint)),
    linear-gradient(105deg, transparent 0 7%, rgba(255,239,229,.075) 10%, rgba(255,239,229,.018) 15%, transparent 21%),
    linear-gradient(102deg, transparent 0 18%, rgba(232,241,237,.045) 21%, rgba(232,241,237,.012) 25%, transparent 30%),
    linear-gradient(78deg, transparent 0 70%, rgba(226,240,236,.035) 74%, transparent 80%),
    linear-gradient(90deg, rgba(166,103,91,.19) 0%, rgba(126,88,81,.085) 25%, transparent 47%),
    linear-gradient(270deg, rgba(71,111,111,.115) 0%, rgba(64,87,88,.045) 26%, transparent 48%),
    linear-gradient(180deg, rgba(239,224,215,.045) 0%, transparent 24%),
    linear-gradient(rgba(238,229,223,.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(238,229,223,.055) 1px, transparent 1px),
    linear-gradient(116deg, #211E1D 0%, #1B1B1A 49%, #191D1D 100%) !important;
  background-size:
    auto,
    100% 100%,
    100% 100%,
    100% 100%,
    100% 100%,
    100% 100%,
    100% 100%,
    24px 24px,
    24px 24px,
    100% 100% !important;
  background-position: center !important;
  background-repeat: no-repeat, no-repeat, no-repeat, no-repeat, no-repeat, no-repeat, no-repeat, repeat, repeat, no-repeat !important;
  background-attachment: scroll !important;
  box-shadow:
    inset 0 1px rgba(255,255,255,.045),
    inset 18px 0 72px rgba(255,220,207,.018),
    inset -18px 0 72px rgba(211,237,235,.014),
    inset 0 -72px 120px rgba(3,5,6,.14) !important;
}

.chat-minimap,
.chat-minimap-preview {
  display: none !important;
}

/* Code stays inside the answer column on every viewport. */
.msg.ai .msg-content { min-width: 0; max-width: 100%; overflow: hidden; }
.msg.ai .code-block { max-width: 100%; box-sizing: border-box; }

/* Единые тёмные полосы прокрутки без белых системных дорожек. */
* { scrollbar-width: thin; scrollbar-color: rgba(207,198,191,.38) rgba(10,10,10,.22); }
*::-webkit-scrollbar { width: 7px; height: 7px; }
*::-webkit-scrollbar-track { background: rgba(10,10,10,.22); }
*::-webkit-scrollbar-thumb {
  min-height: 28px; border: 2px solid transparent; border-radius: 999px;
  background: rgba(207,198,191,.38); background-clip: padding-box;
}
*::-webkit-scrollbar-thumb:hover { background: rgba(231,222,214,.56); background-clip: padding-box; }
*::-webkit-scrollbar-corner { background: transparent; }
textarea { resize: none; }

/* Более цельный премиальный фон: мягкое стекло без резких цветных кругов. */
body[data-wallpaper="graphite"] .wallpaper-scene {
  display: block !important;
  background:
    linear-gradient(118deg, rgba(119,76,68,.2) 0%, transparent 34%),
    linear-gradient(242deg, rgba(60,91,91,.16) 0%, transparent 37%),
    linear-gradient(155deg, #211c1b 0%, #171818 47%, #151919 100%);
}
body[data-wallpaper="graphite"] .wallpaper-scene::before {
  content: ""; position: absolute; z-index: 0; inset: -12%; pointer-events: none;
  background:
    linear-gradient(104deg, transparent 17%, rgba(255,235,225,.065) 31%, transparent 44%),
    linear-gradient(72deg, transparent 58%, rgba(208,231,228,.045) 71%, transparent 83%);
  filter: blur(42px); opacity: .9;
  animation: glassBreath 28s ease-in-out infinite alternate;
}
body[data-wallpaper="graphite"] .wallpaper-grid {
  background-image:
    linear-gradient(rgba(235,228,222,.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(235,228,222,.055) 1px, transparent 1px);
  background-size: 22px 22px; opacity: .42;
  -webkit-mask-image: radial-gradient(ellipse 88% 82% at 50% 46%, #000 16%, rgba(0,0,0,.83) 62%, rgba(0,0,0,.3) 100%);
  mask-image: radial-gradient(ellipse 88% 82% at 50% 46%, #000 16%, rgba(0,0,0,.83) 62%, rgba(0,0,0,.3) 100%);
}
body[data-wallpaper="graphite"] .wallpaper-glare {
  opacity: .3; filter: blur(28px) saturate(1.06);
  background: linear-gradient(108deg, transparent 22%, rgba(255,241,233,.075) 39%, transparent 53%);
}
body[data-wallpaper="graphite"] .wallpaper-glare::before,
body[data-wallpaper="graphite"] .wallpaper-glare::after { display: none; }

/* Keep the wallpaper attached to the viewport. When the message history becomes
   taller than one screen an absolute 100% layer ends and exposes a second
   background, which looks like a horizontal seam. */
body[data-wallpaper="graphite"] .wallpaper-scene {
  position: fixed !important;
  top: calc(var(--top) + 59px) !important;
  right: 0 !important;
  bottom: 0 !important;
  left: var(--active-sidebar, 0px) !important;
  width: auto !important;
  height: auto !important;
  min-height: 0 !important;
}
body.canvas-mode[data-wallpaper="graphite"] .wallpaper-scene {
  right: var(--result-panel) !important;
}
body.canvas-mode.canvas-collapsed[data-wallpaper="graphite"] .wallpaper-scene {
  right: 0 !important;
}
@media (max-width: 899px) {
  body[data-wallpaper="graphite"] .wallpaper-scene { left: 0 !important; }
}

/* Стеклянные панели главного экрана и выбора модели. */
body:not(.has-chat) .composer,
.topbar-cluster,
.model-menu {
  border-color: rgba(255,255,255,.1);
  background: linear-gradient(145deg, rgba(34,33,32,.88), rgba(20,21,21,.82));
  box-shadow: inset 0 1px rgba(255,255,255,.055), 0 18px 52px rgba(0,0,0,.25);
  backdrop-filter: blur(20px) saturate(1.08);
  -webkit-backdrop-filter: blur(20px) saturate(1.08);
}
.model-option { border: 1px solid transparent; border-radius: 10px; }
.model-option:hover { background: rgba(255,255,255,.055); border-color: rgba(255,255,255,.06); }
.model-option.on { background: rgba(221,126,91,.075); border-color: rgba(221,126,91,.18); }

@keyframes glassBreath {
  from { transform: translate3d(-1.5%, -.5%, 0) scale(1.01); opacity: .7; }
  to { transform: translate3d(2%, 1%, 0) scale(1.035); opacity: 1; }
}

/* Smoked glass wallpaper: one seamless surface, no grid and no visible colour fields. */
body[data-wallpaper="graphite"] .chat {
  background: #111313 !important;
  background-image: none !important;
  box-shadow: inset 0 1px rgba(255,255,255,.035), inset 0 -90px 150px rgba(0,0,0,.24) !important;
}

body[data-wallpaper="graphite"] .wallpaper-scene {
  isolation: isolate;
  background:
    linear-gradient(var(--time-tint), var(--time-tint)),
    linear-gradient(132deg, #191817 0%, #121414 46%, #101415 100%) !important;
}

body[data-wallpaper="graphite"] .wallpaper-grid,
body[data-wallpaper="graphite"] .wallpaper-fog {
  display: none !important;
}

body[data-wallpaper="graphite"] .wallpaper-scene::before {
  content: "";
  position: absolute;
  z-index: 1;
  inset: -28%;
  pointer-events: none;
  background:
    linear-gradient(112deg,
      transparent 12%,
      rgba(206,139,119,.035) 25%,
      rgba(230,174,153,.12) 36%,
      rgba(244,218,201,.052) 43%,
      transparent 55%),
    linear-gradient(126deg,
      transparent 47%,
      rgba(155,187,181,.018) 57%,
      rgba(139,177,171,.072) 67%,
      transparent 79%);
  filter: blur(68px) saturate(112%);
  transform: translate3d(-2%, -1%, 0) rotate(-3deg) scale(1.08);
  opacity: .78;
  animation: smokedGlassDrift 42s ease-in-out infinite alternate;
  will-change: transform, opacity;
}

body[data-wallpaper="graphite"] .wallpaper-scene::after {
  content: "";
  position: absolute;
  z-index: 4;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255,255,255,.045), transparent 13%),
    linear-gradient(105deg, transparent 3%, rgba(255,231,217,.025) 23%, transparent 42%),
    linear-gradient(285deg, transparent 7%, rgba(202,231,227,.02) 28%, transparent 47%);
  box-shadow:
    inset 0 1px rgba(255,255,255,.055),
    inset 0 -1px rgba(255,255,255,.014),
    inset 0 -120px 180px rgba(0,0,0,.19);
}

body[data-wallpaper="graphite"] .wallpaper-glare {
  display: block !important;
  position: absolute;
  z-index: 3;
  width: 48vw;
  height: 165vh;
  top: -42vh;
  left: -62vw;
  opacity: 0;
  pointer-events: none;
  background: linear-gradient(100deg,
    transparent 24%,
    rgba(255,255,255,.014) 39%,
    rgba(255,239,230,.075) 49%,
    rgba(255,255,255,.018) 57%,
    transparent 73%);
  filter: blur(48px);
  transform: rotate(-7deg);
  animation: smokedGlassSheen 34s ease-in-out infinite;
  will-change: transform, opacity;
}

body[data-wallpaper="graphite"] .wallpaper-grain {
  display: block !important;
  position: absolute;
  z-index: 2;
  inset: -18%;
  pointer-events: none;
  opacity: .025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.8'/%3E%3C/svg%3E");
  animation: smokedGlassGrain .8s steps(2) infinite;
}

.wallpaper-graphite i {
  background:
    linear-gradient(136deg, rgba(223,151,130,.13), transparent 37%),
    linear-gradient(310deg, rgba(126,165,160,.09), transparent 38%),
    linear-gradient(132deg, #211d1b, #121515 62%, #101415) !important;
}
.wallpaper-graphite i::before {
  background: linear-gradient(108deg, transparent 18%, rgba(255,234,222,.1) 43%, transparent 64%) !important;
  background-size: 100% 100% !important;
  filter: blur(13px) !important;
  opacity: .7 !important;
}

@keyframes smokedGlassDrift {
  0% { transform: translate3d(-3%, -1.5%, 0) rotate(-3deg) scale(1.08); opacity: .68; }
  52% { transform: translate3d(1.5%, 1%, 0) rotate(-1deg) scale(1.11); opacity: .82; }
  100% { transform: translate3d(4%, -1%, 0) rotate(1deg) scale(1.09); opacity: .74; }
}
@keyframes smokedGlassSheen {
  0%, 55% { transform: translate3d(0, 0, 0) rotate(-7deg); opacity: 0; }
  60% { opacity: 0; }
  68% { opacity: .72; }
  78% { transform: translate3d(225vw, 8vh, 0) rotate(-7deg); opacity: .18; }
  81%, 100% { transform: translate3d(225vw, 8vh, 0) rotate(-7deg); opacity: 0; }
}
@keyframes smokedGlassGrain {
  0% { transform: translate3d(0,0,0); }
  25% { transform: translate3d(-1.5%,1%,0); }
  50% { transform: translate3d(1%,-1.5%,0); }
  75% { transform: translate3d(.5%,1.5%,0); }
  100% { transform: translate3d(-1%,0,0); }
}

@media (prefers-reduced-motion: reduce) {
  body[data-wallpaper="graphite"] .wallpaper-scene::before,
  body[data-wallpaper="graphite"] .wallpaper-glare,
  body[data-wallpaper="graphite"] .wallpaper-grain { animation: none !important; }
  body[data-wallpaper="graphite"] .wallpaper-glare { display: none !important; }
}

/* Obsidian silk: one continuous dark surface with broad satin reflections. */
body[data-wallpaper="graphite"] .chat {
  background: #0c0e10 !important;
  background-image: none !important;
  box-shadow: inset 0 1px rgba(255,255,255,.035), inset 0 -120px 180px rgba(0,0,0,.28) !important;
}
body[data-wallpaper="graphite"] .wallpaper-scene {
  isolation: isolate;
  overflow: hidden;
  background: linear-gradient(var(--time-tint), var(--time-tint)), linear-gradient(154deg, #17191c 0%, #0e1114 44%, #0a0d10 100%) !important;
}
body[data-wallpaper="graphite"] .wallpaper-grid,
body[data-wallpaper="graphite"] .wallpaper-fog { display: none !important; }
body[data-wallpaper="graphite"] .wallpaper-scene::before {
  content: "";
  position: absolute;
  z-index: 1;
  inset: -32% -18%;
  pointer-events: none;
  background:
    linear-gradient(116deg, transparent 19%, rgba(255,255,255,.012) 28%, rgba(219,225,227,.055) 35%, rgba(255,255,255,.016) 42%, transparent 51%),
    linear-gradient(128deg, transparent 45%, rgba(201,214,218,.012) 55%, rgba(206,151,126,.044) 64%, rgba(246,218,199,.012) 70%, transparent 78%);
  filter: blur(56px) saturate(108%);
  opacity: .78;
  transform: translate3d(-2%, -1%, 0) skewX(-4deg) scale(1.07);
  animation: obsidianFoldDrift 48s cubic-bezier(.45,.05,.55,.95) infinite alternate;
  will-change: transform, opacity;
}
body[data-wallpaper="graphite"] .wallpaper-scene::after {
  content: "";
  position: absolute;
  z-index: 4;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255,255,255,.038), transparent 14%),
    linear-gradient(102deg, transparent 8%, rgba(255,255,255,.018) 34%, transparent 57%),
    linear-gradient(180deg, transparent 58%, rgba(0,0,0,.29) 100%);
  box-shadow: inset 0 1px rgba(255,255,255,.045), inset 0 0 150px rgba(0,0,0,.18);
}
body[data-wallpaper="graphite"] .wallpaper-glare {
  display: block !important;
  position: absolute;
  z-index: 3;
  top: -55vh;
  left: -72vw;
  width: 44vw;
  height: 210vh;
  pointer-events: none;
  opacity: 0;
  background: linear-gradient(102deg, transparent 19%, rgba(255,255,255,.008) 37%, rgba(225,157,126,.068) 49%, rgba(255,255,255,.012) 59%, transparent 76%);
  filter: blur(58px);
  transform: rotate(-8deg);
  animation: obsidianSheen 38s ease-in-out infinite;
  will-change: transform, opacity;
}
body[data-wallpaper="graphite"] .wallpaper-grain {
  display: block !important;
  position: absolute;
  z-index: 2;
  inset: -10%;
  pointer-events: none;
  opacity: .018;
  mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.72' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.72'/%3E%3C/svg%3E");
  background-size: 180px 180px;
  animation: none !important;
}
.wallpaper-graphite i {
  background: linear-gradient(119deg, transparent 17%, rgba(211,219,221,.08) 40%, transparent 62%), linear-gradient(153deg, #1a1c1f, #0c1013 72%) !important;
}
.wallpaper-graphite i::before {
  background: linear-gradient(105deg, transparent 23%, rgba(220,151,121,.09) 48%, transparent 70%) !important;
  background-size: 100% 100% !important;
  filter: blur(11px) !important;
  opacity: .65 !important;
}
@keyframes obsidianFoldDrift {
  0% { transform: translate3d(-3%, -1%, 0) skewX(-4deg) scale(1.07); opacity: .68; }
  50% { transform: translate3d(1%, 1.4%, 0) skewX(-2deg) scale(1.1); opacity: .82; }
  100% { transform: translate3d(4%, -.5%, 0) skewX(1deg) scale(1.08); opacity: .72; }
}
@keyframes obsidianSheen {
  0%, 62% { transform: translate3d(0,0,0) rotate(-8deg); opacity: 0; }
  68% { opacity: .42; }
  79% { transform: translate3d(245vw,8vh,0) rotate(-8deg); opacity: .1; }
  82%, 100% { transform: translate3d(245vw,8vh,0) rotate(-8deg); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  body[data-wallpaper="graphite"] .wallpaper-scene::before,
  body[data-wallpaper="graphite"] .wallpaper-glare { animation: none !important; }
  body[data-wallpaper="graphite"] .wallpaper-glare { display: none !important; }
}

/* Stable subscription gallery: procedural surfaces and glow-only interaction. */
#proSheet .pro-head { margin-bottom: 26px; }
#proSheet .pro-icon {
  background: linear-gradient(145deg, #d78363, #a84f37);
  box-shadow: 0 12px 36px rgba(196, 91, 59, .2), inset 0 1px rgba(255,255,255,.24);
}
#proSheet .plans {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  align-items: stretch;
  perspective: 1100px;
}
#proSheet .plan {
  --plan-accent-rgb: 170, 170, 166;
  position: relative;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  grid-template-rows: 1fr auto;
  align-items: start;
  gap: 15px 14px;
  min-height: 312px;
  padding: 96px 22px 18px;
  overflow: hidden;
  isolation: isolate;
  border: 1px solid rgba(var(--plan-accent-rgb), .25);
  border-radius: 22px;
  background: linear-gradient(180deg, #191a1b 0 94px, #202122 94px 100%);
  box-shadow: 0 18px 44px rgba(0,0,0,.2), inset 0 1px rgba(255,255,255,.045);
  color: #eeece8;
  transform: perspective(980px) rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg)) translateZ(0) !important;
  transform-style: preserve-3d;
  transform-origin: center;
  transition: transform .38s cubic-bezier(.2,.8,.2,1), border-color .32s ease, box-shadow .32s ease, background-color .32s ease !important;
  will-change: transform;
}
#proSheet .plan-plus { --plan-accent-rgb: 91, 154, 230; }
#proSheet .plan-pro { --plan-accent-rgb: 214, 173, 77; }
#proSheet .plan::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0 0 auto;
  height: 118px;
  pointer-events: none;
  background:
    radial-gradient(circle at 20% 30%, rgba(var(--plan-accent-rgb), .16), transparent 34%),
    repeating-linear-gradient(135deg, rgba(var(--plan-accent-rgb), .055) 0 1px, transparent 1px 13px),
    linear-gradient(135deg, rgba(var(--plan-accent-rgb), .08), transparent 62%);
  opacity: .88;
  transform: translate3d(var(--parallax-x, 0px), var(--parallax-y, 0px), 18px) scale(1.08);
  transition: transform .38s cubic-bezier(.2,.8,.2,1);
}
#proSheet .plan::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -1px;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(circle at var(--shine-x, 50%) var(--shine-y, 50%), rgba(255,255,255,.13), transparent 34%);
  box-shadow: inset 0 0 0 1px rgba(var(--plan-accent-rgb), .48), 0 0 34px rgba(var(--plan-accent-rgb), .18);
  transform: translateZ(28px);
  transition: opacity .32s ease;
}
#proSheet .plan:hover,
#proSheet .plan:focus-visible {
  border-color: rgba(var(--plan-accent-rgb), .62);
  box-shadow: 0 20px 50px rgba(0,0,0,.28), 0 0 28px rgba(var(--plan-accent-rgb), .11), inset 0 1px rgba(255,255,255,.06);
  outline: none;
}
#proSheet .plan:hover::after,
#proSheet .plan:focus-visible::after { opacity: 1; }
#proSheet .plan.is-tilting {
  transition: transform .075s linear, border-color .32s ease, box-shadow .32s ease, background-color .32s ease !important;
}
#proSheet .plan.is-tilting::before { transition: transform .09s linear; }
#proSheet .plan.current { border-color: rgba(var(--plan-accent-rgb), .7); }
#proSheet .plan.current-arrive { animation: none !important; }
#proSheet .plan-photo { display: none !important; }
#proSheet .plan-art {
  grid-column: 1;
  grid-row: 1;
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  border: 1px solid rgba(var(--plan-accent-rgb), .35);
  border-radius: 15px;
  background: rgba(var(--plan-accent-rgb), .075);
  color: rgb(var(--plan-accent-rgb));
  box-shadow: inset 0 0 18px rgba(var(--plan-accent-rgb), .08);
  transform: translateZ(26px) !important;
}
#proSheet .plan-art svg { width: 28px; height: 28px; }
#proSheet .plan-copy {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  transform: translateZ(22px) !important;
}
#proSheet .plan-name { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-bottom: 10px; }
#proSheet .plan-name b { font-size: 16px; letter-spacing: .01em; }
#proSheet .plan-name em {
  padding: 3px 7px;
  border: 1px solid rgba(var(--plan-accent-rgb), .28);
  border-radius: 999px;
  background: rgba(var(--plan-accent-rgb), .09);
  color: rgb(var(--plan-accent-rgb));
  font-size: 9px;
  font-style: normal;
}
#proSheet .plan-copy > small { display: block; min-height: 15px; color: #817e79; font-size: 10px; }
#proSheet .plan-copy ul { display: grid; gap: 7px; margin: 14px 0 0; padding: 0; list-style: none; }
#proSheet .plan-copy li { position: relative; padding-left: 13px; color: #aaa7a2; font-size: 11.5px; line-height: 1.35; }
#proSheet .plan-copy li::before {
  content: "";
  position: absolute;
  top: .55em;
  left: 0;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgb(var(--plan-accent-rgb));
  box-shadow: 0 0 8px rgba(var(--plan-accent-rgb), .34);
}
#proSheet .plan-price {
  grid-column: 1 / -1;
  grid-row: 2;
  display: flex;
  justify-content: flex-end;
  padding-top: 14px;
  border-top: 1px solid rgba(255,255,255,.07);
  color: rgb(var(--plan-accent-rgb));
  font-size: 14px;
  transform: translateZ(20px) !important;
}

/* Roulette: matching prize labels, stable wheel and restrained glow. */
#rouletteSheet .roulette-stage { width: 264px; height: 264px; margin-top: 30px; }
#rouletteSheet .roulette-pointer {
  top: -5px;
  border-left-width: 9px;
  border-right-width: 9px;
  border-top: 18px solid #e1dcd5;
  filter: drop-shadow(0 3px 8px rgba(221,128,91,.32));
}
#rouletteSheet .roulette-wheel {
  border: 1px solid rgba(221,128,91,.28);
  background: conic-gradient(from -22.5deg,
    #292725 0 45deg, #1c1d1f 45deg 90deg, #2d2926 90deg 135deg, #1b1d1e 135deg 180deg,
    #2b2825 180deg 225deg, #1b1c1e 225deg 270deg, #302a27 270deg 315deg, #1b1d1e 315deg 360deg);
  box-shadow: 0 0 42px rgba(209,111,74,.11), inset 0 0 0 9px #121314, inset 0 0 36px rgba(255,255,255,.025);
  transition: none;
}
#rouletteSheet .roulette-wheel span {
  font-size: 11px;
  letter-spacing: .02em;
  transform: translate(-50%, -50%) rotate(var(--angle)) translateY(-98px) rotate(calc(-1 * var(--angle)));
}
#rouletteSheet .roulette-wheel > i {
  width: 58px;
  height: 58px;
  background: radial-gradient(circle at 38% 30%, #2d2a28, #111214 70%);
  box-shadow: 0 0 22px rgba(209,111,74,.12), inset 0 1px rgba(255,255,255,.08);
}
#rouletteSheet .roulette-wheel > i::after { content: "✦"; color: #d77d5b; font-family: inherit; font-size: 20px; }
#rouletteSheet .roulette-result { color: #f0ebe5; text-shadow: 0 0 18px rgba(214,119,83,.2); }

@media (max-width: 920px) {
  #proSheet .plans { grid-template-columns: 1fr; }
  #proSheet .plan { min-height: 0; }
}

@media (hover: none), (pointer: coarse), (prefers-reduced-motion: reduce) {
  #proSheet .plan {
    transform: none !important;
    transition: border-color .25s ease, box-shadow .25s ease !important;
    will-change: auto;
  }
  #proSheet .plan::before { transform: none; transition: none; }
  #proSheet .plan-art,
  #proSheet .plan-copy,
  #proSheet .plan-price { transform: none !important; }
}
