/* ============ Финдир — стили ============ */
/* Чёрный + оранжевый. Display — Unbounded, текст — Onest. */
/* Цвета берутся из темы daisyUI (--color-*); ниже — производные для своих компонентов */
:root {
  --bg: var(--color-base-100);
  --bg-2: color-mix(in oklab, var(--color-base-100), var(--color-base-content) 3%);
  --card: color-mix(in oklab, var(--color-base-100), var(--color-base-content) 7%);
  --card-2: color-mix(in oklab, var(--color-base-100), var(--color-base-content) 11%);
  --text: var(--color-base-content);
  --text-2: color-mix(in oklab, var(--color-base-content) 62%, transparent);
  --text-3: color-mix(in oklab, var(--color-base-content) 36%, transparent);
  --line: color-mix(in oklab, var(--color-base-content) 9%, transparent);
  --glass-bg: var(--card);
  --rim-a: rgba(255, 255, 255, .12);
  --rim-b: rgba(255, 255, 255, .04);
  --shadow: none;
  --accent: var(--color-primary);
  --accent-2: color-mix(in oklab, var(--color-primary), #fff 30%);
  --accent-soft: color-mix(in oklab, var(--color-primary) 16%, transparent);
  --accent-grad: var(--color-primary);
  --on-accent: var(--color-primary-content);
  --c-needs: var(--color-base-content);
  --c-wants: var(--color-primary);
  --c-buffer: var(--color-warning);
  --c-save: var(--color-success);
  --good: var(--color-success);
  --warn: var(--color-warning);
  --bad: var(--color-error);
  --display: "Unbounded", "Onest", -apple-system, sans-serif;
  --radius: 26px;
  --tab-h: 70px;
  --safe-b: max(var(--tg-safe-area-inset-bottom, 0px), env(safe-area-inset-bottom, 0px));
  /* Сверху: вырез/статус-бар + кнопки Telegram («Закрыть», «…») в полноэкранном режиме.
     Переменные --tg-* выставляет Telegram (и наш app.js); вне Telegram берём env(). */
  --safe-t: calc(max(var(--tg-safe-area-inset-top, 0px), env(safe-area-inset-top, 0px)) + var(--tg-content-safe-area-inset-top, 0px));
}

/* Свои темы Финдира в формате daisyUI (фон всегда чёрный) */
[data-theme^="fd-"] {
  color-scheme: dark;
  --color-base-100: #050505; --color-base-200: #0e0e0e; --color-base-300: #161616; --color-base-content: #f6f1ea;
  --color-primary: #ff5b14; --color-primary-content: #0a0a0a;
  --color-secondary: #ffb547; --color-secondary-content: #0a0a0a;
  --color-accent: #d4ff5c; --color-accent-content: #0a0a0a;
  --color-neutral: #1a1a1a; --color-neutral-content: #f6f1ea;
  --color-info: #6ee7ff; --color-info-content: #0a0a0a;
  --color-success: #d4ff5c; --color-success-content: #0a0a0a;
  --color-warning: #ffb547; --color-warning-content: #0a0a0a;
  --color-error: #ff4d4d; --color-error-content: #0a0a0a;
  --radius-selector: 1rem; --radius-field: 1rem; --radius-box: 1.5rem;
  --size-selector: .25rem; --size-field: .3125rem;
  --border: 1px; --depth: 1; --noise: 0;
}
[data-theme="fd-lime"] { --color-primary: #c8ff2e; --color-accent: #6ee7ff; --color-success: #6ee7ff; }
[data-theme="fd-blue"] { --color-base-100: #04060d; --color-primary: #3366ff; --color-primary-content: #ffffff; --color-accent: #5cf2c0; --color-success: #5cf2c0; --color-warning: #ffc35c; }
[data-theme="fd-pink"] { --color-base-100: #070406; --color-primary: #e0115f; --color-primary-content: #ffffff; --color-accent: #b7ff8a; --color-success: #b7ff8a; }
[data-theme="fd-mint"] { --color-base-100: #030806; --color-primary: #1fe08f; --color-primary-content: #03120b; --color-accent: #ffd25c; --color-success: #ffd25c; --color-warning: #ff9f5c; }
[data-theme="fd-mono"] { --color-primary: #f6f1ea; --color-accent: #4d4d4d; --color-success: #f6f1ea; --color-warning: #b3b3b3; }
:root[data-mode="light"] {
  --bg: var(--color-base-200);
  --bg-2: var(--color-base-100);
  --card: var(--color-base-100);
  --card-2: color-mix(in oklab, var(--color-base-100), var(--color-base-content) 5%);
  --accent-2: color-mix(in oklab, var(--color-primary), #000 18%);
  --rim-a: rgba(0, 0, 0, .06); --rim-b: rgba(0, 0, 0, .02);
}
[data-theme="fd-paper"] {
  color-scheme: light;
  --color-base-100: #fffdf9; --color-base-200: #f2eee6; --color-base-300: #e8e2d6; --color-base-content: #141210;
  --color-primary: #ff5b14; --color-primary-content: #0a0a0a;
  --color-accent: #22a356; --color-success: #22a356; --color-warning: #d98b00; --color-error: #e0362c;
  --color-neutral: #141210; --color-neutral-content: #fffdf9;
}
:root[data-mode="light"] .glass { box-shadow: 0 10px 30px -18px rgba(40, 30, 20, .25); }
:root[data-mode="light"] #toast { background: rgba(255, 255, 255, .95); color: var(--text); box-shadow: 0 8px 30px rgba(0, 0, 0, .15); }
:root[data-mode="light"] .seg button.on { background: var(--text); color: var(--bg); box-shadow: none; }
:root[data-theme="fd-mono"] { --c-needs: #7d7d7d; --c-save: #4d4d4d; --accent-2: #ffffff; }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: "Onest", -apple-system, "SF Pro Display", "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.4;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "tnum" 1;
}
/* сброс в слое base, чтобы компоненты daisyUI (слой daisyui) были сильнее */
@layer base {
  button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; padding: 0; }
  input, select, textarea { font: inherit; color: inherit; }
}
svg.i { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- живой фон ---------- */
.bg { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; background: radial-gradient(120% 80% at 50% 0%, var(--bg-2), var(--bg)); }
.blob { position: absolute; width: 70vmax; height: 70vmax; border-radius: 50%; opacity: .55; will-change: transform; }
.b1 { background: radial-gradient(circle, rgba(143, 124, 255, .55), transparent 60%); top: -30vmax; left: -25vmax; animation: drift1 26s ease-in-out infinite alternate; }
.b2 { background: radial-gradient(circle, rgba(79, 227, 214, .38), transparent 60%); top: 20vh; right: -35vmax; animation: drift2 32s ease-in-out infinite alternate; }
.b3 { background: radial-gradient(circle, rgba(255, 115, 176, .32), transparent 60%); bottom: -40vmax; left: -10vmax; animation: drift3 38s ease-in-out infinite alternate; }
:root[data-mode="light"] .blob { opacity: .5; }
@keyframes drift1 { to { transform: translate(12vmax, 10vmax) scale(1.1); } }
@keyframes drift2 { to { transform: translate(-14vmax, 8vmax) scale(.9); } }
@keyframes drift3 { to { transform: translate(10vmax, -12vmax) scale(1.15); } }

/* ---------- стекло ---------- */
.glass {
  position: relative;
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(22px) saturate(170%);
  backdrop-filter: blur(22px) saturate(170%);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  isolation: isolate;
}
.glass::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none;
  background: linear-gradient(140deg, var(--rim-a), var(--rim-b) 35%, transparent 55%, var(--rim-b) 80%, rgba(255, 255, 255, .25));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
}

/* ---------- каркас ---------- */
#app {
  position: relative; z-index: 1;
  max-width: 560px; margin: 0 auto;
  padding: calc(14px + var(--safe-t)) 16px calc(var(--tab-h) + 44px + var(--safe-b));
}
.screen { animation: screenIn .45s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes screenIn { from { opacity: 0; transform: translateY(10px) scale(.99); } to { opacity: 1; transform: none; } }
.stack > * + * { margin-top: 14px; }

.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 2px 18px; }
.top h1 { font-size: 28px; line-height: 1.1; letter-spacing: -.02em; margin: 0; font-weight: 700; }
.top .sub { color: var(--text-2); font-size: 13px; margin-bottom: 4px; }
.top .sub::first-letter { text-transform: uppercase; }
.icon-btn { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; flex: none; transition: transform .2s; }
.icon-btn:active { transform: scale(.9); }

.card { padding: 18px; }
.card-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.card-h h3 { margin: 0; white-space: nowrap; font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
.card-h .link { color: var(--accent); font-size: 13px; font-weight: 500; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.small { font-size: 13px; }
.tiny { font-size: 11.5px; }
.label { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); font-weight: 600; }

/* ---------- герой ---------- */
.hero { padding: 22px 20px 20px; overflow: hidden; }
.hero::after {
  content: ""; position: absolute; inset: -40% -20% auto auto; width: 70%; height: 140%; border-radius: 50%;
  background: radial-gradient(circle, rgba(143, 124, 255, .35), transparent 65%); z-index: -1;
}
.big { font-size: 44px; font-weight: 700; letter-spacing: -.035em; line-height: 1.05; margin: 6px 0 4px; }
.big small { font-size: 22px; font-weight: 600; opacity: .55; margin-left: 4px; }
.grad-text { background: var(--accent-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

.meter { position: relative; height: 10px; border-radius: 10px; background: rgba(127, 127, 160, .16); overflow: visible; margin-top: 16px; }
.meter > b { position: absolute; inset: 0 auto 0 0; border-radius: inherit; background: var(--accent-grad); transition: width .8s cubic-bezier(.2, .8, .2, 1); }
.meter > b.over { background: linear-gradient(90deg, var(--warn), var(--bad)); }
.meter > i { position: absolute; top: -5px; bottom: -5px; width: 2px; border-radius: 2px; background: var(--text); opacity: .7; }
.meter-legend { display: flex; justify-content: space-between; margin-top: 9px; font-size: 12px; color: var(--text-2); }

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; font-size: 13px; background: rgba(127, 127, 160, .14); white-space: nowrap; }
.chip b { font-weight: 600; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }

/* ---------- сетка групп ---------- */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.mini { padding: 14px; display: flex; gap: 12px; align-items: center; }
.mini .t { font-size: 12px; color: var(--text-2); }
.mini .v { font-size: 16px; font-weight: 600; letter-spacing: -.01em; }
.ring { width: 44px; height: 44px; flex: none; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 5; stroke-linecap: round; }
.ring .track { stroke: rgba(127, 127, 160, .18); }
.ring .val { transition: stroke-dashoffset 1s cubic-bezier(.2, .8, .2, 1); }

/* ---------- советы ---------- */
.tips { display: flex; flex-direction: column; gap: 10px; }
.tip { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 18px; background: rgba(127, 127, 160, .1); }
.tip .ic { width: 32px; height: 32px; border-radius: 11px; display: grid; place-items: center; flex: none; }
.tip .ic svg { width: 18px; height: 18px; }
.tip p { margin: 0; font-size: 13.5px; line-height: 1.4; }
.tip p b { font-weight: 600; }

/* ---------- операции ---------- */
.list { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; gap: 12px; padding: 10px 0; width: 100%; text-align: left; }
.row + .row { border-top: 1px solid var(--line); }
.cat-ic { width: 40px; height: 40px; border-radius: 14px; display: grid; place-items: center; flex: none; position: relative; }
.cat-ic svg { width: 20px; height: 20px; }
.row .mid { flex: 1; min-width: 0; }
.row .name { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .meta { font-size: 12px; color: var(--text-3); }
.row .amt { font-weight: 600; white-space: nowrap; }
.amt.plus { color: var(--good); }
.amt.save { color: var(--c-save); }
.day-h { font-size: 12px; color: var(--text-3); margin: 14px 0 2px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }

.empty { text-align: center; padding: 22px 10px; color: var(--text-2); font-size: 14px; }
.empty .em { font-size: 34px; margin-bottom: 6px; }

/* ---------- бюджет ---------- */
.seg { display: flex; gap: 6px; padding: 5px; border-radius: 18px; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button { flex: 1; padding: 9px 8px; border-radius: 13px; font-weight: 600; font-size: 13.5px; color: var(--text-2); white-space: nowrap; transition: background .3s, color .3s; }
.seg button.on { color: var(--text); background: rgba(255, 255, 255, .14); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 4px 14px rgba(0, 0, 0, .25); }

.donut-wrap { display: flex; align-items: center; gap: 18px; }
.donut { width: 150px; height: 150px; flex: none; position: relative; }
.donut svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.donut circle { fill: none; stroke-width: 16; }
.donut .c { position: absolute; inset: 19%; display: grid; place-content: center; justify-items: center; text-align: center; overflow: hidden; }
.donut .c b { font-size: 19px; letter-spacing: -.02em; }
.ring-amt { display: inline-flex; align-items: center; gap: 3px; margin-top: 2px; }
.ring-amt > span { display: flex; flex-direction: column; align-items: flex-end; }
.ring-amt b { display: block; line-height: 1.02; font-variant-numeric: tabular-nums; }
.ring-amt i { font-style: normal; font-size: 15px; font-weight: 600; color: var(--text-2); }
.legend { flex: 1; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.legend .li { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.legend .li > span:not(.dot) { flex: 1; color: var(--text-2); }
.legend .li b { font-weight: 600; }

.cat-line { display: grid; grid-template-columns: 40px 1fr; gap: 12px; align-items: center; padding: 9px 0; }
.cat-line + .cat-line { border-top: 1px solid var(--line); }
.cat-line .top-l { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; }
.cat-line .top-l b { font-weight: 600; white-space: nowrap; }
.bar { height: 6px; border-radius: 6px; background: rgba(127, 127, 160, .16); margin-top: 7px; overflow: hidden; }
.bar > b { display: block; height: 100%; border-radius: inherit; transition: width .8s cubic-bezier(.2, .8, .2, 1); }
.group-h { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.group-h h3 { margin: 0; font-size: 15px; flex: 1; }
.group-h .pct { font-size: 12px; padding: 3px 9px; border-radius: 99px; font-weight: 600; }

.pay { padding: 16px; }
.pay-h { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.pay-h b { font-size: 20px; letter-spacing: -.02em; }
.alloc { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.alloc .a { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.alloc .a > span:not(.dot) { flex: 1; }
.alloc .a b { font-weight: 600; }
.stackbar { display: flex; height: 8px; border-radius: 8px; overflow: hidden; margin-top: 12px; gap: 2px; }
.stackbar > i { display: block; height: 100%; }

details.rule { border-top: 1px solid var(--line); padding: 12px 0; }
details.rule:first-of-type { border-top: 0; padding-top: 2px; }
details.rule summary { list-style: none; cursor: pointer; font-weight: 600; display: flex; justify-content: space-between; gap: 10px; align-items: center; }
details.rule summary::-webkit-details-marker { display: none; }
details.rule summary::after { content: "+"; font-size: 20px; color: var(--text-3); transition: transform .3s; }
details.rule[open] summary::after { transform: rotate(45deg); }
details.rule p { margin: 8px 0 0; color: var(--text-2); font-size: 13.5px; }

/* ---------- хотелки ---------- */
.wish { padding: 16px; }
.wish-top { display: flex; gap: 12px; align-items: center; }
.wish-top .mid { flex: 1; min-width: 0; }
.wish-top .name { font-weight: 600; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wish-top .price { font-weight: 700; font-size: 17px; white-space: nowrap; }
.timer { font-size: 13px; color: var(--text-2); margin-top: 12px; display: flex; justify-content: space-between; }
.wish-actions { display: flex; gap: 8px; margin-top: 12px; }
.wish.done { opacity: .55; }

/* ---------- капитал ---------- */
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.kpi { padding: 10px 12px; border-radius: 16px; background: rgba(127, 127, 160, .1); }
.kpi .t { font-size: 11.5px; color: var(--text-2); }
.kpi .v { font-weight: 700; font-size: 15px; letter-spacing: -.01em; margin-top: 2px; white-space: nowrap; }
.chart { width: 100%; height: 170px; display: block; margin-top: 8px; overflow: visible; }
.chart text { fill: var(--text-3); font-size: 10px; font-family: inherit; }
.range { width: 100%; margin: 8px 0 4px; --range-fill: 1; color: var(--accent); }
.slider-h { display: flex; justify-content: space-between; font-size: 13px; color: var(--text-2); margin-top: 12px; }
.slider-h b { color: var(--text); font-weight: 600; }
.alloc-bar { display: flex; height: 14px; border-radius: 10px; overflow: hidden; gap: 3px; margin: 6px 0 14px; }
.alloc-bar i { display: block; border-radius: 4px; }

/* ---------- кнопки (daisyUI btn) ---------- */
.btn { gap: 8px; font-weight: 600; font-size: 15px; transition: transform .2s cubic-bezier(.3, .7, .4, 1.5), opacity .2s, background-color .2s; }
.btn:active { transform: scale(.96); }
.btn-sm { font-size: 14px; flex: 1; }
.btn:not(.btn-primary):not(.btn-soft):not(.btn-ghost) { background: var(--card-2); border-color: var(--line); color: var(--text); }
.btn[disabled] { opacity: .4; pointer-events: none; }
.btn-primary { --btn-shadow: 0 12px 30px -8px color-mix(in oklab, var(--color-primary) 60%, transparent); }

/* ---------- Liquid Glass таббар ---------- */
.tabbar {
  position: fixed; z-index: 20; left: 50%; transform: translateX(-50%);
  bottom: max(8px, calc(var(--safe-b) - 14px));
  width: min(calc(100% - 24px), 460px); height: var(--tab-h);
  border-radius: 999px; display: flex; align-items: center; padding: 0 8px;
  --glass: color-mix(in oklab, var(--bg) 38%, transparent);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .16), rgba(255, 255, 255, 0) 42%, rgba(255, 255, 255, .05)),
    var(--glass);
  -webkit-backdrop-filter: blur(20px) saturate(185%);
  backdrop-filter: blur(20px) saturate(185%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .38),
    inset 0 -1px 0 rgba(255, 255, 255, .08),
    0 14px 34px -10px rgba(0, 0, 0, .6),
    0 1px 3px rgba(0, 0, 0, .22);
}
:root[data-mode="light"] .tabbar {
  --glass: color-mix(in oklab, var(--bg) 52%, transparent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .95), inset 0 -1px 0 rgba(255, 255, 255, .5), 0 0 0 .5px rgba(0, 0, 0, .07), 0 14px 34px -12px rgba(30, 30, 70, .32);
}
/* стеклянная кромка: блик сверху-слева и снизу-справа */
.tabbar::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none;
  background: linear-gradient(120deg, rgba(255, 255, 255, .75), rgba(255, 255, 255, .08) 28%, rgba(255, 255, 255, 0) 62%, rgba(255, 255, 255, .4));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
}
/* мягкий световой блик по стеклу */
.tabbar::after {
  content: ""; position: absolute; inset: 1px; border-radius: inherit; pointer-events: none;
  background: radial-gradient(60% 90% at 22% -20%, rgba(255, 255, 255, .22), transparent 70%);
}
.tabbar[hidden] { display: none; }
.tab {
  flex: 1; height: 56px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--text-2); font-size: 10.5px; font-weight: 600; position: relative; z-index: 2;
  transition: color .35s, transform .35s cubic-bezier(.3, .7, .4, 1.5);
}
.tab svg { width: 24px; height: 24px; transition: transform .45s cubic-bezier(.3, .7, .4, 1.6); }
.tab.on { color: var(--text); }
.tab.on svg { transform: translateY(-1px) scale(1.08); }
.tab:active { transform: scale(.9); }
.tab-pill {
  position: absolute; z-index: 1; top: 7px; height: 56px; left: 0; width: 70px; border-radius: 999px;
  background:
    radial-gradient(90% 120% at 30% 0%, rgba(255, 255, 255, .35), transparent 60%),
    linear-gradient(180deg, rgba(255, 255, 255, .16), rgba(255, 255, 255, .05));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6), inset 0 -1px 1px rgba(255, 255, 255, .15), inset 0 0 12px rgba(255, 255, 255, .08), 0 6px 18px rgba(0, 0, 0, .25);
  transition: transform .6s cubic-bezier(.34, 1.45, .5, 1), width .6s cubic-bezier(.34, 1.45, .5, 1);
}
:root[data-mode="light"] .tab-pill { background: linear-gradient(180deg, rgba(255, 255, 255, 1), rgba(255, 255, 255, .7)); box-shadow: inset 0 1px 0 #fff, 0 6px 18px rgba(40, 40, 90, .16); }
.tab-pill.squish { animation: squish .6s cubic-bezier(.3, .7, .4, 1); }
@keyframes squish { 30% { scale: 1.18 .86; } 60% { scale: .96 1.04; } 100% { scale: 1 1; } }

.fab-slot { flex: 0 0 72px; display: grid; place-items: center; z-index: 3; }
.fab {
  width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; color: #0b0b14;
  background: var(--accent-grad);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .65), inset 0 -4px 10px rgba(40, 20, 120, .35), 0 10px 26px -6px rgba(143, 124, 255, .9);
  transition: transform .4s cubic-bezier(.3, .7, .4, 1.6);
  position: relative; overflow: hidden;
}
.fab::after { content: ""; position: absolute; top: 3px; left: 12px; right: 12px; height: 45%; border-radius: 50%; background: linear-gradient(180deg, rgba(255, 255, 255, .55), transparent); }
.fab svg { width: 28px; height: 28px; stroke-width: 2.4; }
.fab:active { transform: scale(.86) rotate(90deg); }

/* ---------- шторка ---------- */
#sheet-root { position: fixed; inset: 0; z-index: 50; pointer-events: none; }
#sheet-root.open { pointer-events: auto; }
.scrim { position: absolute; inset: 0; background: rgba(0, 0, 0, .55); touch-action: none; opacity: 0; transition: opacity .35s; }
#sheet-root.open .scrim { opacity: 1; }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; margin: 0 auto; max-width: 560px;
  max-height: calc(100vh - 12px - var(--safe-t)); overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; touch-action: pan-y;
  border-radius: 30px 30px 0 0; padding: 10px 18px calc(22px + var(--safe-b));
  background: #15151f; box-shadow: 0 -1px 0 rgba(255, 255, 255, .08), 0 -20px 50px rgba(0, 0, 0, .5);
  transform: translateY(105%); transition: transform .5s cubic-bezier(.2, .9, .25, 1);
}
:root[data-mode="light"] .sheet { background: var(--color-base-100); box-shadow: 0 -20px 50px rgba(40, 40, 90, .18); }
#sheet-root.open .sheet { transform: none; }
.grabber { height: 8px; }
.sheet h2 { margin: 0 0 4px; font-size: 22px; letter-spacing: -.02em; }
.sheet .lead { color: var(--text-2); margin: 0 0 16px; font-size: 14px; }

.amount-in { display: flex; align-items: baseline; justify-content: center; gap: 6px; margin: 10px 0 16px; }
.amount-in input {
  width: 2ch; min-width: 1ch; max-width: 100%; background: none; border: 0; outline: none; text-align: center; padding: 0;
  font-size: 52px; font-weight: 700; letter-spacing: -.04em; caret-color: var(--accent);
}
.amount-in input::placeholder { color: var(--text-3); }
.amount-in span { font-size: 30px; font-weight: 600; color: var(--text-3); }

.cat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.cat-btn { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 4px; border-radius: 18px; font-size: 11px; color: var(--text-2); transition: background .25s, transform .25s; text-align: center; line-height: 1.15; min-width: 0; overflow-wrap: anywhere; hyphens: auto; }
.cat-btn:active { transform: scale(.94); }
.cat-btn.on { background: rgba(127, 127, 160, .18); color: var(--text); box-shadow: inset 0 0 0 1.5px var(--cc, var(--accent)); }

.field { display: flex; flex-direction: column; gap: 6px; margin-top: 14px; }
.field label { font-size: 13px; color: var(--text-2); font-weight: 500; }
.field .input, .field .select { width: 100%; height: 50px; font-size: 16px; background: var(--card-2); border-color: var(--line); }
.field .input:focus, .field .select:focus, .field .input:focus-within { border-color: var(--accent); outline: none; box-shadow: none; }
.field .hint { font-size: 12px; color: var(--text-3); }
.row2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.field .input, .field .select { min-width: 0; max-width: 100%; }
.field input[type="date"] { display: flex; align-items: center; }
.field input[type="date"]::-webkit-date-and-time-value { text-align: left; }
.row2 .field { margin-top: 14px; }
.actions { display: flex; gap: 10px; margin-top: 20px; }

/* ---------- стоп-кран ---------- */
.stop-badge { width: 72px; height: 72px; border-radius: 24px; margin: 6px auto 12px; display: grid; place-items: center; background: linear-gradient(135deg, #ff8a5c, #ff4d7d); box-shadow: 0 14px 30px -10px rgba(255, 77, 125, .8), inset 0 2px 0 rgba(255, 255, 255, .5); color: #fff; animation: pulse 1.6s ease-in-out infinite; }
.stop-badge svg { width: 36px; height: 36px; stroke-width: 2.2; }
@keyframes pulse { 50% { transform: scale(1.06); } }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 16px 0 6px; }
.fact { padding: 12px; border-radius: 16px; background: rgba(127, 127, 160, .1); }
.fact b { display: block; font-size: 20px; letter-spacing: -.02em; }
.fact span { font-size: 12px; color: var(--text-2); }

/* ---------- онбординг ---------- */
.onb { min-height: calc(100vh - 60px); display: flex; flex-direction: column; justify-content: center; padding-bottom: 20px; }
.onb .logo { width: 84px; height: 84px; border-radius: 28px; display: grid; place-items: center; margin-bottom: 22px; background: var(--accent-grad); color: #0b0b14; box-shadow: 0 20px 40px -12px rgba(143, 124, 255, .9), inset 0 2px 0 rgba(255, 255, 255, .6); }
.onb .logo svg { width: 42px; height: 42px; stroke-width: 2; }
.onb h1 { font-size: 34px; line-height: 1.08; letter-spacing: -.03em; margin: 0 0 12px; }
.onb p.lead { color: var(--text-2); font-size: 16px; margin: 0 0 22px; }
.steps { display: flex; gap: 6px; margin-bottom: 22px; }
.steps i { height: 4px; flex: 1; border-radius: 4px; background: rgba(127, 127, 160, .22); transition: background .4s; }
.steps i.on { background: var(--accent-grad); }
.feat { display: flex; gap: 12px; align-items: center; padding: 10px 0; }
.feat .cat-ic { width: 38px; height: 38px; }

/* ---------- тост ---------- */
#toast {
  position: fixed; z-index: 60; left: 50%; top: calc(14px + var(--safe-t));
  transform: translate(-50%, -140%); padding: 12px 18px; border-radius: 999px; font-weight: 600; font-size: 14px;
  background: rgba(30, 30, 46, .85); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 10px 30px rgba(0, 0, 0, .4);
  transition: transform .5s cubic-bezier(.3, .8, .3, 1.3), opacity .3s, visibility 0s .5s; white-space: nowrap; color: #fff;
  opacity: 0; visibility: hidden; pointer-events: none;
}
#toast.show { transform: translate(-50%, 0); opacity: 1; visibility: visible; transition: transform .5s cubic-bezier(.3, .8, .3, 1.3), opacity .2s; }

.disclaimer { font-size: 11.5px; color: var(--text-3); line-height: 1.45; margin-top: 4px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
@media (max-width: 360px) {
  .big { font-size: 38px; }
  .donut { width: 124px; height: 124px; }
  .tab span { display: none; }
}


/* ============ Чёрно-оранжевая тема: компоненты ============ */
.bg { background: var(--bg); }
.blob { opacity: .5; }
.b1 { background: radial-gradient(circle, color-mix(in srgb, var(--accent) 34%, transparent), transparent 60%); }
.b2 { background: radial-gradient(circle, color-mix(in srgb, var(--accent-2) 12%, transparent), transparent 60%); }
.b3 { background: radial-gradient(circle, color-mix(in srgb, var(--accent) 14%, transparent), transparent 60%); }

.glass { background: var(--card); border: 1px solid var(--line); -webkit-backdrop-filter: none; backdrop-filter: none; }
.glass::before { display: none; }

.top h1, .big, .donut .c b, .onb h1, .sheet h2, .stop-badge + h2, .pay-h b, .kpi .v, .mini .v, .fact b, .wish-top .price { font-family: var(--display); font-weight: 600; letter-spacing: -.02em; }
.top h1 { font-size: 24px; }
.big { font-weight: 700; }
.onb h1 { font-size: 30px; line-height: 1.12; }
.mini .v, .kpi .v { font-size: 14px; }
.pay-h b { font-size: 18px; }

/* Главный блок — сплошной оранжевый с чёрным текстом */
.hero { background: var(--accent); border-color: transparent; color: var(--on-accent); }
.hero::after { background: radial-gradient(circle, rgba(255, 255, 255, .32), transparent 65%); z-index: 0; }
.hero > * { position: relative; z-index: 1; }
.hero .label, .hero .muted { color: color-mix(in srgb, var(--on-accent) 66%, transparent); }
.hero .grad-text { background: none; -webkit-background-clip: border-box; background-clip: border-box; color: var(--on-accent); }
.hero .big small { opacity: .55; }
.hero .meter { background: rgba(0, 0, 0, .16); }
.hero .meter > b { background: var(--on-accent); }
.hero .meter > b.over { background: #7a0d00; }
.hero .meter > i { background: var(--on-accent); opacity: .5; }
.hero .meter-legend { color: color-mix(in srgb, var(--on-accent) 72%, transparent); font-weight: 600; }
.hero .kpi { background: rgba(0, 0, 0, .12); }
.hero .kpi .t { color: color-mix(in srgb, var(--on-accent) 62%, transparent); }
.hero .kpi .v { color: var(--on-accent) !important; }
.hero .btn-primary { --btn-color: #0a0a0a; --btn-fg: #fff; --btn-shadow: none; }

.grad-text { background: none; -webkit-background-clip: border-box; background-clip: border-box; color: var(--accent-2); }


.seg { background: var(--card); }
.seg button.on { background: var(--text); color: var(--bg); box-shadow: none; }

.chip.badge { height: auto; padding: 7px 12px; font-size: 13px; font-weight: 600; color: var(--accent-2); }
.card-h .link { color: var(--accent-2); }
.tip { background: var(--card-2); }
.kpi { background: var(--card-2); }
.fact { background: var(--card-2); }
.cat-btn.on { background: var(--card-2); }
.meter > b { background: var(--accent); }
.bar > b { transition: width .8s cubic-bezier(.2, .8, .2, 1); }

.onb .logo { background: var(--accent); color: var(--on-accent); box-shadow: inset 0 2px 0 rgba(255, 255, 255, .5), 0 20px 40px -12px color-mix(in srgb, var(--accent) 70%, transparent); }
.steps i.on { background: var(--accent); }

.tab-pill { background: radial-gradient(90% 120% at 30% 0%, rgba(255, 255, 255, .3), transparent 60%), linear-gradient(180deg, rgba(255, 255, 255, .16), rgba(255, 255, 255, .05)); }
.fab { background: var(--accent); color: var(--on-accent); box-shadow: inset 0 2px 0 rgba(255, 255, 255, .55), inset 0 -4px 10px rgba(0, 0, 0, .25), 0 10px 28px -4px color-mix(in srgb, var(--accent) 75%, transparent); }

.sheet { background: #111; box-shadow: 0 -1px 0 rgba(255, 255, 255, .1), 0 -20px 50px rgba(0, 0, 0, .6); }
#toast { background: rgba(26, 26, 26, .92); }

/* ============ Палитры ============ */
:root[data-theme="fd-mono"] .hero::after { background: radial-gradient(circle, rgba(0, 0, 0, .06), transparent 65%); }

.pal-h { display: block; margin: 10px 0 6px; font-size: 12px; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; }
.pal-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.pal { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 4px 8px; border-radius: 16px; background: var(--card-2); border: 1px solid var(--line); font-size: 11.5px; color: var(--text-2); }
.pal i { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, var(--color-base-100) 0 50%, var(--color-primary) 50% 100%); box-shadow: inset 0 0 0 1px rgba(127, 127, 127, .35); }
.pal.on { color: var(--text); border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.pal-own { position: relative; cursor: pointer; }
.pal-own i { background: conic-gradient(from 180deg, #ff3b3b, #ffb800, #c8ff2e, #1fe08f, #2ec5ff, #3366ff, #a259ff, #ff2e88, #ff3b3b); position: relative; }
.pal-own i::after { content: ""; position: absolute; inset: 9px; border-radius: 50%; background: var(--pa); box-shadow: 0 0 0 2px #050505; }
.pal-own input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; border: 0; padding: 0; cursor: pointer; }

/* ---------- профиль ---------- */
.ava { overflow: hidden; font-family: var(--display); font-weight: 600; font-size: 17px; color: var(--accent-2, var(--accent)); }
.ava img { width: 100%; height: 100%; object-fit: cover; }
.ava svg { width: 22px; height: 22px; }
.prof-h { display: flex; align-items: center; gap: 14px; }
.prof-h h2 { margin: 0; font-family: var(--display); font-size: 20px; font-weight: 600; letter-spacing: -.02em; }
.ava-l { width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--accent-soft); font-size: 24px; }
.ava-l svg { width: 28px; height: 28px; }
.actions > .btn { flex: 1 1 0; min-width: 0; }
