/* MIRROR AI: оформление сайта.
   Подключается в base.html после style.css и перекрывает его.
   Чтобы вернуть старый вид, удали строку с theme.css из base.html. */

:root {
  color-scheme: dark;
  --bg: #0b0a1c;
  --surface: rgba(255, 255, 255, 0.055);
  --surface-2: rgba(255, 255, 255, 0.10);
  --line: rgba(255, 255, 255, 0.13);
  --text: #f0eeff;
  --muted: #aaa6d0;
  --accent: #8b7bff;
  --accent-2: #4fd8ff;
  --danger: #ff8fa3;
  --radius: 20px;
  --grad: linear-gradient(135deg, #6a58f5, #4666e8);
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { background: var(--bg); }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  color: var(--text);
  background:
    radial-gradient(900px 520px at 12% -8%, rgba(139, 123, 255, 0.30), transparent 62%),
    radial-gradient(760px 480px at 100% 4%, rgba(79, 216, 255, 0.16), transparent 58%),
    radial-gradient(900px 600px at 50% 120%, rgba(139, 123, 255, 0.18), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

main, .wide, main.wide {
  max-width: 1040px;
  width: auto;
  margin: 0 auto;
  padding: 8px 20px 72px;
}

.narrow { max-width: 680px; margin: 0 auto; }
.center { text-align: center; }

/* ---------- шапка и подвал ---------- */
.site-head {
  max-width: 1040px;
  margin: 0 auto;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-weight: 750;
  letter-spacing: 0.06em;
}
.logo-mark {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 30%, #fff, #c9c2ff 28%, #8b7bff 62%, #4fd8ff);
  box-shadow: 0 0 22px rgba(139, 123, 255, 0.7);
}
.site-foot {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 20px 36px;
  color: var(--muted);
  font-size: 0.9rem;
}

/* ---------- текст ---------- */
h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-weight: 750;
  margin: 0.2em 0 0.4em;
}
p { margin: 0 0 1rem; }
a { color: var(--accent-2); }
.muted { color: var(--muted); }
.lead { font-size: 1.15rem; color: #dcd8f8; }
.eyebrow {
  margin: 0 0 0.3rem;
  color: var(--accent-2);
  font-weight: 650;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.8rem;
}

/* ---------- кнопки ---------- */
button, .button {
  display: inline-block;
  font: inherit;
  font-weight: 650;
  line-height: 1.2;
  color: #fff;
  background: var(--grad);
  border: 0;
  border-radius: 999px;
  padding: 0.8rem 1.5rem;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 8px 24px -8px rgba(110, 110, 255, 0.7);
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
}
button:hover:not(:disabled), .button:hover { transform: translateY(-1px); }
button:disabled { opacity: 0.5; cursor: not-allowed; }
button.ghost, .button.ghost {
  color: var(--text);
  background: transparent;
  border: 1px solid var(--line);
  box-shadow: none;
}
button.ghost:hover:not(:disabled), .button.ghost:hover { background: var(--surface-2); }
button.ghost.danger { color: var(--danger); border-color: rgba(255, 143, 163, 0.4); }
.small { padding: 0.5rem 1rem; font-size: 0.9rem; }
:focus-visible { outline: 3px solid var(--accent-2); outline-offset: 3px; }

/* ---------- поля ---------- */
input, textarea {
  width: 100%;
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.8rem 1rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input::placeholder, textarea::placeholder { color: #8f8bb8; }
input:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(139, 123, 255, 0.25);
}
textarea { min-height: 96px; resize: vertical; }
label { display: block; margin: 1.4rem 0 0.45rem; font-weight: 600; }
label:first-child { margin-top: 0; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.progress { height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; margin: 1.2rem 0 0.5rem; }
.progress span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #8b7bff, #4fd8ff); transition: width 0.25s; }

/* ---------- главная ---------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 48px;
  align-items: center;
  padding: 36px 0 24px;
}
.hero h1 {
  background: linear-gradient(95deg, #fff 10%, #cfc9ff 55%, #8fe6ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.orb-stage { width: 100%; max-width: 440px; aspect-ratio: 1; margin-inline: auto; }
.orb-stage canvas, .orb-small canvas { width: 100%; height: 100%; display: block; }
.orb-small { width: 64px; height: 64px; flex: none; }

.steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 40px 0 0;
  padding: 0;
  list-style: none;
}
.steps li {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.2rem 1.3rem;
  color: var(--muted);
}
.steps b { display: block; margin-bottom: 0.3rem; color: var(--text); }
.step-n {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  margin-bottom: 0.7rem;
  border-radius: 50%;
  background: linear-gradient(135deg, #8b7bff, #4fd8ff);
  color: #0b0a1c;
  font-weight: 800;
}

/* ---------- страница профиля ---------- */
.profile { display: block; }
.profile.has-avatar {
  display: grid;
  grid-template-columns: minmax(260px, 360px) minmax(0, 1fr);
  gap: 36px;
  align-items: start;
}
.avatar-stage {
  position: sticky;
  top: 20px;
  aspect-ratio: 3 / 4;
  border-radius: 28px;
  overflow: hidden;
  border: 1px solid var(--line);
  background:
    radial-gradient(120% 80% at 50% 100%, rgba(139, 123, 255, 0.38), transparent 60%),
    radial-gradient(90% 60% at 50% 20%, rgba(79, 216, 255, 0.12), transparent 70%),
    var(--surface);
}
.avatar-stage { position: sticky; }
.frame-toggle { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: rgba(11,10,28,.6); backdrop-filter: blur(8px); border: 1px solid var(--line); }
.frame-toggle button { padding: .35rem .8rem; font-size: .82rem; background: transparent; box-shadow: none; color: var(--muted); }
.frame-toggle button.on { background: var(--grad); color: #fff; }
.avatar-stage canvas { width: 100%; height: 100%; display: block; }
.profile-head { display: flex; align-items: center; gap: 16px; margin-bottom: 0.4rem; }
.profile-head h1 { margin: 0; }
.has-avatar .orb-small { display: none; }

.chat {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  max-height: 48vh;
  overflow-y: auto;
  padding: 1rem;
  margin: 1.2rem 0 0.8rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.chat:empty { display: none; }
.msg {
  max-width: 85%;
  padding: 0.7rem 1rem;
  border-radius: 18px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.msg.me { align-self: flex-end; color: #fff; background: var(--grad); border-bottom-right-radius: 6px; }
.msg.ai { align-self: flex-start; background: var(--surface-2); border: 1px solid var(--line); border-bottom-left-radius: 6px; }

.starters { display: flex; flex-wrap: wrap; gap: 8px; margin: 1rem 0 0.8rem; }
.composer { display: flex; gap: 0.6rem; align-items: stretch; }
.composer input { flex: 1; min-width: 0; }
.composer button { flex: none; }
.mic.on { color: #fff; background: var(--grad); border-color: transparent; animation: pulse 1.2s infinite; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(139,123,255,.5); } 50% { box-shadow: 0 0 0 8px rgba(139,123,255,0); } }
.voice-row { margin: 0.6rem 0; }
.status { min-height: 1.5em; color: var(--muted); font-size: 0.95rem; }
.status.error { color: var(--danger); }

.owner {
  display: none;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-top: 1.6rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--line);
}
.owner.on { display: flex; }

/* ---------- навигация, аккаунт ---------- */
.nav { display: flex; align-items: center; gap: 14px; }
.nav-link { color: var(--muted); text-decoration: none; font-weight: 600; padding: 6px 4px; }
.nav-link:hover { color: var(--text); }
.auth { margin-top: 24px; }
.auth h1 { font-size: clamp(1.7rem, 4vw, 2.3rem); }
.auth form { margin-top: 1.2rem; }
.auth button[type=submit] { width: 100%; margin-top: 0.8rem; }
.auth-alt { margin: 1.2rem 0 0.4rem; text-align: center; }
.small-note { font-size: 0.88rem; text-align: center; }
.versions { display: grid; gap: 12px; margin: 1.4rem 0; }
.version { display: flex; align-items: center; justify-content: space-between; gap: 12px; text-decoration: none; color: var(--text); transition: transform .15s, border-color .15s, background .15s; }
a.version:hover { transform: translateY(-2px); border-color: var(--accent); background: var(--surface-2); }
.version.off { opacity: .55; }
.v-name { font-weight: 700; font-size: 1.1rem; }
.row-actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- индикатор «печатает» ---------- */
.msg.typing { display: inline-flex; gap: 5px; align-items: center; padding: 0.9rem 1.1rem; }
.msg.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: blink-dot 1.2s infinite ease-in-out; }
.msg.typing i:nth-child(2) { animation-delay: .15s; }
.msg.typing i:nth-child(3) { animation-delay: .3s; }
@keyframes blink-dot { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

/* ---------- появление элементов ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.hero > div:first-child, .steps li, .card, .msg { animation: rise .45s ease both; }
.steps li:nth-child(2) { animation-delay: .08s; }
.steps li:nth-child(3) { animation-delay: .16s; }
.steps li { transition: transform .2s, border-color .2s; }
.steps li:hover { transform: translateY(-3px); border-color: var(--accent); }
::selection { background: rgba(139, 123, 255, .5); }
.chat::-webkit-scrollbar { width: 8px; }
.chat::-webkit-scrollbar-thumb { background: var(--surface-2); border-radius: 8px; }

/* ---------- тексты и вопросы ---------- */
.prose h2 { font-size: 1.25rem; margin: 1.8rem 0 .4rem; }
.prose p { color: #cfcaf0; }
.faq { margin-top: 56px; max-width: 760px; }
.faq h2 { font-size: 1.5rem; margin: 0 0 1rem; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: .9rem 1.2rem; margin-bottom: 10px; }
.faq summary { cursor: pointer; font-weight: 650; }
.faq details[open] summary { margin-bottom: .4rem; }
.faq p { margin: 0; color: var(--muted); }
.voice-row { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- новые возможности чата ---------- */
.reactions { display: flex; gap: 6px; margin: .2rem 0 .6rem; }
.reactions button { font-size: 1.1rem; padding: .3rem .7rem; }
.msg .copy { display: block; margin-top: .4rem; padding: 0; font-size: .78rem; font-weight: 600; color: var(--muted); background: none; border: 0; box-shadow: none; cursor: pointer; }
.msg .copy:hover { color: var(--text); transform: none; }
.style-pick { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-weight: 600; font-size: .85rem; color: var(--muted); }
.style-pick select { font: inherit; font-size: .85rem; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: .3rem .7rem; }
.style-pick option { color: #111; }
.stage-bg { position: absolute; top: 12px; right: 12px; padding: .3rem .8rem; font-size: .8rem; background: rgba(11,10,28,.6); border: 1px solid var(--line); box-shadow: none; backdrop-filter: blur(8px); }
.avatar-stage[data-bg="1"] { background: radial-gradient(120% 80% at 50% 100%, rgba(255,140,90,.55), transparent 60%), radial-gradient(90% 60% at 50% 15%, rgba(255,90,140,.25), transparent 70%), #1a1030; }
.avatar-stage[data-bg="2"] { background: radial-gradient(120% 80% at 50% 100%, rgba(60,220,170,.45), transparent 60%), radial-gradient(90% 60% at 50% 15%, rgba(79,216,255,.2), transparent 70%), #08181c; }
.avatar-stage[data-bg="3"] { background: linear-gradient(180deg, #2a2d3e, #11121c); }

/* ---------- вкладки ---------- */
.tabs { display: flex; gap: 4px; margin: 1.2rem 0 1rem; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: none; padding: .7rem 1.1rem; font-size: .98rem; font-weight: 650; color: var(--muted); background: none; border: 0; border-bottom: 3px solid transparent; border-radius: 0; box-shadow: none; margin-bottom: -1px; }
.tab:hover:not(:disabled) { color: var(--text); transform: none; }
.tab[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }
.tabpanel { animation: rise .3s ease both; }
.tabpanel .chat { margin-top: 0; }
.small-note-left { font-size: .9rem; margin-top: 1rem; }
.tabpanel .owner { margin-top: 0; padding-top: 0; border-top: 0; }

/* ---------- современный ИИ-стиль ---------- */
#ambient { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.site-head, main, .site-foot { position: relative; z-index: 1; }
body::before {
  content: ""; position: fixed; inset: -20%; z-index: 0; pointer-events: none;
  background:
    radial-gradient(40% 35% at 20% 25%, rgba(139,123,255,.20), transparent 70%),
    radial-gradient(35% 30% at 80% 70%, rgba(79,216,255,.14), transparent 70%),
    radial-gradient(30% 30% at 60% 15%, rgba(255,126,182,.10), transparent 70%);
  animation: aurora 22s ease-in-out infinite alternate;
}
@keyframes aurora { from { transform: translate3d(-3%, -2%, 0) scale(1); } to { transform: translate3d(3%, 3%, 0) scale(1.08); } }

.pulse-dot { display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; background: var(--accent-2); box-shadow: 0 0 0 0 rgba(79,216,255,.7); animation: ping 2s infinite; vertical-align: middle; }
@keyframes ping { 70% { box-shadow: 0 0 0 10px rgba(79,216,255,0); } 100% { box-shadow: 0 0 0 0 rgba(79,216,255,0); } }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin: 1.4rem 0 1rem; }
.hero .orb-stage { filter: drop-shadow(0 0 48px rgba(139,123,255,.45)); }

.section-title { font-size: clamp(1.5rem, 3vw, 2rem); margin: 3.2rem 0 1rem; letter-spacing: -0.01em; }
.demo { max-width: 640px; margin: 8px auto 0; border: 1px solid var(--line); border-radius: 24px; background: rgba(255,255,255,.04); backdrop-filter: blur(14px); overflow: hidden; box-shadow: 0 30px 80px -40px rgba(100,90,255,.6); }
.demo-head { padding: .8rem 1.2rem; font-size: .85rem; font-weight: 650; color: var(--muted); border-bottom: 1px solid var(--line); }
.demo-body { display: flex; flex-direction: column; gap: .6rem; padding: 1.1rem; min-height: 190px; }
.demo-body .msg { opacity: 0; transition: opacity .3s; }
.demo-body .msg.show { opacity: 1; }
.demo-body .msg:empty { display: none; }
.typing-caret::after { content: ""; display: inline-block; width: 2px; height: 1em; margin-left: 2px; vertical-align: -2px; background: var(--accent-2); animation: caret 1s steps(1) infinite; }
@keyframes caret { 50% { opacity: 0; } }

.features { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.feature { display: flex; flex-direction: column; gap: .4rem; padding: 1.2rem; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); color: var(--muted); font-size: .95rem; transition: transform .2s, border-color .2s, background .2s; }
.feature:hover { transform: translateY(-3px); border-color: var(--accent); background: var(--surface-2); }
.feature b { color: var(--text); font-size: 1.02rem; }
.f-ico { font-size: 1.6rem; line-height: 1; margin-bottom: .3rem; }
.cta-band { margin-top: 3.4rem; padding: 2.4rem 1.5rem; text-align: center; border-radius: 28px; border: 1px solid var(--line); background: linear-gradient(135deg, rgba(106,88,245,.28), rgba(70,102,232,.12)); }
.cta-band h2 { margin: 0 0 .4rem; font-size: 1.7rem; }
.cta-band p { color: var(--muted); }
.card { backdrop-filter: blur(10px); }
html { scroll-behavior: smooth; }
@media (max-width: 820px) { .features { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .features { grid-template-columns: 1fr; } }

/* ---------- ещё эффекты ---------- */
.site-head { position: sticky; top: 0; z-index: 5; transition: background .25s; }
.site-head.scrolled { background: rgba(11,10,28,.72); box-shadow: 0 0 0 100vmax rgba(11,10,28,.72); clip-path: inset(0 -100vmax); }

.glow:hover { background-image: radial-gradient(280px circle at var(--mx, 50%) var(--my, 50%), rgba(139,123,255,.20), transparent 62%); }

.reveal { opacity: 0; transform: translateY(18px); animation: none !important; transition: opacity .6s ease, transform .6s ease, border-color .2s, background .2s; }
.reveal.in { opacity: 1; transform: none; }
.feature.reveal.in { transition: transform .12s ease-out, border-color .2s, background .2s; }

@property --ang { syntax: "<angle>"; initial-value: 0deg; inherits: false; }
.demo, .cta-band { position: relative; }
.demo::before, .cta-band::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none;
  background: conic-gradient(from var(--ang), transparent 0 55%, var(--accent-2), var(--accent), transparent 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  animation: spin-ang 7s linear infinite;
}
@keyframes spin-ang { to { --ang: 360deg; } }

.marquee { overflow: hidden; margin: 18px 0 34px; -webkit-mask: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); mask: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); }
.marquee-track { display: flex; gap: 12px; width: max-content; animation: marquee 48s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee span { flex: none; padding: .45rem 1rem; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: .92rem; white-space: nowrap; }
@keyframes marquee { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .marquee-track { animation: none; flex-wrap: wrap; width: auto; justify-content: center; } }

.wave { display: block; width: 100%; max-width: 480px; height: 34px; margin: 0 0 .5rem; opacity: 0; transition: opacity .25s; }
.wave.on { opacity: 1; }
.shimmer { background: linear-gradient(90deg, var(--muted) 20%, #fff 50%, var(--muted) 80%); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: shimmer 1.6s linear infinite; font-weight: 600; }
@keyframes shimmer { to { background-position: -200% 0; } }
.msg.typing { display: inline-flex; }

/* ---------- ещё: прогресс, курсор, быстрые действия ---------- */
#scroll-progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 50; transform: scaleX(0); transform-origin: 0 50%; background: linear-gradient(90deg, #8b7bff, #4fd8ff); pointer-events: none; }
.to-top { position: fixed; right: 18px; bottom: 18px; z-index: 40; width: 44px; height: 44px; padding: 0; border-radius: 50%; font-size: 1.2rem; opacity: 0; transform: translateY(12px); pointer-events: none; transition: opacity .25s, transform .25s; }
.to-top.show { opacity: 1; transform: none; pointer-events: auto; }
.cursor-glow { position: fixed; top: 0; left: 0; width: 380px; height: 380px; z-index: 0; pointer-events: none; opacity: 0; transition: opacity .4s; background: radial-gradient(circle, rgba(139,123,255,.16), transparent 62%); }
.cursor-glow.on { opacity: 1; }

.rot { display: inline-block; background: linear-gradient(95deg, #8fe6ff, #b9a6ff); -webkit-background-clip: text; background-clip: text; color: transparent; transition: opacity .3s, transform .3s; }
.rot.out { opacity: 0; transform: translateY(8px); }

.kbd-hint { padding: .4rem .8rem; font-size: .85rem; font-weight: 600; color: var(--muted); background: var(--surface); border: 1px solid var(--line); box-shadow: none; }
.kbd-hint:hover { color: var(--text); transform: none; }
kbd { font: inherit; font-size: .72rem; padding: 1px 6px; margin-left: 6px; border-radius: 6px; border: 1px solid var(--line); color: var(--muted); }
@media (max-width: 640px) { .kbd-hint { display: none; } }

.palette-overlay { position: fixed; inset: 0; z-index: 100; display: flex; justify-content: center; align-items: flex-start; padding: 14vh 16px 16px; background: rgba(5,4,16,.6); backdrop-filter: blur(6px); }
.palette { width: min(560px, 100%); border: 1px solid var(--line); border-radius: 20px; background: #12102a; box-shadow: 0 30px 80px -20px rgba(0,0,0,.7); overflow: hidden; animation: rise .2s ease both; }
.palette input { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 1rem 1.2rem; font-size: 1.05rem; background: transparent; box-shadow: none !important; }
.palette ul { list-style: none; margin: 0; padding: 6px; max-height: 320px; overflow-y: auto; }
.palette li { padding: .65rem .9rem; border-radius: 12px; cursor: pointer; }
.palette li.sel, .palette li:hover { background: var(--surface-2); }
.palette li.none { color: var(--muted); cursor: default; }
.palette .hint { margin: 0; padding: .6rem 1.2rem; font-size: .8rem; color: var(--muted); border-top: 1px solid var(--line); }

/* ---------- статистика владельца ---------- */
.stats { display: flex; flex-wrap: wrap; gap: 12px; align-items: stretch; margin-bottom: 1rem; }
.stat { flex: 1 1 130px; padding: 1rem 1.2rem; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); display: flex; flex-direction: column; }
.stat-n { font-size: 2rem; font-weight: 750; line-height: 1.1; background: linear-gradient(95deg, #fff, #8fe6ff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.spark { flex: 2 1 220px; display: flex; align-items: flex-end; gap: 4px; min-height: 84px; padding: .8rem; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.spark i { flex: 1; border-radius: 4px; background: linear-gradient(180deg, var(--accent-2), var(--accent)); opacity: .85; }
.embed { margin-bottom: 1rem; padding: .8rem 1.1rem; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); }
.embed summary { cursor: pointer; font-weight: 650; }
.embed textarea { margin: .6rem 0; min-height: 70px; font: .82rem/1.4 ui-monospace, Consolas, monospace; }

/* ---------- форма создания ---------- */
.field { position: relative; }
.field-foot { display: flex; justify-content: space-between; align-items: center; margin-top: .3rem; font-size: .82rem; }
.dictate { padding: .3rem .8rem; }

/* ---------- общий лоск ---------- */
body::after { content: ""; position: fixed; inset: 0; z-index: 2; pointer-events: none; opacity: .045; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>"); }
button, .button { position: relative; overflow: hidden; }
button:not(.ghost):not(.tab):not(.to-top):not(.kbd-hint)::after, .button:not(.ghost)::after {
  content: ""; position: absolute; inset: 0; transform: translateX(-120%); background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.28) 50%, transparent 70%); transition: transform .6s ease; pointer-events: none; }
button:not(.ghost):hover::after, .button:not(.ghost):hover::after { transform: translateX(120%); }
* { scrollbar-width: thin; scrollbar-color: rgba(139,123,255,.45) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(139,123,255,.4); border-radius: 10px; border: 2px solid transparent; background-clip: content-box; }
main a:not(.button):not(.version):not(.card) { text-decoration: none; background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat; transition: background-size .25s; }
main a:not(.button):not(.version):not(.card):hover { background-size: 100% 1px; }
.lead { text-wrap: pretty; }
h1, h2 { text-wrap: balance; }

.msg .fb { display: inline-flex; gap: 2px; margin: .3rem 0 0 .8rem; font-size: .78rem; color: var(--muted); }
.msg .fb button { padding: 0 4px; font-size: .85rem; background: none; border: 0; box-shadow: none; color: inherit; cursor: pointer; opacity: .7; }
.msg .fb button:hover { opacity: 1; transform: none; }
.msg .copy { display: inline-block; }
.settings-form { display: grid; gap: .3rem; margin-top: .6rem; }
.settings-form select { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: .7rem 1rem; }
.settings-form option { color: #111; }
.settings-form input[type=date] { color-scheme: dark; }
.settings-form label { margin: .8rem 0 .3rem; font-size: .92rem; }
.settings-form .check { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.settings-form .check input { width: 18px; height: 18px; }
.settings-form button { justify-self: start; margin-top: .6rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

[hidden] { display: none !important; }

@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; gap: 24px; }
  .steps { grid-template-columns: 1fr; }
  .profile.has-avatar { grid-template-columns: 1fr; gap: 20px; }
  .avatar-stage {
    position: relative;
    top: 0;
    aspect-ratio: auto;
    height: min(46vh, 420px);
    width: 100%;
    max-width: 420px;
    margin-inline: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
