/* ─────────────────────────── токены ───────────────────────────
   Светлая тема — основная, тёмная переопределяет только переменные.
   Акцент подставляется из настроек скриптом, поэтому здесь только запасное
   значение на случай, если скрипт ещё не отработал.                        */
:root{
  color-scheme: light;
  --paper:#F3F3EF;
  --card:#FFFFFF;
  --card-2:#FAFAF8;
  --ink:#131312;
  --ink-2:#57564F;
  --ink-3:#8C8A83;
  --rule:#E7E6E0;
  --rule-2:#D6D5CD;
  --accent:#17604A;
  --accent-ink:#FFFFFF;
  --accent-soft:#E4EDE9;
  --bad:#BE382E;
  --bad-soft:#FAEAE8;
  --sheet-scrim:rgba(19,19,18,.34);
  --shadow-sm:0 1px 2px rgba(19,19,18,.05);
  --shadow-md:0 2px 4px rgba(19,19,18,.04), 0 12px 28px -14px rgba(19,19,18,.22);
  --shadow-lg:0 24px 60px -18px rgba(19,19,18,.28), 0 4px 12px rgba(19,19,18,.06);
  --s0:#A9A79E; --s1:#2a78d6; --s2:#eb6834; --s3:#1baf7a; --s4:#eda100;
  --s5:#e87ba4; --s6:#008300; --s7:#4a3aa7; --s8:#e34948;
  --ring:2px;
}
/* Тёмная тема живёт в двух местах нарочно: медиазапрос отрабатывает до того,
   как загрузится скрипт, а атрибут data-theme ставит скрипт по теме телеграма
   или по ручному выбору в настройках, и он должен перебивать системную. */
@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]){
    color-scheme: dark;
    --paper:#0B0B0A;
    --card:#1A1A19;
    --card-2:#212120;
    --ink:#FFFFFF;
    --ink-2:#C3C2B7;
    --ink-3:#898781;
    --rule:#2C2C2A;
    --rule-2:#3A3A38;
    --accent:#4FB894;
    --accent-ink:#0B0B0A;
    --accent-soft:rgba(79,184,148,.15);
    --bad:#E66767;
    --bad-soft:rgba(230,103,103,.15);
    --sheet-scrim:rgba(0,0,0,.6);
    --shadow-sm:0 1px 2px rgba(0,0,0,.4);
    --shadow-md:0 2px 4px rgba(0,0,0,.3), 0 12px 28px -14px rgba(0,0,0,.7);
    --shadow-lg:0 24px 60px -18px rgba(0,0,0,.8), 0 4px 12px rgba(0,0,0,.4);
    --s0:#6E6D67; --s1:#3987e5; --s2:#d95926; --s3:#199e70; --s4:#c98500;
    --s5:#d55181; --s6:#008300; --s7:#9085e9; --s8:#e66767;
  }
}
:root[data-theme="dark"]{
  color-scheme: dark;
  --paper:#0B0B0A;
  --card:#1A1A19;
  --card-2:#212120;
  --ink:#FFFFFF;
  --ink-2:#C3C2B7;
  --ink-3:#898781;
  --rule:#2C2C2A;
  --rule-2:#3A3A38;
  --accent:#4FB894;
  --accent-ink:#0B0B0A;
  --accent-soft:rgba(79,184,148,.15);
  --bad:#E66767;
  --bad-soft:rgba(230,103,103,.15);
  --sheet-scrim:rgba(0,0,0,.6);
  --shadow-sm:0 1px 2px rgba(0,0,0,.4);
  --shadow-md:0 2px 4px rgba(0,0,0,.3), 0 12px 28px -14px rgba(0,0,0,.7);
  --shadow-lg:0 24px 60px -18px rgba(0,0,0,.8), 0 4px 12px rgba(0,0,0,.4);
  --s0:#6E6D67; --s1:#3987e5; --s2:#d95926; --s3:#199e70; --s4:#c98500;
  --s5:#d55181; --s6:#008300; --s7:#9085e9; --s8:#e66767;
}

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

html,body{ height:100%; overflow:hidden; overscroll-behavior:none; }
body{
  margin:0;
  background:var(--paper);
  color:var(--ink);
  font-family:"Golos Text","Segoe UI",system-ui,sans-serif;
  font-size:15px; line-height:1.45;
  -webkit-font-smoothing:antialiased;
  -webkit-tap-highlight-color:transparent;
  user-select:none; -webkit-user-select:none;
}
button{ font:inherit; color:inherit; background:none; border:0; padding:0; cursor:pointer; }
button:focus-visible,[tabindex]:focus-visible{ outline:2px solid var(--accent); outline-offset:2px; border-radius:8px; }
input{ font:inherit; color:inherit; user-select:text; -webkit-user-select:text; }

.num{ font-family:"Geologica","Golos Text",system-ui,sans-serif; font-variant-numeric:tabular-nums; letter-spacing:-.01em; }

.app{
  position:relative;
  height:var(--tg-viewport-stable-height, 100dvh);
  max-width:560px; margin:0 auto;
  display:flex; flex-direction:column; overflow:hidden;
}

/* ─────────────────────────── верхняя панель ─────────────────────────── */
.topbar{
  flex:0 0 auto; display:flex; align-items:center; gap:2px;
  padding:calc(10px + env(safe-area-inset-top)) 10px 10px 12px;
  background:var(--paper);
  border-bottom:1px solid transparent;
  transition:border-color .2s ease; z-index:5;
}
.topbar.is-stuck{ border-bottom-color:var(--rule); }
.icon-btn{
  width:34px; height:34px; border-radius:10px;
  display:grid; place-items:center; color:var(--ink-2);
  transition:background .15s ease, color .15s ease;
}
.icon-btn:hover{ background:var(--card); color:var(--ink); }
.icon-btn:disabled{ opacity:.3; cursor:default; }
.icon-btn svg{ width:19px; height:19px; }
.month{ flex:1; text-align:center; font-weight:600; font-size:15.5px; letter-spacing:-.01em; }
.month small{ display:block; font-weight:400; font-size:11px; color:var(--ink-3); letter-spacing:.04em; }

/* ─────────────────────────── экраны ─────────────────────────── */
.screens{ position:relative; flex:1 1 auto; overflow:hidden; }
.screen{
  position:absolute; inset:0; overflow-y:auto; overflow-x:hidden;
  -webkit-overflow-scrolling:touch;
  padding:4px 16px 112px;
  opacity:0; visibility:hidden; transform:translateY(8px);
  transition:opacity .22s ease, transform .28s cubic-bezier(.2,.8,.3,1), visibility .28s;
}
.screen.is-active{ opacity:1; visibility:visible; transform:none; }

h2.sec{
  margin:22px 0 9px;
  font-size:11.5px; font-weight:600; letter-spacing:.1em; text-transform:uppercase;
  color:var(--ink-3);
  display:flex; align-items:baseline; justify-content:space-between; gap:10px;
}
h2.sec .sec-act{
  font-size:11.5px; letter-spacing:.04em; text-transform:none;
  color:var(--accent); font-weight:600;
}
.card{
  background:var(--card); border:1px solid var(--rule);
  border-radius:16px; box-shadow:var(--shadow-sm);
}
.scroll-x{ overflow-x:auto; }

/* ─────────────────────────── шапка «потрачено» ─────────────────────────── */
.hero{ padding:20px 4px 6px; }
.hero-label{ font-size:13px; color:var(--ink-3); }
.hero-sum{ display:flex; align-items:baseline; gap:6px; margin-top:2px; }
.hero-sum .v{ font-size:42px; font-weight:400; line-height:1.05; }
.hero-sum .cur{ font-size:22px; color:var(--ink-3); font-weight:300; }
.chips{ display:flex; flex-wrap:wrap; gap:7px; margin-top:12px; }
.chip{
  display:inline-flex; align-items:center; gap:5px;
  padding:5px 10px; border-radius:999px; font-size:12.5px; font-weight:500;
  background:var(--card); border:1px solid var(--rule); color:var(--ink-2);
}
.chip.good{ color:var(--accent); background:var(--accent-soft); border-color:transparent; }
.chip.bad{ color:var(--bad); background:var(--bad-soft); border-color:transparent; }
.chip svg{ width:13px; height:13px; }

/* ─────────────────────────── лимиты ─────────────────────────── */
.limits{ padding:6px 14px 4px; }
.limit{ padding:11px 0; border-bottom:1px solid var(--rule); }
.limit:last-child{ border-bottom:0; }
.limit-top{ display:flex; align-items:baseline; justify-content:space-between; gap:10px; }
.limit-name{ font-size:14.5px; font-weight:500; }
.limit-val{ font-size:13px; color:var(--ink-3); }
.limit-val b{ color:var(--ink); font-weight:500; }
.limit-track{
  position:relative; height:6px; margin-top:8px;
  border-radius:999px; background:var(--rule); overflow:hidden;
}
.limit-fill{
  position:absolute; inset:0 auto 0 0; width:0;
  border-radius:999px; background:var(--accent);
  transition:width .9s cubic-bezier(.2,.8,.3,1);
}
.limit.over .limit-fill{ background:var(--bad); }
.limit-note{ margin-top:6px; font-size:12px; color:var(--bad); display:flex; align-items:center; gap:5px; }
.limit-note svg{ width:12px; height:12px; flex:0 0 auto; }

/* ─────────────────────────── операции ─────────────────────────── */
.daygroup{ margin-top:14px; }
.daygroup:first-child{ margin-top:0; }
.dayname{ font-size:12px; color:var(--ink-3); padding:0 4px 6px; display:flex; justify-content:space-between; }
.txlist{ overflow:hidden; }
.txwrap{ position:relative; overflow:hidden; border-bottom:1px solid var(--rule); }
.txlist .txwrap:last-child{ border-bottom:0; }
.txactions{ position:absolute; inset:0 0 0 auto; width:132px; display:flex; }
.txactions button{ flex:1; display:grid; place-items:center; gap:3px; font-size:11px; font-weight:600; color:#fff; }
.txactions button svg{ width:16px; height:16px; }
.act-edit{ background:var(--ink-3); }
.act-del{ background:var(--bad); }
.tx{
  position:relative; z-index:1; display:flex; align-items:center; gap:12px;
  padding:11px 14px; background:var(--card); touch-action:pan-y;
  transition:transform .26s cubic-bezier(.2,.8,.3,1); will-change:transform;
}
.tx.dragging{ transition:none; }
.tx-dot{ width:9px; height:9px; border-radius:50%; flex:0 0 auto; }
.tx-body{ flex:1; min-width:0; }
.tx-name{ font-size:14.5px; font-weight:500; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.tx-meta{ font-size:12px; color:var(--ink-3); display:flex; gap:7px; margin-top:1px; }
.tx-tag{ color:var(--accent); }
.tx-amt{ font-size:15px; font-weight:500; flex:0 0 auto; }
.tx-amt.inc{ color:var(--accent); }
.review{
  display:inline-flex; align-items:center; gap:4px; font-size:11px;
  color:var(--bad); background:var(--bad-soft); padding:2px 7px; border-radius:999px;
}

/* ─────────────────────────── отчёты ─────────────────────────── */
.segmented{
  display:flex; gap:2px; padding:3px; margin:12px 0 4px;
  background:var(--card); border:1px solid var(--rule); border-radius:12px;
}
.segmented button{
  flex:1; padding:7px 4px; border-radius:9px; font-size:12.5px; font-weight:500;
  color:var(--ink-2); transition:background .18s ease, color .18s ease;
}
.segmented button.is-on{ background:var(--accent); color:var(--accent-ink); }

.subview{ display:none; }
.subview.is-on{ display:block; animation:fade .26s ease both; }
@keyframes fade{ from{ opacity:0; transform:translateY(6px);} to{ opacity:1; transform:none;} }

.donut-wrap{ position:relative; display:grid; place-items:center; padding:18px 0 6px; }
.donut{ width:198px; height:198px; transform:rotate(-90deg); }
.donut circle{ fill:none; cursor:pointer; transition:stroke-width .22s ease, opacity .22s ease; }
.donut.has-sel circle{ opacity:.32; }
.donut.has-sel circle.is-sel{ opacity:1; stroke-width:30; }
.donut-center{ position:absolute; text-align:center; pointer-events:none; display:grid; gap:1px; }
.donut-center .dc-lab{ font-size:12px; color:var(--ink-3); }
.donut-center .dc-val{ font-size:25px; font-weight:400; }

.catrow{
  display:flex; align-items:center; gap:11px;
  padding:11px 14px; border-bottom:1px solid var(--rule); width:100%; text-align:left;
}
.catrow:last-child{ border-bottom:0; }
.catrow.is-sel{ background:var(--card-2); }
.catrow .tx-dot{ width:10px; height:10px; }
.catrow .cr-name{ flex:1; font-size:14.5px; font-weight:500; }
.catrow .cr-share{ font-size:12.5px; color:var(--ink-3); width:42px; text-align:right; }
.catrow .cr-sum{ font-size:14.5px; font-weight:500; width:86px; text-align:right; }

.bars{ padding:16px 12px 10px; }
.bars-plot{ display:flex; align-items:flex-end; gap:0; height:142px; }
.bargroup{
  flex:1; display:flex; align-items:flex-end; justify-content:center; gap:var(--ring);
  height:100%; position:relative; cursor:pointer; padding:0 1px;
}
.bar{ width:9px; border-radius:4px 4px 0 0; transition:opacity .2s ease, height .6s cubic-bezier(.2,.8,.3,1); }
.bar.inc{ background:var(--s1); }
.bar.exp{ background:var(--s2); }
.bars.has-sel .bargroup:not(.is-sel) .bar{ opacity:.3; }
.bars-x{ display:flex; margin-top:7px; }
.bars-x span{ flex:1; text-align:center; font-size:10.5px; color:var(--ink-3); }
.bars-x span.is-sel{ color:var(--ink); font-weight:600; }
.legend{ display:flex; gap:14px; padding:2px 14px 14px; }
.legend span{ display:inline-flex; align-items:center; gap:6px; font-size:12px; color:var(--ink-2); }
.legend i{ width:9px; height:9px; border-radius:2px; display:inline-block; }
.tip{
  position:absolute; bottom:calc(100% + 8px); left:50%; transform:translateX(-50%);
  background:var(--ink); color:var(--paper); border-radius:9px; padding:7px 10px;
  font-size:12px; white-space:nowrap; box-shadow:var(--shadow-md);
  pointer-events:none; z-index:3; display:grid; gap:2px;
}
.tip b{ font-weight:600; }

.cmp{ width:100%; border-collapse:collapse; }
.cmp th,.cmp td{ padding:10px 14px; text-align:right; font-size:13.5px; border-bottom:1px solid var(--rule); white-space:nowrap; }
.cmp th{ font-size:11px; letter-spacing:.06em; text-transform:uppercase; color:var(--ink-3); font-weight:600; }
.cmp th:first-child,.cmp td:first-child{ text-align:left; font-weight:500; }
.cmp tr:last-child td{ border-bottom:0; }
.cmp .d-up{ color:var(--bad); }
.cmp .d-down{ color:var(--accent); }

/* ─────────────────────────── планы и долги ─────────────────────────── */
.rowitem{
  display:flex; align-items:center; gap:12px; padding:13px 14px;
  border-bottom:1px solid var(--rule); width:100%; text-align:left;
}
.rowitem:last-child{ border-bottom:0; }
.ri-body{ flex:1; min-width:0; }
.ri-name{ font-size:14.5px; font-weight:500; }
.ri-meta{ font-size:12px; color:var(--ink-3); margin-top:1px; }
.ri-amt{ font-size:14.5px; font-weight:500; }
.pill{ padding:4px 9px; border-radius:999px; font-size:11.5px; font-weight:600; background:var(--accent); color:var(--accent-ink); }
.pill.ghost{ background:var(--card-2); color:var(--ink-2); border:1px solid var(--rule); }

.goal{ padding:15px 14px; border-bottom:1px solid var(--rule); }
.goal:last-child{ border-bottom:0; }
.goal-top{ display:flex; align-items:baseline; justify-content:space-between; gap:10px; }
.goal-name{ font-size:15px; font-weight:500; }
.goal-pct{ font-size:13px; color:var(--accent); font-weight:600; }
.goal-track{ height:8px; margin-top:9px; border-radius:999px; background:var(--rule); overflow:hidden; }
.goal-fill{ height:100%; width:0; border-radius:999px; background:var(--accent); transition:width 1s cubic-bezier(.2,.8,.3,1); }
.goal-meta{ display:flex; justify-content:space-between; gap:10px; margin-top:7px; font-size:12px; color:var(--ink-3); }

/* ─────────────────────────── нижние вкладки ─────────────────────────── */
.tabbar{
  position:absolute; left:0; right:0; bottom:0; z-index:6;
  display:flex; align-items:flex-end;
  padding:8px 6px calc(10px + env(safe-area-inset-bottom));
  background:var(--paper);
  background:color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter:blur(14px); -webkit-backdrop-filter:blur(14px);
  border-top:1px solid var(--rule);
}
.tab{
  flex:1; display:grid; place-items:center; gap:3px; padding:5px 0;
  color:var(--ink-3); font-size:10.5px; font-weight:500; transition:color .18s ease;
}
.tab svg{ width:21px; height:21px; }
.tab.is-on{ color:var(--accent); }
.fab-slot{ flex:0 0 74px; display:grid; place-items:center; }
.fab{
  width:54px; height:54px; border-radius:19px;
  background:var(--accent); color:var(--accent-ink);
  display:grid; place-items:center;
  box-shadow:0 8px 20px -8px color-mix(in srgb, var(--accent) 70%, transparent);
  transform:translateY(-6px); transition:transform .16s cubic-bezier(.2,.8,.3,1);
}
.fab:active{ transform:translateY(-6px) scale(.93); }
.fab svg{ width:25px; height:25px; }

/* ─────────────────────────── шторки ─────────────────────────── */
.scrim{
  position:absolute; inset:0; z-index:8; background:var(--sheet-scrim);
  opacity:0; visibility:hidden; transition:opacity .26s ease, visibility .26s;
}
.scrim.is-on{ opacity:1; visibility:visible; }
.sheet{
  position:absolute; left:0; right:0; bottom:0; z-index:9;
  background:var(--card); border-radius:22px 22px 0 0; border-top:1px solid var(--rule);
  box-shadow:var(--shadow-lg); transform:translateY(102%);
  transition:transform .34s cubic-bezier(.2,.85,.25,1);
  max-height:94%; display:flex; flex-direction:column;
}
.sheet.is-on{ transform:none; }
.grabber{ width:38px; height:4px; border-radius:99px; background:var(--rule-2); margin:9px auto 2px; flex:0 0 auto; }
.sheet-head{ display:flex; align-items:center; justify-content:space-between; padding:6px 16px 10px; flex:0 0 auto; }
.sheet-title{ font-size:16px; font-weight:600; }
.sheet-body{ overflow-y:auto; padding:0 16px calc(16px + env(safe-area-inset-bottom)); }

.rd{ display:flex; gap:2px; padding:3px; background:var(--card-2); border:1px solid var(--rule); border-radius:12px; }
.rd button{ flex:1; padding:8px; border-radius:9px; font-size:13.5px; font-weight:500; color:var(--ink-2); transition:background .18s, color .18s; }
.rd button.is-on{ background:var(--card); color:var(--ink); box-shadow:var(--shadow-sm); }

.amount{ text-align:center; padding:22px 0 6px; font-size:46px; font-weight:300; line-height:1; }
.amount .z{ color:var(--ink-3); }
.amount .cur{ font-size:26px; color:var(--ink-3); margin-left:4px; }
.amount-note{ text-align:center; font-size:12px; color:var(--ink-3); min-height:18px; }

.catscroll{ display:flex; gap:7px; overflow-x:auto; padding:12px 0 4px; scrollbar-width:none; }
.catscroll::-webkit-scrollbar{ display:none; }
.catchip{
  flex:0 0 auto; display:inline-flex; align-items:center; gap:7px;
  padding:8px 13px; border-radius:999px; border:1px solid var(--rule);
  background:var(--card-2); font-size:13.5px; font-weight:500; color:var(--ink-2);
  transition:background .16s, color .16s, border-color .16s;
}
.catchip .tx-dot{ width:8px; height:8px; }
.catchip.is-on{ background:var(--accent); border-color:var(--accent); color:var(--accent-ink); }
.catchip.is-on .tx-dot{ background:var(--accent-ink) !important; }
.subcats{ display:flex; flex-wrap:wrap; gap:7px; padding-top:4px; }
.subchip{ padding:6px 12px; border-radius:999px; font-size:13px; border:1px dashed var(--rule-2); color:var(--ink-2); }
.subchip.is-on{ border-style:solid; border-color:var(--accent); color:var(--accent); background:var(--accent-soft); }

.fields{ margin-top:14px; }
.field{ display:flex; align-items:center; gap:10px; padding:11px 0; border-bottom:1px solid var(--rule); }
.field:last-child{ border-bottom:0; }
.field-lab{ flex:0 0 84px; font-size:13.5px; color:var(--ink-3); }
.opts{ display:flex; gap:6px; flex-wrap:wrap; flex:1; }
.opt{ padding:6px 12px; border-radius:9px; font-size:13px; background:var(--card-2); border:1px solid var(--rule); color:var(--ink-2); }
.opt.is-on{ background:var(--accent-soft); border-color:var(--accent); color:var(--accent); font-weight:500; }
.text-in{
  flex:1; min-width:0; padding:8px 11px; border-radius:9px;
  background:var(--card-2); border:1px solid var(--rule); color:var(--ink); font-size:13.5px;
}
.text-in::placeholder{ color:var(--ink-3); }
.date-hidden{ position:absolute; opacity:0; pointer-events:none; width:1px; height:1px; }

.pad{ display:grid; grid-template-columns:repeat(3,1fr); gap:8px; padding:14px 0 10px; }
.key{
  height:52px; border-radius:14px; background:var(--card-2); border:1px solid var(--rule);
  font-family:"Geologica","Golos Text",system-ui,sans-serif; font-size:23px; font-weight:300;
  display:grid; place-items:center; transition:transform .09s ease, background .12s ease;
}
.key:active{ transform:scale(.94); background:var(--accent-soft); }
.key svg{ width:22px; height:22px; }

.primary{
  width:100%; height:52px; border-radius:15px; margin-top:6px;
  background:var(--accent); color:var(--accent-ink); font-size:15.5px; font-weight:600;
  display:grid; place-items:center; transition:transform .1s ease, opacity .2s ease;
}
.primary:active{ transform:scale(.985); }
.primary:disabled{ opacity:.4; cursor:default; }
.ghostbtn{
  width:100%; height:46px; border-radius:14px; margin-top:8px;
  border:1px solid var(--rule); color:var(--ink-2); font-size:14px; font-weight:500;
  display:flex; align-items:center; justify-content:center; gap:8px;
}
.dangerbtn{ color:var(--bad); border-color:var(--bad-soft); background:var(--bad-soft); }

.swatches{ display:flex; gap:10px; padding:4px 0 2px; }
.sw{ display:grid; gap:6px; justify-items:center; }
.sw-dot{ width:38px; height:38px; border-radius:13px; border:2px solid transparent; transition:border-color .18s ease, transform .18s ease; }
.sw.is-on .sw-dot{ border-color:var(--ink); transform:scale(1.06); }
.sw-lab{ font-size:11px; color:var(--ink-3); }
.note{
  margin-top:16px; padding:12px 14px; border-radius:13px;
  background:var(--card-2); border:1px solid var(--rule);
  font-size:12.5px; color:var(--ink-2); line-height:1.5;
}

.toast{
  position:absolute; left:50%; bottom:96px; transform:translate(-50%,14px);
  z-index:20; padding:11px 17px; border-radius:13px;
  background:var(--ink); color:var(--paper); font-size:13.5px; font-weight:500;
  box-shadow:var(--shadow-lg); opacity:0; visibility:hidden;
  transition:opacity .24s ease, transform .28s cubic-bezier(.2,.8,.3,1), visibility .28s;
  display:flex; align-items:center; gap:8px; max-width:88%;
}
.toast.is-on{ opacity:1; visibility:visible; transform:translate(-50%,0); }
.toast.err{ background:var(--bad); color:#fff; }
.toast svg{ width:16px; height:16px; flex:0 0 auto; }

.empty{ text-align:center; color:var(--ink-3); font-size:13.5px; padding:26px 20px; line-height:1.5; }

.loader{
  position:absolute; inset:0; z-index:30; display:grid; place-items:center;
  background:var(--paper); transition:opacity .3s ease, visibility .3s;
}
.loader.is-off{ opacity:0; visibility:hidden; }
.spin{
  width:26px; height:26px; border-radius:50%;
  border:2.5px solid var(--rule); border-top-color:var(--accent);
  animation:spin .8s linear infinite;
}
@keyframes spin{ to{ transform:rotate(360deg); } }

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

/* ─────────────────────────── умная строка: фраза и голос ─────────────────────────── */
.smart{ display:flex; gap:8px; align-items:center; padding-top:2px; }
.mic, .go{
  width:44px; height:44px; border-radius:14px; flex:0 0 auto;
  display:grid; place-items:center;
  transition:transform .12s ease, background .18s ease, color .18s ease;
}
.mic{ background:var(--card-2); border:1px solid var(--rule); color:var(--ink-2); }
.mic svg, .go svg{ width:20px; height:20px; }
.mic:active, .go:active{ transform:scale(.94); }
.mic.rec{ background:var(--bad); border-color:transparent; color:#fff; animation:pulse 1.3s ease-in-out infinite; }
@keyframes pulse{ 50%{ opacity:.55; } }
.go{ background:var(--accent); color:var(--accent-ink); }
.go:disabled{ opacity:.32; cursor:default; }
.smart-in{
  flex:1; min-width:0; height:44px; padding:0 13px;
  border-radius:14px; background:var(--card-2); border:1px solid var(--rule);
  color:var(--ink); font-size:14px;
}
.smart-in::placeholder{ color:var(--ink-3); }
.smart-note{ font-size:12px; color:var(--ink-3); padding:8px 4px 14px; line-height:1.4; }
.smart-note.busy{ color:var(--accent); }
.smart-note.err{ color:var(--bad); }

.prow{
  display:flex; align-items:flex-start; gap:11px; width:100%; text-align:left;
  padding:12px 14px; border-bottom:1px solid var(--rule);
}
.prow:last-child{ border-bottom:0; }
.prow .tx-dot{ margin-top:5px; }
.prow-body{ flex:1; min-width:0; }
.prow-name{ font-size:14.5px; font-weight:500; }
.prow-meta{ font-size:12px; color:var(--ink-3); margin-top:2px; }
.prow-amt{ font-size:15px; font-weight:500; white-space:nowrap; }
.prow-amt.inc{ color:var(--accent); }
.prow-edit{ font-size:11.5px; color:var(--accent); font-weight:600; margin-top:4px; display:inline-block; }
