/* Финмониторинг — design tokens, layout, components, motion. */
:root {
  color-scheme: light;
  --bg: #f4f5fb;
  --bg-2: #eceefa;
  --surface: rgba(255, 255, 255, .78);
  --surface-solid: #ffffff;
  --surface-2: rgba(246, 247, 253, .9);
  --line: rgba(20, 24, 60, .08);
  --line-2: rgba(20, 24, 60, .14);
  --text: #12142a;
  --text-2: #4a4e6a;
  --muted: #8a8ea8;
  --accent: #6d5dfc;
  --accent-2: #1fb7a6;
  --accent-soft: rgba(109, 93, 252, .12);
  --good: #12a150;
  --bad: #e0453f;
  --warn: #d98a00;
  --shadow: 0 1px 2px rgba(18, 20, 42, .04), 0 8px 28px rgba(18, 20, 42, .07);
  --shadow-lg: 0 24px 64px rgba(18, 20, 42, .18);
  --blob-1: #b9b0ff; --blob-2: #9ee6dc; --blob-3: #ffc9b0;
  --radius: 20px;
  --radius-sm: 12px;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --nav-w: 248px;

  /* Category colour slots (identity, fixed order) */
  --c1: #2a78d6; --c2: #eb6834; --c3: #1baf7a; --c4: #eda100; --c5: #e87ba4; --c6: #008300; --c7: #6250d6; --c8: #e34948;
  --c9: #0f9db3; --c10: #9a6a3a; --c11: #b04fc4; --c12: #7a8594; --c13: #a3a39e; --c14: #12a150; --c15: #3949ab; --c16: #7c8a1e; --c17: #d0456f;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0c0e1c; --bg-2: #11142a;
    --surface: rgba(24, 27, 52, .72); --surface-solid: #171a33; --surface-2: rgba(32, 36, 66, .8);
    --line: rgba(255, 255, 255, .07); --line-2: rgba(255, 255, 255, .13);
    --text: #eef0ff; --text-2: #b6b9d6; --muted: #7d81a3;
    --accent: #8a7dff; --accent-2: #2fd1bd; --accent-soft: rgba(138, 125, 255, .16);
    --good: #3ccf7f; --bad: #ff6b66; --warn: #f2b13c;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px rgba(0, 0, 0, .28);
    --shadow-lg: 0 24px 80px rgba(0, 0, 0, .55);
    --blob-1: #3b2f9e; --blob-2: #0d6b63; --blob-3: #6b2f4a;
    --c1: #3987e5; --c2: #d95926; --c3: #199e70; --c4: #c98500; --c5: #d55181; --c6: #2f9e2f; --c7: #9085e9; --c8: #e66767;
    --c9: #22b5cc; --c10: #b5844f; --c11: #c46fd6; --c12: #8e98a6; --c13: #6f6f6a; --c14: #2bbf6a; --c15: #6574d6; --c16: #9aa83a; --c17: #e8709a;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0c0e1c; --bg-2: #11142a;
  --surface: rgba(24, 27, 52, .72); --surface-solid: #171a33; --surface-2: rgba(32, 36, 66, .8);
  --line: rgba(255, 255, 255, .07); --line-2: rgba(255, 255, 255, .13);
  --text: #eef0ff; --text-2: #b6b9d6; --muted: #7d81a3;
  --accent: #8a7dff; --accent-2: #2fd1bd; --accent-soft: rgba(138, 125, 255, .16);
  --good: #3ccf7f; --bad: #ff6b66; --warn: #f2b13c;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px rgba(0, 0, 0, .28);
  --shadow-lg: 0 24px 80px rgba(0, 0, 0, .55);
  --blob-1: #3b2f9e; --blob-2: #0d6b63; --blob-3: #6b2f4a;
  --c1: #3987e5; --c2: #d95926; --c3: #199e70; --c4: #c98500; --c5: #d55181; --c6: #2f9e2f; --c7: #9085e9; --c8: #e66767;
  --c9: #22b5cc; --c10: #b5844f; --c11: #c46fd6; --c12: #8e98a6; --c13: #6f6f6a; --c14: #2bbf6a; --c15: #6574d6; --c16: #9aa83a; --c17: #e8709a;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 "Inter", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); }
.num { font-variant-numeric: tabular-nums; letter-spacing: -.01em; }

/* ---------- animated background ---------- */
.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; background: linear-gradient(180deg, var(--bg), var(--bg-2)); }
.bg i { position: absolute; width: 55vmax; height: 55vmax; border-radius: 50%; filter: blur(90px); opacity: .45; animation: drift 26s ease-in-out infinite alternate; }
.bg i:nth-child(1) { background: var(--blob-1); left: -15vmax; top: -20vmax; }
.bg i:nth-child(2) { background: var(--blob-2); right: -20vmax; top: 10vmax; animation-duration: 32s; animation-delay: -8s; }
.bg i:nth-child(3) { background: var(--blob-3); left: 20vmax; bottom: -30vmax; animation-duration: 38s; animation-delay: -16s; opacity: .3; }
@keyframes drift { 0% { transform: translate(0, 0) scale(1); } 50% { transform: translate(6vmax, 4vmax) scale(1.08); } 100% { transform: translate(-4vmax, 7vmax) scale(.96); } }

/* ---------- boot ---------- */
.boot { min-height: 100vh; display: grid; place-items: center; }
.boot-logo { width: 64px; height: 64px; border-radius: 18px; background: url(/icons/icon.svg) center/cover; animation: pulse 1.2s var(--ease) infinite alternate; }
@keyframes pulse { from { transform: scale(.92); opacity: .6; } to { transform: scale(1.04); opacity: 1; } }

/* ---------- layout ---------- */
.app { min-height: 100vh; }
.shell { display: grid; grid-template-columns: var(--nav-w) 1fr; min-height: 100vh; }
.nav {
  position: sticky; top: 0; height: 100vh; padding: 22px 14px; display: flex; flex-direction: column; gap: 6px;
  border-right: 1px solid var(--line); background: var(--surface); backdrop-filter: blur(24px) saturate(1.4); -webkit-backdrop-filter: blur(24px) saturate(1.4);
}
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 10px 22px; font-weight: 700; font-size: 17px; letter-spacing: -.02em; }
.brand-logo { width: 36px; height: 36px; border-radius: 11px; background: url(/icons/icon.svg) center/cover; box-shadow: 0 6px 18px rgba(109, 93, 252, .35); }
.brand small { display: block; font-weight: 500; font-size: 12px; color: var(--muted); letter-spacing: 0; }
.nav-list { position: relative; display: flex; flex-direction: column; gap: 4px; }
.nav-pill { position: absolute; left: 0; right: 0; height: 46px; border-radius: 14px; background: var(--accent-soft); transition: transform .5s var(--spring), opacity .3s; pointer-events: none; }
.nav-btn {
  position: relative; display: flex; align-items: center; gap: 12px; height: 46px; padding: 0 14px; border: 0; border-radius: 14px;
  background: none; color: var(--text-2); font-weight: 600; text-align: left; transition: color .2s, transform .2s var(--ease);
}
.nav-btn svg { width: 22px; height: 22px; flex: none; transition: transform .4s var(--spring); }
.nav-btn:hover { color: var(--text); }
.nav-btn:hover svg { transform: scale(1.1) rotate(-4deg); }
.nav-btn.active { color: var(--accent); }
.nav-btn .badge { margin-left: auto; }
.nav-foot { margin-top: auto; padding: 12px 10px 0; font-size: 12px; color: var(--muted); }
.nav-foot .live { display: flex; align-items: center; gap: 8px; }

.main { min-width: 0; padding: 26px clamp(16px, 3vw, 40px) 120px; max-width: 1280px; width: 100%; }
.topbar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 22px; }
.topbar h1 { margin: 0; font-size: clamp(24px, 3vw, 32px); letter-spacing: -.03em; line-height: 1.1; }
.topbar .sub { color: var(--muted); font-size: 14px; margin-top: 4px; }
.topbar .spacer { flex: 1; }

/* ---------- cards ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  backdrop-filter: blur(20px) saturate(1.3); -webkit-backdrop-filter: blur(20px) saturate(1.3); padding: 20px; min-width: 0;
}
.card h2, .card h3 { margin: 0 0 14px; font-size: 16px; letter-spacing: -.01em; display: flex; align-items: center; gap: 8px; }
.card h2 .hint, .card h3 .hint { margin-left: auto; font-weight: 500; font-size: 13px; color: var(--muted); }
.grid { display: grid; gap: 16px; }
.g-hero { grid-template-columns: 1.5fr 1fr 1fr; }
.g-2 { grid-template-columns: 1.15fr 1fr; }
.g-2e { grid-template-columns: 1fr 1fr; }
.g-3 { grid-template-columns: repeat(3, 1fr); }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; gap: 10px; }
.wrap { flex-wrap: wrap; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mt { margin-top: 16px; }
.card h2.mt { margin-top: 24px; }

/* hero tiles */
.tile { position: relative; overflow: hidden; }
.tile .label { color: var(--text-2); font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.tile .value { font-size: clamp(28px, 3.4vw, 40px); font-weight: 750; letter-spacing: -.035em; margin: 8px 0 6px; line-height: 1.05; }
.tile .value small { font-size: .5em; font-weight: 600; color: var(--muted); margin-left: 4px; }
.tile.primary { background: linear-gradient(135deg, #6d5dfc, #8f5cf6 55%, #1fb7a6); color: #fff; border: 0; }
.tile.primary .label, .tile.primary .delta, .tile.primary .value small { color: rgba(255, 255, 255, .85); }
.tile.primary::after { content: ""; position: absolute; right: -60px; top: -60px; width: 200px; height: 200px; border-radius: 50%; background: rgba(255, 255, 255, .12); animation: float 9s ease-in-out infinite alternate; }
.tile.primary::before { content: ""; position: absolute; right: 40px; bottom: -90px; width: 160px; height: 160px; border-radius: 50%; background: rgba(255, 255, 255, .08); animation: float 12s ease-in-out infinite alternate-reverse; }
@keyframes float { to { transform: translate(-20px, 24px) scale(1.1); } }
.delta { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; }
.delta.up { color: var(--bad); } .delta.down { color: var(--good); }
.tile.primary .delta.up, .tile.primary .delta.down { color: #fff; background: rgba(255, 255, 255, .18); padding: 2px 8px; border-radius: 99px; }
.budget-bar { height: 8px; border-radius: 99px; background: rgba(255, 255, 255, .22); overflow: hidden; margin-top: 12px; }
.budget-bar i { display: block; height: 100%; border-radius: 99px; background: #fff; transform-origin: left; animation: grow-x 1.2s var(--ease) both; }

/* ---------- controls ---------- */
.seg { display: inline-flex; padding: 4px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); position: relative; box-shadow: var(--shadow); }
.seg button { position: relative; z-index: 1; border: 0; background: none; padding: 7px 14px; border-radius: 10px; font-weight: 600; font-size: 14px; color: var(--text-2); transition: color .25s; white-space: nowrap; }
.seg button.on { color: #fff; }
.seg .seg-pill { position: absolute; top: 4px; bottom: 4px; border-radius: 10px; background: var(--accent); transition: left .45s var(--spring), width .45s var(--spring); box-shadow: 0 4px 14px rgba(109, 93, 252, .4); }
.period { display: inline-flex; align-items: center; gap: 4px; }
.period .lbl { min-width: 150px; text-align: center; font-weight: 700; letter-spacing: -.01em; }
.icon-btn { width: 38px; height: 38px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); display: grid; place-items: center; transition: transform .2s var(--ease), background .2s; box-shadow: var(--shadow); }
.icon-btn:hover { transform: translateY(-1px); background: var(--surface-solid); }
.icon-btn:active { transform: scale(.92); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn:disabled { opacity: .35; pointer-events: none; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 18px; border-radius: 13px; border: 1px solid var(--line-2);
  background: var(--surface-solid); font-weight: 600; transition: transform .2s var(--ease), box-shadow .2s, background .2s; white-space: nowrap; text-decoration: none; color: var(--text);
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.btn:active { transform: scale(.96); }
.btn.primary { background: linear-gradient(135deg, var(--accent), #8f5cf6); color: #fff; border: 0; box-shadow: 0 8px 22px rgba(109, 93, 252, .35); }
.btn.danger { color: var(--bad); }
.btn.ghost { background: none; border-color: transparent; }
.btn.block { width: 100%; }
.btn.sm { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btn:disabled { opacity: .5; pointer-events: none; }
.btn .spin { width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > span { font-size: 13px; font-weight: 600; color: var(--text-2); }
.input, textarea.input, select.input {
  width: 100%; height: 46px; padding: 0 14px; border-radius: 13px; border: 1px solid var(--line-2); background: var(--surface-solid); outline: none;
  transition: border-color .2s, box-shadow .2s;
}
textarea.input { height: auto; min-height: 120px; padding: 12px 14px; resize: vertical; line-height: 1.4; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.search { position: relative; flex: 1; min-width: 200px; }
.search svg { position: absolute; left: 14px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); color: var(--muted); }
.search .input { padding-left: 42px; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 10px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; flex: none; height: 36px; padding: 0 14px; border-radius: 99px; border: 1px solid var(--line-2);
  background: var(--surface); font-weight: 600; font-size: 14px; color: var(--text-2); transition: all .25s var(--ease);
}
.chip:hover { transform: translateY(-1px); }
.chip.on { background: var(--chip, var(--accent)); color: #fff; border-color: transparent; box-shadow: 0 6px 16px color-mix(in srgb, var(--chip, var(--accent)) 40%, transparent); }
.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--dot); }
.badge { min-width: 22px; height: 22px; padding: 0 7px; border-radius: 99px; background: var(--bad); color: #fff; font-size: 12px; font-weight: 700; display: inline-grid; place-items: center; }
.badge.soft { background: var(--accent-soft); color: var(--accent); }

/* ---------- categories list with bars ---------- */
.cat-list { display: flex; flex-direction: column; gap: 4px; }
.cat-row { display: grid; grid-template-columns: 42px 1fr auto; gap: 12px; align-items: center; padding: 9px 10px; border-radius: 14px; border: 0; background: none; text-align: left; width: 100%; transition: background .2s, transform .25s var(--ease); }
.cat-row:hover { background: var(--surface-2); transform: translateX(3px); }
.cat-ico { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; font-size: 20px; background: color-mix(in srgb, var(--cc) 16%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--cc) 22%, transparent); }
.cat-name { font-weight: 600; display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.cat-name b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cat-name small { color: var(--muted); font-weight: 500; white-space: nowrap; }
.bar { height: 6px; border-radius: 99px; background: var(--line); margin-top: 7px; overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 99px; background: var(--cc); transform-origin: left; animation: grow-x 1s var(--ease) both; animation-delay: calc(var(--i, 0) * 60ms + 150ms); }
@keyframes grow-x { from { transform: scaleX(0); } }
.cat-sum { text-align: right; font-weight: 700; }
.cat-sum small { display: block; font-weight: 600; font-size: 12px; }

/* ---------- donut ---------- */
.donut-wrap { display: grid; grid-template-columns: minmax(150px, 200px) minmax(0, 1fr); gap: 18px; align-items: center; }
@media (max-width: 1280px) and (min-width: 1101px) { .donut-wrap { grid-template-columns: 1fr; } .donut { max-width: 220px; margin: 0 auto; } }
.donut { position: relative; width: 100%; aspect-ratio: 1; }
.donut svg { width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.donut circle.seg-arc { fill: none; stroke-width: 22; stroke-linecap: butt; transition: stroke-width .3s var(--ease), opacity .3s; cursor: pointer; animation: arc-in 1.1s var(--ease) both; }
.donut circle.seg-arc:hover, .donut circle.seg-arc.hl { stroke-width: 30; }
.donut.has-hl circle.seg-arc:not(.hl) { opacity: .35; }
@keyframes arc-in { from { stroke-dasharray: 0 999; } }
.donut-center { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; pointer-events: none; }
.donut-center b { display: block; font-size: clamp(20px, 2.4vw, 26px); letter-spacing: -.03em; }
.donut-center span { font-size: 12px; color: var(--muted); font-weight: 600; }

/* ---------- bar charts ---------- */
.chart { position: relative; }
.bars { display: flex; align-items: flex-end; gap: var(--gap, 3px); height: var(--h, 180px); padding-top: 8px; position: relative; }
.bars .col { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: stretch; position: relative; cursor: pointer; min-width: 0; }
.bars .col i {
  display: block; border-radius: 4px 4px 0 0; background: var(--bc, var(--accent)); min-height: 2px; transform-origin: bottom;
  animation: grow-y .9s var(--ease) both; animation-delay: calc(var(--i, 0) * 18ms); transition: filter .2s, opacity .2s;
}
.bars .col i + i { margin-top: 2px; border-radius: 0; }
.bars .col i.zero { background: var(--line-2); opacity: .5; }
.bars:hover .col i { opacity: .55; }
.bars .col:hover i, .bars .col.on i { opacity: 1; filter: brightness(1.08); }
.bars .col.on::after { content: ""; position: absolute; inset: -4px -1px -4px; border-radius: 6px; background: var(--accent-soft); z-index: -1; }
@keyframes grow-y { from { transform: scaleY(0); } }
.axis { display: flex; gap: var(--gap, 3px); margin-top: 8px; font-size: 11px; color: var(--muted); }
.axis span { flex: 1; text-align: center; white-space: nowrap; overflow: visible; min-width: 0; }
.gridlines { position: absolute; inset: 8px 0 0; pointer-events: none; display: flex; flex-direction: column; justify-content: space-between; }
.gridlines div { border-top: 1px dashed var(--line); position: relative; }
.gridlines div span { position: absolute; right: 0; top: -16px; font-size: 10px; color: var(--muted); }
.avgline { position: absolute; left: 0; right: 0; border-top: 2px dashed var(--accent); opacity: .6; pointer-events: none; }
.avgline span { position: absolute; right: 0; top: -20px; font-size: 11px; font-weight: 700; color: var(--accent); background: var(--surface-solid); padding: 1px 6px; border-radius: 6px; }

.tip {
  position: fixed; z-index: 60; pointer-events: none; padding: 10px 12px; border-radius: 12px; background: var(--surface-solid); border: 1px solid var(--line-2);
  box-shadow: var(--shadow-lg); font-size: 13px; min-width: 150px; opacity: 0; transform: translateY(6px) scale(.98); transition: opacity .15s, transform .2s var(--ease);
}
.tip.show { opacity: 1; transform: none; }
.tip b { display: block; font-size: 15px; margin-bottom: 2px; }
.tip .tl { display: flex; align-items: center; gap: 6px; color: var(--text-2); }
.tip .tl .num { margin-left: auto; padding-left: 12px; color: var(--text); font-weight: 600; }

/* ---------- operations ---------- */
.day-group { margin-bottom: 8px; }
.day-head { display: flex; justify-content: space-between; align-items: baseline; padding: 14px 6px 6px; font-size: 13px; font-weight: 700; color: var(--text-2); position: sticky; top: 0; z-index: 2; }
.day-head span:last-child { color: var(--muted); font-weight: 600; }
.op {
  display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: center; width: 100%; padding: 10px 12px; border: 0; border-radius: 16px;
  background: none; text-align: left; transition: background .2s, transform .25s var(--ease);
}
.op:hover { background: var(--surface-2); transform: translateX(3px); }
.op:active { transform: scale(.985); }
.op .cat-ico { width: 44px; height: 44px; }
.op-title { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.op-meta { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.op-amt { font-weight: 750; text-align: right; white-space: nowrap; }
.op-amt.in { color: var(--good); }
.op-amt small { display: block; font-size: 11.5px; font-weight: 600; color: var(--muted); }

.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty .big { font-size: 54px; margin-bottom: 8px; animation: bob 3s ease-in-out infinite; display: inline-block; }
.empty h3 { color: var(--text); justify-content: center; margin: 4px 0 6px; font-size: 18px; }
@keyframes bob { 50% { transform: translateY(-8px) rotate(4deg); } }

/* ---------- category cards ---------- */
.cat-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.cat-card { position: relative; overflow: hidden; text-align: left; border: 1px solid var(--line); cursor: pointer; transition: transform .3s var(--ease), box-shadow .3s; }
.cat-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.cat-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 4px; background: var(--cc); }
.cat-card .cat-ico { width: 48px; height: 48px; font-size: 24px; margin-bottom: 12px; transition: transform .4s var(--spring); }
.cat-card:hover .cat-ico { transform: scale(1.12) rotate(-6deg); }
.cat-card .t { font-weight: 700; }
.cat-card .v { font-size: 22px; font-weight: 750; letter-spacing: -.02em; margin-top: 6px; }
.cat-card .r { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.cat-card.add { display: grid; place-items: center; border: 2px dashed var(--line-2); background: none; box-shadow: none; color: var(--muted); font-weight: 700; min-height: 160px; }
.cat-card.add::before { display: none; }

/* ---------- statistics ---------- */
.insights { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.insight { display: flex; gap: 14px; align-items: flex-start; }
.insight .ic { width: 46px; height: 46px; flex: none; border-radius: 14px; display: grid; place-items: center; font-size: 22px; background: var(--accent-soft); }
.insight .k { font-size: 12.5px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.insight .v { font-size: 20px; font-weight: 750; letter-spacing: -.02em; margin: 2px 0; }
.insight .d { font-size: 13px; color: var(--text-2); }
.heat { width: 100%; border-collapse: separate; border-spacing: 3px; font-size: 12.5px; }
.heat th { font-weight: 600; color: var(--muted); text-align: center; padding: 2px; white-space: nowrap; }
.heat th:first-child { text-align: left; }
.heat td { height: 32px; border-radius: 7px; text-align: center; font-weight: 600; font-size: 11.5px; transition: transform .2s var(--ease); position: relative; }
.heat td:first-child { text-align: left; font-weight: 600; white-space: nowrap; padding-right: 8px; }
.heat td.cell { background: color-mix(in srgb, var(--cc) calc(var(--a) * 100%), var(--surface-2)); color: var(--cell-ink, var(--text)); cursor: default; }
.heat td.cell:hover { transform: scale(1.12); z-index: 2; box-shadow: var(--shadow); }
.scroll-x { overflow-x: auto; }
.trend { display: grid; grid-template-columns: 36px 1fr auto; gap: 12px; align-items: center; padding: 8px 4px; }
.trend .cat-ico { width: 36px; height: 36px; font-size: 17px; border-radius: 11px; }
.trend .meter { position: relative; height: 8px; border-radius: 99px; background: var(--line); margin-top: 6px; }
.trend .meter i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 99px; background: var(--cc); transform-origin: left; animation: grow-x 1s var(--ease) both; }
.trend .meter b { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--text); border-radius: 2px; opacity: .55; }
.pct { font-weight: 700; font-size: 13px; padding: 3px 8px; border-radius: 99px; white-space: nowrap; }
.pct.up { color: var(--bad); background: color-mix(in srgb, var(--bad) 12%, transparent); }
.pct.down { color: var(--good); background: color-mix(in srgb, var(--good) 12%, transparent); }
.pct.flat { color: var(--muted); background: var(--line); }
.top-day { display: grid; grid-template-columns: 30px 1fr auto; gap: 12px; align-items: center; padding: 9px 4px; border-bottom: 1px solid var(--line); }
.top-day:last-child { border: 0; }
.rank { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; font-weight: 800; font-size: 13px; background: var(--line); }
.rank.r1 { background: linear-gradient(135deg, #ffd25e, #f2a100); color: #3a2600; }
.rank.r2 { background: linear-gradient(135deg, #e3e6ef, #aab0c2); color: #262a3a; }
.rank.r3 { background: linear-gradient(135deg, #f3c09a, #c9804d); color: #3b1f0b; }

/* ---------- connect ---------- */
.step { display: grid; grid-template-columns: 44px 1fr; gap: 14px; }
.step-n { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; font-weight: 800; color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 6px 16px rgba(109, 93, 252, .3); }
.step h3 { margin: 8px 0 6px; }
.step p, .step li { color: var(--text-2); margin: 4px 0; }
.step ol { padding-left: 18px; margin: 6px 0; }
.copy-box { display: flex; gap: 8px; align-items: center; padding: 6px 6px 6px 14px; border-radius: 13px; background: var(--surface-2); border: 1px solid var(--line-2); margin: 10px 0; }
.copy-box code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
code, pre { font-family: "Cascadia Code", Consolas, monospace; }
pre.code { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px; font-size: 12.5px; overflow-x: auto; margin: 8px 0; }
.drop { display: block; margin: 10px 0; border: 2px dashed var(--line-2); border-radius: 18px; padding: 28px; text-align: center; transition: all .25s var(--ease); cursor: pointer; }
.drop:hover, .drop.over { border-color: var(--accent); background: var(--accent-soft); transform: scale(1.01); }
.drop .big { font-size: 34px; display: block; margin-bottom: 6px; }
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 0 var(--good); animation: ping 2s infinite; flex: none; }
.live-dot.off { background: var(--muted); animation: none; }
@keyframes ping { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--good) 60%, transparent); } 70%, 100% { box-shadow: 0 0 0 10px transparent; } }
.sms { padding: 12px 14px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); font-size: 13.5px; white-space: pre-wrap; word-break: break-word; }
.sms-head { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-bottom: 4px; font-weight: 600; }

/* ---------- sheet (bottom drawer / dialog) ---------- */
.backdrop { position: fixed; inset: 0; z-index: 40; background: rgba(8, 10, 24, .45); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: fade .3s both; }
.backdrop.out { animation: fade .25s reverse both; }
@keyframes fade { from { opacity: 0; } }
.sheet {
  position: fixed; z-index: 41; left: 50%; bottom: 0; width: min(560px, 100%); max-height: 92vh; overflow-y: auto; transform: translateX(-50%);
  background: var(--surface-solid); border-radius: 26px 26px 0 0; padding: 10px 22px calc(24px + env(safe-area-inset-bottom)); box-shadow: var(--shadow-lg);
  animation: sheet-in .5s var(--ease) both; overscroll-behavior: contain;
}
.sheet.out { animation: sheet-out .28s ease-in both; }
@keyframes sheet-in { from { transform: translate(-50%, 100%); } }
@keyframes sheet-out { to { transform: translate(-50%, 100%); } }
@media (min-width: 760px) {
  .sheet { bottom: auto; top: 50%; border-radius: 26px; transform: translate(-50%, -50%); animation-name: dlg-in; padding-top: 22px; }
  .sheet.out { animation-name: dlg-out; }
  .sheet .grab { display: none; }
  @keyframes dlg-in { from { transform: translate(-50%, -46%) scale(.94); opacity: 0; } }
  @keyframes dlg-out { to { transform: translate(-50%, -48%) scale(.96); opacity: 0; } }
}
.grab { width: 44px; height: 5px; border-radius: 99px; background: var(--line-2); margin: 0 auto 16px; }
.sheet-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.sheet-head h2 { margin: 0; font-size: 20px; letter-spacing: -.02em; flex: 1; }
.op-hero { text-align: center; padding: 6px 0 18px; }
.op-hero .cat-ico { width: 64px; height: 64px; font-size: 30px; border-radius: 20px; margin: 0 auto 10px; animation: pop .6s var(--spring) both; }
@keyframes pop { from { transform: scale(.4); opacity: 0; } }
.op-hero .amt { font-size: 36px; font-weight: 800; letter-spacing: -.03em; }
.op-hero .amt.in { color: var(--good); }
.op-hero .where { font-weight: 650; font-size: 17px; margin-top: 2px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: 14px; margin: 6px 0 16px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; font-weight: 600; }
.cat-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin: 8px 0 12px; }
.cat-pick button { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 13px; border: 1px solid var(--line-2); background: none; font-weight: 600; font-size: 13.5px; text-align: left; transition: all .2s var(--ease); }
.cat-pick button span:first-child { font-size: 18px; }
.cat-pick button:hover { transform: translateY(-1px); border-color: var(--cc); }
.cat-pick button.on { background: color-mix(in srgb, var(--cc) 16%, transparent); border-color: var(--cc); box-shadow: inset 0 0 0 1px var(--cc); }
.switch { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); cursor: pointer; margin-bottom: 14px; }
.switch input { appearance: none; width: 46px; height: 28px; border-radius: 99px; background: var(--line-2); position: relative; flex: none; transition: background .25s; cursor: pointer; margin: 0; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .25); transition: transform .35s var(--spring); }
.switch input:checked { background: var(--accent); }
.switch input:checked::after { transform: translateX(18px); }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatches button { width: 34px; height: 34px; border-radius: 50%; border: 3px solid transparent; background: var(--sw); transition: transform .25s var(--spring); }
.swatches button.on { border-color: var(--surface-solid); box-shadow: 0 0 0 2px var(--sw); transform: scale(1.1); }
.emoji-row { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.emoji-row button { width: 38px; height: 38px; border-radius: 10px; border: 0; background: none; font-size: 20px; transition: transform .2s var(--spring), background .2s; }
.emoji-row button:hover { background: var(--surface-2); transform: scale(1.2); }
.rule { display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px 4px 12px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); font-size: 13px; font-weight: 600; margin: 3px; animation: pop .35s var(--spring) both; }
.rule button { border: 0; background: none; width: 22px; height: 22px; border-radius: 50%; color: var(--muted); }
.rule button:hover { background: var(--line-2); color: var(--bad); }

/* ---------- toasts ---------- */
.toasts { position: fixed; z-index: 80; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: max-content; max-width: calc(100% - 32px); }
.toast { padding: 12px 18px; border-radius: 14px; background: #1b1e38; color: #fff; font-weight: 600; box-shadow: var(--shadow-lg); animation: toast-in .45s var(--spring) both; display: flex; gap: 10px; align-items: center; }
.toast.err { background: #b3261e; }
.toast.out { animation: toast-out .3s ease-in both; }
@keyframes toast-in { from { transform: translateY(20px) scale(.9); opacity: 0; } }
@keyframes toast-out { to { transform: translateY(10px) scale(.95); opacity: 0; } }

/* ---------- auth ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.auth-card { width: min(420px, 100%); padding: 32px 28px; animation: rise .8s var(--ease) both; }
.auth-logo { width: 72px; height: 72px; border-radius: 22px; background: url(/icons/icon.svg) center/cover; margin: 0 auto 18px; box-shadow: 0 16px 40px rgba(109, 93, 252, .4); animation: pop .8s var(--spring) both; }
.auth h1 { text-align: center; margin: 0; font-size: 28px; letter-spacing: -.03em; }
.auth p.lead { text-align: center; color: var(--text-2); margin: 6px 0 24px; }
.auth .err { color: var(--bad); font-weight: 600; font-size: 14px; min-height: 20px; margin-bottom: 8px; text-align: center; }
.auth .switch-mode { text-align: center; margin-top: 16px; font-size: 14px; color: var(--muted); }
.auth .switch-mode button { border: 0; background: none; color: var(--accent); font-weight: 700; }
.features { display: flex; justify-content: center; gap: 18px; margin-top: 22px; font-size: 12.5px; color: var(--muted); flex-wrap: wrap; }

/* ---------- motion helpers ---------- */
.reveal { animation: rise .7s var(--ease) both; animation-delay: calc(var(--i, 0) * 70ms); }
@keyframes rise { from { opacity: 0; transform: translateY(18px) scale(.985); } }
.view-out { animation: view-out .2s ease-in both; }
@keyframes view-out { to { opacity: 0; transform: translateY(-8px); } }
.skel { border-radius: 12px; background: linear-gradient(90deg, var(--line) 25%, var(--line-2) 50%, var(--line) 75%); background-size: 200% 100%; animation: shimmer 1.3s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.fab {
  position: fixed; right: 22px; bottom: calc(96px + env(safe-area-inset-bottom)); z-index: 30; width: 58px; height: 58px; border-radius: 19px; border: 0;
  background: linear-gradient(135deg, var(--accent), #8f5cf6); color: #fff; box-shadow: 0 14px 30px rgba(109, 93, 252, .45); display: grid; place-items: center;
  transition: transform .3s var(--spring); animation: pop .6s var(--spring) .3s both;
}
.fab:hover { transform: scale(1.08) rotate(90deg); }
.fab svg { width: 26px; height: 26px; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .g-hero { grid-template-columns: 1fr 1fr; }
  .g-hero .tile.primary { grid-column: 1 / -1; }
  .g-2, .g-2e { grid-template-columns: 1fr; }
}
@media (min-width: 861px) { .fab { bottom: 28px; right: 32px; } .toasts { bottom: 28px; } }
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .nav {
    position: fixed; top: auto; bottom: 0; left: 0; right: 0; height: auto; z-index: 35; padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
    flex-direction: row; border-right: 0; border-top: 1px solid var(--line);
  }
  .brand, .nav-foot { display: none; }
  .nav-list { flex-direction: row; width: 100%; gap: 0; }
  .nav-pill { top: 0; height: 100%; left: 0; right: auto; }
  .nav-btn { flex: 1; flex-direction: column; justify-content: center; gap: 3px; height: 58px; padding: 0 2px; font-size: 10.5px; font-weight: 600; text-align: center; }
  .nav-btn .badge { position: absolute; top: 4px; left: 50%; margin-left: 6px; min-width: 18px; height: 18px; font-size: 10px; padding: 0 5px; }
  .main { padding: 18px 16px 110px; }
  .donut-wrap { grid-template-columns: 1fr; }
  .donut { max-width: 240px; margin: 0 auto; }
  .g-3 { grid-template-columns: 1fr; }
  .period .lbl { min-width: 0; flex: 1; }
  .topbar .seg { order: 3; width: 100%; overflow-x: auto; }
  .topbar .seg button { flex: 1; }
}
@media (max-width: 520px) {
  .g-hero { grid-template-columns: 1fr; }
  .card { padding: 16px; border-radius: 18px; }
  .tile .value { font-size: 30px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0ms !important; transition-duration: .01ms !important; }
}

/* =====================================================================
   v1.2 — receipts, voice, converter, admin, more-menu
   ===================================================================== */
/* navigation: phones show 4 sections + «Ещё» */
.nav-btn.more { display: none; }
@media (max-width: 860px) {
  .nav-btn.extra { display: none; }
  .nav-btn.more { display: flex; }
}
.more-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.more-item { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 18px 8px; border-radius: 18px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); font-weight: 650; font-size: 13.5px; text-decoration: none; animation: pop .45s var(--spring) both; transition: transform .25s var(--spring), border-color .2s; }
.more-item:nth-child(2) { animation-delay: 40ms; } .more-item:nth-child(3) { animation-delay: 80ms; } .more-item:nth-child(4) { animation-delay: 120ms; } .more-item:nth-child(5) { animation-delay: 160ms; }
.more-item svg { width: 26px; height: 26px; color: var(--accent); }
.more-item:hover { transform: translateY(-2px); border-color: var(--accent); }

/* voice */
.voice { display: flex; flex-direction: column; align-items: center; }
.mic-big { position: relative; width: 92px; height: 92px; border-radius: 50%; border: 0; color: #fff; background: linear-gradient(135deg, var(--accent), #8f5cf6); box-shadow: 0 16px 36px rgba(109, 93, 252, .45); display: grid; place-items: center; margin: 4px 0 12px; transition: transform .3s var(--spring), background .3s; }
.mic-big svg { width: 38px; height: 38px; position: relative; z-index: 1; }
.mic-big i { position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--accent); opacity: 0; }
.mic-big.on { background: linear-gradient(135deg, #e5484d, #f76b15); transform: scale(1.05); }
.mic-big.on i { border-color: #e5484d; animation: ring 1.6s ease-out infinite; }
.mic-big.on i + i { animation-delay: .8s; }
@keyframes ring { from { transform: scale(1); opacity: .7; } to { transform: scale(1.8); opacity: 0; } }
.voice-state { font-weight: 650; text-align: center; min-height: 22px; }
.voice-lang { margin-top: 10px; }
.voice-lang button { padding: 5px 12px; font-size: 13px; }
/* the text box grows with every recognised word — nothing hides behind its edge */
.voice textarea.voice-text { width: 100%; min-height: 64px; resize: none; overflow: hidden; font-size: 17px; line-height: 1.45; transition: height .15s ease-out; word-break: break-word; }
.voice-cta { display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px 16px; margin-bottom: 14px; border-radius: 16px; border: 1px dashed color-mix(in srgb, var(--accent) 55%, transparent); background: var(--accent-soft); color: var(--text); text-align: left; transition: transform .25s var(--spring); }
.voice-cta:hover { transform: translateY(-1px); }
.voice-cta svg { width: 26px; height: 26px; flex: none; color: var(--accent); }
.voice-cta small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.mic-fab { position: fixed; right: 22px; bottom: calc(96px + env(safe-area-inset-bottom)); z-index: 30; width: 52px; height: 52px; border-radius: 50%; border: 0; color: #fff; background: linear-gradient(135deg, #e5484d, #f76b15); box-shadow: 0 12px 28px rgba(229, 72, 77, .4); display: grid; place-items: center; animation: pop .6s var(--spring) .4s both; transition: transform .3s var(--spring), bottom .3s var(--ease); }
.mic-fab svg { width: 24px; height: 24px; }
.mic-fab:hover { transform: scale(1.08); }
.mic-fab.raised { bottom: calc(166px + env(safe-area-inset-bottom)); right: 25px; }
.mic-fab[hidden] { display: none; }
@media (min-width: 861px) { .mic-fab { bottom: 28px; right: 32px; } .mic-fab.raised { bottom: 98px; right: 35px; } }

/* expense / receipt sheets */
.g-amt { display: grid; grid-template-columns: 1fr 120px; gap: 10px; }
.big-num { font-size: 22px; font-weight: 750; letter-spacing: -.02em; }
.kind-pick { display: flex; gap: 6px; overflow-x: auto; padding: 2px 2px 10px; margin-bottom: 6px; scrollbar-width: thin; }
.kind-pick button { flex: none; display: flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 99px; border: 1px solid var(--line-2); background: none; font-weight: 600; font-size: 13px; color: var(--text-2); transition: all .2s var(--ease); }
.kind-pick button span { font-size: 16px; }
.kind-pick button.on { background: var(--accent-soft); border-color: var(--accent); color: var(--text); }
.it-head, .it-row { display: grid; grid-template-columns: 1fr 64px 64px 92px 34px; gap: 6px; align-items: center; }
.it-head { padding: 0 2px 4px; }
.it-row { margin-bottom: 6px; animation: rise .35s var(--ease) both; }
.it-row .input { padding: 8px 10px; font-size: 14px; min-width: 0; }
.it-row .it-del { width: 34px; height: 34px; }
.it-row .it-del svg { width: 16px; height: 16px; }
@media (max-width: 560px) {
  .it-head { display: none; }
  .it-row { grid-template-columns: 1fr 1fr 1fr 34px; padding: 8px; border-radius: 14px; background: var(--surface-2); }
  .it-row .it-name { grid-column: 1 / -1; }
}
.sheet .btn.sm svg { width: 15px; height: 15px; }

/* receipts page */
.actions4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.act { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 16px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); color: var(--text); text-align: left; transition: transform .3s var(--spring), border-color .2s; backdrop-filter: blur(14px); }
.act svg { width: 30px; height: 30px; color: var(--accent); margin-bottom: 6px; transition: transform .4s var(--spring); }
.act:hover { transform: translateY(-3px); border-color: var(--accent); }
.act:hover svg { transform: scale(1.12) rotate(-6deg); }
.act b { font-size: 15px; }
.act small { color: var(--muted); font-size: 12.5px; }
@media (max-width: 700px) { .actions4 { grid-template-columns: 1fr 1fr; gap: 10px; } .act { padding: 13px; } }
.op-amt small { display: block; font-size: 12px; color: var(--muted); font-weight: 500; }
.prod-list { display: flex; flex-direction: column; }
.prod { display: grid; grid-template-columns: 1fr 110px auto; gap: 14px; align-items: center; padding: 12px 6px; border: 0; border-bottom: 1px solid var(--line); background: none; text-align: left; color: var(--text); border-radius: 10px; transition: background .2s; }
.prod:last-child { border-bottom: 0; }
.prod:hover { background: var(--surface-2); }
.prod-price { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.prod-price small { color: var(--muted); font-size: 11.5px; }
.spark { display: flex; align-items: flex-end; gap: 3px; height: 34px; }
.spark i { flex: 1; min-width: 4px; max-width: 12px; border-radius: 3px 3px 1px 1px; background: color-mix(in srgb, var(--accent) 55%, transparent); transform-origin: bottom; animation: grow-y .6s var(--ease) both; }
.spark i:last-child { background: var(--accent); }
@keyframes grow-y { from { transform: scaleY(0); } }
@media (max-width: 520px) { .prod { grid-template-columns: 1fr auto; } .prod .spark { display: none; } }

/* QR scanner */
.scan { position: relative; border-radius: 20px; overflow: hidden; background: #000; aspect-ratio: 4 / 3; margin-bottom: 12px; }
.scan video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scan-frame { position: absolute; inset: 14% 22%; border-radius: 18px; box-shadow: 0 0 0 999px rgba(0, 0, 0, .38); border: 3px solid rgba(255, 255, 255, .9); overflow: hidden; }
.scan-frame i { position: absolute; left: 0; right: 0; height: 3px; background: linear-gradient(90deg, transparent, #4ade80, transparent); box-shadow: 0 0 14px #4ade80; animation: scanline 2s ease-in-out infinite alternate; }
@keyframes scanline { from { top: 4%; } to { top: 94%; } }
.scan-msg { position: absolute; left: 0; right: 0; bottom: 10px; text-align: center; color: #fff; font-weight: 650; font-size: 14px; text-shadow: 0 1px 4px rgba(0, 0, 0, .7); }

/* photo → AI */
.reading { position: relative; border-radius: 18px; overflow: hidden; max-height: 52vh; display: grid; place-items: center; background: var(--surface-2); }
.reading img { max-width: 100%; max-height: 52vh; display: block; filter: saturate(.7) brightness(.95); }
.reading .scanline { position: absolute; left: 0; right: 0; height: 30%; background: linear-gradient(180deg, transparent, color-mix(in srgb, var(--accent) 45%, transparent)); border-bottom: 2px solid var(--accent); animation: read-sweep 1.8s ease-in-out infinite; }
@keyframes read-sweep { from { top: -30%; } to { top: 100%; } }
.reading-msg { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 16px 0 4px; }
.reading-msg small { color: var(--muted); }
.spin.dark { width: 26px; height: 26px; border: 3px solid var(--accent); border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; margin-bottom: 6px; }

/* converter */
.fx-card { padding: 0; overflow: hidden; }
.fx-input { display: grid; grid-template-columns: 1fr 130px; gap: 10px; padding: 18px; background: linear-gradient(135deg, var(--accent-soft), transparent); border-bottom: 1px solid var(--line); }
.fx-amount { font-size: 30px; font-weight: 800; letter-spacing: -.03em; padding: 10px 14px; }
.fx-from { font-size: 17px; font-weight: 700; }
.fx-list { padding: 6px 10px 10px; }
.fx-row { display: grid; grid-template-columns: 38px 1fr auto; gap: 12px; align-items: center; padding: 11px 8px; border-bottom: 1px solid var(--line); }
.fx-row:last-child { border-bottom: 0; }
.fx-flag { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; font-size: 15px; color: #fff; background: var(--b, var(--accent)); box-shadow: 0 6px 14px color-mix(in srgb, var(--b, var(--accent)) 35%, transparent); }
.fx-val { text-align: right; display: flex; flex-direction: column; align-items: flex-end; }
.fx-val b { font-size: 18px; }
.fx-val small { font-size: 11.5px; }
@media (max-width: 520px) { .fx-input { grid-template-columns: 1fr 108px; padding: 14px; } .fx-amount { font-size: 24px; } }

/* admin */
.toggle { flex: none; width: 52px; height: 30px; border-radius: 99px; border: 0; background: var(--line-2); position: relative; transition: background .25s; padding: 0; }
.toggle i { position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .25); transition: transform .35s var(--spring); }
.toggle.on { background: var(--good); }
.toggle.on i { transform: translateX(22px); }
.users { display: flex; flex-direction: column; }
.user { display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: center; padding: 12px 4px; border-bottom: 1px solid var(--line); }
.user:last-child { border-bottom: 0; }
.user.blocked { opacity: .6; }
.avatar { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; font-weight: 800; color: #fff; background: linear-gradient(135deg, var(--accent), #8f5cf6); }
.user.blocked .avatar { background: var(--muted); }
.user-act { display: flex; gap: 6px; align-items: center; }
.user-act svg { width: 18px; height: 18px; }
@media (max-width: 600px) { .user { grid-template-columns: 44px 1fr; } .user-act { grid-column: 1 / -1; justify-content: flex-end; } }
.danger-zone { padding: 14px; border-radius: 14px; border: 1px solid color-mix(in srgb, var(--bad) 40%, transparent); background: color-mix(in srgb, var(--bad) 6%, transparent); }

/* connect: bank & AI */
.bank-ok { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.acc { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 12px; background: var(--surface-2); font-size: 14px; cursor: pointer; }
.acc input { width: 18px; height: 18px; accent-color: var(--accent); }
@media (prefers-reduced-motion: reduce) { .mic-big.on i, .scan-frame i, .reading .scanline { animation: none; } }

/* ---------- «Поблагодарить разработчика» (as in «Дело») ---------- */
.thanks-btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 46px; margin-top: 14px; padding: 9px 14px; border-radius: 14px; border: 1.5px solid color-mix(in srgb, #e5484d 45%, var(--line)); background: color-mix(in srgb, #e5484d 8%, var(--surface-solid)); color: #d13b40; font-weight: 700; font-size: 15px; cursor: pointer; transition: transform .2s var(--spring); }
.thanks-btn:hover { transform: translateY(-1px); }
.thanks-btn:active { transform: scale(.98); }
.ic-heart { width: 20px; height: 20px; fill: currentColor; flex: none; }
.thanks-btn .ic-heart { animation: beat 2.4s ease-in-out infinite; }
@keyframes beat { 0%, 60%, 100% { transform: scale(1); } 70% { transform: scale(1.18); } 80% { transform: scale(1); } 90% { transform: scale(1.12); } }
.dev-line { margin: 12px 0 0; text-align: center; font-size: 13.5px; color: var(--muted); }
.dev-line b { color: var(--text); font-weight: 700; }
.side-dev { margin-top: 10px; }
.side-dev .thanks-btn { min-height: 40px; font-size: 13.5px; margin-top: 0; }
.side-dev .dev-line { margin-top: 8px; font-size: 12.5px; }
.auth .dev-line { margin-top: 14px; }
.thanks-hero { display: flex; gap: 14px; align-items: center; margin: -4px 0 16px; }
.thanks-hero p { margin: 0; font-size: 15px; line-height: 1.5; color: var(--text-2); }
.thanks-heart { flex: none; width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, #ff6b6b, #e5484d); box-shadow: 0 10px 24px rgba(229, 72, 77, .35); animation: pop .6s var(--spring) both; }
.thanks-heart .ic-heart { width: 28px; height: 28px; }
.pay-card { border-radius: 20px; padding: 16px; margin-bottom: 14px; animation: rise .5s var(--ease) both; }
.pay-usdt { animation-delay: 80ms; }
.pay-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.pay-top b { font-size: 17px; }
.pay-top span { font-size: 13px; font-weight: 600; opacity: .85; }
.pay-mono { color: #fff; background: linear-gradient(135deg, #1b1b1f 0%, #3a3a44 100%); }
.pay-num { font-size: 24px; font-weight: 700; letter-spacing: .06em; font-variant-numeric: tabular-nums; margin: 4px 0 16px; white-space: nowrap; }
.pay-usdt { background: var(--surface-2); border: 1.5px solid var(--line); text-align: center; }
.pay-usdt .pay-top { text-align: left; }
.pay-qr { display: block; width: 212px; height: 212px; margin: 2px auto 12px; padding: 8px; border-radius: 14px; background: #fff; image-rendering: pixelated; }
.pay-addr { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 15px; font-weight: 600; line-height: 1.45; word-break: break-all; margin-bottom: 14px; }
.pay-copy { width: 100%; font-weight: 700; border: 0; justify-content: center; }
.pay-copy svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.pay-mono .pay-copy { background: #fff; color: #17171c; }
.pay-usdt .pay-copy { background: #0b7a5f; color: #fff; }
.pay-copy.copied { background: var(--good) !important; color: #fff !important; }
.pay-warn { margin: 12px 2px 0; font-size: 13px; line-height: 1.45; color: var(--muted); text-align: left; }
@media (max-width: 380px) { .pay-num { font-size: 20px; } .thanks-hero { align-items: flex-start; } }
@media (prefers-reduced-motion: reduce) { .thanks-btn .ic-heart { animation: none; } }

/* ---------- sign-up as a conversation ---------- */
.auth-card.wiz { width: min(460px, 100%); padding: 22px 22px 24px; display: flex; flex-direction: column; }
.wiz-top { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.auth-logo.sm { width: 40px; height: 40px; border-radius: 13px; margin: 0; flex: none; box-shadow: 0 8px 20px rgba(109, 93, 252, .35); }
.wiz-prog { flex: 1; height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; }
.wiz-prog i { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--accent), #1fb7a6); transition: width .6s var(--spring); }
.wiz-count { font-size: 13px; font-weight: 700; color: var(--muted); min-width: 34px; text-align: right; font-variant-numeric: tabular-nums; }
.wiz-chat { display: flex; flex-direction: column; gap: 8px; min-height: 120px; max-height: 46vh; overflow-y: auto; padding: 4px 2px 10px; scrollbar-width: thin; }
.bub { max-width: 86%; padding: 11px 14px; border-radius: 18px; font-size: 15px; line-height: 1.4; animation: bub-in .45s var(--spring) both; word-break: break-word; }
.bub b { font-weight: 650; display: block; }
.bub small { display: block; margin-top: 3px; color: var(--muted); font-size: 13px; }
.bub.bot { align-self: flex-start; background: var(--surface-2); border: 1px solid var(--line); border-bottom-left-radius: 6px; transform-origin: left bottom; }
.bub.me { align-self: flex-end; background: linear-gradient(135deg, var(--accent), #8f5cf6); color: #fff; border-bottom-right-radius: 6px; font-weight: 600; transform-origin: right bottom; }
.bub.me .muted { color: rgba(255, 255, 255, .8); font-weight: 500; font-style: italic; }
@keyframes bub-in { from { opacity: 0; transform: scale(.6) translateY(10px); } }
.bub.typing { display: flex; gap: 5px; padding: 14px 16px; }
.bub.typing i { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); animation: dots 1s ease-in-out infinite; }
.bub.typing i:nth-child(2) { animation-delay: .15s; } .bub.typing i:nth-child(3) { animation-delay: .3s; }
@keyframes dots { 0%, 60%, 100% { transform: translateY(0); opacity: .4; } 30% { transform: translateY(-6px); opacity: 1; } }
.wiz-form { margin-top: 6px; min-height: 52px; }
.wiz-in { display: flex; gap: 8px; align-items: center; position: relative; animation: rise .45s var(--ease) both; }
.wiz-in .input { flex: 1; font-size: 17px; padding: 13px 16px; border-radius: 16px; }
.wiz-go { flex: none; width: 52px; height: 52px; padding: 0; border-radius: 16px; font-size: 22px; justify-content: center; }
.wiz-eye { position: absolute; right: 66px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; font-size: 16px; }
.wiz-row { display: flex; justify-content: space-between; margin-top: 8px; min-height: 8px; }
.wiz-row .btn { color: var(--text-2); }
.wiz-start { font-size: 17px; padding: 15px; animation: rise .5s var(--ease) both, glow 2.4s ease-in-out 1s infinite; }
@keyframes glow { 50% { box-shadow: 0 0 0 8px color-mix(in srgb, var(--accent) 18%, transparent); } }
.wiz .err { margin: 8px 0 0; min-height: 0; }
.pw-meter { height: 5px; border-radius: 99px; background: var(--line); margin-top: 8px; overflow: hidden; }
.pw-meter i { display: block; height: 100%; width: 0; background: var(--bad); transition: width .3s, background .3s; }
.pw-meter i[data-l="2"] { background: var(--warn); } .pw-meter i[data-l="3"], .pw-meter i[data-l="4"] { background: var(--good); }
.shake { animation: shake .4s; border-color: var(--bad) !important; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 90; overflow: hidden; }
.confetti i { position: absolute; top: -12px; width: 9px; height: 14px; border-radius: 2px; animation: fall var(--d) cubic-bezier(.2, .6, .4, 1) both; }
@keyframes fall { to { transform: translate(var(--x), 105vh) rotate(var(--r)); opacity: .9; } }
@media (prefers-reduced-motion: reduce) { .bub.typing i, .wiz-start { animation: none; } }
