/* Мио · платформа LifeMio — тёмная спокойная HUD-эстетика в палитре бренда (глубокий бирюзовый, аква, персик). */
:root {
  --bg: #031417; --bg-2: #051C20; --surface: #082427; --surface-2: #0C2E32; --surface-3: #113A3E;
  --line: rgba(139, 234, 221, .10); --line-2: rgba(139, 234, 221, .18); --line-3: rgba(139, 234, 221, .30);
  --text: #E3F2EF; --text-2: #A9C9C4; --muted: #84A8A2;
  --aqua: #5FE0CF; --aqua-2: #8BEADD; --teal: #0E8C85; --deep: #03292B;
  --peach: #FF9C7F; --peach-2: #FFC2AE; --sun: #F5B54A; --coral: #FF7F70;
  --display: "Geologica", "Onest", system-ui, sans-serif;
  --sans: "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;
  --r: 16px; --r-sm: 11px;
  --out: cubic-bezier(.16, 1, .3, 1);
  --side: 248px; --tabbar: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scrollbar-color: #1E4A4E transparent; scrollbar-width: thin; }
body { margin: 0; min-height: 100dvh; background: var(--bg); color: var(--text); font: 400 16px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; overflow-x: clip; }
body::before { content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background: radial-gradient(60% 45% at 50% 0%, rgba(14, 140, 133, .16), transparent 70%),
              radial-gradient(40% 30% at 85% 100%, rgba(255, 156, 127, .05), transparent 70%); }
body.noscroll { overflow: hidden; }
::selection { background: var(--aqua); color: var(--deep); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #1E4A4E; border-radius: 10px; border: 3px solid var(--bg); }
::-webkit-scrollbar-track { background: transparent; }
:focus-visible { outline: 2px solid var(--aqua); outline-offset: 2px; border-radius: 8px; }
h1, h2, h3 { font-family: var(--display); font-weight: 600; margin: 0; letter-spacing: -.01em; text-wrap: balance; color: var(--text); }
p { margin: 0; text-wrap: pretty; }
a { color: var(--aqua-2); text-underline-offset: 3px; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
[hidden] { display: none !important; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.dim { color: var(--muted); }
svg.i { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--aqua); color: var(--deep); padding: 8px 12px; border-radius: 10px; font-weight: 600; }
.skip:focus { top: 12px; }
.noscript { padding: 24px; }

/* ── загрузка ── */
#app { position: relative; z-index: 1; }
.booting { min-height: 100dvh; display: grid; place-items: center; }
.boot img { width: 64px; height: auto; opacity: .85; animation: breathe 2.4s var(--out) infinite alternate; }
@keyframes breathe { from { transform: scale(.94); opacity: .55; } to { transform: scale(1); opacity: .95; } }

/* ── кнопки и поля ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 16px;
  border-radius: var(--r-sm); border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text);
  font-weight: 500; font-size: 15px; white-space: nowrap; transition: background .18s, border-color .18s, transform .12s; }
.btn:hover { background: var(--surface-3); border-color: var(--line-3); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; }
.btn.primary { background: var(--aqua); border-color: var(--aqua); color: var(--deep); font-weight: 600; }
.btn.primary:hover { background: var(--aqua-2); border-color: var(--aqua-2); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { background: rgba(139, 234, 221, .07); color: var(--text); }
.btn.danger { background: rgba(255, 127, 112, .14); border-color: rgba(255, 127, 112, .4); color: #FFC9C1; }
.btn.danger:hover { background: rgba(255, 127, 112, .22); }
.danger-t { color: #FFB3A8 !important; }
.btn.sm { min-height: 32px; padding: 0 11px; font-size: 14px; border-radius: 9px; gap: 6px; }
.btn.sm svg.i { width: 17px; height: 17px; }
.btn.wide { width: 100%; min-height: 48px; font-size: 16px; }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; border: 0; background: transparent; color: var(--text-2); }
.icon-btn:hover { background: rgba(139, 234, 221, .08); color: var(--text); }
.icon-btn.sm { width: 30px; height: 30px; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--aqua-2); font-size: 14px; text-decoration: underline; text-underline-offset: 3px; }
.linkbtn:disabled { color: var(--muted); text-decoration: none; }
.field { flex: 1; min-width: 0; height: 40px; padding: 0 12px; border-radius: var(--r-sm); border: 1px solid var(--line-2); background: var(--bg-2); }
.field::placeholder, textarea::placeholder { color: var(--muted); }
.field:focus { border-color: var(--aqua); outline: none; }
.chip { min-height: 34px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-2); background: transparent; color: var(--text-2); font-size: 14px; }
.chip:hover { border-color: var(--aqua); color: var(--text); }
.row { display: flex; align-items: center; }
.gap { gap: 10px; }
.wrap { flex-wrap: wrap; }
.tag { display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border-radius: 999px; font-size: 13px; font-weight: 500;
  background: rgba(95, 224, 207, .1); color: var(--aqua-2); white-space: nowrap; }
.tag.ok { background: rgba(95, 224, 207, .14); color: var(--aqua-2); }
.tag.warn { background: rgba(245, 181, 74, .14); color: #FFD796; }
.tag.dim { background: rgba(139, 234, 221, .06); color: var(--muted); }
.code { display: inline-flex; align-items: center; height: 22px; padding: 0 6px; border: 0; border-radius: 6px; vertical-align: 1px;
  background: rgba(95, 224, 207, .1); color: var(--aqua-2); font: 600 12.5px/1 var(--sans); font-variant-numeric: tabular-nums; letter-spacing: .01em; }
.code:hover { background: rgba(95, 224, 207, .2); }

/* ── оболочка ── */
.shell { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: 100dvh; }
.side { position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; gap: 6px; padding: 18px 12px 12px;
  border-right: 1px solid var(--line); background: rgba(3, 20, 23, .7); overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 14px; text-decoration: none; }
.brand img { width: 30px; height: auto; }
.brand-t { font: 600 21px/1 var(--display); color: var(--text); letter-spacing: -.01em; }
.brand-s { margin-left: auto; font-size: 12px; color: var(--muted); }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-a { display: flex; align-items: center; gap: 12px; min-height: 37px; padding: 0 12px; border-radius: 10px; color: var(--text-2);
  text-decoration: none; font-size: 15px; border: 0; background: none; width: 100%; text-align: left; transition: background .15s, color .15s; }
.nav-a:hover { background: rgba(139, 234, 221, .06); color: var(--text); }
.nav-a.on { background: rgba(95, 224, 207, .11); color: var(--text); }
.nav-a.on svg.i { color: var(--aqua); }
.nav-t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-sep { height: 1px; background: var(--line); margin: 6px 10px; }
.badge { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--peach); color: #3A1A0E; font: 700 12px/22px var(--sans); text-align: center; font-variant-numeric: tabular-nums; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 6px; padding-top: 12px; border-top: 1px solid var(--line); }
.sync { display: flex; align-items: center; gap: 8px; padding: 4px 12px; font-size: 12.5px; color: var(--muted); }
.sync-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--aqua); flex: none; }
.sync-dot.off { background: var(--sun); }
.ghostlink { color: var(--muted); }
.main { min-width: 0; position: relative; }
.view-page { padding: 32px clamp(16px, 4vw, 48px) 64px; }
.tabbar, .drawer { display: none; }

/* ── страницы ── */
.page { max-width: 1040px; margin: 0 auto; display: flex; flex-direction: column; gap: 20px; }
.page-head { display: flex; flex-direction: column; gap: 6px; margin-bottom: 4px; }
.page-head h1 { font-size: 30px; line-height: 1.15; }
.page-sub { color: var(--text-2); max-width: 68ch; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.card-head h2 { font-size: 18px; }
.lead { color: var(--text-2); }
.note { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding: 14px 16px; border-radius: var(--r);
  border: 1px dashed var(--line-2); color: var(--text-2); font-size: 14.5px; }
.empty { padding: 36px 20px; text-align: center; border: 1px dashed var(--line-2); border-radius: var(--r); }
.empty-t { color: var(--text); font-weight: 500; }
.empty-s { color: var(--muted); font-size: 14.5px; margin-top: 6px; }
.skel-wrap { display: flex; flex-direction: column; gap: 12px; }
.skel { height: 72px; border-radius: var(--r); background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

.seg { display: flex; gap: 6px; flex-wrap: wrap; }
.seg-b { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-2);
  background: transparent; color: var(--text-2); font-size: 14px; }
.seg-b:hover { color: var(--text); border-color: var(--line-3); }
.seg-b[aria-selected="true"] { background: var(--text); border-color: var(--text); color: var(--deep); font-weight: 600; }
.seg-n { font-size: 12px; opacity: .75; }

/* текст движка */
.et { display: flex; flex-direction: column; gap: 3px; color: var(--text-2); font-size: 15px; }
.et p { color: var(--text-2); }
.et .et-head { color: var(--text); font-weight: 600; margin-bottom: 4px; }
.et .et-ind { padding-left: 16px; }
.et .et-ind1 { padding-left: 8px; }
.et-list { margin: 2px 0 4px; padding-left: 20px; display: flex; flex-direction: column; gap: 3px; }
.et-list li { color: var(--text-2); }
.et-list li::marker { color: var(--teal); }
.et-list li.sub { margin-left: 14px; }
.preview { padding: 14px 16px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line); }

/* главная — см. блок «живой кабинет» в конце файла */
/* range */
input[type="range"] { -webkit-appearance: none; appearance: none; height: 28px; background: transparent; --v: 50%; }
input[type="range"]::-webkit-slider-runnable-track { height: 6px; border-radius: 6px; background: linear-gradient(to right, var(--aqua) var(--v), var(--surface-3) var(--v)); }
input[type="range"]::-moz-range-track { height: 6px; border-radius: 6px; background: var(--surface-3); }
input[type="range"]::-moz-range-progress { height: 6px; border-radius: 6px; background: var(--aqua); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; margin-top: -8px; border-radius: 50%; background: var(--text); border: 3px solid var(--aqua); }
input[type="range"]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: var(--text); border: 3px solid var(--aqua); }

/* ── сегодня ── */
.today-grid { display: grid; grid-template-columns: minmax(280px, 360px) minmax(0, 1fr); gap: 16px; align-items: start; }
.col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.energy-row { display: flex; align-items: baseline; font: 600 52px/1 var(--display); }
.energy-row .pct { font-size: 20px; color: var(--muted); margin-left: 4px; }
.energy-range { width: 100%; }
.energy-scale { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--muted); margin-top: -6px; }
.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.tl { display: grid; grid-template-columns: 52px 18px minmax(0, 1fr) auto; column-gap: 10px; align-items: start; padding: 10px 0; position: relative; }
.tl + .tl { border-top: 1px solid var(--line); }
.tl-time { color: var(--text-2); font-size: 15px; padding-top: 1px; }
.tl-dot { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--aqua); margin: 6px auto 0; }
.tl.habit .tl-dot { border-color: var(--peach); }
.tl.done .tl-dot { background: var(--aqua); }
.tl.done .tl-title { color: var(--muted); text-decoration: line-through; text-decoration-color: rgba(132, 168, 162, .6); }
.tl-title { color: var(--text); font-weight: 500; }
.tl-meta { color: var(--muted); font-size: 13.5px; }
.tl-acts { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.r { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 0; flex-wrap: wrap; }
.r + .r { border-top: 1px solid var(--line); }
.r-main { flex: 1; min-width: 200px; color: var(--text); display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.r-meta { flex-basis: 100%; color: var(--muted); font-size: 13.5px; }
.r-acts { display: flex; gap: 6px; flex-wrap: wrap; }
.minutes { padding-top: 4px; border-top: 1px solid var(--line); }
.menu-wrap { position: relative; }
.menu { position: absolute; z-index: 20; right: 0; top: calc(100% + 6px); min-width: 210px; padding: 6px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line-2);
  box-shadow: 0 16px 40px -12px rgba(0, 0, 0, .7); display: flex; flex-direction: column; }
.menu button { text-align: left; padding: 9px 12px; border: 0; border-radius: 8px; background: transparent; color: var(--text); font-size: 14.5px; }
.menu button:hover, .menu button:focus-visible { background: rgba(95, 224, 207, .1); }
.menu-time { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 12px; font-size: 14.5px; color: var(--text-2); border-top: 1px solid var(--line); margin-top: 4px; }
.menu-time input { background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 8px; padding: 4px 6px; color-scheme: dark; }

/* ── решения, память, история ── */
.proposal .preview { font-size: 15px; }
.result { border-color: rgba(95, 224, 207, .35); }
.fact-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.fact-text { font-size: 17px; color: var(--text); font-weight: 500; }
.fact-meta { color: var(--text-2); font-size: 14px; }
.fact-why { color: #FFD796; font-size: 14px; }
.fact.s-use_disabled .fact-text, .fact.s-stale .fact-text, .fact.s-excluded .fact-text { color: var(--text-2); }
.confirm { padding: 12px 14px; border-radius: 12px; background: rgba(255, 127, 112, .08); border: 1px solid rgba(255, 127, 112, .3); display: flex; flex-direction: column; gap: 10px; }
.hist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.hist-i { display: grid; grid-template-columns: 14px minmax(0, 1fr) auto; gap: 12px; padding: 14px 4px; align-items: start; }
.hist-i + .hist-i { border-top: 1px solid var(--line); }
.hist-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--aqua); margin-top: 8px; }
.hist-i.st-undone .hist-dot, .hist-i.st-declined .hist-dot, .hist-i.st-expired .hist-dot { background: var(--surface-3); border: 1px solid var(--line-3); }
.hist-i.st-failed .hist-dot { background: var(--coral); }
.hist-main { display: flex; flex-direction: column; gap: 3px; align-items: flex-start; min-width: 0; }
.hist-t { color: var(--text); }
.hist-code { color: var(--aqua-2); font-weight: 600; font-size: 14px; }
.hist-meta { color: var(--muted); font-size: 13.5px; }
.hist-more { margin-top: 6px; padding: 12px 14px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line); align-self: stretch; }
.hist-acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

/* ── карточка записи ── */
.sheet { position: fixed; inset: 0; z-index: 60; background: rgba(1, 10, 12, .62); display: flex; justify-content: flex-end; animation: fade .2s; }
@keyframes fade { from { opacity: 0; } }
.sheet-panel { width: min(460px, 100%); height: 100%; background: var(--surface); border-left: 1px solid var(--line-2); display: flex; flex-direction: column; overflow: hidden; animation: slide .32s var(--out); }
@keyframes slide { from { transform: translateX(24px); opacity: .4; } }
.sheet-head { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px 12px; }
.sheet-code { font: 600 18px/1 var(--display); color: var(--aqua-2); }
.sheet-actions { flex: none; display: flex; gap: 8px; flex-wrap: wrap; padding: 12px 20px 18px; border-top: 1px solid var(--line); background: var(--surface); }

/* ── тосты ── */
.toasts { position: fixed; z-index: 80; left: 50%; bottom: 24px; transform: translateX(-50%); width: min(560px, calc(100% - 32px)); display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 16px; border-radius: 14px; background: #0F3438; border: 1px solid var(--line-2);
  box-shadow: 0 18px 40px -14px rgba(0, 0, 0, .75); color: var(--text); font-size: 14.5px; opacity: 0; transform: translateY(8px); transition: opacity .25s var(--out), transform .3s var(--out); }
.toast.in { opacity: 1; transform: none; }
.toast-text { flex: 1; min-width: 0; }
.toast.error { background: #3A1E1E; border-color: rgba(255, 127, 112, .45); }
.toast.info { background: #13353A; }

/* ── вход ── */
.login-mode { min-height: 100dvh; }
.login { min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px; padding: 24px 16px; }
.login-card { width: min(420px, 100%); display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 36px 28px 28px; border-radius: 24px;
  background: rgba(8, 36, 39, .82); border: 1px solid var(--line-2); text-align: center; box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .8); }
.login-mark { width: 88px; height: auto; margin-bottom: 4px; }
.login-title { font-size: 34px; }
.login-sub { color: var(--text-2); font-size: 15px; max-width: 32ch; }
.login-step { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 14px; margin-top: 10px; }
.login-lead { color: var(--text-2); font-size: 14.5px; }
.login-msg { min-height: 20px; font-size: 14.5px; color: var(--text-2); }
.login-msg.err { color: #FFB3A8; }
.login-foot { color: var(--muted); font-size: 13px; }
.otp-row { display: flex; gap: 8px; justify-content: center; }
.otp { width: 46px; height: 56px; text-align: center; font: 600 24px/1 var(--display); border-radius: 12px; border: 1px solid var(--line-2); background: var(--bg-2); font-variant-numeric: tabular-nums; }
.otp:focus { outline: none; border-color: var(--aqua); background: var(--surface-2); }

/* ── телефон и планшет ── */
@media (max-width: 900px) {
  :root { --side: 0px; }
  .shell { grid-template-columns: minmax(0, 1fr); padding-bottom: calc(var(--tabbar) + var(--safe-b)); }
  .side { display: none; }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; z-index: 50; left: 0; right: 0; bottom: 0; height: calc(var(--tabbar) + var(--safe-b));
    padding-bottom: var(--safe-b); background: rgba(4, 24, 27, .96); border-top: 1px solid var(--line); }
  .tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--muted); text-decoration: none; font-size: 11.5px; border: 0; background: none; position: relative; min-width: 0; }
  .tab .nav-t { flex: none; max-width: 100%; }
  .tab.on { color: var(--text); }
  .tab.on svg.i { color: var(--aqua); }
  .tab .badge { position: absolute; top: 6px; left: calc(50% + 6px); min-width: 18px; height: 18px; font-size: 11px; line-height: 18px; padding: 0 5px; }
  .drawer { display: block; position: fixed; inset: 0; z-index: 70; background: rgba(1, 10, 12, .6); }
  .drawer[hidden] { display: none !important; }
  .drawer-panel { width: min(320px, 86%); height: 100%; background: var(--bg-2); border-right: 1px solid var(--line-2); padding: 16px 12px calc(16px + var(--safe-b)); display: flex; flex-direction: column; gap: 8px; overflow-y: auto; animation: slideL .3s var(--out); }
  @keyframes slideL { from { transform: translateX(-24px); opacity: .4; } }
  .drawer-head { display: flex; align-items: center; gap: 10px; padding: 0 4px 10px 10px; }
  .drawer-head .brand-t { font-size: 18px; flex: 1; }
  .view-page { padding: 22px 16px 32px; }
  .page-head h1 { font-size: 25px; }
  .today-grid { grid-template-columns: minmax(0, 1fr); }
  .tl { grid-template-columns: 46px 14px minmax(0, 1fr); }
  .tl-acts { grid-column: 2 / -1; justify-content: flex-start; margin-top: 8px; flex-wrap: nowrap; }
  .hist-i { grid-template-columns: 12px minmax(0, 1fr); }
  .hist-acts { grid-column: 2; justify-content: flex-start; }
  .sheet { align-items: flex-end; }
  .sheet { padding-bottom: var(--kb, 0px); }
  .sheet-panel { height: auto; max-height: min(88dvh, calc(var(--vvh, 100dvh) - 12px)); border-left: 0; border-top: 1px solid var(--line-2); border-radius: 20px 20px 0 0; animation: slideU .32s var(--out); }
  .sheet-actions { padding-bottom: calc(14px + var(--safe-b)); }
  .sheet-actions .btn.lg { flex: 1 1 auto; }
  @keyframes slideU { from { transform: translateY(24px); opacity: .4; } }
  .toasts { bottom: calc(var(--tabbar) + var(--safe-b) + 12px); }
  .card { padding: 16px; }
  .menu { right: auto; left: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* ── главная: живой кабинет ── */
.view-home { min-height: 100dvh; }
.home { min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr) 360px; }
.stage { display: flex; flex-direction: column; align-items: center; padding: 18px 28px 22px; gap: 10px; min-width: 0; position: relative;
  background: radial-gradient(48% 42% at 50% 38%, rgba(14, 140, 133, .14), transparent 72%); }
.stage-top { align-self: stretch; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.pill { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 13px; border-radius: 999px; border: 1px solid var(--line-2);
  background: rgba(8, 36, 39, .6); color: var(--text-2); font-size: 13.5px; }
.pill svg.i { width: 17px; height: 17px; }
.pill:hover { color: var(--text); border-color: var(--line-3); }
.live { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 14px; border-radius: 999px; font-size: 13.5px; color: var(--text-2);
  border: 1px solid var(--line); background: rgba(8, 36, 39, .5); min-width: 112px; justify-content: center; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; transition: background .3s; }
[data-state="hands"] .live-dot, [data-state="listening"] .live-dot { background: var(--aqua); animation: livepulse 1.4s var(--out) infinite; }
[data-state="thinking"] .live-dot, [data-state="transcribing"] .live-dot { background: var(--sun); }
[data-state="speaking"] .live-dot { background: var(--peach); }
[data-state="error"] .live-dot { background: var(--coral); }
[data-state="hands"] .live, [data-state="listening"] .live { color: var(--text); border-color: rgba(95, 224, 207, .45); }
@keyframes livepulse { 0% { box-shadow: 0 0 0 0 rgba(95, 224, 207, .55); } 100% { box-shadow: 0 0 0 9px rgba(95, 224, 207, 0); } }
.orb-wrap { position: relative; width: min(100%, 56vh, 580px); aspect-ratio: 1; padding: 0; border: 0; background: none; cursor: default; margin-top: -8px; border-radius: 50%; }
.orb-wrap:focus-visible { outline-offset: -10px; }
.orb-gl, .orb-hud { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.orb-hint { color: var(--text-2); font-size: 14.5px; text-align: center; margin-top: -14px; min-height: 22px; }
.subtitle { width: min(100%, 680px); text-align: center; display: flex; flex-direction: column; gap: 6px; align-items: center; min-height: 56px; }
.subtitle.is-empty { min-height: 0; }
.subtitle.is-empty .sub-mio, .subtitle.is-empty .sub-you { display: none; }
.sub-you { color: var(--muted); font-size: 14px; max-width: 60ch; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.sub-you:not(:empty)::before { content: "Вы: "; color: var(--text-2); }
.sub-mio { color: var(--text); font-size: 16.5px; line-height: 1.5; max-height: 9.5em; overflow-y: auto; text-wrap: pretty; }
.sub-mio p + p, .sub-mio ul { margin-top: 6px; }
.sub-mio ul { text-align: left; display: inline-block; }
.subtitle .msg-acts { justify-content: center; }
.quick { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; max-width: 720px; }
.quick .chip { font-size: 13.5px; min-height: 32px; background: rgba(8, 36, 39, .55); }
.controls { display: flex; align-items: center; justify-content: center; gap: 22px; margin-top: 6px; }
.sens { display: inline-flex; padding: 3px; border-radius: 999px; border: 1px solid var(--line-2); background: rgba(8, 36, 39, .6); }
.sens-b { height: 30px; padding: 0 13px; border-radius: 999px; border: 0; background: transparent; color: var(--text-2); font-size: 13px; }
.sens-b[aria-checked="true"] { background: var(--surface-3); color: var(--text); box-shadow: inset 0 0 0 1px rgba(95, 224, 207, .55); }
.bigmic { width: 76px; height: 76px; border-radius: 50%; border: 0; display: grid; place-items: center; color: var(--deep); background: var(--aqua);
  box-shadow: 0 10px 30px -10px rgba(95, 224, 207, .55); transition: transform .15s var(--out), background .25s; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; position: relative; }
.bigmic svg.i { width: 30px; height: 30px; stroke-width: 1.8; }
.bigmic:hover { transform: scale(1.04); }
.bigmic:active { transform: scale(.97); }
.bigmic.on { background: var(--coral); color: #fff; box-shadow: 0 10px 30px -10px rgba(255, 127, 112, .6); }
.bigmic.rec { background: var(--peach); }
.bigmic.on::after, .bigmic.rec::after { content: ""; position: absolute; inset: -7px; border-radius: 50%; border: 2px solid currentColor; opacity: .0; }
.bigmic.on::after { border-color: var(--coral); animation: ring 1.6s var(--out) infinite; }
.bigmic.rec::after { border-color: var(--peach); animation: ring 1s var(--out) infinite; }
@keyframes ring { from { opacity: .8; transform: scale(.92); } to { opacity: 0; transform: scale(1.3); } }
.bigmic.off { background: var(--surface-3); color: var(--muted); box-shadow: none; }
.endbtn { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line-2); background: transparent; color: var(--text-2); display: grid; place-items: center; }
.endbtn:hover { color: var(--text); border-color: var(--line-3); }
.controls .endbtn[hidden] { display: grid !important; visibility: hidden; }

.side-live { border-left: 1px solid var(--line); background: rgba(5, 28, 32, .55); display: flex; flex-direction: column; min-height: 0; height: 100dvh; position: sticky; top: 0; }
.cards { flex: 1; overflow-y: auto; padding: 20px 18px 12px; display: flex; flex-direction: column; gap: 12px; }
.lc { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); color: inherit; text-decoration: none; }
.lc-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.lc-label { font-size: 13px; color: var(--muted); }
.lc-big { display: flex; align-items: baseline; gap: 4px; font: 600 32px/1 var(--display); color: var(--text); }
.lc-big.money { font-size: 28px; }
.lc-big .unit { font-size: 15px; color: var(--muted); font-weight: 500; }
.lc-big .lc-note { margin-left: 8px; font: 400 14px/1.3 var(--sans); }
.lc-note { color: var(--muted); font-size: 13.5px; }
.lc-text { color: var(--text-2); }
.lc-text.strong { color: var(--text); font-weight: 500; }
.lc-next { border-color: rgba(95, 224, 207, .28); }
.lc-pending { flex-direction: row; align-items: center; gap: 12px; border-color: rgba(255, 156, 127, .35); }
.lc-pending:hover { background: var(--surface-2); }
.lc-pending .lc-text { flex: 1; color: var(--text); }
.lc-pend-n { font: 600 24px/1 var(--display); color: var(--peach); }
.meter { height: 5px; border-radius: 5px; background: var(--surface-3); overflow: hidden; }
.meter i { display: block; height: 100%; width: var(--p, 0%); background: var(--aqua); border-radius: 5px; transition: width .7s var(--out); }
.meter.energy i { background: linear-gradient(90deg, var(--teal), var(--aqua)); }
.meter.money i { background: linear-gradient(90deg, var(--teal), var(--aqua-2)); }
.card-edit { display: flex; align-items: center; gap: 10px; }
.card-edit input { flex: 1; }
.near { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.near li { display: grid; grid-template-columns: 20px 1fr; column-gap: 10px; align-items: start; font-size: 14px; }
.near li svg.i { color: var(--aqua); width: 18px; height: 18px; margin-top: 2px; grid-row: span 2; }
.n-t { color: var(--text); }
.n-w { color: var(--muted); font-size: 13px; }
.side-live .composer { margin: 0; border-radius: 0; border: 0; border-top: 1px solid var(--line); background: rgba(3, 20, 23, .6); padding: 12px 14px 14px; }

.composer { display: flex; align-items: flex-end; gap: 10px; padding: 8px 8px 8px 16px; border-radius: 22px; border: 1px solid var(--line-2); background: var(--surface); }
.composer textarea { flex: 1; min-width: 0; resize: none; border: 0; outline: none; background: transparent; padding: 9px 0; max-height: 140px; line-height: 1.45; }
.side-live .composer textarea { padding: 10px 12px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line-2); }
.side-live .composer textarea:focus { border-color: rgba(95, 224, 207, .55); }
.round { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--aqua); color: var(--deep); flex: none; }
.round:hover { background: var(--aqua-2); }
.round svg.i { width: 20px; height: 20px; stroke-width: 1.9; }

/* переписка */
.convo-panel { width: min(560px, 100%); }
.convo { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; padding: 6px 2px; }
.msg { max-width: 92%; display: flex; flex-direction: column; gap: 4px; }
.msg.user { align-self: flex-end; align-items: flex-end; }
.msg.user .msg-body { background: var(--surface-3); border: 1px solid var(--line-2); border-radius: 16px 16px 4px 16px; padding: 9px 13px; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.assistant { align-self: flex-start; }
.msg-who { font: 600 12.5px/1 var(--display); color: var(--aqua); }
.msg-body p + p, .msg-body p + ul, .msg-body ul + p { margin-top: 8px; }
.msg-body ul { margin: 6px 0 0; padding-left: 20px; }
.msg-body strong, .sub-mio strong { color: #fff; font-weight: 600; }
.msg-tag { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); }
.msg-tag svg.i { width: 13px; height: 13px; }
.msg-err { color: #FFB3A8; font-size: 14.5px; }
.msg-acts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.caret { display: inline-block; width: 7px; height: 1.05em; margin-left: 2px; vertical-align: -2px; background: var(--aqua); border-radius: 2px; animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.typing { display: inline-flex; gap: 4px; padding: 6px 0; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--aqua-2); opacity: .4; animation: dot 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 30% { opacity: 1; transform: translateY(-3px); } }

@media (max-width: 1180px) { .home { grid-template-columns: minmax(0, 1fr) 310px; } }
@media (max-width: 900px) {
  .view-home { min-height: 0; }
  .home { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .stage { padding: 10px 14px 6px; gap: 8px; }
  .stage-top .pill span { display: none; }
  .stage-top .pill { width: 34px; padding: 0; justify-content: center; }
  .orb-wrap { width: min(100%, 44dvh, 420px); margin-top: -4px; }
  .orb-hint { font-size: 13.5px; margin-top: -10px; }
  .sub-mio { font-size: 15.5px; max-height: 7.5em; }
  .quick { flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; width: calc(100% + 28px); margin: 0 -14px; padding: 0 14px; scrollbar-width: none; }
  .quick::-webkit-scrollbar { display: none; }
  .quick .chip { flex: none; }
  .controls { gap: 14px; }
  .sens-b { padding: 0 10px; }
  .bigmic { width: 68px; height: 68px; }
  .side-live { border-left: 0; height: auto; position: static; background: none; }
  .cards { flex-direction: row; overflow-x: auto; overflow-y: hidden; padding: 6px 14px 10px; scroll-snap-type: x mandatory; scrollbar-width: none; align-items: flex-start; }
  .cards::-webkit-scrollbar { display: none; }
  .lc { flex: 0 0 240px; scroll-snap-align: start; }
  .near li:nth-child(n + 3) { display: none; }
  .side-live .composer { position: sticky; bottom: calc(var(--tabbar) + var(--safe-b)); z-index: 5; border-top: 1px solid var(--line); background: rgba(3, 20, 23, .94); }
}

/* ── этап 2: формы, превью, разделы ── */
.sheet-title { font-size: 19px; }
.sheet-panel.wide { width: min(640px, 100%); }
.sheet-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 12px; padding: 4px 20px 20px; }
.kform { display: flex; flex-direction: column; gap: 14px; }
.kfield { display: flex; flex-direction: column; gap: 6px; }
.kfield > label { font-size: 14px; color: var(--text-2); font-weight: 500; }
.kfield .opt { color: var(--muted); font-weight: 400; }
.kfield input:not([type="checkbox"]):not([type="range"]), .kfield select, .kfield textarea, select.mode-sel, .add-item .field {
  min-height: 42px; padding: 9px 12px; border-radius: var(--r-sm); border: 1px solid var(--line-2); background: var(--bg-2); color: var(--text); font: inherit; color-scheme: dark; }
.kfield textarea { resize: vertical; line-height: 1.45; }
.kfield input:focus, .kfield select:focus, .kfield textarea:focus, select.mode-sel:focus { outline: none; border-color: var(--aqua); }
.kfield input[type="file"] { padding: 8px; }
.khint { font-size: 13px; color: var(--muted); }
.kcheck { flex-direction: row; align-items: center; gap: 10px; cursor: pointer; font-size: 15px; color: var(--text); }
.kcheck input, .switch input { accent-color: var(--aqua); }
.kcheck input { width: 18px; height: 18px; }
.kchips { display: flex; flex-wrap: wrap; gap: 6px; }
.kchip { min-width: 42px; height: 36px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--line-2); background: transparent; color: var(--text-2); }
.kchip[aria-pressed="true"] { background: rgba(95, 224, 207, .16); border-color: rgba(95, 224, 207, .6); color: var(--text); }
.kform-err { color: #FFB3A8; font-size: 14px; min-height: 18px; }
.pv-lead { color: var(--text-2); }
.pv-head { font-weight: 600; color: var(--text); }
.code-t { color: var(--aqua-2); font-variant-numeric: tabular-nums; }
.pv-items { margin: 0; padding: 0 0 0 22px; display: flex; flex-direction: column; gap: 8px; color: var(--text); }
.pv-items li::marker { color: var(--muted); font-variant-numeric: tabular-nums; }
.pv-op { display: inline-block; margin-right: 6px; padding: 0 7px; border-radius: 6px; background: rgba(95, 224, 207, .1); color: var(--aqua-2); font-size: 12.5px; font-weight: 600; }
.pv-notes { padding: 10px 12px; border-radius: 12px; background: rgba(245, 181, 74, .07); border: 1px solid rgba(245, 181, 74, .25); color: #FFE2B0; font-size: 14px; display: flex; flex-direction: column; gap: 4px; }
.row-head { flex-direction: row; justify-content: space-between; align-items: flex-end; gap: 14px; flex-wrap: wrap; }
.r-title { color: var(--text); }
.r-meta-i { color: var(--muted); font-size: 13.5px; }
.sub-r { padding-left: 22px; }
.dim-r .r-title { color: var(--muted); }
select.mode-sel { min-height: 34px; padding: 4px 10px; font-size: 14px; }
.two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.chk { width: 24px; height: 24px; border-radius: 7px; border: 1.5px solid var(--line-3); background: transparent; display: grid; place-items: center; color: var(--deep); flex: none; padding: 0; }
.chk svg.i { width: 15px; height: 15px; stroke-width: 2.4; }
.chk[aria-pressed="true"] { background: var(--aqua); border-color: var(--aqua); }
.chk.big { width: 26px; height: 26px; border-radius: 50%; }
.chk:hover { border-color: var(--aqua); }
.task-r { flex-wrap: nowrap; align-items: flex-start; }
.task-r .r-main { min-width: 0; }
.task-r.done .r-title { color: var(--muted); text-decoration: line-through; }
.steps, .checklist { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; flex-basis: 100%; }
.steps li, .checklist li { display: flex; align-items: center; gap: 10px; font-size: 14.5px; color: var(--text-2); }
.steps li.done span, .checklist li.done .ci-t { color: var(--muted); text-decoration: line-through; }
.checklist li { padding: 6px 0; border-bottom: 1px solid var(--line); }
.checklist .ci-t { flex: 1; color: var(--text); }
.add-item { display: flex; gap: 8px; margin-top: 4px; }
.add-item .field { flex: 1; min-height: 38px; }
.switch { position: relative; display: inline-flex; width: 42px; height: 24px; flex: none; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--line-2); transition: background .2s; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--text-2); transition: transform .2s var(--out), background .2s; }
.switch input:checked + span { background: rgba(95, 224, 207, .35); border-color: rgba(95, 224, 207, .6); }
.switch input:checked + span::after { transform: translateX(18px); background: var(--aqua); }
.switch input:focus-visible + span { outline: 2px solid var(--aqua); outline-offset: 2px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0; font-size: 14.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; color: var(--text); }
.kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.kpi { display: flex; flex-direction: column; gap: 8px; padding: 16px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); }
.kpi-v { font: 600 26px/1.1 var(--display); color: var(--text); }
.amt { font-weight: 600; color: var(--text); white-space: nowrap; }
.amt.in { color: var(--aqua-2); }
.note-body { color: var(--text-2); font-size: 14px; flex-basis: 100%; margin-top: 4px; white-space: pre-wrap; }
.voice-list { max-height: 360px; overflow-y: auto; }
.voice-list .r.cur .r-title { color: var(--aqua-2); }
.now-title { font: 500 18px/1.35 var(--display); color: var(--text); }
.now-step { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line); }
.now-step > span:nth-child(2) { flex: 1; color: var(--text); }
.why { color: var(--text-2); font-size: 14px; }
.fact-r.st-accepted .r-title strong { color: var(--aqua-2); }
.fact-r.st-rejected .r-title { color: var(--muted); text-decoration: line-through; }
.flip svg { transform: scaleX(-1); }

/* календарь */
.cal-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.cal-nav { display: flex; align-items: center; gap: 6px; }
.cal-label { min-width: 200px; text-align: center; font: 500 16px/1.2 var(--display); color: var(--text); }
.cal-day { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.ag-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.ag-i { display: grid; grid-template-columns: 58px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14.5px; }
.ag-i:first-child { border-top: 0; }
.ag-t { color: var(--muted); font-size: 13.5px; display: flex; align-items: center; }
.ag-t svg.i { width: 17px; height: 17px; color: var(--aqua); }
.ag-x { color: var(--text); min-width: 0; overflow-wrap: anywhere; }
.ag-m { display: block; color: var(--muted); font-size: 13px; }
.ag-i.ev .ag-x { color: #CFF8F1; }
.ag-i.ev .ag-t { color: var(--aqua-2); }
.ag-i.ev.free .ag-x { color: var(--muted); }
.ag-i.dl .ag-t { color: #FFD796; }
.ag-i.task.done .ag-x { color: var(--muted); text-decoration: line-through; }
.ag-i.hab .ag-x, .ag-i.rest .ag-x { color: var(--text-2); }
.ag-empty { color: var(--muted); font-size: 14px; padding: 6px 0; }
.free-l { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.free-l li { display: flex; justify-content: space-between; align-items: center; color: var(--text); }
.cal-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.wk-day { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 10px; min-height: 180px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.wk-day.today { border-color: rgba(95, 224, 207, .55); }
.wk-day.past { opacity: .7; }
.wk-head { display: flex; align-items: baseline; gap: 6px; background: none; border: 0; padding: 0; color: var(--text-2); text-align: left; }
.wk-wd { font-size: 13px; text-transform: lowercase; }
.wk-num { font: 600 20px/1 var(--display); color: var(--text); }
.wk-day.today .wk-num { color: var(--aqua); }
.wk-busy { margin-left: auto; font-size: 11.5px; color: var(--muted); }
.wk-busy.warn { color: #FFD796; }
.wk-day .ag-i { grid-template-columns: 1fr auto; gap: 4px; font-size: 13px; padding: 5px 0; }
.wk-day .ag-t { display: none; }
.wk-day .ag-i.ev .ag-t, .wk-day .ag-i.task .ag-t { display: block; grid-column: 1 / -1; font-size: 12px; }
.cal-month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.mo-wd { text-align: center; font-size: 12.5px; color: var(--muted); padding-bottom: 2px; }
.mo-day { aspect-ratio: 1.7; min-height: 54px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); padding: 6px 8px; display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; color: var(--text); position: relative; }
.mo-day:hover { border-color: var(--line-3); }
.mo-day.out { opacity: .4; }
.mo-day.today { border-color: var(--aqua); }
.mo-day.today .mo-num { color: var(--aqua); }
.mo-num { font: 600 15px/1 var(--display); }
.mo-dots { display: flex; gap: 3px; flex-wrap: wrap; }
.mo-n { position: absolute; right: 8px; top: 6px; font-size: 11.5px; color: var(--muted); }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--muted); vertical-align: 1px; }
.dot.ev { background: var(--aqua); } .dot.task { background: #CFF8F1; } .dot.dl { background: var(--sun); } .dot.pay { background: var(--peach); } .dot.date { background: #C6A6FF; }
.legend { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
@media (max-width: 1100px) { .cal-week { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px) {
  .two-col, .cal-day, .kpis { grid-template-columns: minmax(0, 1fr); }
  .cal-week { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
  .wk-day { min-height: 92px; padding: 6px 4px; border-radius: 10px; gap: 4px; align-items: center; }
  .wk-day .ag-list { display: none; }
  .wk-head { flex-direction: column; align-items: center; gap: 2px; }
  .wk-busy { margin: 0; font-size: 10px; }
  .wk-num { font-size: 17px; }
  .wk-dots { display: flex; flex-wrap: wrap; justify-content: center; gap: 3px; flex: 1; align-content: flex-start; }
  .cal-label { min-width: 0; font-size: 15px; }
  .mo-day { min-height: 44px; padding: 4px 5px; border-radius: 9px; }
  .mo-n { display: none; }
  .row-head { align-items: flex-start; }
  .task-r { flex-wrap: wrap; }
}
.meter.warn i { background: var(--sun); }
.usage { display: flex; flex-direction: column; gap: 6px; }
.usage-warn { color: #FFD796; font-size: 14px; }
@media (max-width: 900px) { .now-step > span:nth-child(2) { flex-basis: 100%; order: 2; } .now-step .btn { order: 3; } }

.wk-dots { display: none; background: none; border: 0; padding: 0; color: var(--muted); }
.wk-n { width: 100%; text-align: center; font-size: 11px; color: var(--text-2); }
@media (max-width: 900px) { .wk-dots { display: flex; } }

/* подключения и система */
.sec-title { font-size: 18px; margin-top: 8px; }
.conn-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; align-items: start; }
.conn-res { font-size: 14px; color: var(--text-2); min-height: 0; }
.conn-res.ok { color: var(--aqua-2); }
.conn-res.bad { color: #FFB3A8; }
.otp-one { height: 52px; text-align: center; font: 600 24px/1 var(--display); letter-spacing: .3em; border-radius: 12px; border: 1px solid var(--line-2); background: var(--bg-2); color: var(--text); }
.otp-one:focus { outline: none; border-color: var(--aqua); }
.foot-note { margin-top: 12px; }
.page-head .btn.ghost.sm { align-self: flex-start; }
.obs-r .r-acts { flex-wrap: wrap; }

.wk-sel { display: none; }
@media (max-width: 900px) { .wk-sel { display: flex; margin-top: 10px; } .wk-day.sel { border-color: var(--aqua-2); } }
/* уровень микрофона и «включить звук» */
.sens-wrap { display: flex; flex-direction: column; gap: 6px; align-items: stretch; }
.miclevel { position: relative; height: 4px; border-radius: 4px; background: var(--surface-3); overflow: visible; opacity: .35; transition: opacity .3s; }
.miclevel.on { opacity: 1; }
.miclevel i { position: absolute; left: 0; top: 0; bottom: 0; width: var(--l, 0%); border-radius: 4px; background: var(--aqua); transition: width .08s linear; }
.miclevel b { position: absolute; top: -3px; bottom: -3px; left: var(--t, 0%); width: 2px; border-radius: 2px; background: var(--sun); opacity: .8; }
.sound-gate { border-color: rgba(255, 156, 127, .6); color: var(--text); background: rgba(255, 156, 127, .14); }
/* мастера подключения */
.wiz-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; margin-bottom: 14px; }
.wiz-card { border-color: rgba(95, 224, 207, .35); background: linear-gradient(180deg, rgba(14, 140, 133, .12), var(--surface) 60%); }
.wiz-card h2 { display: flex; align-items: center; gap: 8px; }
.wiz-card .btn.primary { align-self: flex-start; }
.wiz-steps { list-style: none; margin: 0; padding: 0; display: flex; gap: 6px; counter-reset: st; }
.wiz-steps li { flex: 1; font-size: 12.5px; color: var(--muted); padding-top: 8px; border-top: 3px solid var(--surface-3); counter-increment: st; }
.wiz-steps li::before { content: counter(st) ". "; }
.wiz-steps li.done { border-color: var(--teal); color: var(--text-2); }
.wiz-steps li.cur { border-color: var(--aqua); color: var(--text); font-weight: 600; }
.wiz-howto { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 8px; color: var(--text); }
.wiz-howto a { color: var(--aqua-2); font-weight: 500; }
.wiz-in { min-height: 46px; padding: 10px 12px; border-radius: var(--r-sm); border: 1px solid var(--line-2); background: var(--bg-2); color: var(--text); font-size: 16px; }
.wiz-in:focus { outline: none; border-color: var(--aqua); }
.mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: .04em; }
.ok-line { color: var(--aqua-2); font-weight: 500; display: flex; align-items: center; gap: 6px; }
.kfield > span { font-size: 14px; color: var(--text-2); font-weight: 500; }

/* ── подключения: три крупные карточки, «Ещё», мастера ── */
.page-narrow { max-width: 780px; }
.btn.lg { min-height: 50px; padding: 0 26px; font-size: 16.5px; border-radius: 13px; }
.linkish { background: none; border: 0; padding: 4px 2px; color: var(--aqua-2); font: inherit; font-size: 14.5px; cursor: pointer; align-self: flex-start; text-decoration: underline; text-decoration-color: rgba(139, 234, 221, .35); text-underline-offset: 3px; }
.linkish:hover { text-decoration-color: currentColor; }
.linkish.quiet { color: var(--muted); text-decoration-color: rgba(132, 168, 162, .35); }
.linkish.quiet:hover { color: #FFB3A8; }
.warn-t { color: #FFD796; }
.stack.tight { gap: 8px; }
.st-badge { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 11px; border-radius: 999px; font-size: 13.5px; font-weight: 500; white-space: nowrap; }
.st-badge svg.i { width: 15px; height: 15px; stroke-width: 2.2; }
.st-badge.ok { background: rgba(95, 224, 207, .14); color: var(--aqua-2); }
.st-badge.dim { background: rgba(139, 234, 221, .06); color: var(--muted); }
.st-badge.err { background: rgba(255, 127, 112, .15); color: #FFB3A8; }
.link-list { display: flex; flex-direction: column; gap: 16px; }
.link-card { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 20px; padding: 24px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); }
.link-card.is-connected { border-color: rgba(95, 224, 207, .22); }
.link-card.is-error { border-color: rgba(255, 127, 112, .35); }
.link-ic { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line-2); color: var(--aqua-2); }
.link-ic svg.i { width: 28px; height: 28px; }
.link-card.is-missing .link-ic { color: var(--text-2); }
.link-main { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.link-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.link-head h2 { font-size: 21px; display: flex; align-items: center; gap: 10px; }
.link-ic-s { display: none; place-items: center; width: 36px; height: 36px; border-radius: 11px; background: var(--surface-2); border: 1px solid var(--line-2); color: var(--aqua-2); flex: none; }
.link-ic-s svg.i { width: 20px; height: 20px; }
.link-head h3 { font-size: 16.5px; }
.link-about { color: var(--text-2); font-size: 15.5px; max-width: 60ch; }
.link-detail { display: flex; flex-direction: column; gap: 8px; }
.link-detail:empty { display: none; }
.link-detail > p:first-child:not(.link-reason) { color: var(--text); font-size: 15px; overflow-wrap: anywhere; }
.link-reason { color: #FFB3A8; font-size: 14.5px; }
.link-acts { display: flex; align-items: center; gap: 10px 16px; flex-wrap: wrap; margin-top: 4px; }
.conn-res:empty { display: none; }
.more-box { border-radius: var(--r); border: 1px solid var(--line); background: var(--surface); }
.more-box > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 12px; padding: 16px 20px; min-height: 56px; }
.more-box > summary::-webkit-details-marker { display: none; }
.more-box > summary > span:first-child { font: 600 16.5px/1.2 var(--display); }
.more-box > summary svg.i { margin-left: auto; color: var(--muted); transition: transform .2s var(--out); }
.more-box[open] > summary svg.i { transform: rotate(90deg); }
.more-box > summary:focus-visible { outline: 2px solid var(--aqua); outline-offset: -2px; border-radius: var(--r); }
.more-rows { display: flex; flex-direction: column; padding: 0 20px 6px; }
.more-row { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; padding: 16px 0; border-top: 1px solid var(--line); }
.more-main { flex: 1 1 320px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.more-acts { display: flex; align-items: center; gap: 14px; }
.sys-link { display: flex; align-items: center; gap: 16px; padding: 16px 20px; border-radius: var(--r); border: 1px solid var(--line); color: var(--text); text-decoration: none; }
.sys-link:hover { background: var(--surface); }
.sys-link > span { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.sys-link b { font: 600 16.5px/1.2 var(--display); }
.sys-link svg.i { color: var(--muted); }
.sys-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; align-items: start; }
.wiz { display: flex; flex-direction: column; gap: 18px; }
.wiz-intro { color: var(--text-2); }
.wsteps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 18px; }
.wstep { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 14px; }
.wnum { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: rgba(95, 224, 207, .14); color: var(--aqua-2); font: 600 15px/1 var(--display); }
.wstep-b { display: flex; flex-direction: column; gap: 8px; min-width: 0; padding-top: 4px; }
.wstep-b h3 { font-size: 16px; }
.wstep-b a { color: var(--aqua-2); font-weight: 500; overflow-wrap: anywhere; }
.wiz-status { font-size: 14.5px; color: var(--text-2); }
.wiz-status:empty { display: none; }
.wiz-status.bad { color: #FFB3A8; }
.wiz-done { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 20px 0 6px; }
.wiz-done .stack { align-self: stretch; text-align: left; margin-top: 10px; }
.wiz-ok { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: rgba(95, 224, 207, .16); color: var(--aqua); }
.wiz-ok svg.i { width: 32px; height: 32px; stroke-width: 2.4; }
.secret { position: relative; display: flex; }
.secret input { flex: 1; min-width: 0; padding-right: 92px !important; }
.reveal { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); height: 34px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent; color: var(--aqua-2); font: inherit; font-size: 14px; cursor: pointer; }
.reveal:hover { background: var(--surface-3); }
.khint.good { color: var(--aqua-2); }
.khint.bad { color: #FFB3A8; }
.wiz-in { width: 100%; }
@media (max-width: 900px) {
  .link-card { grid-template-columns: minmax(0, 1fr); gap: 14px; padding: 20px; }
  .link-ic { display: none; }
  .link-ic-s { display: inline-grid !important; }
  .link-head h2 { font-size: 19px; }
  .link-acts .btn.lg { flex: 1 1 100%; }
  .more-rows { padding: 0 16px 4px; }
  .more-box > summary { padding: 14px 16px; flex-wrap: wrap; }
}
.convo-panel .convo { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 4px 20px calc(20px + var(--safe-b)); }
.lc-hello { border-color: rgba(95, 224, 207, .4); background: linear-gradient(180deg, rgba(14, 140, 133, .16), var(--surface) 70%); }
.lc-hello .btn { align-self: flex-start; }
.addr-note { min-height: 18px; margin: 0; }
