@font-face {
  font-family: "Onest";
  src: url("/fonts/onest-cyrillic-wght-normal.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Onest";
  src: url("/fonts/onest-latin-wght-normal.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+20BD, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --accent: #0a84ff;
  --accent-rgb: 10 132 255;
  --on-accent: #fff;

  --bg: #000;
  --bg-elev: #0d0d0f;
  --card: #151517;
  --card-2: #1d1d20;
  --card-3: #26262a;
  --line: rgb(255 255 255 / .07);
  --line-2: rgb(255 255 255 / .12);
  --text: #f5f5f7;
  --text-2: rgb(235 235 245 / .62);
  --text-3: rgb(235 235 245 / .34);
  --glass: rgb(36 36 40 / .58);
  --glass-hi: rgb(255 255 255 / .14);
  --shadow: 0 18px 40px -18px rgb(0 0 0 / .8);

  --green: #30d158;
  --red: #ff453a;
  --orange: #ff9f0a;
  --yellow: #ffd60a;

  --r-xl: 28px;
  --r-lg: 22px;
  --r-md: 16px;
  --r-sm: 12px;

  --font: -apple-system, "SF Pro Text", "SF Pro Display", "Onest", system-ui, sans-serif;
  --spring: cubic-bezier(.32, 1.4, .5, 1);
  --ease: cubic-bezier(.2, .8, .2, 1);

  --safe-top: max(env(safe-area-inset-top), var(--tg-safe-area-inset-top, 0px));
  --safe-bottom: max(env(safe-area-inset-bottom), var(--tg-safe-area-inset-bottom, 0px));
  --content-top: var(--tg-content-safe-area-inset-top, 0px);

  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #f2f2f7;
  --bg-elev: #f7f7fa;
  --card: #fff;
  --card-2: #f2f2f5;
  --card-3: #e7e7ec;
  --line: rgb(0 0 0 / .06);
  --line-2: rgb(0 0 0 / .1);
  --text: #0b0b0d;
  --text-2: rgb(60 60 67 / .66);
  --text-3: rgb(60 60 67 / .36);
  --glass: rgb(250 250 252 / .7);
  --glass-hi: rgb(255 255 255 / .9);
  --shadow: 0 18px 40px -22px rgb(0 0 0 / .28);
  --green: #24b14a;
  --red: #e5352b;
  --orange: #f08c00;
  color-scheme: light;
}

:root[data-accent="blue"] { --accent: #0a84ff; --accent-rgb: 10 132 255; }
:root[data-accent="green"] { --accent: #30d158; --accent-rgb: 48 209 88; --on-accent: #04210d; }
:root[data-accent="orange"] { --accent: #ff9f0a; --accent-rgb: 255 159 10; --on-accent: #2b1700; }
:root[data-accent="red"] { --accent: #ff453a; --accent-rgb: 255 69 58; }
:root[data-accent="purple"] { --accent: #bf5af2; --accent-rgb: 191 90 242; }
:root[data-accent="teal"] { --accent: #40c8e0; --accent-rgb: 64 200 224; --on-accent: #032027; }
:root[data-accent="pink"] { --accent: #ff375f; --accent-rgb: 255 55 95; }
:root[data-accent="graphite"] { --accent: #a1a1a8; --accent-rgb: 161 161 168; --on-accent: #111; }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.35;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior-y: none;
  min-height: 100vh;
  min-height: var(--tg-viewport-stable-height, 100vh);
}
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
input, textarea, select { -webkit-appearance: none; appearance: none; }
img { display: block; }
.num { font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.hidden { display: none !important; }

/* ---------- Загрузка ---------- */
.boot { height: 100vh; display: grid; place-items: center; }
.boot-mark { display: flex; gap: 6px; }
.boot-mark span { width: 9px; height: 9px; border-radius: 50%; background: var(--text-3); animation: dot 1s var(--ease) infinite; }
.boot-mark span:nth-child(2) { animation-delay: .12s; }
.boot-mark span:nth-child(3) { animation-delay: .24s; }
@keyframes dot { 0%, 100% { transform: translateY(0); opacity: .35; } 40% { transform: translateY(-6px); opacity: 1; } }

/* ---------- Экран ---------- */
.screen {
  padding: calc(var(--safe-top) + var(--content-top) + 10px) 12px calc(var(--safe-bottom) + 104px);
  max-width: 560px;
  margin: 0 auto;
  animation: screen-in .42s var(--ease) both;
}
.screen.no-tabs { padding-bottom: calc(var(--safe-bottom) + 112px); }
@keyframes screen-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.screen.push { animation: push-in .38s var(--ease) both; }
@keyframes push-in { from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: none; } }

.stagger > * { animation: rise .5s var(--ease) both; }
.stagger > *:nth-child(1) { animation-delay: .02s; }
.stagger > *:nth-child(2) { animation-delay: .06s; }
.stagger > *:nth-child(3) { animation-delay: .1s; }
.stagger > *:nth-child(4) { animation-delay: .14s; }
.stagger > *:nth-child(5) { animation-delay: .18s; }
.stagger > *:nth-child(6) { animation-delay: .22s; }
.stagger > *:nth-child(7) { animation-delay: .26s; }
.stagger > *:nth-child(n+8) { animation-delay: .3s; }
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(.985); } to { opacity: 1; transform: none; } }

.title-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 6px 6px 14px; }
.title { font-size: 30px; font-weight: 750; letter-spacing: -.035em; margin: 0; }
.section { margin: 22px 6px 10px; display: flex; align-items: baseline; justify-content: space-between; }
.section h2 { font-size: 20px; font-weight: 700; letter-spacing: -.02em; margin: 0; }
.section .link { color: var(--accent); font-size: 15px; font-weight: 500; }
.overline { font-size: 12px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: var(--text-2); }

/* ---------- Карточки ---------- */
.card {
  background: var(--card);
  border-radius: var(--r-xl);
  padding: 18px;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px var(--line);
}
.card + .card { margin-top: 10px; }
.press { transition: transform .35s var(--spring), background-color .2s; }
.press:active { transform: scale(.965); transition-duration: .12s; }
.grid { display: grid; gap: 10px; }
.grid-2 { grid-template-columns: 1fr 1fr; }
.stack { display: flex; flex-direction: column; gap: 10px; }

.hero {
  min-height: 210px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background:
    radial-gradient(120% 90% at 100% 0%, rgb(var(--accent-rgb) / .38), transparent 58%),
    radial-gradient(90% 80% at 0% 100%, rgb(var(--accent-rgb) / .16), transparent 60%),
    linear-gradient(160deg, #1b1b1f, #0e0e10);
}
:root[data-theme="light"] .hero {
  background:
    radial-gradient(120% 90% at 100% 0%, rgb(var(--accent-rgb) / .3), transparent 58%),
    radial-gradient(90% 80% at 0% 100%, rgb(var(--accent-rgb) / .12), transparent 60%),
    linear-gradient(160deg, #ffffff, #f4f4f8);
}
.hero::after {
  content: "";
  position: absolute; inset: 0;
  background-image: radial-gradient(rgb(255 255 255 / .05) 1px, transparent 1.2px);
  background-size: 14px 14px;
  mask-image: linear-gradient(200deg, #000 10%, transparent 55%);
  pointer-events: none;
}
.hero-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; position: relative; z-index: 1; }
.hero-hello { font-size: 17px; font-weight: 700; letter-spacing: -.015em; }
.hero-company { font-size: 13px; color: var(--text-2); margin-top: 1px; }
.hero-amount { display: flex; align-items: baseline; gap: 6px; margin-top: 4px; }
.hero-amount .num { font-size: 46px; font-weight: 760; line-height: 1; letter-spacing: -.045em; }
.hero-amount .cur { font-size: 26px; font-weight: 650; color: var(--text-2); }
.hero-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; position: relative; z-index: 1; }
.hero .sticker-xl { position: absolute; right: 8px; bottom: 6px; width: 104px; height: 104px; z-index: 0; filter: drop-shadow(0 12px 22px rgb(0 0 0 / .45)); }
.delta { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; padding: 4px 9px; border-radius: 999px; background: rgb(255 255 255 / .08); margin-top: 10px; }
:root[data-theme="light"] .delta { background: rgb(0 0 0 / .05); }
.delta.up { color: var(--green); }
.delta.down { color: var(--red); }

.avatar {
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 15px; font-weight: 700; letter-spacing: -.02em;
  color: #fff;
  background: linear-gradient(145deg, hsl(var(--h, 215) 70% 58%), hsl(calc(var(--h, 215) + 35) 65% 42%));
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / .18);
  flex: none;
}
.avatar.sm { width: 30px; height: 30px; font-size: 11px; }
.avatar.lg { width: 76px; height: 76px; font-size: 26px; }
.avatars { display: flex; }
.avatars .avatar { margin-left: -8px; box-shadow: 0 0 0 2px var(--card); }
.avatars .avatar:first-child { margin-left: 0; }

.sticker { width: 52px; height: 52px; flex: none; }
[data-sticker] { display: block; position: relative; }
[data-sticker] > img, [data-sticker] > svg { width: 100% !important; height: 100% !important; object-fit: contain; display: block; }
.sticker-lg { width: 72px; height: 72px; }
.sticker-xl { width: 120px; height: 120px; }

/* Плитки статистики */
.tile { padding: 16px; min-height: 112px; display: flex; flex-direction: column; justify-content: space-between; gap: 10px; }
.tile .label { font-size: 13px; color: var(--text-2); font-weight: 500; }
.tile .value { font-size: 26px; font-weight: 720; letter-spacing: -.035em; line-height: 1.05; }
.tile .value small { font-size: 15px; font-weight: 600; color: var(--text-2); margin-left: 3px; letter-spacing: 0; }
.tile .hint { font-size: 12.5px; color: var(--text-3); }
.tile .sticker { width: 38px; height: 38px; }
.tile-head { display: flex; justify-content: space-between; align-items: flex-start; }

.ring { width: 44px; height: 44px; }
.ring circle { fill: none; stroke-width: 5; }
.ring .bg { stroke: var(--card-3); }
.ring .fg { stroke: var(--accent); stroke-linecap: round; transition: stroke-dashoffset 1.2s var(--ease); }

/* Призыв к действию */
.cta {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 18px;
  background: linear-gradient(135deg, rgb(var(--accent-rgb) / .22), rgb(var(--accent-rgb) / .07));
  box-shadow: inset 0 0 0 1px rgb(var(--accent-rgb) / .28);
}
.cta .sticker { width: 58px; height: 58px; }
.cta-title { font-size: 18px; font-weight: 720; letter-spacing: -.02em; }
.cta-sub { font-size: 13.5px; color: var(--text-2); margin-top: 2px; }
.cta .go {
  margin-left: auto; width: 40px; height: 40px; border-radius: 50%;
  background: var(--accent); color: var(--on-accent);
  display: grid; place-items: center; flex: none;
  box-shadow: 0 8px 18px -6px rgb(var(--accent-rgb) / .7);
}

/* Строки списка */
.list { background: var(--card); border-radius: var(--r-xl); overflow: hidden; box-shadow: inset 0 0 0 1px var(--line); }
.row {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 16px;
  min-height: 60px;
  position: relative;
  width: 100%;
  text-align: left;
}
.row + .row::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; height: 1px; background: var(--line); }
.row.has-avatar + .row.has-avatar::before { left: 68px; }
button.row:active, a.row:active { background: var(--card-2); }
.row-main { flex: 1; min-width: 0; }
.row-title { font-size: 16px; font-weight: 600; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-sub { font-size: 13.5px; color: var(--text-2); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-end { text-align: right; flex: none; }
.row-amount { font-size: 16px; font-weight: 680; letter-spacing: -.02em; }
.chev { color: var(--text-3); flex: none; }

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; font-weight: 650;
  padding: 3px 8px; border-radius: 999px;
  background: var(--card-3); color: var(--text-2);
  white-space: nowrap;
}
.badge.green { background: rgb(48 209 88 / .15); color: var(--green); }
.badge.red { background: rgb(255 69 58 / .15); color: var(--red); }
.badge.orange { background: rgb(255 159 10 / .16); color: var(--orange); }
.badge.accent { background: rgb(var(--accent-rgb) / .16); color: var(--accent); }

/* ---------- Таб-бар: жидкое стекло ---------- */
.tabbar {
  position: fixed;
  left: 0; right: 0;
  bottom: calc(var(--safe-bottom) + 12px);
  display: flex; justify-content: center; align-items: center; gap: 10px;
  pointer-events: none;
  z-index: 40;
  animation: bar-in .6s var(--spring) both .1s;
}
@keyframes bar-in { from { transform: translateY(120%); } to { transform: none; } }
.tabbar[hidden] { display: none; }
.web-back {
  position: fixed; z-index: 44; top: calc(var(--safe-top) + 10px); left: 10px;
  height: 36px; padding: 0 14px 0 8px; border-radius: 999px;
  display: inline-flex; align-items: center; gap: 2px;
  color: var(--accent); font-size: 16px; font-weight: 600;
}
.web-back svg { width: 20px; height: 20px; }
.has-web-back .screen.push, .has-web-back > .screen { padding-top: calc(var(--safe-top) + 54px); }
.glass {
  background: var(--glass);
  -webkit-backdrop-filter: blur(22px) saturate(190%);
  backdrop-filter: blur(22px) saturate(190%);
  box-shadow:
    inset 0 1px 0 var(--glass-hi),
    inset 0 0 0 1px rgb(255 255 255 / .06),
    0 10px 30px -8px rgb(0 0 0 / .55);
}
:root[data-theme="light"] .glass { box-shadow: inset 0 1px 0 #fff, inset 0 0 0 1px rgb(0 0 0 / .05), 0 10px 30px -10px rgb(0 0 0 / .22); }
.tab-pill {
  pointer-events: auto;
  position: relative;
  display: flex;
  padding: 5px;
  border-radius: 999px;
}
.tab-pill .indicator {
  position: absolute; top: 5px; bottom: 5px; left: 5px;
  border-radius: 999px;
  background: rgb(255 255 255 / .12);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .12);
  transition: transform .55s var(--spring), width .55s var(--spring);
}
:root[data-theme="light"] .tab-pill .indicator { background: rgb(0 0 0 / .07); box-shadow: none; }
.tab {
  position: relative; z-index: 1;
  width: 74px; height: 54px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--text-2);
  border-radius: 999px;
  transition: color .25s, transform .35s var(--spring);
}
.tab:active { transform: scale(.9); }
.tab-pill.four .tab { width: 66px; }
@media (max-width: 370px) { .tab-pill.four .tab { width: 60px; } .tab span { font-size: 10px; } }
.tab svg { width: 24px; height: 24px; }
.tab span { font-size: 10.5px; font-weight: 600; letter-spacing: .01em; }
.tab.on { color: var(--accent); }
.tab-solo {
  pointer-events: auto;
  width: 64px; height: 64px; border-radius: 50%;
  display: grid; place-items: center;
  color: var(--text-2);
  transition: transform .35s var(--spring), color .25s;
}
.tab-solo:active { transform: scale(.9); }
.tab-solo.on { color: var(--accent); }
.tab-solo svg { width: 26px; height: 26px; }

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 52px; padding: 0 22px;
  border-radius: 999px;
  font-size: 17px; font-weight: 650; letter-spacing: -.01em;
  background: var(--card-2);
  color: var(--text);
  transition: transform .35s var(--spring), opacity .2s, background-color .2s;
  white-space: nowrap;
}
.btn:active { transform: scale(.96); }
.btn[disabled] { opacity: .4; pointer-events: none; }
.btn.primary { background: var(--accent); color: var(--on-accent); box-shadow: 0 10px 24px -10px rgb(var(--accent-rgb) / .8); }
.btn.danger { background: rgb(255 69 58 / .14); color: var(--red); }
.btn.ghost { background: transparent; color: var(--accent); }
.btn.block { width: 100%; }
.btn.sm { height: 38px; padding: 0 16px; font-size: 15px; }
.btn svg { width: 20px; height: 20px; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--card-2); color: var(--text);
  transition: transform .35s var(--spring);
  flex: none;
}
.icon-btn:active { transform: scale(.9); }
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn.accent { background: var(--accent); color: var(--on-accent); }

.dock {
  position: fixed; left: 0; right: 0; bottom: 0;
  padding: 12px 16px calc(var(--safe-bottom) + 14px);
  display: flex; gap: 10px;
  z-index: 45;
  background: linear-gradient(to top, var(--bg) 55%, transparent);
  animation: bar-in .5s var(--spring) both;
}
.dock > * { flex: 1; }
.dock .btn { height: 56px; }

/* ---------- Поля ---------- */
.field { display: block; }
.field + .field { margin-top: 10px; }
.field-label { display: block; font-size: 13px; color: var(--text-2); margin: 0 6px 6px; font-weight: 500; }
.input {
  width: 100%;
  height: 52px;
  padding: 0 16px;
  border-radius: var(--r-md);
  background: var(--card-2);
  border: 1px solid transparent;
  font-size: 17px;
  outline: none;
  transition: border-color .2s, background-color .2s;
}
textarea.input { height: auto; min-height: 96px; padding: 14px 16px; resize: none; line-height: 1.4; }
.input:focus { border-color: rgb(var(--accent-rgb) / .7); background: var(--card); }
.input::placeholder { color: var(--text-3); }
.search {
  display: flex; align-items: center; gap: 8px;
  height: 44px; padding: 0 14px;
  border-radius: 14px;
  background: var(--card-2);
  color: var(--text-3);
}
.search input { flex: 1; height: 100%; background: none; border: 0; outline: none; font-size: 17px; color: var(--text); }
.search svg { width: 18px; height: 18px; flex: none; }
.form-group { background: var(--card); border-radius: var(--r-lg); box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; }
.form-row { position: relative; min-height: 56px; padding: 0 16px; display: block; }
.form-row + .form-row::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; height: 1px; background: var(--line); }
/* Подпись стоит внутри поля, как подсказка, и исчезает, когда в поле что-то есть. */
.form-row label {
  position: absolute; left: 16px; right: 16px; top: 50%; transform: translateY(-50%);
  font-size: 16px; color: var(--text-3); pointer-events: none;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: opacity .15s;
}
.form-row.filled label, .form-row:has(input[placeholder]:focus) label { opacity: 0; }
.form-row input, .form-row select {
  display: block; width: 100%; height: 56px; padding: 0; margin: 0;
  background: none; border: 0; outline: none; font-size: 16px; text-align: left; text-overflow: ellipsis; color: var(--text);
}
.form-row input::placeholder { color: transparent; }
.form-row input:focus::placeholder { color: var(--text-3); }
.form-row input:focus { caret-color: var(--accent); }
.form-row input[type="password"] { font-family: Verdana, "DejaVu Sans", sans-serif; font-size: 30px; letter-spacing: .06em; line-height: 1; }
.form-row input:disabled { color: var(--text-2); opacity: 1; -webkit-text-fill-color: var(--text-2); }
/* В списке выбора значение есть всегда, поэтому подпись остаётся — маленькой строкой над значением. */
.form-row:has(select) label { top: 9px; transform: none; font-size: 12px; opacity: 1; }
.form-row select { padding: 18px 22px 0 0; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238e8e93' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E") no-repeat right center / 16px; }
.form-row select option { background: var(--card); color: var(--text); }
.form-note { font-size: 13px; color: var(--text-3); margin: 8px 16px 0; }

/* Чипы и сегменты */
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px 6px 4px; margin: 0 -12px; padding-left: 18px; padding-right: 18px; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none;
  height: 36px; padding: 0 15px;
  border-radius: 999px;
  background: var(--card-2);
  font-size: 15px; font-weight: 600;
  color: var(--text);
  display: inline-flex; align-items: center; gap: 6px;
  transition: background-color .2s, color .2s, transform .3s var(--spring);
}
.chip:active { transform: scale(.94); }
.chip.on { background: var(--text); color: var(--bg); }
.chip .count { font-size: 12px; opacity: .6; }
.segment {
  display: flex; position: relative;
  background: var(--card-2);
  border-radius: 12px; padding: 3px;
}
.segment button { flex: 1; height: 34px; border-radius: 9px; font-size: 14px; font-weight: 600; color: var(--text-2); position: relative; z-index: 1; transition: color .2s; }
.segment button.on { color: var(--text); }
.segment .thumb { position: absolute; top: 3px; bottom: 3px; left: 3px; border-radius: 9px; background: var(--card-3); box-shadow: 0 3px 8px rgb(0 0 0 / .2); transition: transform .45s var(--spring), width .45s var(--spring); }
:root[data-theme="light"] .segment .thumb { background: #fff; }

.toggle {
  width: 51px; height: 31px; border-radius: 999px;
  background: var(--card-3);
  position: relative; flex: none;
  transition: background-color .25s;
}
.toggle::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 27px; height: 27px; border-radius: 50%;
  background: #fff;
  box-shadow: 0 3px 8px rgb(0 0 0 / .25);
  transition: transform .4s var(--spring);
}
.toggle.on { background: var(--green); }
.toggle.on::after { transform: translateX(20px); }

.check {
  width: 26px; height: 26px; border-radius: 50%;
  box-shadow: inset 0 0 0 2px var(--text-3);
  display: grid; place-items: center; flex: none;
  color: transparent;
  transition: background-color .2s, box-shadow .2s, transform .35s var(--spring);
}
.check svg { width: 16px; height: 16px; }
.on > .check, .check.on { background: var(--accent); box-shadow: none; color: var(--on-accent); transform: scale(1.06); }

/* ---------- Листы (bottom sheet) ---------- */
.backdrop {
  position: fixed; inset: 0; z-index: 60;
  background: rgb(0 0 0 / .5);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  animation: fade .3s var(--ease) both;
}
.backdrop.out { animation: fade-out .25s var(--ease) both; }
@keyframes fade { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 61;
  max-height: calc(100% - var(--safe-top) - 40px);
  display: flex; flex-direction: column;
  background: var(--bg-elev);
  border-radius: 30px 30px 0 0;
  box-shadow: 0 -1px 0 var(--line-2), 0 -20px 50px rgb(0 0 0 / .4);
  animation: sheet-in .5s var(--spring) both;
  max-width: 600px; margin: 0 auto;
}
.sheet.out { animation: sheet-out .28s var(--ease) both; }
@keyframes sheet-in { from { transform: translateY(100%); } }
@keyframes sheet-out { to { transform: translateY(100%); } }
.sheet-grab { width: 38px; height: 5px; border-radius: 3px; background: var(--text-3); margin: 8px auto 0; flex: none; opacity: .6; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 16px 8px; flex: none; }
.sheet-title { font-size: 19px; font-weight: 720; letter-spacing: -.02em; }
.sheet-body { overflow-y: auto; padding: 4px 14px calc(var(--safe-bottom) + 20px); -webkit-overflow-scrolling: touch; }
.sheet-body.with-dock { padding-bottom: 12px; }
.sheet > .dock { position: relative; flex: none; margin: 0; background: var(--bg-elev); box-shadow: 0 -1px 0 var(--line); animation: none; }

/* ---------- Уведомление ---------- */
.toast {
  position: fixed; left: 50%; top: calc(var(--safe-top) + var(--content-top) + 10px);
  transform: translate(-50%, -150%);
  z-index: 90;
  padding: 12px 18px;
  border-radius: 999px;
  font-size: 15px; font-weight: 600;
  max-width: calc(100% - 32px);
  display: flex; align-items: center; gap: 8px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(22px) saturate(190%);
  backdrop-filter: blur(22px) saturate(190%);
  box-shadow: inset 0 1px 0 var(--glass-hi), 0 12px 30px -10px rgb(0 0 0 / .6);
  transition: transform .5s var(--spring);
  pointer-events: none;
}
.toast.show { transform: translate(-50%, 0); }
.toast.error { color: var(--red); }
.toast svg { width: 18px; height: 18px; flex: none; }

/* ---------- Пустые состояния и скелетоны ---------- */
.empty { text-align: center; padding: 34px 20px; }
.empty .sticker { margin: 0 auto 10px; width: 84px; height: 84px; }
.empty-title { font-size: 18px; font-weight: 700; letter-spacing: -.015em; }
.empty-text { font-size: 14.5px; color: var(--text-2); margin-top: 4px; }
.skel { background: linear-gradient(100deg, var(--card) 40%, var(--card-2) 50%, var(--card) 60%); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; border-radius: var(--r-xl); }
@keyframes shimmer { to { background-position: -100% 0; } }

/* ---------- Графики ---------- */
.spark { width: 100%; height: 46px; display: block; overflow: visible; }
.spark path.line { fill: none; stroke: var(--accent); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.spark path.area { fill: url(#sparkfill); }
.spark .draw { stroke-dasharray: 1000; stroke-dashoffset: 1000; animation: draw 1.4s var(--ease) forwards .2s; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.bars { display: flex; align-items: flex-end; gap: 4px; height: 120px; }
.bars .bar { flex: 1; border-radius: 6px 6px 3px 3px; background: rgb(var(--accent-rgb) / .28); transform-origin: bottom; animation: grow .7s var(--spring) both; position: relative; min-height: 3px; }
.bars .bar.hi { background: var(--accent); }
.bars .bar.zero { background: var(--card-3); }
@keyframes grow { from { transform: scaleY(0); } }
.bars-x { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-3); margin-top: 6px; }

/* ---------- Сдача работы ---------- */
.steps { display: flex; gap: 6px; margin: 2px 6px 16px; }
.steps i { flex: 1; height: 4px; border-radius: 2px; background: var(--card-3); overflow: hidden; position: relative; }
.steps i::after { content: ""; position: absolute; inset: 0; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform .5s var(--ease); }
.steps i.on::after { transform: scaleX(1); }
.step-title { font-size: 26px; font-weight: 750; letter-spacing: -.03em; margin: 0 6px 4px; }
.step-sub { font-size: 15px; color: var(--text-2); margin: 0 6px 16px; }

.pick { display: flex; align-items: center; gap: 14px; padding: 16px; text-align: left; width: 100%; }
.pick .sticker { width: 44px; height: 44px; }
.pick-title { font-size: 17px; font-weight: 680; letter-spacing: -.015em; }
.pick-sub { font-size: 13.5px; color: var(--text-2); margin-top: 2px; }

.sys-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.sys {
  min-height: 84px; padding-top: 12px !important; padding-bottom: 12px !important; border-radius: 20px; gap: 3px;
  background: var(--card);
  box-shadow: inset 0 0 0 1px var(--line);
  display: flex; flex-direction: column; align-items: flex-start; justify-content: center;
  padding: 0 14px; text-align: left;
  transition: transform .35s var(--spring), background-color .2s, box-shadow .2s;
}
.sys b { font-size: 21px; font-weight: 750; letter-spacing: -.02em; }
.sys b { font-size: 24px; }
.sys span { font-size: 13px; line-height: 1.25; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sys:active { transform: scale(.94); }
.sys.on { background: rgb(var(--accent-rgb) / .16); box-shadow: inset 0 0 0 2px var(--accent); }

.mat { display: flex; align-items: center; gap: 12px; padding: 12px 14px; width: 100%; text-align: left; }
.mat-size {
  width: 52px; height: 48px; border-radius: 14px; flex: none;
  display: grid; place-items: center;
  background: var(--card-2);
  font-size: 14px; font-weight: 700; color: var(--text-2);
  position: relative;
}
.mat-size .shape { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); border: 2px solid var(--accent); border-radius: 3px; box-shadow: inset 0 0 0 3px rgb(var(--accent-rgb) / .12); }
.mat-size .shape.round { border-radius: 50%; }
.mat-size.lg { width: 76px; height: 64px; border-radius: 18px; }

.keypad-display {
  text-align: center; padding: 14px 0 6px;
}
.keypad-display .val { font-size: 64px; font-weight: 760; letter-spacing: -.05em; line-height: 1; }
.keypad-display .val.empty { color: var(--text-3); }
.keypad-display .unit { font-size: 28px; font-weight: 650; color: var(--text-2); margin-left: 6px; }
.keypad-display .area { margin-top: 10px; font-size: 16px; color: var(--accent); font-weight: 650; min-height: 22px; }
.caret { display: inline-block; width: 3px; height: 52px; background: var(--accent); margin-left: 3px; vertical-align: -6px; border-radius: 2px; animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.quick { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin: 6px 0 14px; }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.key {
  height: 62px; border-radius: 18px;
  background: var(--card);
  box-shadow: inset 0 0 0 1px var(--line);
  font-size: 28px; font-weight: 550;
  transition: transform .3s var(--spring), background-color .15s;
}
.key:active { transform: scale(.92); background: var(--card-3); }
.key svg { width: 26px; height: 26px; margin: auto; }

.receipt { padding: 0; }
.receipt-head { padding: 18px 18px 14px; display: flex; gap: 12px; align-items: center; }
.receipt-line { display: flex; justify-content: space-between; gap: 12px; padding: 12px 18px; position: relative; }
.receipt-line::before { content: ""; position: absolute; top: 0; left: 18px; right: 18px; border-top: 1px dashed var(--line-2); }
.receipt-line .what { font-size: 15px; font-weight: 600; }
.receipt-line .how { font-size: 13px; color: var(--text-2); margin-top: 2px; }
.receipt-line .sum { font-size: 16px; font-weight: 700; white-space: nowrap; }
.receipt-total { padding: 16px 18px 18px; display: flex; justify-content: space-between; align-items: baseline; background: rgb(var(--accent-rgb) / .1); }
.receipt-total .num { font-size: 30px; font-weight: 780; letter-spacing: -.04em; }
.warn { display: flex; gap: 10px; padding: 12px 14px; border-radius: 16px; background: rgb(255 159 10 / .12); color: var(--orange); font-size: 14px; font-weight: 550; }
.warn.red { background: rgb(255 69 58 / .12); color: var(--red); }
.warn svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }

.done-wrap { min-height: 70vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 20px; }
.done-wrap .sticker { width: 150px; height: 150px; animation: pop .7s var(--spring) both; }
@keyframes pop { from { transform: scale(.3); opacity: 0; } }
.done-title { font-size: 30px; font-weight: 780; letter-spacing: -.035em; margin-top: 8px; }
.done-sum { font-size: 52px; font-weight: 800; letter-spacing: -.05em; margin-top: 6px; color: var(--accent); }

/* ---------- Профиль ---------- */
.profile-head { text-align: center; padding: 24px 18px 20px; }
.profile-head .avatar { margin: 0 auto 12px; }
.profile-name { font-size: 24px; font-weight: 750; letter-spacing: -.03em; }
.profile-role { font-size: 15px; color: var(--text-2); margin-top: 2px; }
.swatches { display: flex; gap: 12px; flex-wrap: wrap; padding: 16px; }
.swatch {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--c);
  position: relative;
  transition: transform .4s var(--spring);
}
.swatch::after { content: ""; position: absolute; inset: -5px; border-radius: 50%; box-shadow: 0 0 0 2.5px var(--c); opacity: 0; transform: scale(.8); transition: opacity .2s, transform .4s var(--spring); }
.swatch.on::after { opacity: 1; transform: none; }
.swatch:active { transform: scale(.88); }

/* Логин */
.login { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; padding: calc(var(--safe-top) + 30px) 18px calc(var(--safe-bottom) + 30px); max-width: 440px; margin: 0 auto; }
.login .sticker { width: 110px; height: 110px; margin: 0 auto 6px; }
.login h1 { text-align: center; font-size: 30px; font-weight: 780; letter-spacing: -.035em; margin: 6px 0 6px; }
.login p { text-align: center; color: var(--text-2); margin: 0 0 24px; font-size: 15.5px; }

/* Секрет (пароль, код) */
.secret {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--card-2);
  font-family: "SF Mono", ui-monospace, Menlo, monospace;
  font-size: 18px; font-weight: 600; letter-spacing: .02em;
}

/* Таймлайн досье */
.timeline { position: relative; padding-left: 22px; }
.timeline::before { content: ""; position: absolute; left: 6px; top: 8px; bottom: 8px; width: 2px; background: var(--line-2); border-radius: 1px; }
.tl-item { position: relative; padding: 0 0 16px; }
.tl-item::before { content: ""; position: absolute; left: -20px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: var(--c, var(--text-3)); box-shadow: 0 0 0 3px var(--card); }
.tl-head { font-size: 13px; color: var(--text-2); }
.tl-text { font-size: 15px; margin-top: 2px; white-space: pre-wrap; }

.progress { height: 6px; border-radius: 3px; background: var(--card-3); overflow: hidden; }
.progress i { display: block; height: 100%; border-radius: 3px; background: var(--accent); transform-origin: left; animation: grow-x .9s var(--ease) both; }
.progress i.red { background: var(--red); }
.progress i.orange { background: var(--orange); }
@keyframes grow-x { from { transform: scaleX(0); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0ms !important; transition-duration: .01ms !important; }
}

.reserve-bar {
  position: fixed; z-index: 46; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--safe-bottom) + 92px);
  max-width: calc(100% - 32px); padding: 9px 14px; border-radius: 14px;
  font-size: 13px; font-weight: 600; color: var(--orange); text-align: center;
}
.form-row:has(input:-webkit-autofill) label { opacity: 0; }
.form-row input:-webkit-autofill { -webkit-text-fill-color: var(--text); transition: background-color 9999s; }
/* Поле только для чтения: подпись тоже остаётся маленькой строкой сверху. */
.form-row:has(input:disabled) label { top: 9px; transform: none; font-size: 12px; opacity: 1; }
.form-row input:disabled { padding-top: 18px; }
