:root {
  --bg: #ffffff;
  --bg-2: #f5f5f7;
  --bg-3: #ececef;
  --ink: #141416;
  --ink-2: #6b6b73;
  --ink-3: #a3a3ab;
  --line: #ededf0;
  --accent: #2d5bff;
  --accent-soft: #e9eeff;
  --danger: #e5484d;
  --danger-soft: #fdecec;
  --sheet: #ffffff;
  --scrim: rgba(20, 20, 22, 0.32);
  --shadow: 0 10px 30px rgba(20, 20, 22, 0.08), 0 2px 6px rgba(20, 20, 22, 0.05);
  --r-blue: #2d5bff; --r-violet: #7a5af8; --r-coral: #f0663e; --r-green: #2f9e5b;
  --r-amber: #e59a1a; --r-pink: #e0457b; --r-teal: #1a9e9a; --r-gray: #8a8a93;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.34, 1.4, .64, 1);
  --font: 'Onest', -apple-system, system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --safe-b: max(env(safe-area-inset-bottom, 0px), var(--tg-safe-area-inset-bottom, 0px));
  --safe-t: calc(var(--tg-safe-area-inset-top, 0px) + var(--tg-content-safe-area-inset-top, 0px));
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #0f0f11;
  --bg-2: #1b1b1e;
  --bg-3: #26262a;
  --ink: #f3f3f4;
  --ink-2: #9b9ba3;
  --ink-3: #64646b;
  --line: #222226;
  --accent: #6d8cff;
  --accent-soft: #1d2340;
  --danger: #ff6b6f;
  --danger-soft: #3a1c1e;
  --sheet: #18181b;
  --scrim: rgba(0, 0, 0, 0.55);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); }
body {
  font-family: var(--font); font-size: 16px; line-height: 1.4; -webkit-font-smoothing: antialiased;
  overscroll-behavior: none; transition: background-color .3s var(--ease), color .3s var(--ease);
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

#app { min-height: 100%; padding-top: var(--safe-t); }

/* ---------- маскот ---------- */
.face {
  font-family: var(--mono); font-weight: 500; white-space: pre; letter-spacing: -0.06em;
  display: inline-flex; align-items: center; justify-content: center; user-select: none;
  transition: transform .45s var(--spring);
}
.face.pop { transform: scale(1.18) translateY(-2px); }
.face.wiggle { animation: wiggle .5s var(--ease); }
@keyframes wiggle { 20% { transform: rotate(-8deg); } 50% { transform: rotate(6deg); } 80% { transform: rotate(-3deg); } }
.face-acc { font-family: var(--mono); color: var(--ink-3); font-size: .5em; margin-left: .15em; transform: translateY(-.6em); display: inline-block; }

/* ---------- шапка ---------- */
.head { padding: 18px 20px 6px; display: flex; align-items: center; gap: 14px; }
.head .face { font-size: 30px; min-width: 74px; height: 48px; justify-content: flex-start; cursor: pointer; }
.head h1 { margin: 0; font-size: 22px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.15; }
.head p { margin: 2px 0 0; color: var(--ink-2); font-size: 14px; }

/* ---------- вьюхи ---------- */
.view { padding-bottom: calc(168px + var(--safe-b)); animation: viewIn .35s var(--ease); }
@keyframes viewIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.title-row { display: flex; align-items: baseline; justify-content: space-between; padding: 22px 20px 4px; }
.title-row h2 { margin: 0; font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.title-row h2 .cnt { color: var(--ink-3); font-weight: 500; margin-left: 6px; }
.title-row.overdue h2 { color: var(--danger); }
.title-row .aside { font-size: 13px; color: var(--ink-3); }

/* ---------- строки дел ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.row {
  position: relative; display: flex; align-items: flex-start; gap: 14px; padding: 11px 20px 11px 20px;
  min-height: 52px; background: var(--bg); transition: background-color .2s;
}
.row:active { background: var(--bg-2); }
.row + .row::before { content: ''; position: absolute; left: 56px; right: 0; top: 0; height: 1px; background: var(--line); }
.row.hl { animation: hl 1.6s var(--ease); }
@keyframes hl { 0%, 40% { background: var(--accent-soft); } 100% { background: var(--bg); } }
.check {
  flex: none; width: 24px; height: 24px; margin-top: 1px; border-radius: 50%; border: 1.75px solid var(--ink-3);
  display: grid; place-items: center; position: relative; transition: border-color .2s, background-color .25s var(--ease), transform .3s var(--spring);
}
.check::after { content: ''; position: absolute; inset: -10px; }
.row[data-kind="meet"] .check { border-radius: 8px; }
.row[data-kind="deadline"] .check { border-style: dashed; }
.check svg { width: 14px; height: 14px; stroke: #fff; stroke-width: 2.4; fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 20; stroke-dashoffset: 20; transition: stroke-dashoffset .28s var(--ease) .05s; }
.row.done .check { background: var(--accent); border-color: var(--accent); transform: scale(1.08); }
.row.done .check svg { stroke-dashoffset: 0; }
.body { flex: 1; min-width: 0; }
.t { font-size: 16px; line-height: 1.35; word-wrap: break-word; position: relative; display: inline; background: linear-gradient(currentColor, currentColor) no-repeat 0 55% / 0 1.5px; transition: background-size .32s var(--ease), color .3s; }
.row.done .t { background-size: 100% 1.5px; color: var(--ink-3); }
.meta { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 3px; font-size: 13px; color: var(--ink-2); }
.meta span { display: inline-flex; align-items: center; gap: 4px; }
.meta svg { width: 13px; height: 13px; stroke: currentColor; fill: none; stroke-width: 2; }
.meta .late { color: var(--danger); }
.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; flex: none; }
.row.leaving { animation: leave .42s var(--ease) forwards; overflow: hidden; }
.row.leaving > * { transition: opacity .18s; opacity: 0; }
.row.leaving::before { opacity: 0; }
@keyframes leave { 0% { opacity: 1; } 100% { opacity: 0; transform: translateX(28px); max-height: 0; min-height: 0; padding-top: 0; padding-bottom: 0; } }
.row.entering { animation: enter .45s var(--spring); }
@keyframes enter { from { opacity: 0; transform: translateY(-8px) scale(.98); } to { opacity: 1; transform: none; } }

.done-toggle { margin: 18px 20px 0; font-size: 14px; color: var(--ink-2); display: inline-flex; align-items: center; gap: 6px; padding: 6px 0; }
.done-toggle svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2; transition: transform .25s var(--ease); }
.done-toggle.open svg { transform: rotate(180deg); }

/* ---------- пустое состояние ---------- */
.empty { text-align: center; padding: 64px 32px 24px; }
.empty .face { font-size: 44px; height: 64px; }
.empty h3 { margin: 14px 0 6px; font-size: 18px; font-weight: 600; }
.empty p { margin: 0 auto; max-width: 280px; color: var(--ink-2); font-size: 15px; }
.empty .ex { margin-top: 18px; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.ex button { font-size: 14px; color: var(--ink); background: var(--bg-2); padding: 9px 14px; border-radius: 14px; transition: transform .2s var(--spring), background-color .2s; }
.ex button:active { transform: scale(.97); background: var(--bg-3); }

/* ---------- композер ---------- */
.composer {
  position: fixed; left: 0; right: 0; bottom: calc(62px + var(--safe-b)); padding: 8px 12px 10px; z-index: 20;
  background: linear-gradient(to bottom, transparent, var(--bg) 28%);
}
.composer.hidden { transform: translateY(20px); opacity: 0; pointer-events: none; }
.composer { transition: transform .3s var(--ease), opacity .3s var(--ease); }
.chips-live { display: flex; gap: 6px; padding: 0 6px 8px; min-height: 0; flex-wrap: wrap; }
.chip-live { font-size: 13px; padding: 5px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); display: inline-flex; align-items: center; gap: 5px; animation: chipIn .3s var(--spring); }
.chip-live svg { width: 12px; height: 12px; stroke: currentColor; fill: none; stroke-width: 2.2; }
.chip-live.ai { background: var(--bg-2); color: var(--ink-2); }
@keyframes chipIn { from { opacity: 0; transform: scale(.8); } }
.bar { display: flex; align-items: flex-end; gap: 8px; background: var(--bg-2); border-radius: 26px; padding: 5px 5px 5px 16px; box-shadow: 0 0 0 1px var(--line); transition: box-shadow .2s; }
.bar:focus-within { box-shadow: 0 0 0 1.5px var(--ink); }
.bar textarea { flex: 1; border: 0; background: none; resize: none; outline: none; padding: 10px 0; max-height: 120px; line-height: 1.35; font-size: 16px; }
.bar textarea::placeholder { color: var(--ink-3); }
.ibtn { flex: none; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; transition: transform .25s var(--spring), background-color .2s, opacity .2s; }
.ibtn svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ibtn:active { transform: scale(.9); }
.ibtn.send { background: var(--ink); color: var(--bg); }
.ibtn.plus { color: var(--ink-2); }
.ibtn.mic { color: var(--ink); }
.ibtn.mic.rec { background: var(--danger); color: #fff; transform: scale(1.12); }
.rec-pill { position: absolute; left: 12px; right: 12px; bottom: 10px; height: 52px; border-radius: 26px; background: var(--ink); color: var(--bg); display: flex; align-items: center; gap: 12px; padding: 0 18px; font-size: 15px; animation: chipIn .25s var(--spring); }
.rec-pill .pulse { width: 10px; height: 10px; border-radius: 50%; background: var(--danger); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .3; transform: scale(.8); } }
.rec-pill .hint { margin-left: auto; opacity: .6; font-size: 13px; }

/* ---------- навигация ---------- */
.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; display: grid; grid-template-columns: repeat(4, 1fr);
  padding: 6px 8px calc(6px + var(--safe-b)); background: var(--bg); border-top: 1px solid var(--line);
}
.nav button { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 0; font-size: 11px; color: var(--ink-3); transition: color .2s; }
.nav svg { width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform .3s var(--spring); }
.nav button.on { color: var(--ink); }
.nav button.on svg { transform: translateY(-1px) scale(1.06); }
.nav .badge { position: absolute; margin-left: 18px; margin-top: -2px; min-width: 16px; height: 16px; border-radius: 8px; background: var(--accent); color: #fff; font-size: 10px; font-weight: 600; display: grid; place-items: center; padding: 0 4px; }
.nav button { position: relative; }

/* ---------- календарь ---------- */
.cal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 12px 6px 20px; }
.cal-head h2 { margin: 0; font-size: 22px; font-weight: 600; letter-spacing: -0.02em; text-transform: none; }
.cal-head h2 span { color: var(--ink-3); font-weight: 500; }
.cal-nav { display: flex; gap: 2px; }
.cal-nav button { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: var(--ink-2); }
.cal-nav button:active { background: var(--bg-2); }
.cal-nav svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; }
.cal-today { font-size: 14px; padding: 0 12px !important; width: auto !important; border-radius: 20px !important; color: var(--accent) !important; }
.wk { display: grid; grid-template-columns: repeat(7, 1fr); padding: 0 10px; font-size: 12px; color: var(--ink-3); text-align: center; margin-top: 4px; }
.grid { display: grid; grid-template-columns: repeat(7, 1fr); padding: 4px 10px 8px; touch-action: pan-y; }
.grid.slide-l { animation: slideL .32s var(--ease); }
.grid.slide-r { animation: slideR .32s var(--ease); }
@keyframes slideL { from { opacity: 0; transform: translateX(24px); } }
@keyframes slideR { from { opacity: 0; transform: translateX(-24px); } }
.day { height: 52px; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding-top: 4px; gap: 3px; border-radius: 14px; font-size: 15px; position: relative; }
.day .n { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; transition: background-color .2s, color .2s, transform .3s var(--spring); }
.day.out { color: var(--ink-3); opacity: .5; }
.day.today .n { color: var(--accent); font-weight: 600; }
.day.sel .n { background: var(--ink); color: var(--bg); transform: scale(1.04); }
.day.wknd { color: var(--ink-2); }
.day .dots { display: flex; gap: 2px; height: 4px; position: absolute; bottom: 5px; }
.day .dots i { width: 4px; height: 4px; border-radius: 50%; background: var(--ink-3); }
.day.sel .dots i { background: var(--ink); }
.agenda-title { padding: 14px 20px 2px; display: flex; align-items: baseline; gap: 8px; border-top: 1px solid var(--line); }
.agenda-title h3 { margin: 0; font-size: 17px; font-weight: 600; }
.agenda-title span { color: var(--ink-3); font-size: 14px; }
.agenda-empty { padding: 18px 20px; color: var(--ink-3); font-size: 15px; }
.agenda-empty button { color: var(--accent); }

/* ---------- комнаты ---------- */
.rooms { padding: 4px 0; }
.room-row { display: flex; align-items: center; gap: 14px; padding: 12px 20px; width: 100%; text-align: left; transition: background-color .2s; }
.room-row:active { background: var(--bg-2); }
.room-ava { width: 46px; height: 46px; border-radius: 16px; display: grid; place-items: center; color: #fff; font-weight: 600; font-size: 18px; flex: none; }
.room-row .b { flex: 1; min-width: 0; }
.room-row .nm { font-size: 16px; font-weight: 500; }
.room-row .sb { font-size: 13px; color: var(--ink-2); margin-top: 2px; }
.stack { display: flex; }
.stack .av { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--bg); margin-left: -8px; background: var(--bg-3); display: grid; place-items: center; font-size: 11px; font-weight: 600; color: var(--ink-2); overflow: hidden; }
.stack .av:first-child { margin-left: 0; }
.stack .av img { width: 100%; height: 100%; object-fit: cover; }
.actions { display: flex; gap: 8px; padding: 12px 20px 0; flex-wrap: wrap; }
.btn { height: 44px; padding: 0 18px; border-radius: 22px; font-size: 15px; font-weight: 500; display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: var(--bg-2); transition: transform .2s var(--spring), background-color .2s, opacity .2s; }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--ink); color: var(--bg); }
.btn.accent { background: var(--accent); color: #fff; }
.btn.danger { color: var(--danger); background: var(--danger-soft); }
.btn.ghost { background: none; color: var(--ink-2); }
.btn.wide { width: 100%; }
.btn svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn[aria-busy="true"] { opacity: .6; pointer-events: none; }
.room-hero { padding: 10px 20px 4px; display: flex; align-items: center; gap: 14px; }
.room-hero .room-ava { width: 56px; height: 56px; border-radius: 20px; font-size: 22px; }
.room-hero h1 { margin: 0; font-size: 22px; font-weight: 600; letter-spacing: -0.02em; }
.room-hero p { margin: 2px 0 0; color: var(--ink-2); font-size: 14px; }
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--ink-2); font-size: 15px; padding: 14px 20px 0; }
.back svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; }

/* ---------- профиль ---------- */
.prof { padding: 8px 20px; display: flex; align-items: center; gap: 14px; }
.prof .ava { width: 56px; height: 56px; border-radius: 50%; background: var(--bg-2); display: grid; place-items: center; font-size: 22px; font-weight: 600; color: var(--ink-2); overflow: hidden; }
.prof .ava img { width: 100%; height: 100%; object-fit: cover; }
.prof h1 { margin: 0; font-size: 20px; font-weight: 600; }
.prof p { margin: 2px 0 0; font-size: 14px; color: var(--ink-2); }
.plan { margin: 16px 20px 6px; padding: 18px; border-radius: 22px; background: var(--bg-2); position: relative; overflow: hidden; }
.plan .face { position: absolute; right: 18px; top: 16px; font-size: 22px; color: var(--ink-2); }
.plan h3 { margin: 0; font-size: 17px; font-weight: 600; }
.plan p { margin: 4px 0 14px; font-size: 14px; color: var(--ink-2); max-width: 85%; }
.plan.pro { background: var(--accent-soft); }
.plan.pro h3 { color: var(--accent); }
.plan ul { margin: 0 0 14px; padding: 0; list-style: none; font-size: 14px; display: grid; gap: 6px; }
.plan li { display: flex; gap: 8px; align-items: center; }
.plan li svg { width: 16px; height: 16px; stroke: var(--accent); fill: none; stroke-width: 2.2; flex: none; }
.group { margin: 18px 0 0; }
.group h4 { margin: 0; padding: 0 20px 6px; font-size: 13px; font-weight: 500; color: var(--ink-3); }
.set { display: flex; align-items: center; gap: 12px; width: 100%; padding: 13px 20px; min-height: 52px; text-align: left; font-size: 16px; transition: background-color .2s; }
.set:active { background: var(--bg-2); }
.set + .set { border-top: 1px solid var(--line); margin-left: 20px; padding-left: 0; width: calc(100% - 20px); }
.set .lbl { flex: 1; }
.set .val { color: var(--ink-2); font-size: 15px; }
.set svg.ch { width: 16px; height: 16px; stroke: var(--ink-3); fill: none; stroke-width: 2; }
.seg { display: inline-flex; background: var(--bg-2); border-radius: 12px; padding: 3px; position: relative; }
.seg button { font-size: 14px; padding: 7px 12px; border-radius: 9px; color: var(--ink-2); position: relative; z-index: 1; transition: color .2s; }
.seg button.on { color: var(--ink); background: var(--bg); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
[data-theme="dark"] .seg button.on { background: var(--bg-3); }
.switch { width: 50px; height: 30px; border-radius: 15px; background: var(--bg-3); position: relative; transition: background-color .25s; flex: none; }
.switch::after { content: ''; position: absolute; left: 3px; top: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .3s var(--spring); }
.switch.on { background: var(--accent); }
.switch.on::after { transform: translateX(20px); }
input[type="time"].inline { border: 0; background: var(--bg-2); border-radius: 10px; padding: 6px 10px; font-size: 15px; }
.foot { text-align: center; color: var(--ink-3); font-size: 12px; padding: 28px 0 0; }
.foot .face { font-size: 14px; }

/* ---------- листы ---------- */
.scrim { position: fixed; inset: 0; background: var(--scrim); z-index: 40; opacity: 0; transition: opacity .3s var(--ease); }
.scrim.on { opacity: 1; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 41; background: var(--sheet); border-radius: 26px 26px 0 0;
  max-height: calc(92vh - var(--safe-t)); overflow-y: auto; padding: 8px 20px calc(20px + var(--safe-b));
  transform: translateY(100%); transition: transform .42s var(--ease); box-shadow: var(--shadow); overscroll-behavior: contain;
}
.sheet.on { transform: none; }
.grab { width: 38px; height: 5px; border-radius: 3px; background: var(--bg-3); margin: 0 auto 14px; }
.sheet h2 { margin: 0 0 4px; font-size: 20px; font-weight: 600; letter-spacing: -0.01em; }
.sheet .sub { margin: 0 0 14px; color: var(--ink-2); font-size: 14px; }
.title-in { width: 100%; border: 0; outline: none; background: none; font-size: 22px; font-weight: 600; letter-spacing: -0.01em; padding: 6px 0; resize: none; line-height: 1.25; }
.note-in { width: 100%; border: 0; outline: none; background: var(--bg-2); border-radius: 14px; padding: 12px 14px; font-size: 15px; resize: none; min-height: 48px; margin-top: 6px; }
.field { margin-top: 18px; }
.field > label, .field > .fl { display: block; font-size: 13px; color: var(--ink-3); margin-bottom: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { height: 38px; padding: 0 14px; border-radius: 19px; background: var(--bg-2); font-size: 15px; display: inline-flex; align-items: center; gap: 6px; transition: background-color .2s, color .2s, transform .2s var(--spring); position: relative; }
.chip:active { transform: scale(.95); }
.chip.on { background: var(--ink); color: var(--bg); }
.chip input[type="date"], .chip input[type="time"] { position: absolute; inset: 0; opacity: 0; width: 100%; }
.chip .dot { width: 8px; height: 8px; }
.sheet-actions { display: flex; gap: 10px; margin-top: 24px; }
.sheet-actions .btn { flex: 1; height: 50px; border-radius: 25px; font-size: 16px; }
.mem { list-style: none; margin: 8px 0 0; padding: 0; }
.mem li { display: flex; align-items: flex-start; gap: 10px; padding: 12px 0; border-top: 1px solid var(--line); font-size: 15px; }
.mem li span { flex: 1; }
.mem li button { color: var(--ink-3); width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; }
.mem li button svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; }
.text-in { width: 100%; height: 48px; border: 0; outline: none; background: var(--bg-2); border-radius: 14px; padding: 0 14px; font-size: 16px; }
.err { color: var(--danger); font-size: 13px; margin-top: 6px; min-height: 0; }
.color-pick { display: flex; gap: 10px; flex-wrap: wrap; }
.color-pick button { width: 36px; height: 36px; border-radius: 50%; position: relative; transition: transform .25s var(--spring); }
.color-pick button.on { transform: scale(1.12); box-shadow: 0 0 0 3px var(--sheet), 0 0 0 5px currentColor; }

/* ---------- тосты ---------- */
.toasts { position: fixed; left: 12px; right: 12px; bottom: calc(140px + var(--safe-b)); z-index: 50; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast { pointer-events: auto; background: var(--ink); color: var(--bg); border-radius: 18px; padding: 11px 12px 11px 16px; font-size: 15px; display: flex; align-items: center; gap: 12px; max-width: 420px; width: max-content; box-shadow: var(--shadow); animation: toastIn .4s var(--spring); }
.toast .face { font-size: 14px; opacity: .8; }
.toast button { color: var(--accent); font-weight: 600; padding: 4px 6px; }
[data-theme="dark"] .toast button { color: #2d5bff; }
.toast.out { animation: toastOut .25s var(--ease) forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(14px) scale(.96); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(8px); } }

/* ---------- онбординг ---------- */
.onb { position: fixed; inset: 0; z-index: 60; background: var(--bg); display: flex; flex-direction: column; padding: calc(24px + var(--safe-t)) 24px calc(24px + var(--safe-b)); animation: viewIn .4s var(--ease); }
.onb .stage { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.onb .face { font-size: 52px; height: 80px; }
.onb h2 { margin: 18px 0 8px; font-size: 26px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.15; }
.onb p { margin: 0; color: var(--ink-2); font-size: 16px; max-width: 300px; }
.demo { width: 100%; max-width: 320px; height: 220px; margin: 28px auto 0; position: relative; }
.onb .dots-nav { display: flex; gap: 6px; justify-content: center; margin-bottom: 18px; }
.onb .dots-nav i { width: 6px; height: 6px; border-radius: 3px; background: var(--bg-3); transition: width .3s var(--ease), background-color .3s; }
.onb .dots-nav i.on { width: 20px; background: var(--ink); }
.onb .skip { position: absolute; top: calc(16px + var(--safe-t)); right: 16px; color: var(--ink-3); font-size: 15px; padding: 8px; }
.onb .stage > * { animation: viewIn .45s var(--ease) both; }
.onb .stage > :nth-child(2) { animation-delay: .05s; } .onb .stage > :nth-child(3) { animation-delay: .1s; } .onb .stage > :nth-child(4) { animation-delay: .15s; }

/* демо 1: сообщение превращается в дела */
.d-bubble { position: absolute; right: 0; top: 0; background: var(--bg-2); border-radius: 18px 18px 4px 18px; padding: 10px 14px; font-size: 14px; text-align: left; max-width: 260px; animation: d1b 6s var(--ease) infinite; }
.d-rows { position: absolute; left: 0; right: 0; top: 96px; text-align: left; }
.d-row { display: flex; align-items: center; gap: 10px; padding: 8px 4px; font-size: 14px; opacity: 0; animation: d1r 6s var(--ease) infinite; }
.d-row i { width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid var(--ink-3); flex: none; }
.d-row em { margin-left: auto; font-style: normal; color: var(--ink-3); font-size: 12px; }
.d-row:nth-child(2) { animation-delay: .15s; } .d-row:nth-child(3) { animation-delay: .3s; }
@keyframes d1b { 0% { opacity: 0; transform: translateY(8px); } 8%, 70% { opacity: 1; transform: none; } 80%, 100% { opacity: 0; } }
@keyframes d1r { 0%, 25% { opacity: 0; transform: translateY(-10px); } 35%, 75% { opacity: 1; transform: none; } 85%, 100% { opacity: 0; } }
/* демо 2: отметка */
.d2 { display: flex; flex-direction: column; gap: 2px; text-align: left; padding-top: 24px; }
.d2 .d-row { opacity: 1; animation: none; padding: 10px 4px; }
.d2 .d-row.a { animation: d2leave 3.2s var(--ease) infinite; }
.d2 .d-row.a i { animation: d2check 3.2s var(--ease) infinite; }
.d2 .d-row.a span { background: linear-gradient(currentColor, currentColor) no-repeat 0 55% / 0 1.5px; animation: d2strike 3.2s var(--ease) infinite; }
.d2 .finger { position: absolute; width: 34px; height: 34px; border-radius: 50%; background: var(--ink); opacity: 0; left: -6px; top: 22px; animation: d2tap 3.2s var(--ease) infinite; }
@keyframes d2tap { 0%, 15% { opacity: 0; transform: scale(1.4); } 25% { opacity: .14; transform: scale(1); } 35%, 100% { opacity: 0; transform: scale(.8); } }
@keyframes d2check { 0%, 25% { background: transparent; border-color: var(--ink-3); } 32%, 100% { background: var(--accent); border-color: var(--accent); } }
@keyframes d2strike { 0%, 30% { background-size: 0 1.5px; } 42%, 100% { background-size: 100% 1.5px; color: var(--ink-3); } }
@keyframes d2leave { 0%, 55% { opacity: 1; transform: none; max-height: 40px; } 72%, 90% { opacity: 0; transform: translateX(30px); max-height: 0; padding: 0 4px; } 100% { opacity: 0; max-height: 0; padding: 0 4px; } }
/* демо 3: комнаты */
.d3 { display: flex; flex-direction: column; align-items: center; gap: 16px; padding-top: 18px; }
.d3 .stack .av { width: 40px; height: 40px; font-size: 14px; color: #fff; border-color: var(--bg); animation: d3pop 4s var(--spring) infinite; }
.d3 .stack .av:nth-child(2) { animation-delay: .12s; } .d3 .stack .av:nth-child(3) { animation-delay: .24s; }
.d3 .card { background: var(--bg-2); border-radius: 16px; padding: 12px 14px; display: flex; gap: 10px; align-items: center; font-size: 14px; width: 260px; text-align: left; animation: d3card 4s var(--ease) infinite; }
.d3 .card small { display: block; color: var(--ink-2); font-size: 12px; }
@keyframes d3pop { 0% { transform: scale(0); } 12%, 100% { transform: scale(1); } }
@keyframes d3card { 0%, 25% { opacity: 0; transform: translateY(10px); } 35%, 90% { opacity: 1; transform: none; } 100% { opacity: 0; } }

/* ---------- скелет и разное ---------- */
.skel { height: 14px; border-radius: 7px; background: var(--bg-2); margin: 18px 20px; animation: skel 1.2s infinite; }
@keyframes skel { 50% { opacity: .5; } }
.center-note { padding: 80px 32px; text-align: center; }
.center-note .face { font-size: 44px; }
.center-note h2 { font-size: 20px; margin: 16px 0 6px; }
.center-note p { color: var(--ink-2); margin: 0 auto 20px; max-width: 300px; }
.thinking-row { display: flex; align-items: center; gap: 12px; padding: 12px 20px; color: var(--ink-2); font-size: 15px; }
.thinking-row .face { font-size: 16px; }
.shimmer { background: linear-gradient(90deg, var(--ink-3) 0%, var(--ink) 50%, var(--ink-3) 100%); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: shim 1.4s linear infinite; }
@keyframes shim { to { background-position: -200% 0; } }
