* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --bg: #eef1f7;
  --card: #ffffff;
  --sub: #f2f4fa;
  --border: #e7eaf3;
  --divider: #e7eaf3;
  --text: #191c26;
  --mid: #555c6e;
  --muted: #8a92a6;
  --green: #0f9d6f;
  --green-bg: #dcf3ea;
  --coral: #e05b3a;
  --coral-bg: #fde7dd;
  --amber: #b47716;
  --amber-bg: #faf0d9;
  --blue: #5a5fe0;
  --blue-hi: #4348c8;
  --blue-lo: #7a7ef0;
  --blue-bg: #e7e8fb;
  --shadow: 0 1px 2px rgba(23, 26, 38, 0.04), 0 10px 30px rgba(23, 26, 38, 0.07);
  --shadow-soft: 0 1px 2px rgba(23, 26, 38, 0.03), 0 6px 18px rgba(23, 26, 38, 0.05);
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;
}
html { background: var(--bg); }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
input, button { font-family: inherit; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgba(25, 28, 38, 0.14); border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }
.hidden { display: none !important; }
.num { font-variant-numeric: tabular-nums; }

/* ── keyframes ─────────────────────────────────────────── */
@keyframes orbPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
@keyframes orbListen {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.14); }
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes ring { 0% { transform: scale(0.6); opacity: 0.5; } 100% { transform: scale(2.2); opacity: 0; } }
@keyframes waveb { 0%, 100% { transform: scaleY(0.28); } 50% { transform: scaleY(1); } }
@keyframes flyIn {
  0% { opacity: 0; transform: translateY(20px) scale(0.96); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
.fly { animation: flyIn 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) both; }

/* ── deck layout · mobile-first ────────────────────────── */
.deck { min-height: 100vh; display: flex; flex-direction: column; }
.dash { display: flex; flex-direction: column; min-width: 0; }
.assistant {
  display: flex; flex-direction: column;
  background: var(--card);
  border-top: 1px solid var(--divider);
  height: 100dvh;
}
@media (min-width: 1000px) {
  .deck { flex-direction: row; align-items: stretch; }
  .dash { flex: 1 1 620px; }
  .assistant {
    flex: 1 1 380px; max-width: 440px; min-width: 320px;
    border-top: none; border-left: 1px solid var(--divider);
    position: sticky; top: 0; height: 100vh;
  }
}

/* ── status strip ──────────────────────────────────────── */
.strip {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 14px 16px;
  background: rgba(238, 241, 247, 0.85);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-dot {
  display: inline-block; width: 12px; height: 12px; border-radius: 50%;
  background: var(--blue);
}
.brand-name { font-size: 17px; font-weight: 700; letter-spacing: -0.2px; }
.brand-sub { font-size: 12px; color: var(--muted); padding-left: 10px; border-left: 1px solid var(--border); }
.month-nav {
  display: flex; align-items: center; gap: 4px; margin-left: auto;
  background: var(--card); border-radius: 999px; padding: 4px;
  box-shadow: var(--shadow-soft);
}
.month-nav button {
  width: 30px; height: 30px; border-radius: 999px;
  background: none; border: none;
  color: var(--mid); cursor: pointer; font-size: 15px;
  transition: background 0.15s, color 0.15s;
}
.month-nav button:hover { background: var(--sub); color: var(--text); }
#m-all { font-size: 13px; }
#m-all.on { color: var(--blue); background: var(--blue-bg); }
.month-nav.all #m-prev, .month-nav.all #m-next { display: none; }
#m-label { font-size: 13px; font-weight: 600; color: var(--text); min-width: 96px; text-align: center; font-variant-numeric: tabular-nums; }
.mini-kpi { display: flex; gap: 14px; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.mk { white-space: nowrap; color: var(--mid); }
.mk.green { color: var(--green); }
.mk.coral { color: var(--coral); }
.logout {
  width: 34px; height: 34px; border-radius: 999px; flex: none;
  display: grid; place-items: center;
  background: var(--card); border: none; box-shadow: var(--shadow-soft);
  color: var(--mid); cursor: pointer;
  transition: background 0.15s, color 0.15s, transform 0.15s;
}
.logout:hover { background: var(--coral-bg, var(--sub)); color: var(--coral); transform: translateY(-1px); }
.logout:active { transform: translateY(0); }

/* ── bento grid / tiles ────────────────────────────────── */
.bento {
  position: relative; flex: 1;
  padding: 8px 16px 28px;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr));
  grid-auto-rows: auto; gap: 14px; align-content: start;
}
.tile {
  position: relative; padding: 20px;
  border-radius: 24px;
  background: var(--card);
  box-shadow: var(--shadow-soft);
  min-width: 0;
  transition: box-shadow 0.2s;
}
.tile:hover { box-shadow: var(--shadow); }
.tile.wide { grid-column: 1 / -1; }
.tile-h { font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 14px; }
.tile-h .hint { float: right; font-weight: 500; color: var(--muted); opacity: 0.85; }

/* KPI tile — пастельные карточки */
.kpi-nums { display: flex; gap: 10px; flex-wrap: wrap; }
.kpi-block { flex: 1 1 130px; border-radius: 18px; padding: 14px 16px; background: var(--sub); }
.kpi-block[data-kind="income"] { background: var(--green-bg); }
.kpi-block[data-kind="expense"] { background: var(--coral-bg); }
.kpi-block[data-kind="all"] { background: var(--blue-bg); }
.kpi-block.clickable { cursor: pointer; transition: transform 0.15s, box-shadow 0.15s; }
.kpi-block.clickable:hover { transform: translateY(-2px); box-shadow: var(--shadow-soft); }
.kpi-block.clickable.active { box-shadow: inset 0 0 0 2px var(--blue); }
.kpi-label { font-size: 12px; font-weight: 600; color: var(--mid); }
.kpi-block[data-kind="income"] .kpi-label { color: #0c6b4d; }
.kpi-block[data-kind="expense"] .kpi-label { color: #9c3f22; }
.kpi-block[data-kind="all"] .kpi-label { color: var(--blue-hi); }
.kpi-val { font-size: 26px; font-weight: 700; letter-spacing: -0.5px; font-variant-numeric: tabular-nums; margin-top: 2px; }
.kpi-val.green { color: #0c6b4d; }
.kpi-val.coral { color: #9c3f22; }
#k-net { color: var(--blue-hi); }
#k-net.neg { color: #9c3f22; }
.kpi-sub { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.kpi-block[data-kind="income"] .kpi-sub { color: rgba(12, 107, 77, 0.75); }
.kpi-block[data-kind="expense"] .kpi-sub { color: rgba(156, 63, 34, 0.75); }
.kpi-block[data-kind="all"] .kpi-sub { color: rgba(67, 72, 200, 0.75); }
.days { display: flex; align-items: flex-end; gap: 3px; height: 34px; margin-top: 18px; }
.days i {
  flex: 1; display: block; background: var(--blue-bg);
  border-radius: 3px 3px 1px 1px; min-height: 2px;
  transition: height 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.days i.peak { background: var(--coral); }
#k-peak { margin-top: 8px; color: var(--muted); }

/* FX tile */
.fx-tile { display: flex; flex-direction: column; justify-content: center; }
.fx-val { font-size: 24px; font-weight: 700; letter-spacing: -0.4px; font-variant-numeric: tabular-nums; }
.fx-sub { font-size: 12px; color: var(--muted); }

/* projects — мягкие карточки с цветными чипами */
#projects { display: grid; gap: 10px; }
.proj {
  cursor: pointer; border-radius: 18px; padding: 13px 15px;
  background: var(--sub);
  transition: background 0.15s, box-shadow 0.15s;
}
.proj:hover { background: #eceff7; }
.proj.active { background: var(--blue-bg); box-shadow: inset 0 0 0 2px var(--blue); }
.proj-top { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.proj-name {
  font-size: 13px; font-weight: 600;
  padding: 4px 12px; border-radius: 999px;
  background: var(--card); color: var(--mid);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  box-shadow: var(--shadow-soft);
}
.proj-pct { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; margin-left: auto; }
.proj-sum { font-size: 13px; font-weight: 700; color: var(--coral); font-variant-numeric: tabular-nums; }
.proj-open { background: none; border: none; color: var(--muted); font-size: 16px; cursor: pointer; padding: 0 2px; }
.proj-open:hover { color: var(--text); }
.bar { height: 8px; background: rgba(25, 28, 38, 0.06); border-radius: 20px; overflow: hidden; }
.bar > div { height: 100%; border-radius: 20px; background: var(--coral); transition: width 1s cubic-bezier(0.2, 0.8, 0.2, 1); }
.bar.green > div { background: var(--green); }
.pc0 > div { background: #17a97b; }
.pc1 > div { background: #4f7df0; }
.pc2 > div { background: #8f6ee0; }
.pc3 > div { background: #e39b3b; }
.pc4 > div { background: #e2646c; }
.tag-pc0 { background: #d9f2e8; color: #0c6b4d; }
.tag-pc1 { background: #dfe9fd; color: #23479f; }
.tag-pc2 { background: #eae2fb; color: #5b3ea8; }
.tag-pc3 { background: #faecd7; color: #8a5a10; }
.tag-pc4 { background: #fbe2e4; color: #a02832; }
.proj:nth-child(5n + 1) .proj-name { background: #d9f2e8; color: #0c6b4d; box-shadow: none; }
.proj:nth-child(5n + 2) .proj-name { background: #dfe9fd; color: #23479f; box-shadow: none; }
.proj:nth-child(5n + 3) .proj-name { background: #eae2fb; color: #5b3ea8; box-shadow: none; }
.proj:nth-child(5n + 4) .proj-name { background: #faecd7; color: #8a5a10; box-shadow: none; }
.proj:nth-child(5n + 5) .proj-name { background: #fbe2e4; color: #a02832; box-shadow: none; }
.budget-row { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.budget-row .bar { flex: 1; height: 5px; }
.budget-txt { font-size: 11px; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* operations rows */
.exp-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; margin: 0 -12px; font-size: 13px;
  border-radius: 14px;
  transition: background 0.15s;
}
.exp-row:hover { background: var(--sub); }
.exp-row.op-new { background: var(--coral-bg); margin-bottom: 6px; }
.exp-date { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; width: 40px; flex-shrink: 0; }
.exp-proj {
  background: var(--sub); color: var(--mid); font-size: 11.5px; font-weight: 600;
  padding: 3px 10px; border-radius: 999px; white-space: nowrap; flex-shrink: 0;
}
.exp-proj-in { background: var(--green-bg); color: #0c6b4d; }
.exp-note { flex: 1; min-width: 0; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.exp-cat { color: var(--muted); font-size: 11.5px; white-space: nowrap; }
.exp-sum { font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; white-space: nowrap; }
.exp-sum-in { color: var(--green); }
.exp-more {
  width: 100%; background: var(--sub); border: none; border-radius: 999px;
  color: var(--mid); font-size: 12.5px; font-weight: 600;
  padding: 8px 0; margin-top: 8px; cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.exp-more:hover { background: var(--blue-bg); color: var(--blue-hi); }
.exp-empty { color: var(--muted); font-size: 13px; padding: 4px 0; }
.tx-del { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 13px; padding: 0 2px; flex-shrink: 0; }
.tx-del:hover { color: var(--coral); }

/* kpi detail / project detail */
#kpi-detail { padding-top: 16px; }
.kpid-head { display: flex; align-items: center; gap: 8px; padding-bottom: 8px; }
.kpid-title { font-size: 13px; font-weight: 600; color: var(--muted); flex: 1; }
.kpid-total { font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.kpid-close, .detail-close { background: var(--sub); border: none; border-radius: 999px; width: 28px; height: 28px; color: var(--mid); font-size: 13px; cursor: pointer; }
.kpid-close:hover, .detail-close:hover { background: var(--coral-bg); color: var(--coral); }
.proj-detail { border-top: 1px solid var(--divider); margin-top: 14px; padding-top: 16px; }
.proj-edit { background: var(--sub); border: none; border-radius: 999px; width: 28px; height: 28px; color: var(--mid); font-size: 13px; cursor: pointer; margin-left: auto; }
.proj-edit:hover { background: var(--blue-bg); color: var(--blue-hi); }
.proj-edit + .detail-close { margin-left: 0; }
.pedit { display: grid; gap: 10px; margin: 4px 0 14px; padding: 16px; border-radius: 18px; background: var(--blue-bg); }
.pedit label { display: grid; gap: 5px; font-size: 12px; font-weight: 600; color: var(--blue-hi); }
.pedit input {
  background: var(--card); border: 1px solid transparent; border-radius: 12px;
  color: var(--text); padding: 9px 13px; font-size: 13px; font-weight: 400; outline: none;
}
.pedit input:focus { border-color: var(--blue); }
.pedit-actions { display: flex; align-items: center; gap: 8px; }
.pedit-save {
  background: var(--blue); border: none; border-radius: 999px;
  color: #fff; padding: 9px 18px; font-size: 13px; font-weight: 600; cursor: pointer;
  transition: background 0.15s;
}
.pedit-save:hover { background: var(--blue-hi); }
.pedit-arch {
  background: var(--card); border: none; border-radius: 999px;
  color: var(--mid); padding: 9px 16px; font-size: 13px; font-weight: 600; cursor: pointer;
  transition: color 0.15s, background 0.15s;
}
.pedit-arch:hover { color: var(--coral); background: var(--coral-bg); }
.pedit-err { font-size: 12px; color: var(--coral); }
.detail-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.detail-title { font-size: 15px; font-weight: 700; }
.detail-close { margin-left: auto; }
.detail-head .proj-sum { margin-left: auto; }
.detail-head .proj-sum + .proj-edit { margin-left: 0; }
.cat-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.cat-name { font-size: 12px; color: var(--mid); width: 96px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-row .bar { flex: 1; height: 6px; }
.cat-sum { font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; min-width: 52px; text-align: right; }
.tx-list { border-top: 1px solid var(--divider); margin-top: 12px; padding-top: 6px; }
.tx-row { display: flex; align-items: center; gap: 8px; padding: 7px 0; font-size: 13px; }
.tx-cat { background: var(--amber-bg); color: var(--amber); font-size: 11.5px; font-weight: 600; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.tx-note { flex: 1; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tx-date { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.tx-sum { font-weight: 700; font-variant-numeric: tabular-nums; }
.card-sub { font-size: 12px; color: var(--muted); }

/* ── assistant: persona ────────────────────────────────── */
.persona {
  display: flex; align-items: center; gap: 14px;
  padding: 18px 20px; border-bottom: 1px solid var(--divider);
}
.orb-wrap { position: relative; width: 46px; height: 46px; flex-shrink: 0; }
.orb {
  position: absolute; inset: 0; border-radius: 50%; display: block;
  background: linear-gradient(135deg, var(--blue-lo), var(--blue));
  animation: orbPulse 3.6s ease-in-out infinite;
}
.orb.listening { animation: orbListen 1s ease-in-out infinite; }
.orb.thinking { animation: orbPulse 1.1s ease-in-out infinite; }
.ring {
  position: absolute; inset: 0; border-radius: 50%;
  border: 2px solid var(--blue);
  animation: ring 1.3s ease-out infinite;
}
.persona-info { flex: 1; min-width: 0; }
.persona-name { font-size: 15px; font-weight: 700; }
.persona-status { font-size: 12px; color: var(--blue); font-weight: 600; }
.persona-badge {
  font-size: 11.5px; font-weight: 600; color: var(--blue-hi);
  background: var(--blue-bg);
  padding: 5px 12px; border-radius: 999px; white-space: nowrap;
}

/* ── assistant: feed ───────────────────────────────────── */
#feed {
  flex: 1; overflow-y: auto; padding: 20px;
  display: flex; flex-direction: column; gap: 14px;
  min-height: 280px;
  background: var(--bg);
}
.feed-empty { margin: auto 0; text-align: center; color: var(--muted); }
.feed-empty .fe-1 { font-size: 14px; margin-bottom: 6px; }
.feed-empty .fe-2 { font-size: 13px; }
.bubble {
  align-self: flex-end; max-width: 88%;
  background: var(--blue);
  color: #fff; font-size: 13.5px;
  padding: 10px 15px; border-radius: 18px 18px 6px 18px;
}
.ori-line { align-self: flex-start; max-width: 92%; font-size: 13.5px; color: var(--mid); padding: 2px; white-space: pre-line; }
.ori-line .ori-pre { color: var(--blue); font-weight: 700; }
.wgt { width: 100%; }
.card {
  background: var(--card);
  border-radius: 20px; padding: 16px;
  box-shadow: var(--shadow-soft);
}
.card-row { display: flex; align-items: center; gap: 12px; }
.card-ico {
  width: 36px; height: 36px; border-radius: 12px; flex-shrink: 0;
  background: var(--sub); color: var(--mid);
  display: flex; align-items: center; justify-content: center; font-size: 17px;
}
.card-main { flex: 1; min-width: 0; }
.card-title { font-size: 14px; font-weight: 600; }
.card-amount { text-align: right; }
.card-usd { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.card-usd.green { color: var(--green); }
.card-usd.coral { color: var(--coral); }
.card-orig { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.card-fx {
  border-top: 1px solid var(--divider); margin-top: 12px; padding-top: 10px;
  font-size: 11.5px; color: var(--muted); display: flex; gap: 8px; align-items: center;
}
.card-fx .del { margin-left: auto; }
.card.deleted { opacity: 0.5; }
.card.deleted .card-title { text-decoration: line-through; }
.card.c-exp { background: var(--coral-bg); }
.card.c-exp .card-ico { background: rgba(255, 255, 255, 0.7); color: var(--coral); }
.card.c-exp .card-fx { border-top-color: rgba(156, 63, 34, 0.12); }
.card.c-inc { background: var(--green-bg); }
.card.c-inc .card-ico { background: rgba(255, 255, 255, 0.7); color: var(--green); }
.card.c-inc .card-fx { border-top-color: rgba(12, 107, 77, 0.12); }
.card.stats { background: var(--card); }
.stats-title { font-size: 12.5px; font-weight: 600; color: var(--muted); margin-bottom: 11px; }
.stats-total { float: right; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.chips button {
  background: var(--sub); border: none; color: var(--mid);
  font-size: 12px; font-weight: 600; padding: 7px 14px; border-radius: 999px; cursor: pointer;
  transition: color 0.15s, background 0.15s;
}
.chips button:hover { background: var(--blue-bg); color: var(--blue-hi); }
.card.clarify { background: var(--blue-bg); }
.clarify-opts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.clarify-opts button {
  background: var(--card); border: none; color: var(--text);
  font-size: 13px; font-weight: 600; padding: 8px 16px; border-radius: 999px; cursor: pointer;
  box-shadow: var(--shadow-soft);
  transition: background 0.15s, color 0.15s;
}
.clarify-opts button:hover { background: var(--blue); color: #fff; }
.clarify-opts button:disabled { opacity: 0.45; cursor: default; }
.card.err { background: var(--coral-bg); color: #9c3f22; font-size: 13px; }
.think {
  align-self: flex-start; display: flex; align-items: center; gap: 9px;
  font-size: 13px; font-weight: 600; color: var(--blue-hi);
}
.think i {
  width: 12px; height: 12px; border-radius: 50%; display: inline-block;
  border: 2px solid var(--blue-bg); border-top-color: var(--blue);
  animation: spin 0.8s linear infinite;
}

/* ── assistant: chips + command bar ────────────────────── */
.chips-row { display: flex; gap: 8px; flex-wrap: wrap; padding: 12px 20px; background: var(--card); border-top: 1px solid var(--divider); }
.qchip {
  background: var(--sub); border: none; color: var(--mid);
  font-size: 12px; font-weight: 600; padding: 7px 14px; border-radius: 999px; cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.qchip:hover { background: var(--blue-bg); color: var(--blue-hi); }
.cmdbar-wrap { padding: 0 16px calc(16px + env(safe-area-inset-bottom)); background: var(--card); }
.cmdbar {
  display: flex; align-items: center; gap: 10px;
  padding: 8px;
  border-radius: 999px;
  background: var(--bg);
}
.mic {
  width: 42px; height: 42px; border-radius: 999px; flex-shrink: 0;
  border: none;
  background: var(--blue-bg); color: var(--blue-hi);
  font-size: 17px; cursor: pointer;
  transition: background 0.15s;
}
.mic:hover { background: #d8d9f8; }
.mic.rec { background: var(--blue); color: #fff; animation: orbPulse 1s ease-in-out infinite; }
.wv { display: none; align-items: center; gap: 3px; height: 22px; flex-shrink: 0; }
.wv i { display: block; width: 3px; height: 22px; border-radius: 3px; background: var(--blue); transform: scaleY(0.3); }
.wv.on { display: flex; }
.wv.on i { animation: waveb 0.7s ease-in-out infinite; }
.chip {
  background: var(--blue); color: #fff; font-size: 12px; font-weight: 600;
  padding: 6px 12px; border-radius: 999px; white-space: nowrap; cursor: pointer; flex-shrink: 0;
}
.chip::after { content: " ✕"; opacity: 0.75; font-size: 10px; }
#msg { flex: 1; background: none; border: none; outline: none; color: var(--text); font-size: 14px; min-width: 0; }
#msg::placeholder { color: var(--muted); }
#send {
  width: 38px; height: 38px; border-radius: 999px; border: none; flex-shrink: 0;
  background: var(--blue); color: #fff;
  font-size: 16px; font-weight: 700; cursor: pointer;
  transition: transform 0.15s, background 0.15s;
}
#send:hover { transform: scale(1.06); background: var(--blue-hi); }
#send:disabled { opacity: 0.4; transform: none; }

/* ── to top ────────────────────────────────────────────── */
.to-top {
  position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 35;
  width: 42px; height: 42px; border-radius: 999px;
  background: var(--card); border: none;
  color: var(--blue-hi); font-size: 17px; cursor: pointer;
  box-shadow: var(--shadow);
}
@media (min-width: 1000px) { .to-top { display: none; } }

/* ── login ─────────────────────────────────────────────── */
.overlay {
  position: fixed; inset: 0; background: var(--bg); z-index: 40;
  display: flex; align-items: center; justify-content: center;
}
.overlay.hidden { display: none; }
.login-card {
  display: grid; gap: 10px; width: 288px;
  background: var(--card); border-radius: 24px; padding: 28px 24px;
  box-shadow: var(--shadow);
}
.login-title { font-size: 20px; font-weight: 700; text-align: center; margin-bottom: 6px; display: flex; align-items: center; justify-content: center; gap: 10px; }
.login-card input {
  background: var(--sub); border: 1px solid transparent; border-radius: 14px;
  color: var(--text); padding: 12px 15px; font-size: 14px; outline: none;
}
.login-card input:focus { border-color: var(--blue); background: var(--card); }
.login-card button {
  background: var(--blue); border: none; border-radius: 999px;
  color: #fff; padding: 12px; font-size: 14px; font-weight: 600; cursor: pointer;
  transition: background 0.15s;
}
.login-card button:hover { background: var(--blue-hi); }
.login-err { color: var(--coral); font-size: 12px; text-align: center; min-height: 16px; }

/* ── адаптив ───────────────────────────────────────────── */
@media (min-width: 481px) {
  .strip { padding: 16px 24px; gap: 16px; }
  .bento { padding: 12px 24px 28px; }
}
@media (max-width: 480px) {
  .kpi-val { font-size: 22px; }
  .kpi-block { padding: 12px 14px; }
  .cat-name { width: 76px; }
  .brand-sub { display: none; }
  .exp-cat { display: none; }
  .mini-kpi { gap: 10px; width: 100%; justify-content: space-between; }
}
@media (prefers-reduced-motion: reduce) {
  .fly, .orb, .ring, .wv.on i, .think i { animation: none !important; }
  * { transition-duration: 0.01ms !important; }
}
