/* ───────────── Токены ───────────── */
:root {
  --bg: #0B0B10;
  --surface: #16161D;
  --surface-2: #1E1E27;
  --surface-3: #282833;
  --track: rgba(255, 255, 255, 0.07);
  --border: rgba(255, 255, 255, 0.06);
  --text: #F4F4F7;
  --text-2: #9C9CAB;
  --text-3: #5F5F6E;
  --accent: #7C6CFF;
  --accent-2: #A594FF;
  --accent-soft: rgba(124, 108, 255, 0.16);
  --green: #2FD07C;
  --green-soft: rgba(47, 208, 124, 0.15);
  --red: #FF5C5C;
  --red-soft: rgba(255, 92, 92, 0.15);
  --blue: #3EA6FF;
  --blue-soft: rgba(62, 166, 255, 0.15);
  --warn: #FFB224;
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  --glass: rgba(14, 14, 20, 0.78);
  --r-lg: 24px;
  --r-md: 18px;
  --r-sm: 14px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", "Segoe UI", Roboto, sans-serif;
  --safe-bottom: max(env(safe-area-inset-bottom, 0px), var(--tg-safe-area-inset-bottom, 0px));
  --safe-top: var(--tg-content-safe-area-inset-top, 0px);
  --tabbar-h: 66px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

[data-theme="light"] {
  --bg: #F2F3F7;
  --surface: #FFFFFF;
  --surface-2: #F3F4F8;
  --surface-3: #E8E9F0;
  --track: rgba(15, 15, 40, 0.07);
  --border: rgba(15, 15, 40, 0.07);
  --text: #0F0F17;
  --text-2: #6C6C7C;
  --text-3: #A6A6B4;
  --accent-soft: rgba(124, 108, 255, 0.12);
  --green: #12B262;
  --green-soft: rgba(18, 178, 98, 0.12);
  --red: #F04848;
  --red-soft: rgba(240, 72, 72, 0.1);
  --blue-soft: rgba(62, 166, 255, 0.12);
  --shadow: 0 10px 28px rgba(20, 20, 50, 0.08);
  --glass: rgba(250, 250, 253, 0.82);
}

/* ───────────── База ───────────── */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
html { background: var(--bg); color-scheme: dark; }
[data-theme="light"] { color-scheme: light; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.4 var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  overscroll-behavior-y: none;
  user-select: none;
  -webkit-user-select: none;
}
input, textarea { user-select: text; -webkit-user-select: text; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
button:disabled { opacity: 0.45; cursor: default; }
h1, h2, h3 { margin: 0; font-family: var(--font-display); letter-spacing: -0.02em; }
.ic { flex: none; display: block; }
.muted { color: var(--text-2); font-size: 13px; }
.center { text-align: center; }
.pad { padding: 24px 0; }
.pos { color: var(--green) !important; }
.neg { color: var(--red) !important; }
.fg { color: var(--text); font-weight: 600; }
.mt { margin-top: 12px; }
body.sheet-open { overflow: hidden; }

#app {
  max-width: 560px;
  margin: 0 auto;
  padding: calc(var(--safe-top) + 10px) 16px calc(var(--tabbar-h) + var(--safe-bottom) + 36px);
}
#screen.enter > * { animation: rise 0.5s var(--ease) both; }
#screen.enter > *:nth-child(2) { animation-delay: 0.03s; }
#screen.enter > *:nth-child(3) { animation-delay: 0.06s; }
#screen.enter > *:nth-child(4) { animation-delay: 0.09s; }
#screen.enter > *:nth-child(5) { animation-delay: 0.12s; }
#screen.enter > *:nth-child(n + 6) { animation-delay: 0.15s; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* ───────────── Кнопки ───────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 52px; padding: 0 20px; border-radius: 16px;
  font-weight: 600; font-size: 16px; letter-spacing: -0.01em;
  transition: transform 0.15s var(--ease), background 0.2s, opacity 0.2s;
}
.btn:active { transform: scale(0.97); }
.btn.sm { height: 38px; padding: 0 14px; font-size: 14px; border-radius: 12px; }
.btn.wide { flex: 1; width: 100%; }
.btn.primary { background: linear-gradient(135deg, #8B7BFF, #6A4DF5); color: #fff; box-shadow: 0 8px 22px -8px rgba(124, 108, 255, 0.7); }
.btn.soft { background: var(--surface-2); }
.btn.ghost { background: transparent; color: var(--text-2); height: 46px; }
.btn.danger-soft { background: var(--red-soft); color: var(--red); width: 56px; flex: none; padding: 0; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center;
  background: var(--surface); color: var(--text-2); transition: transform 0.15s, background 0.2s;
}
.icon-btn:active { transform: scale(0.92); }
.icon-btn.sm { width: 34px; height: 34px; border-radius: 11px; background: var(--surface-2); }
.link { color: var(--accent-2); font-weight: 600; font-size: 14px; padding: 4px 2px; }
[data-theme="light"] .link { color: var(--accent); }

/* ───────────── Шапка ───────────── */
.top { display: flex; align-items: center; gap: 12px; padding: 6px 0 16px; }
.top-text { flex: 1; min-width: 0; }
.top-hello { font: 600 17px/1.2 var(--font-display); letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-sub { color: var(--text-2); font-size: 13px; margin-top: 2px; }
.avatar {
  width: 42px; height: 42px; border-radius: 50%; overflow: hidden; flex: none;
  display: grid; place-items: center; font-weight: 700; font-size: 15px; color: #fff;
  background: linear-gradient(135deg, #FF8AD8, #7C6CFF 60%, #3EA6FF);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.xl { width: 84px; height: 84px; font-size: 30px; box-shadow: 0 12px 30px -10px rgba(124, 108, 255, 0.7); }

/* ───────────── Карта баланса ───────────── */
.card-balance {
  position: relative; overflow: hidden; isolation: isolate;
  border-radius: 28px; padding: 20px 20px 18px; color: #fff; cursor: pointer;
  background:
    radial-gradient(90% 120% at 100% 0%, rgba(255, 128, 214, 0.85) 0%, rgba(255, 128, 214, 0) 55%),
    radial-gradient(80% 110% at 0% 100%, rgba(56, 196, 255, 0.75) 0%, rgba(56, 196, 255, 0) 55%),
    linear-gradient(140deg, #6B55FF 0%, #5A34E0 45%, #2D1A8F 100%);
  box-shadow: 0 22px 50px -18px rgba(108, 80, 255, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  transition: transform 0.2s var(--ease);
}
.card-balance:active { transform: scale(0.985); }
.card-balance::before {
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: 0.22;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.5) 0 1px, transparent 1.5px),
    repeating-linear-gradient(115deg, rgba(255, 255, 255, 0.08) 0 1px, transparent 1px 22px);
  background-size: 18px 18px, auto;
  mask-image: linear-gradient(160deg, #000 10%, transparent 75%);
  -webkit-mask-image: linear-gradient(160deg, #000 10%, transparent 75%);
}
.cb-shine {
  position: absolute; inset: -40% -60%; z-index: -1; pointer-events: none;
  background: linear-gradient(105deg, transparent 40%, rgba(255, 255, 255, 0.18) 50%, transparent 60%);
  animation: shine 6s ease-in-out 1s infinite;
}
@keyframes shine { 0%, 70% { transform: translateX(-40%); } 100% { transform: translateX(40%); } }
.cb-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.cb-brand { display: inline-flex; align-items: center; gap: 7px; font: 700 15px/1 var(--font-display); letter-spacing: 0.01em; opacity: 0.95; }
.cb-brand i { width: 18px; height: 18px; border-radius: 6px; background: rgba(255, 255, 255, 0.9); box-shadow: 7px 0 0 -2px rgba(255, 255, 255, 0.45); margin-right: 6px; }
.cb-cur { font: 600 11px/1 var(--font); letter-spacing: 0.08em; padding: 6px 9px; border-radius: 999px; background: rgba(255, 255, 255, 0.16); backdrop-filter: blur(8px); }
.cb-label { font-size: 13px; opacity: 0.78; }
.cb-amount {
  font: 700 40px/1.1 var(--font-display); letter-spacing: -0.035em; margin: 2px 0 18px;
  font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cb-amount .bm-cents { font-size: 0.6em; opacity: 0.7; letter-spacing: -0.02em; }
.cb-amount .bm-cur { font-size: 0.66em; opacity: 0.75; margin-left: 6px; font-weight: 600; }
.cb-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cb-stat {
  display: flex; align-items: center; gap: 9px; padding: 10px 11px; border-radius: 16px; min-width: 0;
  background: rgba(255, 255, 255, 0.13); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.cb-stat > div { min-width: 0; }
.cb-stat-ic { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; flex: none; background: rgba(255, 255, 255, 0.92); }
.cb-stat-ic.in { color: #0FA45A; }
.cb-stat-ic.out { color: #5A34E0; }
.cb-stat-l { font-size: 11px; opacity: 0.75; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cb-stat-v { font: 600 14.5px/1.25 var(--font-display); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ───────────── Быстрые действия ───────────── */
.actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 18px 0 14px; }
.act { display: flex; flex-direction: column; align-items: center; gap: 7px; font-size: 12.5px; color: var(--text-2); font-weight: 500; }
.act-ic {
  width: 58px; height: 58px; border-radius: 20px; display: grid; place-items: center;
  background: var(--surface); transition: transform 0.18s var(--ease);
  box-shadow: inset 0 0 0 1px var(--border);
}
.act:active .act-ic { transform: scale(0.9); }
.act-ic.red { color: var(--red); background: linear-gradient(var(--red-soft), var(--red-soft)), var(--surface); }
.act-ic.green { color: var(--green); background: linear-gradient(var(--green-soft), var(--green-soft)), var(--surface); }
.act-ic.accent { color: #fff; background: linear-gradient(135deg, #8B7BFF, #6A4DF5); box-shadow: 0 10px 24px -10px rgba(124, 108, 255, 0.9); }
.act-ic.blue { color: var(--blue); background: linear-gradient(var(--blue-soft), var(--blue-soft)), var(--surface); }

/* ───────────── Карточки ───────────── */
.card {
  display: block; width: 100%; text-align: left;
  background: var(--surface); border-radius: var(--r-lg); padding: 16px;
  margin-bottom: 12px; box-shadow: inset 0 0 0 1px var(--border);
  transition: transform 0.18s var(--ease);
}
button.card:active, .card[role="button"]:active { transform: scale(0.985); }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.card-head h3 { font-size: 17px; }
.card-head .muted { text-align: right; }

.onboard { display: grid; grid-template-columns: auto 1fr; gap: 12px 14px; align-items: start; background: linear-gradient(135deg, var(--accent-soft), transparent 70%), var(--surface); }
.onboard-ic { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, #8B7BFF, #6A4DF5); }
.onboard-text b { display: block; font-size: 15px; margin-bottom: 4px; }
.onboard-text span { color: var(--text-2); font-size: 13.5px; }
.onboard .btn { grid-column: 2; justify-self: start; }

.month-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 14px; }
.month-total { font: 700 26px/1.15 var(--font-display); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; margin-top: 2px; }
.month-net { text-align: right; display: flex; flex-direction: column; gap: 3px; }
.month-net .muted { font-size: 12px; }
.month-net b { font: 600 16px/1.2 var(--font-display); font-variant-numeric: tabular-nums; }
.stack-bar { display: flex; gap: 3px; height: 10px; border-radius: 6px; overflow: hidden; margin-bottom: 12px; }
.stack-bar i { display: block; min-width: 4px; border-radius: 3px; animation: grow-x 0.8s var(--ease) both; transform-origin: left; }
@keyframes grow-x { from { transform: scaleX(0); } }
.legend { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; }
.lg { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--text-2); min-width: 0; }
.lg-n { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lg i { width: 8px; height: 8px; border-radius: 3px; flex: none; }
.lg b { margin-left: auto; color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }

.cta { display: flex; align-items: center; gap: 12px; color: var(--text); }
.cta-ic { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; color: var(--warn); background: rgba(255, 178, 36, 0.14); flex: none; }
.cta-text { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.cta-text span { font-size: 13px; color: var(--text-2); }
.cta > .ic:last-child { color: var(--text-3); }

.budget { display: flex; align-items: center; gap: 14px; }
.budget-ring { position: relative; width: 58px; height: 58px; flex: none; }
.budget-ring > span { position: absolute; inset: 0; display: grid; place-items: center; font: 700 13px/1 var(--font-display); }
.ring-val { transition: stroke-dasharray 1s var(--ease); }
.budget-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.budget-text b { font: 600 17px/1.2 var(--font-display); letter-spacing: -0.01em; }
.budget-sub { font-size: 12.5px; color: var(--text-2); }

/* ───────────── Список операций ───────────── */
.block { margin-top: 20px; }
.block-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; padding: 0 2px; }
.block-head h2 { font-size: 21px; }
.day { margin-top: 12px; }
.day-head { display: flex; justify-content: space-between; align-items: baseline; padding: 6px 4px 8px; font-weight: 600; font-size: 14px; }
.day-head em { font-style: normal; color: var(--text-3); font-weight: 500; margin-left: 6px; font-size: 13px; }
.day-sum { color: var(--text-2); font-variant-numeric: tabular-nums; font-size: 13.5px; }
.day-list { background: var(--surface); border-radius: var(--r-lg); padding: 4px 0; box-shadow: inset 0 0 0 1px var(--border); }
.tx {
  position: relative; display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 10px 14px; text-align: left; cursor: pointer; transition: background 0.15s;
}
.tx:active { background: var(--surface-2); }
.tx + .tx::before { content: ""; position: absolute; top: 0; left: 70px; right: 14px; height: 1px; background: var(--border); }
.tx-ic { width: 44px; height: 44px; border-radius: 15px; display: grid; place-items: center; font-size: 21px; flex: none; }
.tx-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tx-title { font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tx-sub { color: var(--text-2); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tx-amt { font: 600 15.5px/1.2 var(--font-display); font-variant-numeric: tabular-nums; white-space: nowrap; letter-spacing: -0.01em; }
.tx-amt.income { color: var(--green); }
.tx-end { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; flex: none; }
.tx-orig { color: var(--text-2); font-size: 12.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tx-x { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); color: var(--text-2); flex: none; margin-left: 2px; }

.empty { text-align: center; padding: 30px 12px 10px; }
.empty.small { padding-top: 40px; }
.empty-art { position: relative; height: 84px; margin-bottom: 8px; }
.empty-art span { position: absolute; top: 18px; width: 56px; height: 56px; border-radius: 18px; display: grid; place-items: center; font-size: 26px; background: var(--surface); box-shadow: var(--shadow), inset 0 0 0 1px var(--border); animation: float 4s ease-in-out infinite; }
.empty-art .e1 { left: calc(50% - 90px); transform: rotate(-10deg); }
.empty-art .e2 { left: calc(50% - 28px); top: 4px; z-index: 1; animation-delay: -1.3s; }
.empty-art .e3 { left: calc(50% + 34px); transform: rotate(10deg); animation-delay: -2.6s; }
@keyframes float { 50% { translate: 0 -6px; } }
.empty-title { font: 600 17px/1.3 var(--font-display); }
.empty-text { color: var(--text-2); font-size: 14px; margin-top: 4px; }
.empty-actions { display: flex; gap: 8px; justify-content: center; margin-top: 18px; }
.empty-actions .btn { height: 46px; font-size: 15px; }

/* ───────────── Заголовки страниц, сегменты, чипы ───────────── */
.page-head { padding: 8px 2px 16px; }
.page-head h1 { font-size: 30px; }

.seg {
  position: relative; display: grid; grid-template-columns: repeat(var(--n), 1fr);
  padding: 4px; border-radius: 15px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--border); margin-bottom: 12px;
}
.seg button { position: relative; z-index: 1; height: 38px; border-radius: 11px; font-weight: 600; font-size: 14.5px; color: var(--text-2); transition: color 0.25s; }
.seg button.on { color: var(--text); }
.seg-pill {
  position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc((100% - 8px) / var(--n));
  border-radius: 11px; background: var(--surface-3); transform: translateX(calc(var(--i) * 100%));
  transition: transform 0.35s var(--ease); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}
[data-theme="light"] .seg-pill { background: #fff; box-shadow: 0 2px 10px rgba(20, 20, 50, 0.1); }
[data-theme="light"] .seg { background: var(--surface-3); }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 12px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 12px;
  background: var(--surface); color: var(--text-2); font-weight: 500; font-size: 14px; white-space: nowrap;
  box-shadow: inset 0 0 0 1px var(--border); transition: background 0.2s, color 0.2s, transform 0.15s;
}
.chip:active { transform: scale(0.95); }
.chip.on { background: var(--text); color: var(--bg); box-shadow: none; }
.chip.cat.on { background: var(--accent-soft); color: var(--accent-2); }
[data-theme="light"] .chip.cat.on { color: var(--accent); }

.period-tabs { display: flex; gap: 8px; margin-bottom: 12px; }
.period-tabs .chip { flex: 1; justify-content: center; }
.period-nav { align-self: stretch; display: flex; align-items: center; justify-content: space-between; gap: 8px; font: 600 16px/1.2 var(--font-display); margin: -8px 0 14px; }
.period-nav span { text-align: center; white-space: nowrap; }
.period-nav .icon-btn:disabled { opacity: 0.3; }

/* ───────────── История ───────────── */
.search {
  display: flex; align-items: center; gap: 10px; height: 46px; padding: 0 14px; border-radius: 15px;
  background: var(--surface); color: var(--text-3); margin-bottom: 10px; box-shadow: inset 0 0 0 1px var(--border);
}
.search input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: none; color: var(--text); font: 16px var(--font); }
.search input::placeholder { color: var(--text-3); }
.search input::-webkit-search-cancel-button { -webkit-appearance: none; }

/* ───────────── Профиль ───────────── */
.profile-head { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 18px 0 18px; text-align: center; }
.profile-name { font: 700 22px/1.2 var(--font-display); letter-spacing: -0.02em; margin-top: 8px; }
.pstats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 8px; }
.pstats > div { background: var(--surface); border-radius: var(--r-md); padding: 12px 10px; text-align: center; box-shadow: inset 0 0 0 1px var(--border); min-width: 0; }
.pstats b { display: block; font: 700 17px/1.25 var(--font-display); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pstats span { font-size: 11.5px; color: var(--text-2); }
.group-title { font-size: 13px; color: var(--text-2); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; padding: 18px 6px 8px; }
.group { background: var(--surface); border-radius: var(--r-lg); overflow: hidden; box-shadow: inset 0 0 0 1px var(--border); }
.group.flat { background: transparent; box-shadow: none; }
.row { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 54px; padding: 8px 14px; text-align: left; transition: background 0.15s; }
.row:active { background: var(--surface-2); }
.row + .row::before { content: ""; position: absolute; top: 0; left: 58px; right: 0; height: 1px; background: var(--border); }
.group.flat .row + .row::before { left: 14px; }
.row-ic { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-2); flex: none; }
[data-theme="light"] .row-ic { color: var(--accent); }
.row-l { flex: 1; font-weight: 500; min-width: 0; }
.row-v { color: var(--text-2); font-size: 14px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.row > .ic:last-child { color: var(--text-3); }
.row.danger .row-ic { background: var(--red-soft); color: var(--red); }
.row.danger .row-l { color: var(--red); }
.row .check { width: 22px; color: var(--accent-2); }
.switch { width: 50px; height: 30px; border-radius: 99px; background: var(--surface-3); position: relative; transition: background 0.25s; flex: none; }
.switch 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, 0.25); transition: transform 0.3s var(--ease); }
.switch.on { background: var(--green); }
.switch.on i { transform: translateX(20px); }
.foot { text-align: center; color: var(--text-3); font-size: 12px; padding: 24px 0 4px; }

/* ───────────── Нижняя панель ───────────── */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: grid; grid-template-columns: repeat(5, 1fr); align-items: center;
  height: calc(var(--tabbar-h) + var(--safe-bottom)); padding: 0 8px var(--safe-bottom);
  background: var(--glass); backdrop-filter: saturate(180%) blur(22px); -webkit-backdrop-filter: saturate(180%) blur(22px);
  border-top: 1px solid var(--border);
}
@media (min-width: 560px) { .tabbar { left: 50%; transform: translateX(-50%); width: 560px; border-radius: 22px 22px 0 0; } }
.tabbar > button { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 10.5px; font-weight: 600; color: var(--text-3); transition: color 0.2s; height: 100%; justify-content: center; }
.tabbar > button.on { color: var(--text); }
.tabbar > button.on .ic { animation: pop 0.35s var(--ease); }
@keyframes pop { 40% { transform: scale(0.82); } }
.tabbar .fab {
  justify-self: center; width: 58px; height: 58px; border-radius: 50%; margin-top: -26px;
  color: #fff; background: linear-gradient(140deg, #9A8BFF, #6A4DF5 60%, #4F2FD8);
  box-shadow: 0 10px 26px -6px rgba(110, 85, 255, 0.85), 0 0 0 5px var(--bg);
  transition: transform 0.18s var(--ease);
}
.tabbar .fab:active { transform: scale(0.9); }
.tabbar .fab .ic { margin: 0 auto; }

/* ───────────── Шторки ───────────── */
.sheet-wrap { position: fixed; inset: 0; z-index: 50; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.55); opacity: 0; transition: opacity 0.3s; }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; margin: 0 auto; max-width: 560px;
  max-height: 92vh; max-height: 92dvh; display: flex; flex-direction: column;
  background: var(--bg); border-radius: 28px 28px 0 0;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.35), inset 0 1px 0 var(--border);
  transform: translateY(100%); transition: transform 0.38s var(--ease);
}
[data-theme="light"] .sheet { background: var(--bg); }
.sheet-wrap.open .sheet-backdrop { opacity: 1; }
.sheet-wrap.open .sheet { transform: translateY(0); }
.sheet-wrap.closing .sheet { transition-duration: 0.26s; }
.sheet-handle { width: 38px; height: 5px; border-radius: 3px; background: var(--surface-3); margin: 8px auto 2px; flex: none; }
.sheet-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 4px 16px calc(var(--safe-bottom) + 18px); -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 6px 0 14px; }
.sheet-head h3 { font-size: 20px; display: flex; align-items: center; gap: 8px; }
.sheet-head .icon-btn { width: 34px; height: 34px; border-radius: 50%; background: var(--surface-2); }
.sheet-hint { color: var(--text-2); font-size: 14px; margin: -4px 0 14px; }
.sheet-actions { display: flex; gap: 10px; margin-top: 16px; position: sticky; bottom: 0; padding-top: 8px; background: linear-gradient(transparent, var(--bg) 30%); }
.label { font-size: 13px; color: var(--text-2); font-weight: 600; margin: 16px 2px 10px; }

/* форма */
.field { display: flex; align-items: center; gap: 10px; height: 50px; padding: 0 14px; margin-top: 14px; border-radius: 15px; background: var(--surface); color: var(--text-3); box-shadow: inset 0 0 0 1px var(--border); }
.field input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; color: var(--text); font: 16px var(--font); height: 100%; }
.field input::placeholder { color: var(--text-3); }
.date-row { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.date-pick { position: relative; overflow: hidden; }
.date-pick input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; }

/* голосовой ввод */
.vs { min-height: 340px; display: flex; flex-direction: column; }
.vs-center { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 10px 0 14px; }
.vs-center.small { padding: 34px 0 10px; }
.vs-title { font: 600 19px/1.3 var(--font-display); letter-spacing: -0.01em; margin-top: 18px; }
.vs-title.left { margin: 0 0 12px; text-align: left; }
.vs-hint { color: var(--text-2); font-size: 14px; margin-top: 6px; max-width: 300px; }
.vs-sub { color: var(--text-2); font-size: 13px; margin: 14px 2px 8px; }
.vs-timer { font: 600 18px/1 var(--font-display); font-variant-numeric: tabular-nums; margin-top: 20px; color: var(--red); }
.orb { --lvl: 0; position: relative; width: 132px; height: 132px; border-radius: 50%; display: grid; place-items: center; margin-top: 18px; }
.orb-core {
  position: relative; z-index: 2; width: 96px; height: 96px; border-radius: 50%; display: grid; place-items: center; color: #fff;
  background: radial-gradient(circle at 30% 25%, #B3A6FF, #7C6CFF 45%, #4F2FD8);
  box-shadow: 0 16px 40px -10px rgba(124, 108, 255, 0.9), inset 0 2px 0 rgba(255, 255, 255, 0.35);
  transition: transform 0.1s linear;
}
.orb.idle .orb-core { animation: breathe 2.6s ease-in-out infinite; }
.orb.idle:active .orb-core { transform: scale(0.92); }
@keyframes breathe { 50% { transform: scale(1.05); } }
.orb-ring { position: absolute; inset: 0; border-radius: 50%; border: 2px solid rgba(124, 108, 255, 0.45); }
.orb.idle .orb-ring { animation: ripple 2.6s ease-out infinite; }
@keyframes ripple { from { transform: scale(0.72); opacity: 1; } to { transform: scale(1.25); opacity: 0; } }
.orb.rec .orb-core { background: radial-gradient(circle at 30% 25%, #FF9A9A, #FF5C5C 45%, #D92F4F); box-shadow: 0 16px 40px -10px rgba(255, 92, 92, 0.9); transform: scale(calc(1 + var(--lvl) * 0.12)); }
.orb.rec .orb-ring { border-color: rgba(255, 92, 92, 0.35); background: rgba(255, 92, 92, 0.08); transform: scale(calc(0.85 + var(--lvl) * 0.5)); transition: transform 0.12s linear; }
.orb.rec .orb-ring.r2 { transform: scale(calc(0.9 + var(--lvl) * 0.85)); opacity: 0.6; }
.orb.busy .orb-core { animation: breathe 1.4s ease-in-out infinite; }
.orb-spin { position: absolute; inset: 6px; border-radius: 50%; border: 3px solid transparent; border-top-color: var(--accent); border-right-color: rgba(124, 108, 255, 0.3); animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.wave { display: flex; align-items: center; justify-content: center; gap: 4px; height: 54px; margin-top: 16px; }
.wave i { display: block; width: 4px; height: 100%; border-radius: 2px; background: linear-gradient(var(--red), #FF9A9A); transform: scaleY(0.12); transition: transform 0.08s linear; }
.vs-actions { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; margin-top: auto; padding: 8px 10px 4px; }
.round-btn { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; transition: transform 0.15s; }
.round-btn:active { transform: scale(0.9); }
.round-btn.ghost { background: var(--surface-2); color: var(--text-2); justify-self: start; }
.round-btn.stop { width: 76px; height: 76px; color: #fff; background: linear-gradient(140deg, #9A8BFF, #6A4DF5); box-shadow: 0 12px 28px -8px rgba(110, 85, 255, 0.9); }
.examples { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 10px; }
.examples.center { justify-content: center; }
.examples .chip { height: 34px; font-size: 13.5px; }
.quote { display: flex; gap: 8px; align-items: flex-start; padding: 12px 14px; border-radius: 16px; background: var(--surface); color: var(--text-2); font-size: 14.5px; box-shadow: inset 0 0 0 1px var(--border); margin-top: 6px; text-align: left; }
.quote .ic { margin-top: 2px; color: var(--accent-2); }
.draft-list { background: var(--surface); border-radius: var(--r-lg); padding: 4px 0; box-shadow: inset 0 0 0 1px var(--border); }
.textbox { position: relative; }
.textbox textarea {
  width: 100%; resize: none; border: 0; outline: 0; border-radius: 18px; padding: 14px 58px 14px 16px;
  background: var(--surface); color: var(--text); font: 16px/1.45 var(--font); box-shadow: inset 0 0 0 1px var(--border);
}
.textbox textarea:focus { box-shadow: inset 0 0 0 2px var(--accent); }
.textbox textarea::placeholder { color: var(--text-3); }
.send { position: absolute; right: 8px; bottom: 10px; width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, #8B7BFF, #6A4DF5); }
.note-box { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border-radius: 14px; background: rgba(255, 178, 36, 0.12); color: var(--warn); font-size: 13px; margin-bottom: 12px; }
.note-box .ic { margin-top: 1px; }

.help { display: flex; flex-direction: column; gap: 4px; }
.help-row { display: flex; gap: 12px; padding: 10px 2px; }
.help-row > span { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; font-size: 20px; background: var(--surface); flex: none; }
.help-row b { font-size: 15px; }
.help-row p { margin: 3px 0 0; color: var(--text-2); font-size: 14px; }

/* ───────────── Тост ───────────── */
.toast {
  position: fixed; left: 50%; top: calc(var(--safe-top) + 12px); z-index: 100;
  display: flex; align-items: center; gap: 14px; width: max-content; max-width: calc(100vw - 32px);
  padding: 12px 14px 12px 16px; border-radius: 16px; font-weight: 500; font-size: 14.5px;
  color: #fff; background: rgba(30, 30, 40, 0.92); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
  transform: translate(-50%, -140%); opacity: 0; transition: transform 0.4s var(--ease), opacity 0.3s; pointer-events: none;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; pointer-events: auto; }
.toast.err { background: rgba(200, 40, 60, 0.95); }
.toast button { color: #B9AEFF; font-weight: 700; font-size: 14px; white-space: nowrap; }

/* ───────────── Заставка и ошибки ───────────── */
#splash { position: fixed; inset: 0; z-index: 200; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; background: var(--bg); transition: opacity 0.4s; }
#splash.hide { opacity: 0; pointer-events: none; }
.splash-logo { animation: breathe 1.6s ease-in-out infinite; filter: drop-shadow(0 14px 30px rgba(124, 108, 255, 0.6)); }
.splash-dots { display: flex; gap: 6px; }
.splash-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--text-3); animation: dot 1.2s ease-in-out infinite; }
.splash-dots i:nth-child(2) { animation-delay: 0.15s; }
.splash-dots i:nth-child(3) { animation-delay: 0.3s; }
@keyframes dot { 40% { transform: translateY(-5px); background: var(--accent); } }
body:not(.ready) .tabbar { opacity: 0; }
body.is-fatal .tabbar { display: none; }
.fatal { min-height: 80vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 10px; padding: 20px; }
.fatal-ic { width: 76px; height: 76px; border-radius: 24px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, #8B7BFF, #6A4DF5); margin-bottom: 8px; }
.fatal h2 { font-size: 22px; }
.fatal p { color: var(--text-2); margin: 0 0 12px; max-width: 300px; }

@media (max-width: 360px) {
  .cb-amount { font-size: 30px; }
  .act-ic { width: 52px; height: 52px; border-radius: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}


/* ═════════════ Контент: клиенты, план, календарь ═════════════ */
.dot { width: 8px; height: 8px; border-radius: 3px; flex: none; display: inline-block; }
.shake { animation: shake 0.4s; }
@keyframes shake { 20%, 60% { transform: translateX(-7px); } 40%, 80% { transform: translateX(7px); } }
.spinner { width: 42px; height: 42px; border-radius: 50%; border: 3px solid var(--track); border-top-color: var(--accent); animation: spin 0.9s linear infinite; display: block; }
.spinner.sm { width: 18px; height: 18px; border-width: 2.5px; border-color: rgba(255, 255, 255, 0.35); border-top-color: #fff; }

.tag { display: inline-flex; align-items: center; flex: none; height: 24px; padding: 0 8px; border-radius: 8px; font-size: 11.5px; font-weight: 600; white-space: nowrap; background: var(--surface-2); color: var(--text-2); }
.tag.ok { background: var(--green-soft); color: var(--green); }
.tag.bad { background: var(--red-soft); color: var(--red); }
.tag.wip { background: rgba(255, 178, 36, 0.14); color: var(--warn); }
[data-theme="light"] .tag.wip { color: #B87400; }
.count { display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 7px; border-radius: 8px; font: 600 13px/1 var(--font); letter-spacing: 0; vertical-align: 3px; margin-left: 4px; background: var(--surface-2); color: var(--text-2); }
.count.bad { background: var(--red-soft); color: var(--red); }
.more { text-align: center; color: var(--text-3); font-size: 13px; padding-top: 10px; }
.card.hint { color: var(--text-2); font-size: 14px; text-align: center; padding: 20px 16px; margin: 0; }
.row-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.row-head .muted { margin-top: 2px; }
.icon-btn.accent { color: #fff; background: linear-gradient(135deg, #8B7BFF, #6A4DF5); box-shadow: 0 8px 20px -8px rgba(124, 108, 255, 0.8); }
.block.first { margin-top: 6px; }
.block-head h2 em { font-style: normal; font-weight: 500; font-size: 14px; color: var(--text-3); margin-left: 8px; letter-spacing: 0; }
.block-head .link { display: inline-flex; align-items: center; gap: 4px; }
.day:first-child { margin-top: 6px; }
.act-ic.warn { color: var(--warn); background: linear-gradient(rgba(255, 178, 36, 0.14), rgba(255, 178, 36, 0.14)), var(--surface); }
.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.duo.one { grid-template-columns: 1fr; }
.duo .btn { gap: 6px; padding: 0 10px; height: 42px; }
.chip-n { color: var(--text-3); font-variant-numeric: tabular-nums; }
.chip.on .chip-n { color: inherit; opacity: 0.6; }
.chips { -webkit-overflow-scrolling: touch; }

/* шапка-карта */
.cb-amount small { font-size: 0.45em; font-weight: 600; opacity: 0.85; letter-spacing: 0; margin-left: 4px; }
.cb-bar { height: 6px; border-radius: 4px; background: rgba(255, 255, 255, 0.22); overflow: hidden; margin: -6px 0 14px; }
.cb-bar i { display: block; height: 100%; min-width: 6px; border-radius: 4px; background: #fff; animation: grow-x 0.9s var(--ease) both; transform-origin: left; }
.cb-stat-ic.out { color: #5A34E0; }
.month-total span { font-size: 0.55em; font-weight: 600; color: var(--text-2); letter-spacing: 0; }
.legend.three { grid-template-columns: repeat(3, auto); justify-content: space-between; }
.legend.three .lg b { margin-left: 4px; }

/* публикация */
.pi { position: relative; display: flex; align-items: center; gap: 2px; padding: 2px 12px 2px 2px; }
.pi + .pi::before, .tx + .pi::before, .pi + .tx::before { content: ""; position: absolute; top: 0; left: 50px; right: 14px; height: 1px; background: var(--border); }
.pi-check { width: 48px; height: 48px; display: grid; place-items: center; flex: none; }
.ck { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; color: transparent; border: 2px solid color-mix(in srgb, var(--c) 75%, transparent); transition: background 0.2s, border-color 0.2s, transform 0.15s var(--ease); }
.pi-check:active .ck { transform: scale(0.82); }
.pi.done .ck { background: var(--green); border-color: var(--green); color: #fff; }
.pi-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; padding: 8px 0; text-align: left; }
.pi-title { font-weight: 600; font-size: 15px; line-height: 1.3; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.pi.done .pi-title { color: var(--text-2); text-decoration: line-through; text-decoration-color: var(--text-3); }
.pi-sub { display: flex; align-items: center; gap: 5px; color: var(--text-2); font-size: 13px; min-width: 0; }
.pi-sub .ic { color: var(--c); }
.pi-sub span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pi .tag { margin-left: 6px; }
.tx.ev.done .tx-title { color: var(--text-2); text-decoration: line-through; text-decoration-color: var(--text-3); }
.day-list.past { opacity: 0.6; }
.tx-end .tx-amt { font-size: 15px; }

/* календарь */
.cal { background: var(--surface); border-radius: var(--r-lg); padding: 12px 8px 8px; margin-bottom: 12px; box-shadow: inset 0 0 0 1px var(--border); }
.cal-head { display: flex; align-items: center; justify-content: space-between; padding: 0 4px 12px; }
.cal-head b { font: 600 17px/1.2 var(--font-display); letter-spacing: -0.01em; }
.cal-week, .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal-week span { text-align: center; font-size: 11.5px; font-weight: 600; color: var(--text-3); padding-bottom: 6px; }
.cal-day { height: 46px; border-radius: 14px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font: 600 15px/1 var(--font-display); font-variant-numeric: tabular-nums; transition: background 0.15s, transform 0.12s; }
.cal-day:active { transform: scale(0.9); }
.cal-day.out { color: var(--text-3); opacity: 0.55; }
.cal-day.today { color: var(--accent-2); }
[data-theme="light"] .cal-day.today { color: var(--accent); }
.cal-day.sel { color: #fff; background: linear-gradient(135deg, #8B7BFF, #6A4DF5); box-shadow: 0 8px 18px -8px rgba(124, 108, 255, 0.85); opacity: 1; }
.cal-dots { display: flex; gap: 2.5px; height: 5px; }
.cal-dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--c); }
.cal-day.sel .cal-dots i { background: #fff; }

/* клиенты */
.cl-av { --c: var(--accent); width: 44px; height: 44px; border-radius: 15px; display: grid; place-items: center; flex: none; font: 700 18px/1 var(--font-display); color: var(--c); background: color-mix(in srgb, var(--c) 17%, transparent); }
.cl-av.sm { width: 34px; height: 34px; border-radius: 11px; font-size: 15px; }
.cl-av.lg { width: 54px; height: 54px; border-radius: 18px; font-size: 23px; }
.cl-card.archived { opacity: 0.55; }
.cl-top { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.cl-text { flex: 1; min-width: 0; }
.cl-name { font: 600 16.5px/1.25 var(--font-display); letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cl-sub { color: var(--text-2); font-size: 13px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cl-bar { height: 6px; border-radius: 4px; background: var(--track); overflow: hidden; }
.cl-bar i { display: block; height: 100%; border-radius: 4px; background: var(--c, var(--accent)); animation: grow-x 0.8s var(--ease) both; transform-origin: left; }
.no-anim .cl-bar i, .no-anim .cb-bar i { animation: none; }
.cl-foot { display: flex; justify-content: space-between; gap: 10px; margin-top: 9px; font-size: 12.5px; color: var(--text-2); }
.ch { display: flex; align-items: center; gap: 12px; padding: 4px 0 16px; }
.ch-text { flex: 1; min-width: 0; }
.ch-name { font: 700 20px/1.2 var(--font-display); letter-spacing: -0.02em; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.ch-sub { color: var(--text-2); font-size: 13.5px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pay-pill { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; padding: 8px 11px; border-radius: 13px; background: var(--red-soft); color: var(--red); transition: transform 0.15s var(--ease); }
.pay-pill:active { transform: scale(0.95); }
.pay-pill b { font: 600 15px/1.2 var(--font-display); font-variant-numeric: tabular-nums; white-space: nowrap; }
.pay-pill span { font-size: 11.5px; font-weight: 600; }
.pay-pill.on { background: var(--green-soft); color: var(--green); }

/* строки настроек и карточки клиента */
.group-title.first { padding-top: 4px; }
.row-l small { display: block; color: var(--text-2); font-size: 12.5px; font-weight: 400; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-l.accent { color: var(--accent-2); font-weight: 600; }
[data-theme="light"] .row-l.accent { color: var(--accent); }
.row-v { max-width: 58%; overflow: hidden; text-overflow: ellipsis; }
.row-v.empty { color: var(--text-3); }
.row-ic.money { background: var(--green-soft); color: var(--green); }
.row.pay:active { background: none; }
.pay-sum { font: 600 15px/1 var(--font-display); font-variant-numeric: tabular-nums; padding: 9px 10px; border-radius: 11px; background: var(--surface-2); white-space: nowrap; }
.link-row { padding: 0 10px 0 0; }
.link-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 8px 0 8px 14px; min-height: 54px; text-align: left; }
.card.about { white-space: pre-wrap; word-break: break-word; font-size: 14.5px; line-height: 1.45; margin-bottom: 0; }

/* заметки */
.note { display: flex; flex-direction: column; gap: 8px; }
.note.pinned { background: linear-gradient(135deg, rgba(255, 178, 36, 0.11), transparent 70%), var(--surface); }
.note-pin { display: inline-flex; align-items: center; gap: 5px; color: var(--warn); font-size: 12px; font-weight: 600; }
.note-text { font-size: 15px; line-height: 1.45; white-space: pre-wrap; word-break: break-word; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 8; -webkit-box-orient: vertical; }
.note-foot { display: flex; align-items: center; gap: 6px; color: var(--text-2); font-size: 12.5px; }

/* формы */
.label.first { margin-top: 2px; }
.sheet-body .field { margin-top: 8px; }
.field:focus-within, .area:focus { box-shadow: inset 0 0 0 2px var(--accent); }
.field .suffix { color: var(--text-2); font-weight: 600; }
.field .icon-btn.sm { margin-right: -6px; flex: none; }
.field .icon-btn.go { color: #fff; background: linear-gradient(135deg, #8B7BFF, #6A4DF5); }
.area { display: block; width: 100%; resize: none; border: 0; outline: 0; border-radius: 16px; padding: 13px 14px; background: var(--surface); color: var(--text); font: 16px/1.45 var(--font); box-shadow: inset 0 0 0 1px var(--border); }
.area::placeholder { color: var(--text-3); }
.field + .area, .area + .field { margin-top: 8px; }
.sheet-body .chips { padding-bottom: 2px; margin: 0 -16px; padding-left: 16px; padding-right: 16px; }
.sheet-body .seg { margin-bottom: 0; }
.date-row { margin-top: 0; }
.date-row .chip { height: 38px; }
.chip.date-pick.on { background: var(--accent-soft); color: var(--accent-2); box-shadow: none; }
[data-theme="light"] .chip.date-pick.on { color: var(--accent); }
.row.date-pick { cursor: pointer; }
.colors { display: flex; flex-wrap: wrap; gap: 12px; padding: 2px 4px 4px; }
.colors button { width: 32px; height: 32px; border-radius: 50%; background: var(--c); transition: transform 0.15s var(--ease); }
.colors button.on { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--c); transform: scale(0.92); }
.sheet .actions { margin: 4px 0 6px; }
.sheet .examples { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 10px -16px 12px; padding: 0 16px; }
.sheet .examples::-webkit-scrollbar { display: none; }
.send .spinner { margin: 0 auto; }

/* импорт и черновик */
.opt { position: relative; overflow: hidden; display: flex; align-items: center; gap: 12px; width: 100%; padding: 13px 14px; margin-top: 14px; border-radius: var(--r-md); background: var(--surface); box-shadow: inset 0 0 0 1px var(--border); cursor: pointer; }
.opt:active { background: var(--surface-2); }
.opt input[type="file"] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.opt-ic { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; flex: none; color: #fff; background: linear-gradient(135deg, #8B7BFF, #6A4DF5); }
.opt-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.opt-text b { font-size: 15px; }
.opt-text span { color: var(--text-2); font-size: 13px; }
.opt > .ic { color: var(--text-3); }
.busy { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 44px 0 40px; text-align: center; color: var(--text-2); font-size: 14px; }
.busy b { color: var(--text); font: 600 17px/1.3 var(--font-display); margin-top: 12px; }
[hidden] { display: none !important; }
.dr { position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 8px 10px 14px; }
.dr + .dr::before { content: ""; position: absolute; top: 0; left: 70px; right: 14px; height: 1px; background: var(--border); }
.dr-main { flex: 1; min-width: 0; }
.dr-title { font-weight: 600; font-size: 15px; line-height: 1.3; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.dr-sub { color: var(--text-2); font-size: 13px; margin-top: 2px; }
.sheet .quote { margin: 0 0 4px; }

@media (max-width: 360px) {
  .cal-day { height: 42px; font-size: 14px; }
  .legend.three { font-size: 12px; }
}
.sheet-note { color: var(--text-2); font-size: 14px; line-height: 1.4; margin: -4px 4px 10px; }
.group-note { color: var(--text-3); font-size: 12.5px; line-height: 1.4; padding: 8px 6px 0; }
.cb-stat-v small { font-size: 0.8em; font-weight: 500; opacity: 0.8; }
