/* Atomic RD — общие токены и компоненты. Продуктовые композиции: ui-kit/products/. */
:root {
  color-scheme: light;
  --bg: #F0F1F3;
  --card: #FFFFFF;
  --field: #E7E9EC;
  --ink: #141414;
  --subtle: #3C4046;
  --muted: #646A73;
  /* Линии в светлой теме — полупрозрачные от цвета текста и тихие: граница поля .1, разделитель .06 (тёмная тема — сплошные) */
  --line: rgb(20 20 18 / .1);
  --line-soft: rgb(20 20 18 / .06);
  /* Контролы: стеклянная кромка на full, нейтрально-серая без компонентного стекла. */
  --control-border-flat: color-mix(in srgb, var(--ink) 30%, transparent);
  --control-border: var(--glass-card-border);
  /* Стеклянная вторичная кнопка не должна растворяться на белой карточке. */
  --control-edge: #858B94;
  --control-edge-highlight: rgba(255, 255, 255, .72);
  --control-fill-safe: rgba(255, 255, 255, .84);
  --accent: #C6F04E;
  --on-accent: #141414;
  --accent-band: rgba(198, 240, 78, .28);
  --plus: #86AC22;
  --hero-bg: #141414;
  --hero-text: #F4F4F1;
  --hero-muted: #A8A8A2;
  --warn: #C33A16;
  --warn-bg: rgba(255, 90, 44, .12);
  --ok: #63801B;

  /* Стекло в духе Apple: прозрачнее и светлее, сильное размытие с насыщенностью, светлая кромка и мягкая многослойная тень */
  --glass: rgba(255, 255, 255, .56);
  --glass-strong: rgba(250, 250, 248, .76);
  --glass-border: rgba(255, 255, 255, .72);
  --glass-edge: rgba(20, 20, 20, .06);
  --glass-shadow: 0 1px 2px rgba(20, 20, 20, .05), 0 10px 30px -8px rgba(20, 20, 20, .14), 0 28px 56px -24px rgba(20, 20, 20, .16);
  --glass-blur-strong: blur(32px) saturate(190%);
  --scrim: rgba(14, 14, 14, .28);
  /* Постоянные цвета палитры: одинаковы в обеих темах — для бумаги, графита, лимона и чистых белого и чёрного */
  --white: #FFFFFF;
  --black: #000000;
  --paper: #F4F4F1;
  --graphite: #141414;
  --limon: #C6F04E;

  --c-work: #C6F04E;
  --c-tel: #1B44E8;
  --c-media: #FF5A2C;
  --c-bank: #3A3A37;
  --c-web: #A9BFA0;
  --c-charity: #FF4D8D;
  --c-other: #A8A8A2;
  --c-tax: #7B5CE0;
  --c-reserve: #2FA88A;
  --c-home: #D98A2B;

  /* Шрифт продуктов Lorrrem — Manrope (эталон Suyber 13.10.2026). Имя --mono историческое: это основной шрифт, моноширинный — --ard-code-font */
  --mono: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --ard-code-font: "JetBrains Mono", "SFMono-Regular", ui-monospace, Menlo, Consolas, monospace;
  --r-card: 20px;
  --r-field: 14px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0E0E0E; --card: #191917; --field: #242421; --ink: #EDEDED; --subtle: #B7B7B1; --muted: #8A8A85;
    --line: #4C4C46; --line-soft: #353532; --accent-band: rgba(198, 240, 78, .16);
    --hero-bg: #1E1E1B; --hero-text: #EDEDED; --hero-muted: #8A8A85;
    --warn: #FF7A52; --warn-bg: rgba(255, 90, 44, .16); --ok: #A9D62F; --plus: #C6F04E;
    --glass: rgba(40, 40, 37, .56); --glass-strong: rgba(34, 34, 32, .8); --glass-border: rgba(255, 255, 255, .22);
    --glass-edge: rgba(0, 0, 0, .4); --glass-shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 36px -8px rgba(0, 0, 0, .55), 0 28px 56px -24px rgba(0, 0, 0, .5); --scrim: rgba(0, 0, 0, .5);
    --control-edge: #656562; --control-edge-highlight: rgba(255, 255, 255, .24); --control-fill-safe: rgba(25, 25, 23, .88);
    --c-tel: #5B7BFF; --c-bank: #B7B7B1; --c-web: #7F9477; --c-other: #7A7A75; --c-tax: #A58CFF; --c-reserve: #4FC3A1;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0E0E0E; --card: #191917; --field: #242421; --ink: #EDEDED; --subtle: #B7B7B1; --muted: #8A8A85;
  --line: #4C4C46; --line-soft: #353532; --accent-band: rgba(198, 240, 78, .16);
  --hero-bg: #1E1E1B; --hero-text: #EDEDED; --hero-muted: #8A8A85;
  --warn: #FF7A52; --warn-bg: rgba(255, 90, 44, .16); --ok: #A9D62F; --plus: #C6F04E;
  --glass: rgba(40, 40, 37, .56); --glass-strong: rgba(34, 34, 32, .8); --glass-border: rgba(255, 255, 255, .22);
  --glass-edge: rgba(0, 0, 0, .4); --glass-shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 36px -8px rgba(0, 0, 0, .55), 0 28px 56px -24px rgba(0, 0, 0, .5); --scrim: rgba(0, 0, 0, .5);
  --control-edge: #656562; --control-edge-highlight: rgba(255, 255, 255, .24); --control-fill-safe: rgba(25, 25, 23, .88);
  --c-tel: #5B7BFF; --c-bank: #B7B7B1; --c-web: #7F9477; --c-other: #7A7A75; --c-tax: #A58CFF; --c-reserve: #4FC3A1;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); overflow-x: clip; overscroll-behavior-x: none; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; touch-action: manipulation; }
body { overscroll-behavior-y: contain; }
body {
  font-family: var(--mono); font-size: 14px; line-height: 20px;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
  font-variant-numeric: tabular-nums;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; text-decoration: none; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--ard-r-sm); }
[hidden] { display: none !important; }
h1, h2, h3 { margin: 0; text-wrap: balance; }
p { margin: 0; }

/* ---------- стекло ---------- */
.glass {
  background: var(--glass);
  -webkit-backdrop-filter: var(--glass-blur-strong);
  backdrop-filter: var(--glass-blur-strong);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow), var(--glass-hl);
}

/* ---------- каркас ---------- */

.page-head { display: flex; align-items: center; gap: 12px; min-height: 52px; }
.page-title { flex: 1; min-width: 0; }
.page-head h1 { font-size: 30px; line-height: 36px; font-weight: 800; letter-spacing: -.02em; }
.kicker { font-size: 11px; line-height: 16px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
.head-actions { display: flex; gap: 8px; }

.icon-btn {
  width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; padding: 0;
  color: var(--ink); border: 0; background: none;
}
.icon-btn.plus { color: var(--plus); }
.icon-btn.plus svg { width: 26px; height: 26px; stroke-width: 2.4; }
.icon-btn svg, .btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- базовые блоки ---------- */
.card { background: var(--card); border: 1px solid var(--line-soft); border-radius: var(--r-card); padding: 20px; }
.section { display: grid; gap: var(--ard-space-row, 12px); }
/* Заголовок группы — ближе к своим карточкам (10), чем карточки друг к другу (12) и виджеты страницы (24) */
.section > :is(.section-head, h2, h3):first-child + * { margin-top: calc(var(--ard-space-heading, 10px) - var(--ard-space-row, 12px)); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.section-head h2 { font-size: 16px; line-height: 24px; font-weight: 700; }
.section-head .link { font-size: 12px; color: var(--muted); text-decoration: none; }
.muted { color: var(--muted); }
.small { font-size: 12px; line-height: 16px; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }

.btn {
  min-height: 48px; height: auto; padding: 12px 20px; border-radius: var(--ard-r-full); border: 0; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--ink); color: var(--bg); font-weight: 700; line-height: 20px; letter-spacing: .01em; text-decoration: none; white-space: normal; text-align: center;
}
.btn.accent { background: var(--accent); color: var(--on-accent); }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn.danger { background: var(--warn); color: var(--white); }
.btn.sm { min-height: 36px; padding: 8px 14px; font-size: 12px; line-height: 16px; border-radius: var(--ard-r-full); }
.btn.block { width: 100%; }
.btn svg { width: 18px; height: 18px; }

.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: var(--ard-r-full);
  border: 1px solid var(--line); font-size: 11px; line-height: 16px; letter-spacing: .04em; white-space: nowrap; color: var(--subtle);
}
.chip.warn { border-color: transparent; background: var(--warn-bg); color: var(--warn); font-weight: 600; }
.chip.accent { border-color: transparent; background: var(--accent); color: var(--on-accent); font-weight: 600; }
.chip.soft { border-color: transparent; background: var(--field); }

/* Сегменты-табы — на всю ширину контейнера, кнопки делят её поровну; не влезают — лента с фейдом (.ard-fade-x) */
.seg { display: flex; padding: 4px; border-radius: var(--ard-r-full); background: var(--field); gap: 2px; overflow-x: auto; scrollbar-width: none; }
.seg button {
  flex: 1; height: 36px; border: 0; background: transparent; border-radius: var(--ard-r-full); padding: 0 14px; white-space: nowrap;
  color: var(--subtle); font-size: 13px;
}
.seg button[aria-pressed="true"] { background: var(--card); color: var(--ink); font-weight: 700; box-shadow: 0 1px 3px rgba(20,20,20,.12); }

/* ---------- обзор ---------- */
.hero { background: var(--hero-bg); color: var(--hero-text); border-radius: var(--ard-r-xl); padding: 24px; display: grid; gap: 20px; }
.hero .kicker { color: var(--hero-muted); }
.hero-num { font-size: clamp(40px, 11vw, 64px); line-height: 1; font-weight: 800; letter-spacing: -.04em; color: var(--accent); }
.hero-num small { font-size: .45em; letter-spacing: 0; margin-left: 6px; color: var(--hero-text); }
.hero-sub { font-size: 12px; color: var(--hero-muted); margin-top: 8px; }
.hero-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; border-top: 1px solid rgba(237,237,237,.14); padding-top: 16px; }
.hero-stats b { display: block; font-size: 16px; line-height: 24px; }
.hero-stats span { font-size: 11px; line-height: 14px; color: var(--hero-muted); }
@media (max-width: 420px) { .hero-stats { grid-template-columns: 1fr 1fr; } .hero-stats > :last-child { grid-column: 1 / -1; } }

/* ---------- списки ---------- */
.list { background: var(--card); border: 1px solid var(--line-soft); border-radius: var(--r-card); overflow: hidden; }
.list-group-head { display: flex; justify-content: space-between; gap: 12px; padding: 12px 16px 8px; font-size: 12px; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; }
.row {
  display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: center;
  width: 100%; padding: 12px 16px; background: none; border: 0; border-top: 1px solid var(--line-soft); text-align: left;
}
.list > .row:first-child, .list-group-head + .row { border-top: 0; }
.row:hover { background: var(--accent-band); }
.row.paused { opacity: .5; }
.avatar {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 14px;
  color: var(--graphite); background: var(--cat, var(--c-other));
}
.avatar.dark-text { color: var(--graphite); }
.avatar.light-text { color: var(--paper); }
.row .t { font-weight: 600; overflow: hidden; text-overflow: clip; white-space: nowrap; }
.row .s { font-size: 12px; line-height: 16px; color: var(--muted); overflow: hidden; text-overflow: clip; white-space: nowrap; }
.row .r { text-align: right; }
.row .r b { display: block; font-weight: 700; }
.row .r span { font-size: 12px; color: var(--muted); }
.row .r .warn { color: var(--warn); font-weight: 600; }

.search { position: relative; }
.search #q { padding-left: 44px; }
.search svg { position: absolute; z-index: 1; left: 14px; top: 14px; width: 20px; height: 20px; fill: none; stroke: var(--muted); stroke-width: 1.8; }

/* ---------- календарь ---------- */
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cal-head h2 { font-size: 20px; line-height: 28px; font-weight: 800; }
.cal-nav { display: flex; gap: 8px; }
.cal-nav .icon-btn { width: 40px; height: 40px; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal .wd { font-size: 11px; color: var(--muted); text-align: center; padding: 4px 0; letter-spacing: .08em; }
.day {
  min-height: 64px; border-radius: var(--ard-r-md); border: 1px solid transparent; background: var(--card);
  padding: 6px; display: flex; flex-direction: column; gap: 4px; text-align: left; overflow: hidden;
}
.day.out { background: transparent; }
.day .dn { font-size: 12px; line-height: 16px; color: var(--muted); }
.day.today .dn { background: var(--accent); color: var(--on-accent); border-radius: var(--ard-r-sm); padding: 0 6px; align-self: flex-start; font-weight: 700; }
.day[aria-pressed="true"] { border-color: var(--ink); }
.day.has { cursor: pointer; }
.dots { display: flex; flex-wrap: wrap; gap: 3px; }
.dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--cat); display: block; }
.dots i.transfer { background: transparent; box-shadow: inset 0 0 0 1.5px var(--muted); }
.day .dsum { font-size: 10px; line-height: 12px; font-weight: 700; margin-top: auto; }
.day .names { display: none; }
@media (min-width: 960px) {
  .day { min-height: 112px; padding: 8px; }
  .day .dots { display: none; }
  .day .names { display: grid; gap: 2px; }
  .day .names span { font-size: 11px; line-height: 14px; overflow: hidden; text-overflow: clip; white-space: nowrap; padding-left: 8px; position: relative; }
  .day .names span::before { content: ""; position: absolute; left: 0; top: 4px; width: 5px; height: 5px; border-radius: 50%; background: var(--cat); }

}
.cal-summary { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- статистика ---------- */
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.kpi { display: grid; gap: 4px; align-content: start; }
.kpi b { font-size: 22px; line-height: 28px; font-weight: 800; letter-spacing: -.02em; }
.kpi .small { color: var(--muted); }
@media (max-width: 640px) { .kpis { grid-template-columns: 1fr; } }
.donut-wrap { display: grid; gap: 20px; align-items: center; }
@media (min-width: 640px) { .donut-wrap { grid-template-columns: 220px 1fr; } }
.donut { width: 100%; max-width: 220px; margin: 0 auto; display: block; }
.donut text { fill: var(--ink); font-family: var(--mono); }
.legend { display: grid; gap: 10px; }
.leg { display: grid; grid-template-columns: 12px 1fr auto; gap: 10px; align-items: center; }
.leg i { width: 12px; height: 12px; border-radius: 4px; background: var(--cat); }
.leg .bar { grid-column: 2 / -1; height: 6px; border-radius: var(--ard-r-full); background: var(--field); overflow: hidden; }
.leg .bar span { display: block; height: 100%; background: var(--cat); border-radius: var(--ard-r-full); }
.leg .v { text-align: right; font-weight: 700; }
.leg .v small { display: block; font-weight: 400; color: var(--muted); font-size: 11px; }

/* ---------- формы ---------- */
.field { display: grid; gap: 6px; }
.field > label, .field > .lbl { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.input, .field input:not([type="checkbox"]):not([type="file"]), .field select, .field textarea {
  width: 100%; height: 48px; border-radius: var(--r-field); border: 1px solid transparent; background: var(--field); padding: 0 14px; font-size: 16px;
  -webkit-appearance: none; appearance: none;
}
.field textarea { height: auto; min-height: 120px; padding: 12px 14px; line-height: 20px; resize: vertical; }
.field select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%237A7A75' stroke-width='1.8'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--control-border); outline: none; }
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible { box-shadow: var(--ard-focus-ring); }
/* Пара полей в строке выровнена по верху: подсказка под одним полем не сдвигает другое */
.row-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: start; }
.row-fields > .field { align-content: start; }
/* Совсем узкий экран: пара полей встаёт в столбец, кроме «сумма + валюта» и «период» */
@media (max-width: 380px) { .row-fields:not(.amount):not(.period) { grid-template-columns: 1fr; } }
.row-fields.amount { grid-template-columns: 1fr 104px; }
.row-fields.period { grid-template-columns: 88px 1fr; }
.check { display: flex; gap: 12px; align-items: center; font-size: 13px; }
.check input { width: 22px; height: 22px; accent-color: var(--ink); }
.form { display: grid; gap: 16px; }
.hint { font-size: 12px; line-height: 16px; color: var(--muted); }
.found { padding: 12px 14px; border-radius: var(--ard-r-md); background: var(--accent-band); font-size: 13px; }

.drop {
  display: grid; place-items: center; gap: 8px; text-align: center; padding: 28px 16px; border-radius: var(--ard-r-lg);
  border: 1.5px dashed var(--line); color: var(--muted); cursor: pointer;
}
.drop svg { width: 32px; height: 32px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.shot-preview { max-height: 220px; border-radius: var(--ard-r-md); display: block; margin: 0 auto; }
.progress { height: 6px; border-radius: var(--ard-r-full); background: var(--field); overflow: hidden; }
.progress span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }

/* ---------- лист (bottom sheet / модальное окно) ---------- */
.scrim { position: fixed; inset: 0; z-index: 40; background: var(--scrim); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); animation: fade .2s; }
.sheet {
  position: fixed; z-index: 41; left: 8px; right: 8px; bottom: calc(8px + var(--safe-b)); max-height: 92dvh; overflow: auto; overscroll-behavior: contain;
  border-radius: var(--ard-r-xl); padding: 8px 20px 24px;
  background: var(--glass-strong);
  animation: up .28s cubic-bezier(.2, .8, .2, 1);
}
.sheet .grab { width: 40px; height: 5px; border-radius: var(--ard-r-full); background: var(--line); margin: 0 auto 12px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; position: sticky; top: -8px; padding-top: 8px; background: transparent; }
.sheet-head h2 { font-size: 20px; line-height: 28px; font-weight: 800; }
.sheet-head .icon-btn { width: 40px; height: 40px; background: var(--glass-field); border: 1px solid var(--glass-card-border); box-shadow: var(--glass-hl); }
.sheet-body { display: grid; gap: 16px; }
@media (min-width: 720px) {
  .sheet { left: 50%; right: auto; bottom: auto; top: 50%; transform: translate(-50%, -50%); width: 560px; max-height: 86dvh; padding: 20px 24px 24px; animation: pop .22s ease-out; }
  .sheet .grab { display: none; }
}
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
@keyframes pop { from { transform: translate(-50%, -48%); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .sheet, .scrim { animation: none; } }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 10px 16px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.actions .btn { flex: 1; }

.toast {
  position: fixed; z-index: 60; left: 50%; transform: translateX(-50%); bottom: calc(92px + var(--safe-b));
  padding: 12px 18px; border-radius: var(--ard-r-lg); font-size: 13px; max-width: calc(100% - 32px);
}
@media (min-width: 960px) { .toast { bottom: 24px; } }

.empty { text-align: center; padding: 32px 16px; color: var(--muted); display: grid; gap: 12px; justify-items: center; }

/* ---------- профиль ---------- */

.me-initials { font-weight: 800; font-size: 14px; }
.auth-list { display: grid; gap: 8px; }
.auth-list .btn { justify-content: flex-start; gap: 12px; padding-left: 8px; height: 56px; border-radius: var(--ard-r-xl); }
.auth-list .avatar { width: 40px; height: 40px; }

/* Действие в тосте */

.toast-action { margin-left: 8px; border: 0; background: var(--accent); color: var(--on-accent); font-weight: 700; border-radius: var(--ard-r-sm); padding: 4px 12px; }

/* ---------- аватар ---------- */
.me-btn { flex: none; padding: 0; overflow: hidden; color: var(--ink); text-decoration: none; }
.me-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }
.me-img.sm { width: 28px; height: 28px; }
.me-img.lg { width: 88px; height: 88px; }

@media (min-width: 960px) { .page-head .me-btn { display: none; } }

/* ---------- обновление свайпом вниз ---------- */
.ptr { position: fixed; z-index: 30; left: 50%; top: calc(-44px + var(--safe-t)); width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center; transform: translate(-50%, 0); opacity: 0; transition: opacity .15s; pointer-events: none; }
.ptr svg { width: 22px; height: 22px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ptr.show { opacity: 1 !important; }
.ptr.ready svg, .ptr.spin svg { stroke: var(--plus); }
.ptr.spin svg { animation: ptr-spin .8s linear infinite; }
@keyframes ptr-spin { to { transform: rotate(360deg); } }

/* ---------- счётчики на обзоре ---------- */
.hero-counts { display: flex; flex-wrap: wrap; gap: 8px; }
.hero-counts a { display: inline-flex; gap: 6px; align-items: baseline; padding: 6px 12px; border-radius: var(--ard-r-full); background: rgba(237,237,237,.08); color: var(--hero-muted); font-size: 12px; text-decoration: none; }
.hero-counts a b { color: var(--hero-text); font-size: 14px; }
.hero-counts a:hover { background: rgba(237,237,237,.16); }

/* ---------- стекло (Apple glass) ---------- */
:root {
  --glass-card: rgba(255, 255, 255, .5);
  --glass-card-border: rgba(255, 255, 255, .72);
  --glass-field: rgba(20, 20, 20, .05);
  --seg-on: var(--glass-card); --seg-on-border: var(--glass-card-border);
  --blob-1: rgba(198, 240, 78, .35);
  --blob-2: rgba(91, 123, 255, .18);
  --blob-3: rgba(255, 90, 44, .12);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --glass-card: rgba(44, 44, 41, .46); --glass-card-border: rgba(255, 255, 255, .18); --glass-field: rgba(255, 255, 255, .06); --seg-on: rgba(255, 255, 255, .17); --seg-on-border: rgba(255, 255, 255, .16);
    --blob-1: rgba(198, 240, 78, .14); --blob-2: rgba(91, 123, 255, .16); --blob-3: rgba(255, 90, 44, .08);
  }
}
:root[data-theme="dark"] {
  --glass-card: rgba(44, 44, 41, .46); --glass-card-border: rgba(255, 255, 255, .18); --glass-field: rgba(255, 255, 255, .06); --seg-on: rgba(255, 255, 255, .17); --seg-on-border: rgba(255, 255, 255, .16);
  --blob-1: rgba(198, 240, 78, .14); --blob-2: rgba(91, 123, 255, .16); --blob-3: rgba(255, 90, 44, .08);
}
/* Деловая палитра: те же категории, но приглушённые — для CRM, банка и бухгалтерии. Включается в разделах, а не глобально */
:root {
  --biz-work: #93A85C; --biz-tel: #4A63B8; --biz-media: #C0674D; --biz-tax: #7669B0; --biz-reserve: #4A8F7E; --biz-home: #B08650; --biz-charity: #B8667F;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --biz-work: #A3B56E; --biz-tel: #7488CC; --biz-media: #C98067; --biz-tax: #9489C4; --biz-reserve: #6BA895; --biz-home: #BE9A68; --biz-charity: #C47D93; }
}
:root[data-theme="dark"] { --biz-work: #A3B56E; --biz-tel: #7488CC; --biz-media: #C98067; --biz-tax: #9489C4; --biz-reserve: #6BA895; --biz-home: #BE9A68; --biz-charity: #C47D93; }
/* Мягкий цветной фон под стеклом — без него размытию нечего показывать */

.card, .list, .icon-btn.glass, .sheet {
  background: var(--glass-card);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-card-border);
  box-shadow: 0 1px 2px rgba(20, 20, 20, .04), 0 8px 24px -10px rgba(20, 20, 20, .1), var(--glass-hl);
}

/* Оверлеи — плотнее и с глубокой тенью, как листы Apple */
.sheet, .icon-btn.glass { background: var(--glass-strong); border-color: var(--glass-border); -webkit-backdrop-filter: var(--glass-blur-strong); backdrop-filter: var(--glass-blur-strong); box-shadow: var(--glass-shadow), var(--glass-hl); }
.list .row + .row, .list-group-head + .row { border-top-color: var(--glass-card-border); }
.hero { background: color-mix(in srgb, #141414 88%, var(--bg)); -webkit-backdrop-filter: none; backdrop-filter: none; border: 1px solid rgba(255,255,255,.08); }

.seg { background: var(--glass-field); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }
/* Выбранная пилюля: в тёмной теме заметно светлее дорожки */
.seg button[aria-pressed="true"] { background: var(--seg-on); box-shadow: 0 1px 6px rgba(20,20,20,.12), inset 0 0 0 1px var(--seg-on-border); }
.field input:not([type="checkbox"]):not([type="file"]), .field select, .field textarea, .input { background: var(--glass-field); }

.hero-counts a { -webkit-backdrop-filter: none; backdrop-filter: none; }
.btn.ghost { background: var(--control-fill-safe); border-color: transparent; }

/* Шапка: справа три стеклянные кнопки */
.head-actions { display: flex; gap: 8px; }
.icon-btn.ai { color: var(--plus); }
@media (max-width: 420px) {
  .page-head h1 { font-size: 24px; line-height: 30px; }
  .head-actions { gap: 6px; }
  .head-actions .icon-btn { width: 42px; height: 42px; }
}

/* Карточка подписки */

.chips { display: flex; gap: 6px; flex-wrap: wrap; }

.row.hist { grid-template-columns: 0 1fr auto; cursor: default; }

/* Форма: популярные сервисы */

.list-tools { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: end; }
.list-tools .sort select { min-width: 170px; }
@media (max-width: 520px) { .list-tools { grid-template-columns: 1fr; } }

/* «Это примерно как» и ИИ-разбор */

.sheet h3 { font-size: 15px; margin: 8px 0 0; }
/* ---------- переключатель темы ---------- */

.theme-btn svg { width: 20px; height: 20px; }

/* Смена темы: круг от кнопки, край размыт маской */
@property --vt-r { syntax: "<length>"; inherits: false; initial-value: 0px; }
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
::view-transition-new(root) {
  -webkit-mask-image: radial-gradient(circle at var(--vt-x) var(--vt-y), var(--black) calc(var(--vt-r) - 110px), transparent var(--vt-r));
  mask-image: radial-gradient(circle at var(--vt-x) var(--vt-y), var(--black) calc(var(--vt-r) - 110px), transparent var(--vt-r));
  animation: vt-reveal .75s cubic-bezier(.4, 0, .2, 1) forwards;
}
@keyframes vt-reveal { from { --vt-r: 0px; } to { --vt-r: var(--vt-end); } }

/* Логотип в скруглённом квадрате (сквиркл, как иконки iOS) */

.brand-logo {
  width: 40px; height: 40px; flex: none; object-fit: cover;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath d='M50 0C8 0 0 8 0 50s8 50 50 50 50-8 50-50S92 0 50 0z'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath d='M50 0C8 0 0 8 0 50s8 50 50 50 50-8 50-50S92 0 50 0z'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
}

/* Шапка на телефоне: кнопки первой строкой, заголовок — второй */
@media (max-width: 959px) {
  .page-head { flex-wrap: wrap; row-gap: 12px; }
  .page-head .head-actions { margin-left: auto; }
  .page-head .page-title { order: 3; flex-basis: 100%; }
  .page-head .icon-btn { width: 44px; height: 44px; }
}

/* Поле поиска: место под значок лупы — и в списке, и в окне поиска */
.search .field input:not([type="checkbox"]):not([type="file"]) { padding-left: 44px; }
.search svg { top: 50%; transform: translateY(-50%); }
.search { margin-bottom: 4px; }

/* Домовой */
.mascot-say { display: flex; gap: 12px; align-items: flex-end; }
.mascot-say img { width: 72px; height: 72px; flex: none; object-fit: cover; object-position: center top; border-radius: 50%; }
.domo { object-fit: contain; flex: none; }
.domo-center { display: grid; justify-items: center; }
.empty .domo { margin-bottom: -4px; }
.bubble { position: relative; margin: 0; padding: 12px 14px; border-radius: var(--ard-r-lg) var(--ard-r-lg) var(--ard-r-lg) 4px; background: var(--glass-field); border: 1px solid var(--glass-card-border); font-size: 13px; line-height: 19px; }
.link-btn { min-height: 44px; border: 0; border-radius: var(--ard-r-sm); background: none; padding: 8px 4px; color: var(--plus); font-weight: 700; text-decoration: none; }
.link-btn:hover { background: color-mix(in srgb, var(--plus) 10%, transparent); }

.empty-mascot { width: 160px; height: 160px; object-fit: contain; margin-bottom: -4px; }
@keyframes wave-in { from { transform: translateY(16px) scale(.9); opacity: 0; } }

/* Подсказки при наведении: тёмная плашка со скруглением */
[data-tip] { position: relative; }
@media (hover: hover) {
  [data-tip]::after {
    content: attr(data-tip); position: absolute; z-index: 50; top: calc(100% + 8px); left: 50%;
    transform: translate(-50%, -4px); padding: 6px 10px; border-radius: var(--ard-r-sm); white-space: nowrap;
    background: rgba(20, 20, 20, .92); color: var(--paper); font: 500 12px/16px var(--mono); letter-spacing: .01em;
    box-shadow: 0 6px 20px rgba(0, 0, 0, .25); opacity: 0; pointer-events: none; transition: opacity .15s, transform .15s;
  }
  [data-tip]:hover::after, [data-tip]:focus-visible::after { opacity: 1; transform: translate(-50%, 0); transition-delay: .25s; }

  .head-actions [data-tip]:last-child::after { left: auto; right: 0; transform: translate(0, -4px); }
  .head-actions [data-tip]:last-child:hover::after { transform: translate(0, 0); }
}

/* Полоса прокрутки: тонкая, скруглённая, «нависает» с отступом от краёв */
* { scrollbar-width: thin; scrollbar-color: rgba(120, 120, 115, .45) transparent; }
::-webkit-scrollbar { width: 12px; height: 12px; background: transparent; }
::-webkit-scrollbar-track { background: transparent; margin: 22px 0; }
::-webkit-scrollbar-thumb { background: rgba(120, 120, 115, .4); border-radius: 12px; border: 4px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background-color: rgba(120, 120, 115, .7); }
::-webkit-scrollbar-corner { background: transparent; }
.sheet { scrollbar-gutter: auto; }

/* ---------- выпадающие списки в стекле ---------- */
select.gsel-native { position: absolute !important; left: 0; top: 0; width: 1px !important; min-width: 0 !important; max-width: 1px !important; height: 1px !important; padding: 0 !important; border: 0 !important; opacity: 0; pointer-events: none; }
.gsel {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; height: 48px; padding: 0 14px;
  border-radius: var(--r-field); border: 1px solid transparent; background: var(--glass-field); font-size: 16px; text-align: left; cursor: pointer;
}
.gsel span { overflow: hidden; text-overflow: clip; white-space: nowrap; }
.gsel svg { width: 16px; height: 16px; flex: none; fill: none; stroke: var(--muted); stroke-width: 1.8; transition: transform .15s; }
.gsel[aria-expanded="true"] { border-color: var(--control-border); }
.gsel[aria-expanded="true"] svg { transform: rotate(180deg); }
.gsel:focus-visible { outline: none; border-color: var(--control-border); box-shadow: var(--ard-focus-ring); }
.list-tools .sort .gsel { min-width: 170px; }
.gsel-menu {
  position: fixed; z-index: 1000; overflow-y: auto; padding: 6px; border-radius: var(--ard-r-lg);
  background: var(--glass); border: 1px solid var(--glass-card-border);
  -webkit-backdrop-filter: blur(28px) saturate(180%); backdrop-filter: blur(28px) saturate(180%);
  box-shadow: var(--glass-shadow), inset 0 1px 0 var(--glass-card-border);
  opacity: 0; transform: translateY(-4px) scale(.98); transform-origin: top center; transition: opacity .14s, transform .14s;
  scrollbar-width: thin;
}
.gsel-menu.up { transform-origin: bottom center; transform: translateY(4px) scale(.98); }
.gsel-menu.on { opacity: 1; transform: none; }
.gsel-opt { display: flex; align-items: center; gap: 8px; padding: 10px 12px 10px 8px; border-radius: var(--ard-r-md); font-size: 14px; line-height: 20px; cursor: pointer; white-space: nowrap; }
.gsel-opt svg { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 2.2; visibility: hidden; }
.gsel-opt[aria-selected="true"] { font-weight: 700; }
.gsel-opt[aria-selected="true"] svg { visibility: visible; }
.gsel-opt.active, .gsel-opt:hover { background: var(--accent-band); }
.gsel-opt[aria-disabled="true"] { opacity: .4; cursor: default; }
@media (prefers-reduced-motion: reduce) { .gsel-menu { transition: none; } }

/* ---------- чекбоксы со скруглением ---------- */
input[type="checkbox"] {
  -webkit-appearance: none; appearance: none; flex: none; width: 22px; height: 22px; margin: 0; border-radius: var(--ard-r-xs);
  border: 1.5px solid color-mix(in srgb, var(--ink) 45%, transparent); background: var(--glass-field); cursor: pointer;
  display: grid; place-items: center; transition: background .12s, border-color .12s;
}
input[type="checkbox"]::after {
  content: ""; width: 12px; height: 12px; background: var(--bg);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m4 12 5 5 11-11' fill='none' stroke='%23000' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m4 12 5 5 11-11' fill='none' stroke='%23000' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
  transform: scale(0); transition: transform .12s;
}
input[type="checkbox"]:checked { background: var(--ink); border-color: var(--ink); }
input[type="checkbox"]:checked::after { transform: scale(1); }
input[type="checkbox"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Рамки плашек контрастнее */
.chip { border-color: color-mix(in srgb, var(--ink) 30%, transparent); color: var(--ink); }

/* ---------- окна на мобилке: содержимое помещается по ширине, без горизонтальной прокрутки ---------- */
.sheet { overflow-x: hidden; }
.sheet-body > *, .auth-list > * { min-width: 0; max-width: 100%; }

.sheet .btn.block { white-space: normal; height: auto; min-height: 48px; padding-block: 10px; line-height: 20px; text-align: left; }
.sheet .auth-list .btn { min-height: 52px; }

@media (max-width: 959px) {
  /* Приветствие целиком на экране: домовой и отступы ужимаются по высоте */


  .sheet .auth-list { gap: 6px; }
  .sheet .auth-list .btn { min-height: 46px; }
  .sheet-head { margin-bottom: 8px; }
}

/* ---------- заголовок + подзаголовок: плотнее ---------- */

.page-head h1 { line-height: 32px; }
.page-title .kicker { line-height: 14px; }
.hero-sub { margin-top: 4px; line-height: 16px; }
.hero-stats b { line-height: 18px; }

.empty h2 { line-height: 24px !important; }
.empty h2 + p { margin-top: -6px; }
@media (max-width: 959px) { .page-head h1 { line-height: 26px; } }

/* Кромка: блик сверху и отражённый свет снизу — край стекла читается без тёмной обводки */
:root { --glass-hl: inset 0 1px 0 rgba(255, 255, 255, .85), inset 0 -1px 0 rgba(255, 255, 255, .28); --glass-blur: blur(24px) saturate(180%); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --glass-hl: inset 0 1px 0 rgba(255, 255, 255, .14), inset 0 -1px 0 rgba(255, 255, 255, .04); } }
:root[data-theme="dark"] { --glass-hl: inset 0 1px 0 rgba(255, 255, 255, .14), inset 0 -1px 0 rgba(255, 255, 255, .04); }

.btn.ghost, .chip:not(.warn):not(.accent), .sheet-head .icon-btn, .bubble, .gsel, .sheet .card, .sheet .list, .seg, .field input:not([type="checkbox"]):not([type="file"]), .field textarea, .input {
  background: var(--glass-field);
  border: 1px solid var(--control-border);
  box-shadow: var(--glass-hl);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
}

.btn.ghost { box-shadow: var(--glass-hl); }
.btn.accent {
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 88%, var(--white)), var(--accent));
  border: 1px solid color-mix(in srgb, var(--accent) 70%, var(--white));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55), 0 4px 14px color-mix(in srgb, var(--accent) 35%, transparent);
}
.btn:not(.accent):not(.danger):not(.ghost) { box-shadow: var(--glass-hl); }
.btn.ghost:hover, .gsel:hover { background: color-mix(in srgb, var(--glass-field) 50%, var(--accent-band)); }
.btn.accent:hover { filter: brightness(1.04); }
.btn:active { transform: scale(.98); }
.btn { transition: transform .1s, filter .15s, background .15s; }
.field input:focus, .field textarea:focus, .gsel[aria-expanded="true"] { border-color: var(--control-border); }

/* ---------- кнопки аккуратнее ---------- */
.sheet .btn.block, .auth-list .btn { justify-content: center; text-align: center; padding-inline: 20px; gap: 10px; border-radius: var(--ard-r-full); }
.sheet .auth-list .btn:has(.avatar) { justify-content: flex-start; padding-left: 8px; text-align: left; }
.sheet .btn.block { min-height: 48px; }
.btn svg { flex: none; }

/* Окно: шапка прозрачная и стоит на месте, прокручивается только содержимое под ней */
.sheet { display: flex; flex-direction: column; overflow: hidden; }
.sheet .grab { flex: none; }
.sheet-head {
  flex: none; position: static; z-index: auto; margin: 0 0 4px; padding: 4px 0; align-items: center;
  background: transparent; -webkit-backdrop-filter: none; backdrop-filter: none;
}
.sheet-head h2 { line-height: 24px; }
.sheet-body {
  flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain;
  margin-inline: -20px; padding: 8px 20px 4px;
}
@media (min-width: 960px) { .sheet-body { margin-inline: -24px; padding-inline: 24px; } }

/* Карточка подписки: сумма и бейджи по центру */

@media (min-width: 960px) { .sheet { padding-top: 14px; padding-bottom: 20px; } }
/* Без «ручки»: шторка по-прежнему смахивается вниз за заголовок */
.sheet .grab { display: none; }
@media (max-width: 959px) { .sheet { padding-top: 16px; } }

/* Поиск и сортировка — одной высоты и на одной линии */
.list-tools { align-items: center; }
.list-tools .field, .list-tools .search { gap: 0; display: grid; }
.list-tools .search .field, .list-tools .sort { height: 48px; }

/* Домовой в поиске — в кружке */
.mascot-say img {
  width: 64px; height: 64px; border-radius: 50%; object-fit: cover; object-position: center top;
  background: var(--accent-band); border: 1px solid var(--glass-card-border); box-shadow: var(--glass-hl);
}
.list-tools { grid-auto-rows: 48px; align-items: stretch; }

/* Один и тот же плавный край во всех окнах: сверху под шапкой и снизу под обрезом, мягкими ступенями */
.sheet-body {
  padding-top: 16px; margin-top: 0; padding-bottom: 56px; margin-bottom: 0;
  --fade-b: 88px;
  --fade: linear-gradient(to bottom, transparent 0, var(--black) 24px, var(--black) calc(100% - var(--fade-b)), rgb(0 0 0 / .85) calc(100% - var(--fade-b) * .78), rgb(0 0 0 / .55) calc(100% - var(--fade-b) * .58), rgb(0 0 0 / .22) calc(100% - var(--fade-b) * .38), rgb(0 0 0 / .05) calc(100% - var(--fade-b) * .2), transparent 100%);
  -webkit-mask-image: none; mask-image: none;
}
/* ---------- окна: переключатели вместо чекбоксов, каждый — в стеклянной рамке ---------- */
:is(.sheet .check, .check.switch) {
  justify-content: space-between; gap: 16px; min-height: 56px; padding: 12px 16px; border-radius: var(--ard-r-lg); cursor: pointer;
  background: var(--glass-field); border: 1px solid var(--glass-card-border); box-shadow: var(--glass-hl);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); font-size: 14px;
}
:is(.sheet .check, .check.switch)[hidden] { display: none; }
:is(.sheet .check, .check.switch) input[type="checkbox"] {
  order: 2; width: 52px; height: 32px; border-radius: var(--ard-r-full); padding: 0; display: block; position: relative;
  background: color-mix(in srgb, var(--ink) 14%, transparent); border: 1px solid var(--glass-card-border);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, .12);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); transition: background .2s;
}
:is(.sheet .check, .check.switch) input[type="checkbox"]::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 26px; height: 26px; border-radius: 50%; transform: none;
  -webkit-mask: none; mask: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, .98), rgba(240, 240, 236, .9));
  box-shadow: 0 2px 6px rgba(0, 0, 0, .18), inset 0 1px 0 var(--white); transition: left .2s cubic-bezier(.3, .7, .3, 1.2);
}
:is(.sheet .check, .check.switch) input[type="checkbox"]:checked { background: var(--accent); border-color: color-mix(in srgb, var(--accent) 70%, var(--white)); }
:is(.sheet .check, .check.switch) input[type="checkbox"]:checked::after { left: 22px; }
@media (prefers-reduced-motion: reduce) { .sheet .check input[type="checkbox"], .sheet .check input[type="checkbox"]::after { transition: none; } }

/* Заголовок и подзаголовок: чуть больше воздуха */

.page-title .kicker { margin-bottom: 4px; }
.hero-sub { margin-top: 8px; }
.hero-stats span { display: block; margin-top: 3px; }

.empty h2 + p { margin-top: -2px; }
.row .s { margin-top: 2px; }

/* Тосты и подсказки — чёрное стекло в обеих темах (решение 05.10.2026; раньше тост был светлым стеклом) */
.toast {
  background: rgba(12, 12, 12, .88) !important; color: #F4F4F1 !important; border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, .12) !important; box-shadow: 0 10px 30px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .08) !important;
  -webkit-backdrop-filter: blur(20px) saturate(160%); backdrop-filter: blur(20px) saturate(160%);
  width: max-content;
}
@media (hover: hover) { [data-tip]::after { background: rgba(12, 12, 12, .92); border: 1px solid rgba(255, 255, 255, .1); } }
/* Содержимое окна не сжимается по высоте: прокручивается целиком, а не сплющивает переключатели */
.sheet-body { grid-auto-rows: max-content; align-content: start; }

/* Типы расходов в настройках */
.check.switch > span { display: grid; gap: 2px; min-width: 0; }
.check.switch > span .hint { font-weight: 400; }
.check.switch input:disabled { opacity: .55; cursor: default; }
.check.switch:has(input:disabled) { cursor: default; }

/* Исходная сумма в другой валюте — мелко под основной */
.row .r .orig { display: block; font-size: 11px; line-height: 14px; color: var(--muted); }

/* Валюты в настройках */

.chip-x { border: 0; background: none; padding: 0 0 0 4px; font-size: 14px; line-height: 1; color: var(--muted); cursor: pointer; }
.chip-x:hover { color: var(--warn); }
/* Вложенный переключатель — продолжение строки над ним */
.check.switch.sub { min-height: 44px; margin: -6px 0 0 24px; padding-block: 8px; font-size: 13px; }
.check.switch.sub input[type="checkbox"] { width: 44px; height: 26px; }
.check.switch.sub input[type="checkbox"]::after { width: 20px; height: 20px; }
.check.switch.sub input[type="checkbox"]:checked::after { left: 20px; }
/* Кнопки с иконками в переключателе */
.seg-ic { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.seg-ic svg { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Виджеты статистики нажимаются — открывают список */
.kpi[role="button"] { cursor: pointer; transition: transform .1s, background .15s; }
.kpi[role="button"]:hover { background: color-mix(in srgb, var(--glass-card) 70%, var(--accent-band)); }
.kpi[role="button"]:active { transform: scale(.98); }
.kpi[role="button"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Статистика: при переключении «в месяц / за год» ничего не сдвигается по горизонтали */

.leg { grid-template-columns: 12px minmax(0, 1fr) 11ch; }
.leg > span:not(.bar):not(.v) { overflow: hidden; text-overflow: clip; white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
.row .r { min-width: 11ch; }
.leg { grid-template-columns: 12px minmax(0, 1fr) 9ch; }
.leg > span:not(.bar):not(.v) { white-space: normal; overflow: visible; overflow-wrap: anywhere; }

/* Исходная сумма в другой валюте — мелко перед основной, на той же строке */
.row .r b .orig { display: inline; margin-right: 6px; font-size: 11px; font-weight: 400; color: var(--muted); }

/* Кнопки входа: значок слева, текст сразу за ним */
.auth-list .btn:has(.avatar) { justify-content: flex-start; text-align: left; padding: 8px 20px 8px 8px; gap: 12px; }
.prov-mark svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Сортировка у поиска — значок сортировки (стрелки вверх-вниз, Lucide arrow-up-down), без шеврона выпадающего списка.
   Шире 520px — значок и текущий вариант текстом; уже — круглая кнопка 48px только со значком,
   подсказка и aria-label «Сортировка: <текущая>» */
.list-tools .sort .gsel { gap: 10px; }
.list-tools .sort .gsel svg { display: none; }
.list-tools .sort .gsel::before {
  content: ""; flex: none; width: 18px; height: 18px; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m21 16-4 4-4-4M17 20V4M3 8l4-4 4 4M7 4v16'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m21 16-4 4-4-4M17 20V4M3 8l4-4 4 4M7 4v16'/%3E%3C/svg%3E") center / contain no-repeat;
}
@media (max-width: 520px) {
  .list-tools { grid-template-columns: minmax(0, 1fr) 48px; }
  .list-tools .sort .gsel { width: 48px; min-width: 0; padding: 0; justify-content: center; border-radius: 50%; }
  .list-tools .sort .gsel span { display: none; }
  .list-tools .sort .gsel::before { width: 20px; height: 20px; }
}

/* Подписи в строках плотнее по горизонтали */
.row .s { letter-spacing: -.03em; word-spacing: -.12em; }

/* ---------- поиск как Spotlight ---------- */
.spot {
  position: fixed; z-index: 45; left: 0; right: 0; top: 0; height: 100dvh;
  display: flex; flex-direction: column; justify-content: flex-end;
  background: color-mix(in srgb, var(--bg, var(--black)) 45%, transparent);
  -webkit-backdrop-filter: blur(28px) saturate(1.6); backdrop-filter: blur(28px) saturate(1.6);
  animation: fade .2s ease-out;
}
.spot-res {
  flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  display: flex; flex-direction: column; justify-content: flex-end; gap: 16px;
  padding: calc(16px + env(safe-area-inset-top)) 16px 12px;
  width: 100%; max-width: 640px; margin: 0 auto;
  animation: up .28s cubic-bezier(.2, .8, .2, 1);
}
.spot-res > :first-child { margin-top: auto; }
.spot-group h3 { margin: 0 4px 8px; font-size: 13px; line-height: 18px; font-weight: 700; color: var(--muted); }
.spot-group .list { background: var(--glass-strong); border-color: var(--glass-border); border-radius: var(--ard-r-lg); }
.spot-hint { display: flex; gap: 10px; align-items: flex-end; }
.spot-hint img { width: 56px; height: 56px; flex: none; object-fit: cover; border-radius: 50%; background: var(--card); }
.spot-hint .bubble { background: var(--glass-strong); border-color: var(--glass-border); }
.spot-bar {
  flex: none; display: flex; align-items: center; gap: 10px;
  width: 100%; max-width: 640px; margin: 0 auto; padding: 8px 16px calc(12px + var(--safe-b, 0px));
}
.spot-field {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; height: 48px; padding: 0 8px 0 16px;
  border-radius: var(--ard-r-full); background: var(--glass-strong); border: 1px solid var(--glass-border);
  box-shadow: 0 8px 24px rgb(0 0 0 / .18);
}
.spot-field > svg { width: 20px; height: 20px; flex: none; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; }
.spot-field input { flex: 1; min-width: 0; height: 100%; border: 0; padding: 0; background: none; box-shadow: none; outline: none; font: inherit; font-size: 17px; color: var(--ink); -webkit-appearance: none; appearance: none; }
.spot-field input::-webkit-search-cancel-button { display: none; }
.spot-clear { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border: 0; border-radius: 50%; background: var(--field); color: var(--muted); padding: 0; }
.spot-clear svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.spot-close { flex: none; display: grid; place-items: center; width: 48px; height: 48px; padding: 0; border-radius: 50%; background: var(--glass-strong); border: 1px solid var(--glass-border); box-shadow: 0 8px 24px rgb(0 0 0 / .18); color: var(--ink); }
.spot-close svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
@media (min-width: 720px) {
  .spot { justify-content: flex-start; align-items: center; padding-top: 18vh; background: color-mix(in srgb, var(--bg) 30%, transparent); }
  .spot-bar { order: -1; max-width: 680px; padding: 0 24px; }
  .spot-field { height: 64px; padding: 0 16px 0 22px; gap: 14px; border-radius: var(--ard-r-full); box-shadow: 0 24px 60px rgb(0 0 0 / .28); }
  .spot-field > svg { width: 26px; height: 26px; stroke-width: 1.8; }
  .spot-field input { font-size: 24px; }
  .spot-close { display: none; }
  .spot-res { flex: 0 1 auto; max-height: 56vh; max-width: 680px; justify-content: flex-start; padding: 12px 24px 24px; animation: fade .2s; }
  .spot-res > :first-child { margin-top: 0; }
}
@media (prefers-reduced-motion: reduce) { .spot, .spot-res { animation: none; } }

/* Диалог подтверждения */
.dialog-root { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 24px; }
.dialog-scrim { position: absolute; inset: 0; background: var(--scrim); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); animation: fade .18s; }
.dialog { position: relative; width: min(360px, 100%); padding: 24px 20px 20px; border-radius: var(--ard-r-xl); background: var(--glass-strong); text-align: center; box-shadow: 0 24px 60px rgb(0 0 0 / .28); animation: dlg .2s cubic-bezier(.2, .8, .2, 1); }
.dialog h2 { margin: 0 0 8px; font-size: 18px; line-height: 24px; font-weight: 800; overflow-wrap: anywhere; }
.dialog p { margin: 0; font-size: 14px; line-height: 20px; color: var(--subtle); }
.dialog-actions { display: flex; gap: 8px; margin-top: 20px; }
.dialog-actions .btn { flex: 1; }
.dialog-root--bottom { place-items: end center; padding-bottom: max(24px, calc(16px + var(--safe-b))); }
.dialog--bottom { width: min(560px, 100%); animation-name: dlg-bottom; }
@keyframes dlg { from { transform: scale(.94); opacity: 0; } }
@keyframes dlg-bottom { from { transform: translateY(32px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .dialog, .dialog-scrim { animation: none; } }

/* Загрузка нескольких скриншотов и файлов */
.shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 8px; }
.shots img, .shot-file { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: var(--ard-r-md); border: 1px solid var(--glass-border); background: var(--field); }
.shot-file { display: grid; place-items: center; align-content: center; gap: 4px; padding: 6px; color: var(--muted); }
.shot-file svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.shot-file small { font-size: 10px; line-height: 12px; max-width: 100%; overflow: hidden; text-overflow: clip; white-space: nowrap; }
.privacy { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--ard-r-lg); background: var(--glass-field); border: 1px solid var(--glass-card-border); }
.privacy svg { width: 20px; height: 20px; flex: none; margin-top: 1px; fill: none; stroke: var(--plus); stroke-width: 1.8; }
.privacy p { margin: 0; font-size: 13px; line-height: 19px; color: var(--subtle); }
.privacy b { color: var(--ink); }

/* ---------- Контролы: тёмные, лимон остаётся только в цифрах и данных ---------- */
:root { --ctl: #1B1B19; --ctl-fg: #FFFFFF; --ctl-border: #1B1B19; --ctl-on: #1B1B19; --segment-selected: #5C5C57; --segment-selected-fg: #FFFFFF; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --ctl: #3A3A36; --ctl-fg: #F2F2EE; --ctl-border: rgba(255, 255, 255, .16); --ctl-on: #6B6B64; --segment-selected: #6B6B64; --segment-selected-fg: #FFFFFF; }
}
:root[data-theme="dark"] { --ctl: #3A3A36; --ctl-fg: #F2F2EE; --ctl-border: rgba(255, 255, 255, .16); --ctl-on: #6B6B64; --segment-selected: #6B6B64; --segment-selected-fg: #FFFFFF; }

.btn.accent {
  background: var(--ctl); color: var(--ctl-fg); border: 1px solid var(--ctl-border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), 0 4px 14px rgba(0, 0, 0, .18);
}
.btn.accent:hover { filter: brightness(1.12); }

.toast-action { background: var(--ctl); color: var(--ctl-fg); }
/* Три кнопки в шапке (ИИ, поиск, добавить) — лимонные иконки; остальные круглые кнопки — цвета текста */
.icon-btn.plus, .icon-btn.ai { color: var(--plus); }
.ptr.ready svg, .ptr.spin svg { stroke: var(--ink); }

.field:has(> select.gsel-native) { position: relative; }

/* Значки Lucide: концы линий скруглены — точка «инфо» и палочка видны, значок не выглядит сломанным */
svg:where([viewBox="0 0 24 24"]) { stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Тост: ширина по тексту, с кнопкой — текст слева, кнопка справа в одну строку ---------- */
.toast:has(.toast-action) { display: flex; align-items: center; gap: 12px; }
.toast[hidden] { display: none !important; }
.toast-msg { min-width: 0; }
.toast .toast-action { flex: none; margin-left: 0; white-space: nowrap; padding: 6px 14px; border-radius: var(--ard-r-full); background: #F4F4F1; color: #141414; }
/* Постоянный информер (.toast.is-persistent, например «Загрузка обновлений» → «Вышла новая версия»): не гаснет сам;
   обычный тост в это время встаёт над ним. Об одном событии — одно уведомление: см. showToast в atomic-rd.js */
.toast.is-persistent { display: flex; align-items: center; gap: 12px; z-index: 59; }
.toast-loading { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.toast-loading svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; animation: ard-spin 1s linear infinite; }
body:has(.toast.is-persistent:not([hidden])) .toast:not(.is-persistent) { translate: 0 -56px; }
@keyframes ard-spin { to { rotate: 360deg; } }
@media (prefers-reduced-motion: reduce) { .toast-loading svg { animation: none; } }

/* Закреплённая панель действий внизу окна («Сохранить»): содержимое под ней растворяется; от кнопки до последнего поля — 24 */
.sheet-bar { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; padding: 20px 20px calc(16px + var(--safe-b, 0px)); pointer-events: none; }
.sheet-bar > * { pointer-events: auto; }
.sheet:has(> .sheet-bar) .sheet-body { padding-bottom: 120px; --fade-b: 140px; }
@media (min-width: 720px) {
  .sheet-bar { padding: 20px 24px; }
  .sheet:has(> .sheet-bar) .sheet-body { padding-bottom: 92px; --fade-b: 96px; }
}
/* Клавиатура на телефоне (iOS не уменьшает окно): шторка встаёт над ней и сжимается до видимой части —
   закреплённая кнопка остаётся над клавиатурой. --ard-vvt и --ard-vvh (верх и высота видимой области) и класс kb-open ставит atomic-rd.js */
@media (max-width: 719px) {
  html.kb-open .sheet { top: calc(var(--ard-vvt, 0px) + 8px); bottom: auto; height: calc(var(--ard-vvh, 100dvh) - 12px); max-height: none; padding-bottom: 10px; animation: none; }
  html.kb-open .sheet-bar { padding-bottom: 10px; }

  /* Короткое окно ввода (вход по коду): стоит над клавиатурой по высоте содержимого и растёт вверх, когда появляется новое поле */
  html.kb-open .sheet:is(.sheet--compact, .sheet-compact) { top: calc(var(--ard-vvt, 0px) + var(--ard-vvh, 100dvh) - 4px); height: auto; max-height: calc(var(--ard-vvh, 100dvh) - 12px - var(--safe-t, 0px)); transform: translateY(-100%); }
  /* Поиск: размытие и затемнение доходят до клавиатуры — страница под строкой поиска не просвечивает чёткой */
  html.kb-open .spot { top: var(--ard-vvt, 0px); height: var(--ard-vvh, 100dvh); }
  html.kb-open .spot::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 320px; pointer-events: none; background: color-mix(in srgb, var(--bg, #000) 45%, transparent); -webkit-backdrop-filter: blur(28px) saturate(1.6); backdrop-filter: blur(28px) saturate(1.6); }
  html.kb-open .spot-bar { padding-bottom: 10px; }
}
/* Окно-сцена (пустое состояние, ошибка в окне): текст по центру; в полях и на кнопках выравнивание своё */
.sheet-body > :is(.ard-scene, .ard-error-state) { text-align: center; }

/* ---------- Сортировка у поиска: значок «стрелки вверх-вниз», не воронка и не шеврон ----------
   Шире 520 — кнопка по ширине содержимого: значок и название текущей сортировки; до 520 — круглая кнопка 48 только со значком */
.list-tools .sort .gsel { gap: 8px; min-width: 0; justify-content: flex-start; padding: 0 16px 0 14px; }
.list-tools .sort .gsel svg { display: none; }
.list-tools .sort .gsel::before {
  content: ""; flex: none; width: 18px; height: 18px; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m21 16-4 4-4-4M17 20V4M3 8l4-4 4 4M7 4v16'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m21 16-4 4-4-4M17 20V4M3 8l4-4 4 4M7 4v16'/%3E%3C/svg%3E") center / contain no-repeat;
}
@media (max-width: 520px) {
  .list-tools { grid-template-columns: minmax(0, 1fr) 48px; }
  .list-tools .sort .gsel { width: 48px; min-width: 0; padding: 0; justify-content: center; border-radius: 50%; }
  .list-tools .sort .gsel span { display: none; }
  .list-tools .sort .gsel::before { width: 20px; height: 20px; }
}

/* ======================= Эталон Suyber (13.10.2026) =======================
   Итоговые значения app/www/styles.css Suyber 4e09349 для элементов системы: стекло, окно, поиск, фейды, поля, бейдж, тост,
   карточка. Прежний каркас .nav вынесен в ui-kit/products/showcase.css. Собрано сверкой (docs/сверка-эталон-suyber.md); поздний слой перекрывает прежние правила основ.
   Исключение по решению владельца — ниже: лимонные иконки в круглых кнопках. */
:root { --glass: rgba(255, 255, 255, .62); --glass-strong: rgba(255, 255, 255, .86); --glass-border: rgba(255, 255, 255, .75); --glass-edge: rgba(20, 20, 20, .08); --glass-shadow: 0 10px 40px rgba(20, 20, 20, .12), 0 1px 2px rgba(20, 20, 20, .06); --glass-card: rgba(255, 255, 255, .55); --glass-card-border: rgba(255, 255, 255, .4); --glass-hl: inset 0 1px 0 rgba(255, 255, 255, .3); --glass-blur: blur(18px) saturate(170%); }
:root[data-theme="dark"] { --glass: rgba(34, 34, 31, .58); --glass-strong: rgba(30, 30, 28, .9); --glass-border: rgba(255, 255, 255, .2); --glass-shadow: 0 10px 40px rgba(0, 0, 0, .5); --glass-card: rgba(38, 38, 35, .5); --glass-card-border: rgba(255, 255, 255, .17); --glass-hl: inset 0 1px 0 rgba(255, 255, 255, .08); }
.glass { -webkit-backdrop-filter: blur(28px) saturate(180%); backdrop-filter: blur(28px) saturate(180%); box-shadow: var(--glass-shadow), inset 0 1px 0 var(--glass-border); }

.chip { border-radius: 12px; box-sizing: border-box; }

.row-fields { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.row-fields.amount { grid-template-columns: minmax(0, 1fr) 104px; }
.row-fields.period { grid-template-columns: 88px minmax(0, 1fr); }
.scrim { -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.sheet { left: 0; right: 0; bottom: 0; border-radius: 28px 28px 0 0; padding: 8px 20px calc(24px + var(--safe-b)); background: var(--glass-card); -webkit-backdrop-filter: blur(24px) saturate(170%); backdrop-filter: blur(24px) saturate(170%); box-shadow: 0 8px 30px rgba(20, 20, 20, .06), inset 0 1px 0 var(--glass-card-border); border-bottom: 0; }
.sheet .grab { border-radius: 3px; }
.toast-action { border-radius: 12px; }

.icon-btn.glass { background: var(--glass-card); -webkit-backdrop-filter: blur(24px) saturate(170%); backdrop-filter: blur(24px) saturate(170%); box-shadow: 0 8px 30px rgba(20, 20, 20, .06), inset 0 1px 0 var(--glass-card-border); }
.card { -webkit-backdrop-filter: blur(24px) saturate(170%); backdrop-filter: blur(24px) saturate(170%); box-shadow: 0 8px 30px rgba(20, 20, 20, .06), inset 0 1px 0 var(--glass-card-border); }
.list { -webkit-backdrop-filter: blur(24px) saturate(170%); backdrop-filter: blur(24px) saturate(170%); box-shadow: 0 8px 30px rgba(20, 20, 20, .06), inset 0 1px 0 var(--glass-card-border); }

.gsel-menu { border-radius: 18px; }
.gsel-opt { border-radius: 12px; }
.chip:not(.warn):not(.accent) { background: color-mix(in srgb, var(--ink) 8%, transparent); box-shadow: none; border-color: transparent; }
.sheet .btn.block { border-radius: 24px; }
.sheet-body { padding-bottom: 28px; --fade-b: 48px; --fade: linear-gradient(to bottom, transparent 0, #000 24px, #000 calc(100% - var(--fade-b)), rgb(0 0 0 / .85) calc(100% - var(--fade-b) * .78), rgb(0 0 0 / .55) calc(100% - var(--fade-b) * .58), rgb(0 0 0 / .22) calc(100% - var(--fade-b) * .38), rgb(0 0 0 / .05) calc(100% - var(--fade-b) * .2), transparent 100%); }
.spot { background: color-mix(in srgb, var(--bg, #000) 45%, transparent); }
/* Mobile search must dim the page even when Android disables backdrop blur. */
@media (max-width: 719px) {
  .spot, html.kb-open .spot::after { background: var(--scrim); }
}
.spot-group .list { border-radius: 22px; }
.shot-file { border: 1px solid var(--glass-card-border); height: 100%; box-sizing: border-box; }

button.leg { width: calc(100% + 16px); margin: -6px -8px; padding: 6px 8px; border: 0; border-radius: 12px; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; transition: background .15s, transform .1s; }
button.leg:hover { background: color-mix(in srgb, var(--glass-card) 70%, var(--accent-band)); }
button.leg:active { transform: scale(.985); }
button.leg:focus-visible { outline: 2px solid var(--accent); outline-offset: 0; }

html.kb-open .spot-bar { padding-bottom: 10px; }
.shot-file svg { stroke-linecap: round; stroke-linejoin: round; }
.is-clipped { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 32px), rgb(0 0 0 / .45) calc(100% - 14px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 32px), rgb(0 0 0 / .45) calc(100% - 14px), transparent); }
.row-fields > .field { min-width: 0; }
.gsel { min-width: 0; max-width: 100%; }
.gsel span { flex: 0 1 auto; min-width: 0; }
.x-fade { --fl: 0px; --fr: 0px; -webkit-mask-image: linear-gradient(to right, transparent 0, rgb(0 0 0 / .5) calc(var(--fl) * .45), #000 var(--fl), #000 calc(100% - var(--fr)), rgb(0 0 0 / .5) calc(100% - var(--fr) * .45), transparent 100%); mask-image: linear-gradient(to right, transparent 0, rgb(0 0 0 / .5) calc(var(--fl) * .45), #000 var(--fl), #000 calc(100% - var(--fr)), rgb(0 0 0 / .5) calc(100% - var(--fr) * .45), transparent 100%); }
.search .field { position: relative; border-radius: var(--r-field); background: var(--glass-field); border: 1px solid var(--control-border); box-shadow: var(--glass-hl); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); }
.search .field input:not([type="checkbox"]):not([type="file"]) { height: 100%; background: transparent !important; border: 0 !important; box-shadow: none !important; -webkit-backdrop-filter: none !important; backdrop-filter: none !important; -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 40px), rgb(0 0 0 / .4) calc(100% - 18px), transparent calc(100% - 4px)); mask-image: linear-gradient(to right, #000 calc(100% - 40px), rgb(0 0 0 / .4) calc(100% - 18px), transparent calc(100% - 4px)); }
.search .field:focus-within { border-color: var(--control-border); box-shadow: var(--ard-focus-ring); }
.drop:has(input:disabled) { opacity: .45; pointer-events: none; }
.toast:has(.toast-action) { width: max-content; }
.sheet:focus { outline: none; }

.sheet .btn.block.text { background: transparent; border: 0; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; color: var(--ink); font-weight: 700; min-height: 44px; }
.sheet .btn.block.text:hover { background: color-mix(in srgb, var(--ink) 6%, transparent); }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --glass: rgba(34, 34, 31, .58); --glass-strong: rgba(30, 30, 28, .9); --glass-border: rgba(255, 255, 255, .2); --glass-shadow: 0 10px 40px rgba(0, 0, 0, .5); --glass-card: rgba(38, 38, 35, .5); --glass-card-border: rgba(255, 255, 255, .17); --glass-hl: inset 0 1px 0 rgba(255, 255, 255, .08); }
}

@media (max-width: 380px) {
  .row-fields:not(.amount):not(.period) { grid-template-columns: minmax(0, 1fr); }
}
@media (min-width: 720px) {
  .spot-field { border-radius: 22px; }
  .sheet-bar { padding: 20px 24px 20px; }
  /* Окно по центру: слой эталона выше прижимает .sheet к низу (left/right/bottom: 0) — на компьютере это надо вернуть, иначе окно уезжает влево за край (30.10.2026) */
  .sheet { left: 50%; right: auto; bottom: auto; top: 50%; padding: 20px 24px 24px; border-radius: 28px; border-bottom: 1px solid var(--glass-border); }
}
@media (max-width: 719px) {
  html.kb-open .sheet { top: calc(var(--ard-vvt, 0px) + 8px); height: calc(var(--ard-vvh, 100dvh) - 12px); border-radius: 28px; }
  html.kb-open .spot { top: var(--ard-vvt, 0px); height: var(--ard-vvh, 100dvh); }
  html.kb-open .sheet.sheet-compact { top: calc(var(--ard-vvt, 0px) + var(--ard-vvh, 100dvh) - 4px); height: auto; max-height: calc(var(--ard-vvh, 100dvh) - 12px - var(--safe-t, 0px)); transform: translateY(-100%); }
}
@media (prefers-reduced-motion: reduce) {
  button.leg { transition: none; }
}
@media (max-width: 959px) {
  .toast { left: 50%; right: auto; transform: translateX(-50%); width: max-content; max-width: calc(100% - 32px); bottom: calc(max(8px, calc(var(--safe-b) - 12px)) + 68px + 4px); text-align: left; }
  .toast:has(.toast-action) { left: 50%; right: auto; transform: translateX(-50%); width: max-content; max-width: calc(100% - 32px); bottom: calc(max(8px, calc(var(--safe-b) - 12px)) + 68px + 4px); text-align: left; }
  .toast-msg { flex: 1; }
}

/* Иконки круглых кнопок — эталон Suyber 14.10.2026, во всех продуктах: графитовые; лимонные — только у кнопок активного действия в шапке приложения
   (создать, найти, ИИ: .head-actions, .ard-page-bar__actions, .ard-appbar__actions или классы .ai/.plus); «удалить» и опасные действия — красные */
.icon-btn > :is(svg, .lucide) { color: var(--ink); }
.icon-btn:is(.ai, .plus) > :is(svg, .lucide), :is(.head-actions, .ard-page-bar__actions, .ard-appbar__actions) .icon-btn:not(.danger) > :is(svg, .lucide) { color: var(--plus); }
/* Кнопки шапки — 48, на узком телефоне 42 (кнопки в содержимом: стрелки календаря и «закрыть» в окне — 40) */
@media (max-width: 420px) { :is(.head-actions, .ard-page-bar__actions) { gap: 6px; } :is(.head-actions, .ard-page-bar__actions) .icon-btn { width: 42px; height: 42px; } }
.icon-btn:is(.danger, [aria-label^="Удалить"], [aria-label^="Delete"], :has(> :is(.lucide-trash, .lucide-trash-2))) > :is(svg, .lucide) { color: var(--warn); }
/* Поиск отдельно от строки сортировки: высоту поля в эталоне задаёт строка, здесь — само поле */
.search .field { min-height: 48px; }
/* Недоступная кнопка — единый стиль (в эталоне общего не было) */
.btn:disabled, .btn[aria-disabled="true"], .icon-btn:disabled { opacity: .45; pointer-events: none; }

/* ======================= Уровни стекла (05.11.2026) =======================
   Свойство системы: сколько стеклянных поверхностей размывают фон. Три значения:
     full — всё стекло (дефолт: iOS, macOS, десктопный веб);
     nav  — только навигация (нижняя панель на телефоне, левая панель на компьютере);
     none — ничего (дефолт на Android: приложение, браузер, PWA — backdrop-filter
            пересчитывается на каждый кадр прокрутки и кладёт fps, замеры 05.11.2026 в Suyber).
   Класс glass-nav / glass-none на <html> ставит продукт или js/glass.js по платформе;
   ручное переопределение — тем же классом в любую сторону (на сильном Android вернуть nav,
   на слабом десктопе убрать в none). Без класса — full.
   Механика — два независимых токена: --glass-blur (компоненты: full — значение, nav/none — none)
   и --nav-blur (навигация: full/nav — значение, none — none). */
:root {
  --nav-blur: blur(28px) saturate(180%);
  /* Фон навигации на уровне nav: полупрозрачный, как --glass на full (правило 4) */
  --nav-bg: rgba(255, 255, 255, .62);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --nav-bg: rgba(34, 34, 31, .58); }
}
:root[data-theme="dark"] { --nav-bg: rgba(34, 34, 31, .58); }

/* Without blur, glass surfaces are opaque, including custom themes. */
:is(html.glass-nav, html.glass-none) {
  --glass: var(--card) !important;
  --glass-strong: var(--card) !important;
  --glass-card: var(--card) !important;
  --glass-field: var(--field) !important;
  --control-border: var(--control-border-flat);
  --glass-blur: none !important;
  --glass-blur-strong: none !important;
}
/* Размытие выключается везде, включая захардкоженные значения и края-фейды */
:is(html.glass-nav, html.glass-none) *, :is(html.glass-nav, html.glass-none) *::before, :is(html.glass-nav, html.glass-none) *::after {
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}
/* Листы и выпадающие меню — непрозрачные */
:is(html.glass-nav, html.glass-none) :is(.sheet, .gsel-menu) { background: var(--glass-strong); }
/* Уровень nav: полупрозрачность и размытие остаются только у навигации */
html.glass-nav :is(.ard-section-nav, .ard-navbar, .ard-bottombar, .ard-rail) {
  background: var(--nav-bg);
  -webkit-backdrop-filter: var(--nav-blur) !important;
  backdrop-filter: var(--nav-blur) !important;
}

/* No blur: modal separation remains visible; floating surfaces cover content. */
:is(html.glass-nav, html.glass-none) :is(.spot, .spot::after) { background: var(--scrim); }
:is(html.glass-nav, html.glass-none) :is(.toast, .ard-snackbar) { background: #0c0c0c !important; }
:is(html.glass-nav, html.glass-none) .hero { background: #141414; }
:is(html.glass-nav, html.glass-none) :is(.ard-svc-sectabs, .ard-svc-tabgrid) { background: var(--bg); }
:is(html.glass-nav, html.glass-none) .ard-media-shorts__ic { background: #3a3a37; }
:is(html.glass-nav, html.glass-none) .ard-gcall-tile__name { background: var(--ard-call-bg); }

/* Dismiss controls use the neutral surface of the current theme. */
.icon-btn.ard-close, .spot-close { background: var(--card); color: var(--ink); border: 1px solid var(--line-soft); border-radius: 50%; }
.icon-btn.ard-close > :is(svg, .lucide), .spot-close > :is(svg, .lucide) { color: inherit; }

/* Overlay effects follow the system setting; content is never blurred. */
html.glass-none .spot, html.glass-none.kb-open .spot::after { -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--scrim); }
html.glass-none .spot :is(.spot-field, .spot-close, .list, .bubble) { background: var(--card); }
.btn.ghost { border-color: var(--glass-border); }
:is(html.glass-nav, html.glass-none) .btn.ghost { border-color: var(--control-edge); box-shadow: none; }

.toast-loading .ard-swifts { width: 20px; height: 20px; fill: currentColor; stroke: none; animation-duration: 1.6s; }

/* Nested sheet surfaces stay lighter than the surrounding chrome. */
.sheet :is(.ard-checklist, .check, .chip) { background: color-mix(in srgb, var(--ink) 3%, var(--card)); border-color: var(--line-soft); box-shadow: none; }
.sheet-head .icon-btn { background: var(--card); border-color: var(--line-soft); box-shadow: none; }

/* Content surfaces are opaque by default, independently of navigation glass.
   Opt in on a card or its section with data-card-style="glass". */
:root, [data-card-style="flat"] {
  --ard-card-background: var(--card);
  --ard-card-border: var(--line);
  --ard-card-blur: none;
}
[data-card-style="glass"] {
  --ard-card-background: color-mix(in srgb, var(--card) 86%, transparent);
  --ard-card-border: var(--line);
  --ard-card-blur: var(--glass-blur);
}
:is(.card, .list) {
  background: var(--ard-card-background);
  border-color: var(--ard-card-border);
  -webkit-backdrop-filter: var(--ard-card-blur);
  backdrop-filter: var(--ard-card-blur);
}
.seg button[aria-pressed="true"] :is(svg, [data-icon]) { color: inherit; }

img.ard-avatar-loading {
  aspect-ratio: 1; color: transparent; object-position: -9999px -9999px;
  background: linear-gradient(90deg, var(--field) 25%, var(--card) 50%, var(--field) 75%);
  background-size: 200% 100%; animation: ard-shimmer 1.4s linear infinite;
}
@media (prefers-reduced-motion: reduce) { img.ard-avatar-loading { animation: none; } }
/* Disabling material effects also makes explicit glass cards opaque. */
html:is(.glass-none, .glass-nav) [data-card-style="glass"] {
  --ard-card-background: var(--card);
  --ard-card-blur: none;
}
