/* Незачёт — ч/б liquid glass. Светлая тема, всё в оттенках серого. */
:root {
  --bg: #efefef;
  --ink: #0a0a0a;
  --ink-2: #3a3a3a;
  --muted: #7a7a7a;
  --line: rgba(0, 0, 0, .08);
  --glass: rgba(255, 255, 255, .52);
  --glass-strong: rgba(255, 255, 255, .72);
  --glass-edge: rgba(255, 255, 255, .85);
  --shadow: 0 1px 0 rgba(255, 255, 255, .9) inset, 0 -1px 0 rgba(0, 0, 0, .04) inset, 0 10px 40px rgba(0, 0, 0, .08), 0 2px 6px rgba(0, 0, 0, .04);
  --r: 22px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --side: 272px;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--ink); font: 16px/1.55 var(--font); -webkit-font-smoothing: antialiased; overflow: hidden; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
a { color: inherit; }
[hidden] { display: none !important; }

/* фон: монохромные пятна под стеклом */
.bg { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.blob { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .55; will-change: transform; }
.b1 { width: 46vmax; height: 46vmax; left: -12vmax; top: -14vmax; background: radial-gradient(circle at 30% 30%, #fff, #c9c9c9 60%, transparent 70%); animation: drift 26s var(--ease) infinite alternate; }
.b2 { width: 38vmax; height: 38vmax; right: -10vmax; top: 18vh; background: radial-gradient(circle at 60% 40%, #9a9a9a, #d6d6d6 55%, transparent 70%); opacity: .45; animation: drift 32s var(--ease) infinite alternate-reverse; }
.b3 { width: 30vmax; height: 30vmax; left: 30vw; bottom: -16vmax; background: radial-gradient(circle, #222 0%, #8a8a8a 45%, transparent 70%); opacity: .18; animation: drift 38s var(--ease) infinite alternate; }
.grain { position: absolute; inset: -50%; opacity: .05; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
@keyframes drift { to { transform: translate3d(6vw, 5vh, 0) scale(1.08); } }
@media (prefers-reduced-motion: reduce) { .blob { animation: none; } }

.glass { background: var(--glass); -webkit-backdrop-filter: blur(28px) saturate(170%); backdrop-filter: blur(28px) saturate(170%); border: 1px solid var(--glass-edge); box-shadow: var(--shadow); }
.ic { width: 20px; height: 20px; flex: none; }
/* Жидкое стекло (glass.js): в Chromium фон преломляет линза под содержимым, сам элемент не фильтрует. */
.lg-on { isolation: isolate; }
.lg-refract .lg-on { -webkit-backdrop-filter: none; backdrop-filter: none; }
.lg-lens { position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none; }
/* Пружина нажатия — springs.press/release из Liquid Glass (21st.dev) */
.press { transition: transform .5s cubic-bezier(.175, .885, .32, 1.275); }
.press:active { transform: scale(.95); transition-duration: .24s; }

.app { position: relative; z-index: 1; display: flex; height: 100%; height: 100dvh; }

/* боковая панель */
.side { position: relative; width: var(--side); margin: 10px 0 10px 10px; border-radius: var(--r); display: flex; flex-direction: column; padding: 14px 10px; gap: 4px; flex: none; transition: transform .35s var(--ease); }
.side-top { display: flex; align-items: center; justify-content: space-between; padding: 2px 8px 10px; }
.logo { font-weight: 800; font-size: 22px; letter-spacing: -.04em; text-decoration: none; display: inline-flex; align-items: baseline; gap: 2px; }
.logo .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ink); display: inline-block; }
.btn-new { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-radius: 14px; background: var(--ink); color: #fff; font-weight: 600; font-size: 15px; transition: transform .15s var(--ease), opacity .15s; }
.btn-new:active { transform: scale(.98); }
.side-link { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; font-size: 15px; color: var(--ink-2); text-align: left; }
.side-link:hover, .thread:hover { background: rgba(255, 255, 255, .6); }
.side-label { font-size: 12px; color: var(--muted); padding: 14px 12px 4px; letter-spacing: .02em; }
.threads { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 1px; margin: 0 -2px; padding: 0 2px; scrollbar-width: thin; }
.thread { padding: 8px 12px; border-radius: 10px; font-size: 14px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: left; flex: none; }
.thread.on { background: var(--glass-strong); color: var(--ink); box-shadow: 0 1px 0 #fff inset; }
.threads .empty { font-size: 13px; color: var(--muted); padding: 6px 12px; }
.side-bottom { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 6px; display: flex; flex-direction: column; gap: 6px; }
.acct { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; text-align: left; width: 100%; }
.acct:hover { background: rgba(255, 255, 255, .6); }
.ava { width: 30px; height: 30px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; }
.acct-txt { min-width: 0; font-size: 13px; line-height: 1.3; }
.acct-txt b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acct-txt span { color: var(--muted); }
.upsell { padding: 12px; border-radius: 14px; background: rgba(255, 255, 255, .55); font-size: 13px; color: var(--ink-2); }
.upsell b { display: block; color: var(--ink); font-size: 14px; margin-bottom: 2px; }
.upsell button { margin-top: 8px; width: 100%; padding: 9px; border-radius: 10px; background: var(--ink); color: #fff; font-weight: 600; font-size: 14px; }

/* основная колонка */
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; position: relative; }
.top { display: flex; align-items: center; gap: 10px; padding: 14px 20px 6px; min-height: 60px; }
.top-title { flex: 1; font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink-2); }
.icon-btn { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; color: var(--ink-2); transition: background .15s; flex: none; }
.icon-btn:hover { background: rgba(0, 0, 0, .05); }
.glass-pill { background: var(--glass); -webkit-backdrop-filter: blur(20px) saturate(170%); backdrop-filter: blur(20px) saturate(170%); border: 1px solid var(--glass-edge); box-shadow: var(--shadow); border-radius: 999px; }
.evil { position: relative; display: inline-flex; align-items: center; gap: 10px; padding: 6px 6px 6px 14px; cursor: pointer; user-select: none; font-size: 14px; font-weight: 600; }
.evil input { position: absolute; opacity: 0; pointer-events: none; }
/* Liquid Switch (21st.dev, liquefy-ui): бегунок-капля сплющивается и тянется при щелчке */
.sw { width: 46px; height: 28px; border-radius: 99px; background: rgba(0, 0, 0, .12); position: relative; transition: background .3s var(--ease); box-shadow: inset 0 1px 3px rgba(0, 0, 0, .18), inset 0 -1px 0 rgba(255, 255, 255, .6); }
.sw i { position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 99px; background: radial-gradient(circle at 35% 30%, #fff 0 30%, rgba(255, 255, 255, .86) 60%, rgba(235, 235, 235, .8)); box-shadow: 0 2px 7px rgba(0, 0, 0, .28), inset 0 -1px 1px rgba(0, 0, 0, .08), inset 0 1px 1px #fff; transform-origin: center; }
.evil input:checked + .sw { background: var(--ink); }
.evil input:checked + .sw i { transform: translateX(18px); }
.evil input:checked + .sw.flick i { animation: flick-on .55s cubic-bezier(.175, .885, .32, 1.275) both; }
.evil input:not(:checked) + .sw.flick i { animation: flick-off .55s cubic-bezier(.175, .885, .32, 1.275) both; }
@keyframes flick-on { 0% { transform: translateX(0) scale(1, 1); } 40% { transform: translateX(7px) scale(1.45, .82); } 100% { transform: translateX(18px) scale(1, 1); } }
@keyframes flick-off { 0% { transform: translateX(18px) scale(1, 1); } 40% { transform: translateX(11px) scale(1.45, .82); } 100% { transform: translateX(0) scale(1, 1); } }
.evil input:focus-visible + .sw { outline: 2px solid var(--ink); outline-offset: 2px; }

.chat { flex: 1; overflow-y: auto; padding: 8px 20px 24px; scroll-behavior: smooth; }
.hero { max-width: 720px; margin: 6vh auto 0; text-align: center; animation: rise .6s var(--ease) both; }
.hero h1 { font-size: clamp(34px, 6vw, 58px); line-height: 1.02; letter-spacing: -.045em; margin: 0 0 14px; font-weight: 800; }
.hero-sub { color: var(--ink-2); font-size: 17px; margin: 0 auto 26px; max-width: 520px; }
.orb-cta { display: inline-flex; align-items: center; gap: 14px; padding: 10px 22px 10px 10px; border-radius: 999px; background: var(--ink); color: #fff; text-align: left; box-shadow: 0 14px 40px rgba(0, 0, 0, .22); transition: transform .2s var(--ease), box-shadow .2s; }
.orb-cta:hover { transform: translateY(-1px); box-shadow: 0 18px 48px rgba(0, 0, 0, .28); }
.orb-cta:active { transform: scale(.98); }
.orb-cta b { display: block; font-size: 16px; }
.orb-cta small { display: block; font-size: 13px; opacity: .65; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }

/* шар — главный образ голоса */
.orb { position: relative; border-radius: 50%; background: radial-gradient(circle at 32% 28%, #fff 0 6%, #8a8a8a 22%, #1b1b1b 58%, #000 78%); box-shadow: inset -8px -10px 24px rgba(255, 255, 255, .12), inset 6px 8px 18px rgba(255, 255, 255, .35), 0 20px 50px rgba(0, 0, 0, .35); flex: none; }
.orb i { position: absolute; inset: 8% 14% auto auto; width: 34%; height: 22%; border-radius: 50%; background: radial-gradient(ellipse, rgba(255, 255, 255, .85), transparent 70%); filter: blur(1px); transform: rotate(-30deg); }
.orb.mini { width: 44px; height: 44px; animation: breathe 3.2s ease-in-out infinite; }
.orb.big { width: min(56vw, 260px); height: min(56vw, 260px); transition: transform .08s linear; }
.orb-canvas { display: block; flex: none; will-change: transform; }
.orb-canvas.mini { width: 46px; height: 46px; }
.orb-canvas.big { width: min(66vw, 300px); height: min(66vw, 300px); }
.orb-fallback { border-radius: 50%; background: radial-gradient(circle at 32% 28%, #fff 0 6%, #8a8a8a 22%, #1b1b1b 58%, #000 78%); }
@keyframes breathe { 50% { transform: scale(1.06); } }

/* сообщения */
.msgs { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 18px; }
.msg { animation: rise .35s var(--ease) both; }
.msg.user { align-self: flex-end; max-width: 82%; background: var(--ink); color: #fff; padding: 11px 16px; border-radius: 20px 20px 6px 20px; white-space: pre-wrap; word-wrap: break-word; box-shadow: 0 6px 18px rgba(0, 0, 0, .14); }
.msg.user img { max-width: 220px; border-radius: 12px; display: block; margin-bottom: 6px; }
.msg.bot { align-self: stretch; padding: 2px 4px; }
.msg.voice::before { content: "голосом"; display: block; font-size: 11px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin-bottom: 2px; }
.msg.user.voice::before { color: rgba(255, 255, 255, .55); }
.md p { margin: 0 0 .7em; }
.md p:last-child { margin-bottom: 0; }
.md h2, .md h3, .md h4 { margin: 1.1em 0 .4em; line-height: 1.25; letter-spacing: -.02em; }
.md h2 { font-size: 21px; } .md h3 { font-size: 18px; } .md h4 { font-size: 16px; }
.md ul, .md ol { margin: 0 0 .8em; padding-left: 1.3em; }
.md li { margin: .2em 0; }
.md code { font-family: var(--mono); font-size: .9em; background: rgba(0, 0, 0, .06); padding: .1em .35em; border-radius: 6px; }
.md pre { background: #0d0d0d; color: #eee; padding: 14px 16px; border-radius: 14px; overflow-x: auto; font-size: 13.5px; }
.md pre code { background: none; padding: 0; color: inherit; }
.md blockquote { margin: 0 0 .8em; padding-left: 14px; border-left: 3px solid var(--ink); color: var(--ink-2); }
.md table { border-collapse: collapse; margin: 0 0 .8em; font-size: 14px; display: block; overflow-x: auto; }
.md td, .md th { border: 1px solid var(--line); padding: 6px 10px; }
.md hr { border: 0; border-top: 1px solid var(--line); margin: 1em 0; }
.cite { display: inline-block; font-size: 11px; font-weight: 700; padding: 0 6px; border-radius: 6px; background: rgba(0, 0, 0, .08); vertical-align: 1px; }
.msg-tools { display: flex; gap: 4px; margin-top: 6px; opacity: .55; transition: opacity .15s; }
.msg:hover .msg-tools { opacity: 1; }
.msg-tools button { font-size: 12px; padding: 4px 8px; border-radius: 8px; color: var(--ink-2); }
.msg-tools button:hover { background: rgba(0, 0, 0, .06); }
.typing { display: inline-flex; gap: 4px; padding: 8px 0; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--ink); animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; } .typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .2; } 40% { opacity: 1; } }
.wall { border-radius: 18px; padding: 16px 18px; font-size: 15px; }
.wall b { display: block; font-size: 16px; margin-bottom: 4px; }
.wall .row { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }

/* поле ввода */
.composer-wrap { padding: 0 20px 14px; padding-bottom: max(14px, env(safe-area-inset-bottom)); }
/* Поле ввода — схема Input Bar (21st.dev Agent Elements): вложения сверху, текст, панель действий снизу */
.composer { position: relative; max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; padding: 8px 8px 8px; border-radius: 26px; background: var(--glass-strong); cursor: text; }
.cx-chips { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .2s ease-out; }
.cx-chips.on { grid-template-rows: 1fr; }
.cx-chips > div { overflow: hidden; display: flex; flex-wrap: wrap; gap: 6px; padding: 2px 4px; }
.composer textarea { width: 100%; border: 0; outline: 0; background: transparent; resize: none; padding: 8px 10px 4px; max-height: 220px; font-size: 16px; line-height: 1.5; }
.composer textarea::placeholder { color: #999; }
.cx-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 2px; }
.cx-left, .cx-right { display: flex; align-items: center; gap: 6px; min-width: 0; }
.voice-btn { display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 14px 0 11px; border-radius: 999px; background: var(--ink); color: #fff; font-weight: 600; font-size: 14px; box-shadow: 0 6px 16px rgba(0, 0, 0, .18); }
.send { position: relative; width: 38px; height: 38px; border-radius: 50%; background: rgba(0, 0, 0, .1); color: #8a8a8a; display: grid; place-items: center; flex: none; transition: background .15s, color .15s, transform .15s var(--ease); }
.send.typing { background: var(--ink); color: #fff; }
.send.typing:active { transform: scale(.92); }
.send .stop { display: none; width: 11px; height: 11px; border-radius: 2px; background: currentColor; }
.send.streaming { background: var(--ink); color: #fff; }
.send.streaming .ic { display: none; }
.send.streaming .stop { display: block; }
.goals { max-width: 760px; margin: 12px auto 0; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.chip { padding: 8px 14px; border-radius: 999px; font-size: 14px; color: var(--ink-2); background: var(--glass); border: 1px solid var(--glass-edge); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); transition: background .15s, color .15s, transform .15s var(--ease); }
.chip:hover { background: var(--glass-strong); color: var(--ink); }
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.chip:active { transform: scale(.97); }
.foot-note { max-width: 760px; margin: 8px auto 0; text-align: center; font-size: 12px; color: var(--muted); }
.pv { position: relative; width: 52px; height: 52px; border-radius: 12px; overflow: hidden; background: rgba(0, 0, 0, .05); }
.pv img { width: 100%; height: 100%; object-fit: cover; }
.pv button { position: absolute; top: 3px; right: 3px; width: 18px; height: 18px; border-radius: 50%; background: rgba(0, 0, 0, .72); color: #fff; display: grid; place-items: center; opacity: 0; transition: opacity .15s; }
.pv:hover button, .pv button:focus-visible { opacity: 1; }
.pv button .ic { width: 10px; height: 10px; }
@media (hover: none) { .pv button { opacity: 1; } }
.mat-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 5px 6px 5px 10px; border-radius: 10px; background: rgba(0, 0, 0, .06); font-size: 13px; color: var(--ink-2); min-width: 0; }
.mat-chip span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mat-chip .ic { width: 15px; height: 15px; }
.mat-chip button { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 6px; color: var(--muted); flex: none; }
.mat-chip button:hover { background: rgba(0, 0, 0, .08); color: var(--ink); }
.mat-chip button .ic { width: 11px; height: 11px; }

/* голосовой режим */
.voice { position: fixed; inset: 0; z-index: 30; display: flex; flex-direction: column; align-items: center; padding: max(20px, env(safe-area-inset-top)) 20px max(28px, env(safe-area-inset-bottom)); background: rgba(240, 240, 240, .72); -webkit-backdrop-filter: blur(40px) saturate(160%); backdrop-filter: blur(40px) saturate(160%); animation: fade .3s var(--ease); }
@keyframes fade { from { opacity: 0; } }
.voice-top { width: 100%; max-width: 640px; display: flex; justify-content: space-between; font-size: 14px; color: var(--ink-2); font-weight: 600; }
.voice-timer { font-variant-numeric: tabular-nums; }
.voice-orb-wrap { flex: 1; display: grid; place-items: center; min-height: 200px; }
.voice-status { font-size: 15px; color: var(--ink-2); margin-bottom: 10px; min-height: 24px; text-align: center; }
.voice-lines { width: 100%; max-width: 640px; max-height: 26vh; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; font-size: 15px; mask-image: linear-gradient(transparent, #000 30%); -webkit-mask-image: linear-gradient(transparent, #000 30%); }
.voice-lines .u { align-self: flex-end; color: var(--muted); text-align: right; }
.voice-lines .a { color: var(--ink); }
.voice-bar { display: flex; gap: 22px; }
.round { position: relative; width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; }
.round .ic { width: 24px; height: 24px; }
.round.end { background: var(--ink); color: #fff; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); }
.round.muted { background: var(--ink); color: #fff; }

/* модальные окна */
.modal { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 16px; background: rgba(0, 0, 0, .18); animation: fade .2s; }
.sheet { width: 100%; max-width: 460px; max-height: calc(100dvh - 32px); overflow-y: auto; border-radius: 28px; padding: 26px; background: rgba(255, 255, 255, .78); position: relative; animation: pop .3s var(--ease); }
.sheet.wide { max-width: 760px; }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.98); } }
.sheet h2 { margin: 0 0 6px; font-size: 26px; letter-spacing: -.03em; line-height: 1.1; }
.sheet .sub { margin: 0 0 18px; color: var(--ink-2); font-size: 15px; }
.sheet .x { position: absolute; top: 14px; right: 14px; }
.field { width: 100%; padding: 14px 16px; border-radius: 16px; border: 1px solid rgba(0, 0, 0, .1); background: rgba(255, 255, 255, .8); outline: 0; font-size: 17px; transition: border-color .15s, box-shadow .15s; }
.field:focus { border-color: var(--ink); box-shadow: 0 0 0 4px rgba(0, 0, 0, .06); }
.field.code { letter-spacing: .5em; text-align: center; font-size: 26px; font-weight: 700; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 15px; border-radius: 16px; background: var(--ink); color: #fff; font-weight: 700; font-size: 16px; margin-top: 12px; transition: transform .15s var(--ease), opacity .15s; }
.btn:disabled { opacity: .4; cursor: default; }
.btn:not(:disabled):active { transform: scale(.985); }
.btn.ghost { background: rgba(0, 0, 0, .06); color: var(--ink); }
.btn.sm { width: auto; padding: 10px 16px; font-size: 14px; margin-top: 0; border-radius: 12px; }
.err { color: #000; font-size: 14px; margin-top: 10px; font-weight: 600; }
.err::before { content: "— "; }
.hint { color: var(--muted); font-size: 13px; margin-top: 12px; }
.linkbtn { color: var(--ink); text-decoration: underline; font-size: 14px; }

.plans { display: flex; flex-direction: column; gap: 10px; margin: 4px 0 14px; }
.plan { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: 18px; border: 1.5px solid rgba(0, 0, 0, .1); background: rgba(255, 255, 255, .6); text-align: left; transition: border-color .15s, background .15s; }
.plan.on { border-color: var(--ink); background: #fff; box-shadow: 0 8px 24px rgba(0, 0, 0, .08); }
.plan .radio { width: 22px; height: 22px; border-radius: 50%; border: 2px solid rgba(0, 0, 0, .25); flex: none; position: relative; }
.plan.on .radio { border-color: var(--ink); }
.plan.on .radio::after { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--ink); }
.plan .pt { flex: 1; }
.plan .pt b { font-size: 17px; display: block; }
.plan .pt span { font-size: 13px; color: var(--ink-2); }
.plan .pp { text-align: right; }
.plan .pp b { font-size: 20px; display: block; letter-spacing: -.02em; }
.plan .pp s { color: var(--muted); font-size: 13px; }
.save { display: inline-block; font-size: 12px; font-weight: 700; background: var(--ink); color: #fff; border-radius: 6px; padding: 1px 6px; margin-left: 6px; vertical-align: 2px; }
.feat { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 8px; font-size: 15px; }
.feat li { display: flex; gap: 10px; align-items: flex-start; }
.feat li::before { content: ""; width: 18px; height: 18px; flex: none; margin-top: 3px; border-radius: 50%; background: var(--ink) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5 9-10'/%3E%3C/svg%3E") center/12px no-repeat; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: #000; flex: none; }
.qr { display: grid; place-items: center; padding: 14px; background: #fff; border-radius: 18px; margin: 10px auto; width: fit-content; }
.steps { display: flex; flex-direction: column; gap: 8px; font-size: 14px; color: var(--ink-2); margin: 10px 0; }

/* материалы */
.mats { display: grid; gap: 8px; margin: 12px 0; }
.mat { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; background: rgba(255, 255, 255, .6); border: 1px solid var(--line); text-align: left; width: 100%; }
.mat:hover { background: #fff; }
.mat .mi { width: 36px; height: 36px; border-radius: 10px; background: var(--ink); color: #fff; display: grid; place-items: center; flex: none; }
.mat .mt { min-width: 0; flex: 1; }
.mat .mt b { display: block; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mat .mt span { font-size: 12.5px; color: var(--muted); }
.add-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.add-row button { padding: 14px 8px; border-radius: 16px; background: rgba(255, 255, 255, .7); border: 1px solid var(--line); font-size: 14px; font-weight: 600; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.add-row button:hover { background: #fff; }
.tools { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0; }
.tool { padding: 14px 12px; border-radius: 16px; background: rgba(255, 255, 255, .7); border: 1px solid var(--line); text-align: left; font-size: 14px; font-weight: 600; display: flex; flex-direction: column; gap: 8px; transition: background .15s, transform .15s var(--ease); }
.tool:hover { background: #fff; transform: translateY(-1px); }
.tool svg { width: 22px; height: 22px; }
.tool.primary { background: var(--ink); color: #fff; border-color: var(--ink); }
.arts { display: grid; gap: 6px; }
.art { display: flex; justify-content: space-between; gap: 10px; padding: 10px 12px; border-radius: 12px; background: rgba(255, 255, 255, .55); font-size: 14px; text-align: left; width: 100%; }
.art span { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.preview { font-size: 13px; color: var(--ink-2); background: rgba(255, 255, 255, .5); border-radius: 14px; padding: 12px; max-height: 140px; overflow: hidden; mask-image: linear-gradient(#000 60%, transparent); -webkit-mask-image: linear-gradient(#000 60%, transparent); white-space: pre-wrap; }
.seg { display: inline-flex; padding: 3px; border-radius: 12px; background: rgba(0, 0, 0, .06); margin-bottom: 10px; }
.seg button { padding: 7px 14px; border-radius: 9px; font-size: 14px; font-weight: 600; color: var(--ink-2); }
.seg button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 4px rgba(0, 0, 0, .1); }
textarea.field { min-height: 160px; resize: vertical; font-size: 15px; }

/* артефакты */
.quiz-q { margin: 0 0 16px; }
.quiz-q > b { display: block; margin-bottom: 8px; font-size: 16px; }
.opt { display: block; width: 100%; text-align: left; padding: 11px 14px; border-radius: 14px; background: rgba(255, 255, 255, .7); border: 1px solid var(--line); margin-bottom: 6px; font-size: 15px; transition: background .15s; }
.opt:hover { background: #fff; }
.opt.right { background: var(--ink); color: #fff; border-color: var(--ink); }
.opt.wrong { background: #fff; text-decoration: line-through; color: var(--muted); }
.why { font-size: 14px; color: var(--ink-2); padding: 4px 4px 0; }
.score { font-size: 15px; font-weight: 700; padding: 12px 14px; border-radius: 14px; background: rgba(0, 0, 0, .06); margin-top: 8px; }
.card-stage { perspective: 1200px; margin: 10px 0; }
.fcard { position: relative; height: 240px; transform-style: preserve-3d; transition: transform .5s var(--ease); cursor: pointer; }
.fcard.flip { transform: rotateY(180deg); }
.fcard > div { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 22px; display: grid; place-items: center; padding: 24px; text-align: center; font-size: 19px; font-weight: 600; }
.fcard .front { background: #fff; box-shadow: var(--shadow); }
.fcard .back { background: var(--ink); color: #fff; transform: rotateY(180deg); font-weight: 500; font-size: 17px; }
.card-nav { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); }
.mm ul { list-style: none; padding-left: 18px; margin: 0; border-left: 1.5px solid rgba(0, 0, 0, .15); }
.mm > ul { border-left: 0; padding-left: 0; }
.mm li { margin: 6px 0; }
.mm .node { display: inline-block; padding: 6px 12px; border-radius: 12px; background: rgba(255, 255, 255, .8); border: 1px solid var(--line); font-size: 14px; cursor: pointer; }
.mm > ul > li > .node { background: var(--ink); color: #fff; font-weight: 700; font-size: 16px; }
.mm li.closed > ul { display: none; }
.tl { list-style: none; padding: 0; margin: 0; position: relative; }
.tl::before { content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: rgba(0, 0, 0, .12); }
.tl li { position: relative; padding: 0 0 14px 28px; }
.tl li::before { content: ""; position: absolute; left: 1px; top: 6px; width: 14px; height: 14px; border-radius: 50%; background: var(--ink); box-shadow: 0 0 0 4px rgba(255, 255, 255, .9); }
.tl b { display: block; font-size: 13px; color: var(--muted); }
.lesson { display: flex; gap: 14px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--line); }
.lesson .n { width: 40px; height: 40px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; font-weight: 800; flex: none; }
.lesson .lt { flex: 1; font-size: 14px; color: var(--ink-2); }
.lesson .lt b { display: block; color: var(--ink); font-size: 16px; }
audio { width: 100%; margin: 8px 0; }

.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 50; padding: 12px 18px; border-radius: 16px; background: var(--ink); color: #fff; font-size: 14px; box-shadow: 0 12px 30px rgba(0, 0, 0, .25); animation: pop .25s var(--ease); max-width: calc(100vw - 32px); }

.only-mobile { display: none; }
@media (max-width: 860px) {
  :root { --side: 286px; }
  .only-mobile { display: grid; }
  .side { position: fixed; top: 0; bottom: 0; left: 0; z-index: 20; margin: 8px; transform: translateX(calc(-100% - 20px)); background: rgba(250, 250, 250, .86); }
  .app.side-on .side { transform: none; }
  .app.side-on::after { content: ""; position: fixed; inset: 0; z-index: 15; background: rgba(0, 0, 0, .15); }
  .top { padding: 10px 12px 4px; min-height: 54px; }
  .evil-txt { font-size: 13px; }
  .chat { padding: 4px 16px 16px; }
  .composer-wrap { padding: 0 12px 10px; padding-bottom: max(10px, env(safe-area-inset-bottom)); }
  .hero { margin-top: 14vh; }
  .hero-sub { font-size: 16px; }
  .msg.user { max-width: 90%; }
  .tools { grid-template-columns: repeat(2, 1fr); }
  .sheet { padding: 22px 18px; border-radius: 24px; }
  .goals { flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; margin: 10px -12px 0; padding: 0 12px; scrollbar-width: none; }
  .goals::-webkit-scrollbar { display: none; }
  .chip { flex: none; }
}

/* вход через ВКонтакте — первая кнопка окна входа */
.btn.vk { margin-top: 4px; }
.btn.vk .ic { width: 22px; height: 22px; }
.or { display: flex; align-items: center; gap: 12px; margin: 18px 0 12px; color: var(--muted); font-size: 13px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* выбор голоса в голосовом режиме */
.voice-top { position: relative; align-items: center; }
.voice-name { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; font-weight: 600; font-size: 14px; color: var(--ink); background: rgba(255, 255, 255, .55); border: 1px solid var(--glass-edge); box-shadow: var(--shadow); }
.voice-name .chev { width: 12px; height: 12px; }
.voice-menu { position: absolute; z-index: 2; top: max(64px, calc(env(safe-area-inset-top) + 52px)); left: 50%; transform: translateX(-50%); width: min(360px, calc(100vw - 32px)); max-height: 60vh; overflow-y: auto; border-radius: 22px; padding: 8px; background: rgba(255, 255, 255, .82); animation: pop .25s var(--ease); }
.vm-head { font-size: 12px; color: var(--muted); padding: 8px 10px 6px; }
.vm-row { display: flex; align-items: center; gap: 6px; border-radius: 14px; }
.vm-row.on { background: var(--ink); color: #fff; }
.vm-row.on .vm-pick span { color: rgba(255, 255, 255, .65); }
.vm-pick { flex: 1; text-align: left; padding: 10px 12px; border-radius: 14px; }
.vm-row:not(.on) .vm-pick:hover { background: rgba(0, 0, 0, .05); }
.vm-pick b { display: block; font-size: 15px; }
.vm-pick span { font-size: 12.5px; color: var(--muted); }
.vm-play { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex: none; margin-right: 6px; background: rgba(0, 0, 0, .06); }
.vm-row.on .vm-play { background: rgba(255, 255, 255, .18); }
.vm-play svg { width: 12px; height: 12px; }
.vm-note { font-size: 12.5px; color: var(--muted); padding: 6px 10px 4px; margin: 0; }

/* расход и материалы целиком */
.usage { display: grid; gap: 7px; padding: 10px 10px 8px; border-radius: 14px; background: rgba(255, 255, 255, .5); }
.use-row { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; font-size: 12.5px; color: var(--ink-2); }
.use-row b { font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.use-row i { grid-column: 1 / -1; height: 4px; border-radius: 4px; background: rgba(0, 0, 0, .08); overflow: hidden; }
.use-row em { display: block; height: 100%; background: var(--ink); border-radius: 4px; transition: width .4s var(--ease); }
.tool small { display: block; font-weight: 500; font-size: 12px; color: var(--muted); margin-top: -4px; }
.tool.primary small { color: rgba(255, 255, 255, .6); }
.tool.hl { border: 1.5px solid var(--ink); box-shadow: 0 6px 18px rgba(0, 0, 0, .1); }
.notice { padding: 12px 14px; border-radius: 14px; background: rgba(0, 0, 0, .05); font-size: 14px; color: var(--ink-2); margin: 0 0 12px; }
.notice b { color: var(--ink); }
.progress { height: 8px; border-radius: 8px; background: rgba(0, 0, 0, .08); overflow: hidden; margin: 14px 0 4px; }
.progress i { display: block; height: 100%; width: 0; background: var(--ink); border-radius: 8px; transition: width .2s; }

/* ── элементы по образцу WhiteCoat Pro ── */
/* панель результата справа; на телефоне — на весь экран */
.panel { position: relative; width: min(46vw, 640px); margin: 10px 10px 10px 0; border-radius: var(--r); display: flex; flex-direction: column; flex: none; background: rgba(255, 255, 255, .72); animation: slide-in .35s var(--ease); }
@keyframes slide-in { from { opacity: 0; transform: translateX(16px); } }
.panel-top { display: flex; align-items: center; gap: 6px; padding: 10px 10px 4px 18px; }
.panel-kind { flex: 1; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.panel-body { flex: 1; overflow-y: auto; padding: 4px 22px 22px; }
.panel-body h2 { font-size: 24px; letter-spacing: -.03em; line-height: 1.15; margin: 4px 0 10px; }
.panel-body .btn { width: auto; padding: 11px 16px; font-size: 14px; margin: 10px 8px 0 0; }
.panel-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
@media (max-width: 1180px) { .panel { position: fixed; top: 10px; right: 10px; bottom: 10px; z-index: 30; margin: 0; width: min(560px, calc(100vw - 20px)); background: rgba(250, 250, 250, .9); box-shadow: 0 30px 80px rgba(0, 0, 0, .2), var(--shadow); } }
@media (max-width: 860px) {
  .panel { position: fixed; inset: 0; z-index: 36; width: auto; margin: 0; border-radius: 0; padding-top: env(safe-area-inset-top); background: rgba(245, 245, 245, .96); }
}

/* шапка: серия и «Поделиться» */
.streak-chip, .share-btn { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 999px; font-size: 13.5px; font-weight: 600; background: rgba(255, 255, 255, .6); border: 1px solid var(--glass-edge); box-shadow: var(--shadow); white-space: nowrap; }
.streak-chip i { width: 8px; height: 8px; border-radius: 50%; background: var(--ink); box-shadow: 0 0 0 3px rgba(0, 0, 0, .1); }
.share-btn .ic { width: 16px; height: 16px; }
@media (max-width: 560px) { .share-btn span { display: none; } .share-btn { padding: 0 10px; } }

/* поиск по чатам */
.side-search { margin: 10px 2px 4px; padding: 9px 12px; border-radius: 12px; border: 1px solid rgba(0, 0, 0, .06); background: rgba(255, 255, 255, .55); outline: 0; font-size: 14px; }
.side-search:focus { border-color: var(--ink); background: #fff; }

/* инструменты в поле ввода */
.tools-btn { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px 0 10px; border-radius: 999px; font-size: 13.5px; font-weight: 600; color: var(--ink-2); background: rgba(0, 0, 0, .05); }
.tools-btn:hover { background: rgba(0, 0, 0, .09); color: var(--ink); }
.tools-btn .ic { width: 17px; height: 17px; }
.tool-chip { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 4px 0 10px; border-radius: 10px; background: var(--ink); color: #fff; font-size: 13px; font-weight: 600; white-space: nowrap; }
.tool-chip .ic { width: 15px; height: 15px; }
.tool-chip button { width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center; color: rgba(255, 255, 255, .7); }
.tool-chip button .ic { width: 10px; height: 10px; }
@media (max-width: 560px) { .tools-btn span { display: none; } .tools-btn { padding: 0 9px; } }
.tools-menu { position: relative; max-width: 760px; margin: 0 auto 8px; border-radius: 20px; padding: 8px; background: rgba(255, 255, 255, .86); animation: pop .2s var(--ease); }
.tm-search { width: 100%; padding: 10px 12px; border-radius: 12px; border: 1px solid rgba(0, 0, 0, .08); outline: 0; font-size: 15px; background: #fff; }
.tm-list { max-height: 300px; overflow-y: auto; margin-top: 6px; }
.tm-sec { font-size: 11.5px; color: var(--muted); padding: 8px 10px 2px; text-transform: uppercase; letter-spacing: .04em; }
.tm-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 10px; border-radius: 12px; text-align: left; }
.tm-item.on, .tm-item:hover { background: rgba(0, 0, 0, .06); }
.tm-item span { flex: 1; min-width: 0; }
.tm-item b { display: block; font-size: 14.5px; }
.tm-item small { font-size: 12.5px; color: var(--muted); }
.tm-item em { font-style: normal; font-size: 12px; color: var(--muted); }
.tm-hint { font-size: 12px; color: var(--muted); padding: 6px 10px 2px; margin: 0; }
.suggest { max-width: 760px; margin: 0 auto 8px; display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.suggest button { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; background: var(--ink); color: #fff; font-weight: 600; font-size: 13px; }
.suggest .ic { width: 15px; height: 15px; }

/* под ответом */
.msg-tools button.on { background: var(--ink); color: #fff; }
.make-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; font-size: 12.5px; color: var(--muted); }
.mk { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px; background: rgba(255, 255, 255, .7); border: 1px solid var(--line); font-size: 13px; font-weight: 600; color: var(--ink-2); transition: background .15s, transform .15s var(--ease); }
.mk:hover { background: #fff; color: var(--ink); transform: translateY(-1px); }
.mk .ic { width: 15px; height: 15px; }
.mk em { font-style: normal; font-size: 11px; font-weight: 700; color: var(--muted); padding-left: 4px; border-left: 1px solid var(--line); }
.dive { margin-left: 8px; padding: 2px 8px; border-radius: 7px; font-size: 11.5px; font-weight: 700; letter-spacing: .01em; color: var(--ink-2); background: rgba(0, 0, 0, .06); vertical-align: 2px; transition: background .15s; }
.dive:hover { background: var(--ink); color: #fff; }

/* «Сегодня» на пустом экране */
.today { max-width: 460px; margin: 26px auto 0; text-align: left; border-radius: 20px; padding: 14px 16px; background: rgba(255, 255, 255, .6); border: 1px solid var(--glass-edge); box-shadow: var(--shadow); }
.td-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.td-head b { font-size: 14.5px; }
.dots { display: flex; gap: 5px; }
.dots span { width: 10px; height: 10px; border-radius: 50%; background: rgba(0, 0, 0, .1); }
.dots span.on { background: var(--ink); }
.dots span.now { box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px rgba(0, 0, 0, .25); }
.td-task { margin-top: 10px; font-size: 14.5px; }
.td-task small { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.td-task p { margin: 4px 0 10px; }
.td-row { display: flex; gap: 8px; }
.td-row .btn { margin: 0; }
.td-ans { margin-top: 10px; padding: 10px 12px; border-radius: 12px; background: rgba(0, 0, 0, .05); font-size: 14px; }
.td-done { margin-top: 8px; font-size: 14px; color: var(--ink-2); }

/* полоса остатка и «Поделиться» */
.low { max-width: 760px; margin: 0 auto 8px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 8px 8px 14px; border-radius: 14px; background: var(--ink); color: #fff; font-size: 13.5px; }
.low button:not(.btn) { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; color: rgba(255, 255, 255, .7); }
.low .btn { background: #fff; color: var(--ink); }
.low .ic { width: 12px; height: 12px; }
.share-url { display: flex; gap: 8px; }
.share-url .field { font-size: 14px; padding: 11px 12px; }
.wall.shared { margin-bottom: 8px; }

/* ── путь уроков (LearnPath WCP) ── */
.badge-n { margin-left: auto; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 99px; background: var(--ink); color: #fff; font-size: 12px; font-weight: 700; display: inline-grid; place-items: center; }
.side-link { width: 100%; }
.path-head { margin: 4px 0 18px; }
.path-head > div:first-child { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 6px; }
.path-head span { color: var(--muted); }
.bar { height: 10px; border-radius: 10px; background: rgba(0, 0, 0, .08); overflow: hidden; flex: 1; }
.bar i { display: block; height: 100%; width: 0; border-radius: 10px; background: var(--ink); transition: width .5s var(--ease); }
.path { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 8px 0 20px; }
.node-row { display: flex; flex-direction: column; align-items: center; gap: 6px; transform: translateX(var(--x)); }
.pnode { width: 72px; height: 66px; border-radius: 50%; display: grid; place-items: center; font-size: 22px; font-weight: 800; color: #fff; background: var(--ink); box-shadow: 0 7px 0 #000, 0 14px 24px rgba(0, 0, 0, .18); transition: transform .12s var(--ease), box-shadow .12s; }
.pnode:active:not(:disabled) { transform: translateY(5px); box-shadow: 0 2px 0 #000, 0 6px 14px rgba(0, 0, 0, .18); }
.pnode.open { animation: pulse 1.8s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 7px 0 #000, 0 0 0 10px rgba(0, 0, 0, .08), 0 14px 24px rgba(0, 0, 0, .18); } }
.pnode.done { background: #fff; color: var(--ink); box-shadow: 0 7px 0 #cfcfcf, 0 14px 24px rgba(0, 0, 0, .1); border: 2px solid var(--ink); }
.pnode.locked { background: #e3e3e3; color: #a5a5a5; box-shadow: 0 7px 0 #cbcbcb; cursor: default; }
.plabel { text-align: center; font-size: 13px; max-width: 220px; }
.plabel b { display: block; font-size: 14px; }
.plabel span { color: var(--muted); }
.star { width: 16px; height: 16px; fill: #d9d9d9; stroke: none; }
.star.on { fill: var(--ink); }
.stars { display: inline-flex; gap: 2px; }
.stars.big .star { width: 54px; height: 54px; }
.stars.big { gap: 6px; justify-content: center; margin-bottom: 10px; }

/* ── проигрыватель урока и повторения — на весь экран ── */
.lesson-ov { position: fixed; inset: 0; z-index: 45; background: #f6f6f6; display: flex; flex-direction: column; padding: max(14px, env(safe-area-inset-top)) 0 0; animation: fade .25s var(--ease); }
.lo-top { display: flex; align-items: center; gap: 14px; width: 100%; max-width: 720px; margin: 0 auto; padding: 0 16px; }
.lo-top .bar { height: 14px; }
.lo-top .snd { font-size: 18px; font-weight: 700; }
.rv-left { flex: 1; text-align: center; font-size: 14px; color: var(--ink-2); font-weight: 600; }
.lo-body { flex: 1; overflow-y: auto; width: 100%; max-width: 640px; margin: 0 auto; padding: 26px 16px 20px; position: relative; }
.lo-wait { text-align: center; margin-top: 18vh; color: var(--ink-2); }
.lo-type { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; }
.lo-q { font-size: clamp(20px, 3.4vw, 26px); line-height: 1.3; letter-spacing: -.02em; margin: 8px 0 22px; }
.lo-opts { display: grid; gap: 10px; }
.lo-opts.two { grid-template-columns: 1fr 1fr; }
.lo-opt { padding: 15px 16px; border-radius: 16px; background: #fff; border: 2px solid #e2e2e2; box-shadow: 0 4px 0 #e2e2e2; font-size: 16px; font-weight: 600; text-align: left; transition: transform .1s, border-color .15s, background .15s; }
.lo-opt:active { transform: translateY(3px); box-shadow: 0 1px 0 #e2e2e2; }
.lo-opt.sel { border-color: var(--ink); box-shadow: 0 4px 0 var(--ink); }
.lo-opt.right { background: var(--ink); color: #fff; border-color: var(--ink); box-shadow: 0 4px 0 #000; }
.lo-opt.wrong { text-decoration: line-through; color: var(--muted); }
.lo-match { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.lo-match > div { display: grid; gap: 10px; align-content: start; }
.lo-opt.m { font-size: 14.5px; }
.lo-opt.done { opacity: .3; pointer-events: none; }
.lo-opt.shake { animation: shake .35s; border-color: #000; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.lo-ans { min-height: 64px; display: flex; flex-wrap: wrap; gap: 8px; padding: 12px; border-radius: 16px; border: 2px dashed #d0d0d0; margin-bottom: 16px; align-content: flex-start; }
.lo-pool { display: flex; flex-wrap: wrap; gap: 8px; }
.lo-ph { color: var(--muted); font-size: 14px; }
.chip-o { padding: 11px 14px; border-radius: 14px; background: #fff; border: 2px solid #e2e2e2; box-shadow: 0 3px 0 #e2e2e2; font-size: 15px; font-weight: 600; text-align: left; }
.lo-foot { width: 100%; padding: 16px 16px max(18px, env(safe-area-inset-bottom)); border-top: 1px solid #e6e6e6; background: #fff; display: flex; align-items: center; justify-content: center; gap: 16px; }
.lo-foot > .btn { max-width: 640px; margin: 0; }
.lo-foot.ok { background: #111; color: #fff; border-color: #111; }
.lo-foot.ok .btn { background: #fff; color: #111; }
.lo-foot.bad { background: #fff; border-top: 2px solid #111; }
.lo-fb { flex: 1; max-width: 460px; display: flex; flex-direction: column; gap: 3px; font-size: 14px; }
.lo-fb b { font-size: 19px; }
.lo-fb em { font-style: normal; opacity: .65; font-size: 13px; }
.lo-foot.ok .lo-fb, .lo-foot.bad .lo-fb { text-align: left; }
.lo-foot .btn { width: auto; min-width: 160px; }
.lo-win { text-align: center; margin-top: 8vh; position: relative; z-index: 1; }
.lo-win h2 { font-size: 30px; letter-spacing: -.03em; margin: 6px 0 22px; }
.lo-stats { display: flex; justify-content: center; gap: 12px; }
.lo-stats div { min-width: 96px; padding: 12px; border-radius: 16px; border: 2px solid var(--ink); background: #fff; }
.lo-stats b { display: block; font-size: 22px; }
.lo-stats span { font-size: 12.5px; color: var(--muted); }
.confetti { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.confetti i { position: absolute; top: -20px; left: var(--x); width: 9px; height: 14px; background: var(--ink); border-radius: 2px; opacity: .85; animation: fall 1.9s var(--d) cubic-bezier(.3, .6, .4, 1) forwards; transform: rotate(var(--r)); }
.confetti i:nth-child(3n) { background: #8a8a8a; width: 7px; height: 7px; border-radius: 50%; }
.confetti i:nth-child(4n) { background: #cfcfcf; }
@keyframes fall { to { top: 105%; transform: rotate(calc(var(--r) + 540deg)); opacity: .2; } }
@media (prefers-reduced-motion: reduce) { .confetti { display: none; } .pnode.open { animation: none; } }
.rv-card { margin-top: 14px; border-radius: 24px; background: #fff; box-shadow: 0 2px 0 #e2e2e2, var(--shadow); padding: 30px 24px; text-align: center; }
.rv-front { font-size: 22px; font-weight: 700; letter-spacing: -.01em; }
.rv-back { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 17px; color: var(--ink-2); }
.rv-grades { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; width: 100%; max-width: 640px; }
.rv-g { padding: 10px 6px; border-radius: 14px; border: 2px solid #e2e2e2; background: #fff; box-shadow: 0 3px 0 #e2e2e2; }
.rv-g b { display: block; font-size: 15px; }
.rv-g span { font-size: 12px; color: var(--muted); }
.rv-g.main { background: var(--ink); color: #fff; border-color: var(--ink); box-shadow: 0 3px 0 #000; }
.rv-g.main span { color: rgba(255, 255, 255, .65); }

/* ── библиотека ── */
.lib-search { margin: 14px 0 8px; font-size: 15px; padding: 11px 14px; }
.lib-folders { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 4px; }
.lib-folders .chip { font-size: 13px; padding: 6px 12px; }
.mat .fold { font-size: 12px; padding: 3px 9px; border-radius: 8px; background: rgba(0, 0, 0, .06); color: var(--ink-2); white-space: nowrap; }
.mat-folder { display: flex; align-items: center; gap: 10px; margin: 12px 0 4px; color: var(--muted); }
.mat-folder .field { font-size: 14px; padding: 10px 12px; }
.msg-tools .fb { display: inline-grid; place-items: center; }
.msg-tools .fb .ic { width: 15px; height: 15px; }
.msg-tools .fb.down .ic { transform: scaleY(-1); }
