/* «Поколение» — интерфейс в стиле iOS: белый фон, мягкие серые карточки, оранжевый акцент */

@font-face { font-family: 'Unbounded'; font-weight: 800; font-display: swap; src: url(/fonts/unbounded-cyrillic-800-normal.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Unbounded'; font-weight: 800; font-display: swap; src: url(/fonts/unbounded-latin-800-normal.woff2) format('woff2'); 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+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'InterVar'; font-weight: 100 900; font-display: swap; src: url(/fonts/inter-cyrillic-wght-normal.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'InterVar'; font-weight: 100 900; font-display: swap; src: url(/fonts/inter-latin-wght-normal.woff2) format('woff2'); 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+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --bg: #ffffff;
  --fill: #f4f4f6;
  --fill-2: #ebebef;
  --fill-3: #e1e1e6;
  --separator: rgba(60, 60, 67, 0.12);
  --label: #111114;
  --label-2: rgba(60, 60, 67, 0.64);
  --label-3: rgba(60, 60, 67, 0.36);
  --accent: #ff5714;
  --accent-2: #ff8a47;
  --accent-ink: #e64a0a;
  --accent-soft: #fff1e9;
  --gradient: linear-gradient(135deg, #ff4b0f 0%, #ff7a33 55%, #ff9a5c 100%);
  --green: #34c759;
  --green-soft: #e9f9ee;
  --red: #ff3b30;
  --red-soft: #ffeceb;
  --blue: #007aff;
  --blue-soft: #e8f2ff;
  --purple: #af52de;
  --purple-soft: #f6ecfc;
  --yellow: #ffb800;
  --yellow-soft: #fff7e0;
  --r-card: 22px;
  --r-btn: 14px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.14);
  --font: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'InterVar', system-ui, Roboto, 'Segoe UI', sans-serif;
  --font-logo: 'Unbounded', 'InterVar', system-ui, sans-serif;
  --safe-top: max(env(safe-area-inset-top, 0px), var(--tg-content-safe-area-inset-top, 0px) + var(--tg-safe-area-inset-top, 0px));
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --tabbar-h: 64px;
  --maxw: 680px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  color-scheme: light;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--label); }
body {
  font-family: var(--font); font-size: 17px; line-height: 1.35; letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility;
  overscroll-behavior-y: none;
}
button, input, textarea, select { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
a { color: var(--accent-ink); text-decoration: none; }
img { display: block; max-width: 100%; }
h1, h2, h3, p { margin: 0; }
::selection { background: var(--accent-soft); }

/* ---------- Каркас ---------- */
#app { min-height: 100vh; min-height: 100dvh; }
.screen { max-width: var(--maxw); margin: 0 auto; min-height: 100vh; min-height: 100dvh; padding-bottom: calc(var(--tabbar-h) + 32px + var(--safe-bottom)); }
.screen.no-tabs { padding-bottom: calc(32px + var(--safe-bottom)); }
.page-enter { animation: page-in 0.32s var(--ease); }
.page-back { animation: page-back 0.28s var(--ease); }
@keyframes page-in { from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: none; } }
@keyframes page-back { from { opacity: 0; transform: translateX(-20px); } to { opacity: 1; transform: none; } }
.fade-in { animation: fade 0.3s var(--ease); }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* Навбар: маленький заголовок появляется, когда большой уезжает за край */
.navbar {
  position: sticky; top: 0; z-index: 20; height: calc(52px + var(--safe-top)); padding: var(--safe-top) 8px 0;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  background: rgba(255, 255, 255, 0.82); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 0.5px solid transparent; transition: border-color 0.2s;
}
.navbar.scrolled { border-bottom-color: var(--separator); }
.navbar .nav-title { font-size: 17px; font-weight: 600; opacity: 0; transform: translateY(4px); transition: opacity 0.2s, transform 0.2s; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 56vw; text-align: center; }
.navbar.scrolled .nav-title, .navbar.always-title .nav-title { opacity: 1; transform: none; }
.nav-left, .nav-right { display: flex; align-items: center; gap: 4px; min-width: 0; }
.nav-right { justify-content: flex-end; }
.nav-btn { height: 40px; min-width: 40px; padding: 0 8px; border-radius: 20px; display: inline-flex; align-items: center; justify-content: center; gap: 2px; color: var(--accent-ink); font-size: 17px; font-weight: 500; }
.nav-btn:active { opacity: 0.5; }
.nav-btn.round { width: 36px; min-width: 36px; height: 36px; padding: 0; background: var(--fill); color: var(--label); }
.nav-btn.round.accent { background: var(--accent-soft); color: var(--accent-ink); }
.nav-back { padding-left: 0; }
.nav-back svg { width: 28px; height: 28px; stroke-width: 2.4; margin-right: -2px; }

.large-title { padding: 2px 20px 14px; }
.large-title .eyebrow { font-size: 13px; font-weight: 600; color: var(--label-2); text-transform: uppercase; letter-spacing: 0.02em; margin-bottom: 2px; }
.large-title h1 { font-size: 34px; line-height: 1.12; font-weight: 750; letter-spacing: -0.03em; }
.large-title .sub { margin-top: 6px; color: var(--label-2); font-size: 15px; }

.content { padding: 0 16px; display: flex; flex-direction: column; gap: 22px; }
.section { display: flex; flex-direction: column; gap: 8px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; padding: 0 4px; gap: 12px; }
.section-head h2 { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.section-head .link { font-size: 15px; color: var(--accent-ink); font-weight: 500; white-space: nowrap; }
.section-label { font-size: 13px; color: var(--label-2); text-transform: uppercase; letter-spacing: 0.02em; padding: 0 16px; font-weight: 500; }
.section-foot { font-size: 13px; color: var(--label-2); padding: 0 16px; line-height: 1.4; }

/* ---------- Таббар: плавающая капсула ---------- */
.tabbar {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(10px + var(--safe-bottom)); z-index: 30;
  width: min(calc(100% - 24px), 520px); height: var(--tabbar-h); border-radius: 32px; padding: 0 6px;
  display: grid; grid-template-columns: repeat(5, 1fr); align-items: center;
  background: rgba(255, 255, 255, 0.86); backdrop-filter: saturate(180%) blur(24px); -webkit-backdrop-filter: saturate(180%) blur(24px);
  box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.08), 0 8px 32px rgba(0, 0, 0, 0.12);
}
.tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; height: 52px; border-radius: 26px; color: var(--label-2); font-size: 10.5px; font-weight: 600; position: relative; transition: color 0.2s, background 0.25s; }
.tab svg { width: 24px; height: 24px; stroke-width: 2; }
.tab.active { color: var(--accent-ink); background: var(--accent-soft); }
.tab .dot { position: absolute; top: 6px; right: calc(50% - 18px); min-width: 16px; height: 16px; border-radius: 8px; background: var(--red); color: #fff; font-size: 10px; display: grid; place-items: center; padding: 0 4px; border: 2px solid #fff; box-sizing: content-box; }

/* ---------- Карточки и списки ---------- */
.card { background: var(--fill); border-radius: var(--r-card); padding: 16px; position: relative; }
.card.white { background: #fff; box-shadow: var(--shadow); }
.card.tap, .tap { cursor: pointer; transition: transform 0.15s var(--ease), opacity 0.15s; }
.card.tap:active, .tap:active { transform: scale(0.98); opacity: 0.85; }
.card.hero { background: var(--gradient); color: #fff; overflow: hidden; }
.card.hero::after { content: ''; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 255, 255, 0.25), rgba(255, 255, 255, 0) 70%); pointer-events: none; }
.card.hero .muted { color: rgba(255, 255, 255, 0.82); }
.card.soft { background: var(--accent-soft); }
.card-title { font-size: 17px; font-weight: 650; letter-spacing: -0.015em; }
.card-sub { font-size: 15px; color: var(--label-2); margin-top: 2px; }

.list { background: var(--fill); border-radius: var(--r-card); overflow: hidden; }
.list.white { background: #fff; box-shadow: var(--shadow); }
.row { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 10px 16px; position: relative; width: 100%; text-align: left; }
.row + .row::before { content: ''; position: absolute; top: 0; left: var(--sep-inset, 16px); right: 0; height: 0.5px; background: var(--separator); }
.row.has-icon { --sep-inset: 60px; }
.row.has-avatar { --sep-inset: 68px; }
button.row:active, a.row:active, .row.tap:active { background: var(--fill-2); }
.row-icon { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; flex: none; color: #fff; background: var(--accent); }
.row-icon svg { width: 18px; height: 18px; stroke-width: 2.2; }
.row-main { flex: 1; min-width: 0; }
.row-title { font-size: 17px; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; }
.row-title.bold { font-weight: 600; }
.row-sub { font-size: 14px; color: var(--label-2); margin-top: 2px; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.row-value { color: var(--label-2); font-size: 16px; white-space: nowrap; flex: none; }
.row .chev { color: var(--label-3); width: 18px; height: 18px; flex: none; stroke-width: 2.6; margin-right: -4px; }
.row.danger .row-title { color: var(--red); }
.row.accent .row-title { color: var(--accent-ink); }

/* ---------- Кнопки ---------- */
.btn { height: 50px; padding: 0 20px; border-radius: var(--r-btn); display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-size: 17px; font-weight: 600; letter-spacing: -0.01em; transition: transform 0.12s, opacity 0.12s, background 0.2s; white-space: nowrap; user-select: none; }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.4; pointer-events: none; }
.btn svg { width: 20px; height: 20px; stroke-width: 2.2; }
.btn.primary { background: var(--gradient); color: #fff; box-shadow: 0 6px 18px rgba(255, 87, 20, 0.28); }
.btn.secondary { background: var(--fill); color: var(--label); }
.btn.tinted { background: var(--accent-soft); color: var(--accent-ink); }
.btn.white { background: #fff; color: var(--accent-ink); }
.btn.glass { background: rgba(255, 255, 255, 0.22); color: #fff; backdrop-filter: blur(8px); }
.btn.danger { background: var(--red-soft); color: var(--red); }
.btn.plain { background: none; color: var(--accent-ink); height: 44px; padding: 0 8px; }
.btn.block { width: 100%; }
.btn.sm { height: 36px; padding: 0 14px; font-size: 15px; border-radius: 18px; }
.btn.sm svg { width: 17px; height: 17px; }
.btn-row { display: flex; gap: 10px; }
.btn-row > .btn { flex: 1; min-width: 0; padding: 0 10px; }
.btn-row > .btn.sm { padding: 0 8px; }

.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.quick-btn { display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 12px; font-weight: 500; color: var(--label); text-align: center; line-height: 1.2; }
.quick-btn .qi { width: 58px; height: 58px; border-radius: 20px; background: var(--fill); display: grid; place-items: center; color: var(--accent-ink); transition: transform 0.15s; }
.quick-btn:active .qi { transform: scale(0.92); }
.quick-btn .qi svg { width: 26px; height: 26px; stroke-width: 2; }

/* ---------- Мелочи ---------- */
.muted { color: var(--label-2); }
.small { font-size: 14px; }
.tiny { font-size: 12px; }
.bold { font-weight: 650; }
.center { text-align: center; }
.row-flex { display: flex; align-items: center; gap: 8px; }
.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack-sm { display: flex; flex-direction: column; gap: 6px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.pre { white-space: pre-wrap; word-break: break-word; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hr { height: 0.5px; background: var(--separator); margin: 4px 0; }

.chip { display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 11px; border-radius: 14px; background: var(--fill); font-size: 14px; font-weight: 500; color: var(--label); white-space: nowrap; }
.chip.accent { background: var(--accent-soft); color: var(--accent-ink); }
.chip.green { background: var(--green-soft); color: #1f9e46; }
.chip.red { background: var(--red-soft); color: var(--red); }
.chip.blue { background: var(--blue-soft); color: var(--blue); }
.chip.purple { background: var(--purple-soft); color: var(--purple); }
.chip.yellow { background: var(--yellow-soft); color: #b07d00; }
.chip.white { background: rgba(255, 255, 255, 0.24); color: #fff; }
.chip.sm { height: 22px; padding: 0 8px; font-size: 12px; border-radius: 11px; font-weight: 600; }
.chip svg { width: 14px; height: 14px; stroke-width: 2.4; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
button.chip:active { opacity: 0.6; }
button.chip.selected { background: var(--accent); color: #fff; }

.badge-count { min-width: 22px; height: 22px; padding: 0 7px; border-radius: 11px; background: var(--red); color: #fff; font-size: 13px; font-weight: 600; display: inline-grid; place-items: center; }

.avatar { flex: none; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 650; overflow: hidden; background: var(--gradient); letter-spacing: 0; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-stack { display: flex; }
.avatar-stack .avatar { border: 2px solid #fff; margin-left: -8px; }
.avatar-stack .avatar:first-child { margin-left: 0; }

.verified { color: var(--blue); width: 18px; height: 18px; flex: none; }

.logo { font-family: var(--font-logo); font-weight: 800; letter-spacing: -0.01em; background: var(--gradient); -webkit-background-clip: text; background-clip: text; color: transparent; line-height: 1; text-transform: uppercase; }

/* Прогресс */
.bar { height: 8px; border-radius: 4px; background: var(--fill-2); overflow: hidden; }
.bar > div { height: 100%; border-radius: 4px; background: var(--gradient); transition: width 0.5s var(--ease); }
.bar.green > div { background: var(--green); }
.ring { position: relative; flex: none; display: grid; place-items: center; }
.ring svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.ring .ring-label { font-weight: 700; letter-spacing: -0.02em; }

/* Числа */
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat .num { font-size: 28px; font-weight: 750; letter-spacing: -0.03em; line-height: 1.1; }
.stat .lbl { font-size: 13px; color: var(--label-2); }
.card.hero .stat .lbl { color: rgba(255, 255, 255, 0.82); }

/* Пустое состояние */
.empty { text-align: center; padding: 36px 24px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.empty .em { font-size: 52px; line-height: 1; margin-bottom: 6px; }
.empty h3 { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; }
.empty p { color: var(--label-2); font-size: 15px; max-width: 320px; }
.empty .btn { margin-top: 10px; }

/* Скелетон загрузки */
.skeleton { background: linear-gradient(90deg, var(--fill) 0%, var(--fill-2) 50%, var(--fill) 100%); background-size: 200% 100%; animation: shimmer 1.2s infinite linear; border-radius: var(--r-card); }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.spinner { width: 22px; height: 22px; border: 2.5px solid var(--fill-3); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Поля ввода ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .field-label { font-size: 13px; color: var(--label-2); font-weight: 500; padding: 0 4px; text-transform: uppercase; letter-spacing: 0.02em; }
.input, .textarea, .select {
  width: 100%; min-height: 50px; padding: 13px 16px; border-radius: var(--r-btn); border: 0; outline: 0;
  background: var(--fill); font-size: 17px; transition: box-shadow 0.15s, background 0.15s; -webkit-appearance: none; appearance: none;
}
.input:focus, .textarea:focus, .select:focus { background: #fff; box-shadow: 0 0 0 2px var(--accent); }
.input::placeholder, .textarea::placeholder { color: var(--label-3); }
.textarea { resize: none; min-height: 96px; line-height: 1.4; }
.select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238a8a8e' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 40px; }
input[type='date'].input, input[type='datetime-local'].input, input[type='time'].input { min-height: 50px; display: block; }
input[type='date']::-webkit-date-and-time-value, input[type='datetime-local']::-webkit-date-and-time-value { text-align: left; }
.hint { font-size: 13px; color: var(--label-2); padding: 0 4px; line-height: 1.4; }
.form { display: flex; flex-direction: column; gap: 16px; }
.search { position: relative; }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--label-3); stroke-width: 2.4; }
.search .input { min-height: 40px; height: 40px; padding: 8px 12px 8px 38px; border-radius: 12px; font-size: 17px; }

/* Переключатель iOS */
.toggle { position: relative; width: 51px; height: 31px; flex: none; }
.toggle input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; z-index: 1; }
.toggle span { position: absolute; inset: 0; border-radius: 16px; background: var(--fill-3); transition: background 0.25s; }
.toggle span::after { content: ''; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15), 0 1px 1px rgba(0, 0, 0, 0.16); transition: transform 0.25s var(--ease); }
.toggle input:checked + span { background: var(--green); }
.toggle input:checked + span::after { transform: translateX(20px); }

/* Сегменты */
.segmented { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--fill); border-radius: 11px; padding: 2px; position: relative; }
.segmented button { height: 34px; border-radius: 9px; font-size: 14px; font-weight: 600; color: var(--label); position: relative; z-index: 1; transition: color 0.2s; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 6px; }
.segmented .seg-pill { position: absolute; top: 2px; bottom: 2px; border-radius: 9px; background: #fff; box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1), 0 0 0 0.5px rgba(0, 0, 0, 0.04); transition: transform 0.3s var(--ease); }

/* Слайдер */
.range { width: 100%; -webkit-appearance: none; appearance: none; height: 28px; background: transparent; }
.range::-webkit-slider-runnable-track { height: 6px; border-radius: 3px; background: linear-gradient(to right, var(--accent) var(--v, 0%), var(--fill-3) var(--v, 0%)); }
.range::-webkit-slider-thumb { -webkit-appearance: none; width: 28px; height: 28px; border-radius: 50%; background: #fff; margin-top: -11px; box-shadow: 0 3px 8px rgba(0, 0, 0, 0.18), 0 0 0 0.5px rgba(0, 0, 0, 0.06); }
.range::-moz-range-track { height: 6px; border-radius: 3px; background: var(--fill-3); }
.range::-moz-range-progress { height: 6px; border-radius: 3px; background: var(--accent); }
.range::-moz-range-thumb { width: 28px; height: 28px; border-radius: 50%; background: #fff; border: 0; box-shadow: 0 3px 8px rgba(0, 0, 0, 0.18); }

/* Чекбокс-кружок */
.check { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--fill-3); display: grid; place-items: center; flex: none; transition: all 0.2s var(--ease); color: #fff; background: #fff; }
.check svg { width: 16px; height: 16px; stroke-width: 3; opacity: 0; transform: scale(0.5); transition: all 0.2s var(--ease); }
.check.on { background: var(--green); border-color: var(--green); }
.check.on svg { opacity: 1; transform: none; }
.check.accent.on { background: var(--accent); border-color: var(--accent); }

/* ---------- Шторка (bottom sheet) ---------- */
.sheet-backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, 0.32); animation: fade 0.25s; display: flex; align-items: flex-end; justify-content: center; }
.sheet-backdrop.closing { animation: fade 0.22s reverse forwards; }
.sheet {
  width: 100%; max-width: var(--maxw); max-height: calc(100dvh - var(--safe-top) - 24px); background: #fff; border-radius: 26px 26px 0 0;
  display: flex; flex-direction: column; animation: sheet-up 0.38s var(--ease); box-shadow: var(--shadow-lg); overflow: hidden;
}
.sheet-backdrop.closing .sheet { animation: sheet-down 0.22s ease-in forwards; }
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: none; } }
@keyframes sheet-down { to { transform: translateY(100%); } }
.sheet-grab { width: 36px; height: 5px; border-radius: 3px; background: var(--fill-3); margin: 8px auto 0; flex: none; }
.sheet-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 6px 8px 8px; flex: none; }
.sheet-head h3 { font-size: 17px; font-weight: 650; text-align: center; padding: 0 4px; }
.sheet-body { padding: 8px 16px calc(20px + var(--safe-bottom)); overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
@media (min-width: 720px) {
  .sheet-backdrop { align-items: center; }
  .sheet { border-radius: 26px; max-height: 86vh; max-width: 520px; animation: pop 0.3s var(--ease); }
  .sheet-backdrop.closing .sheet { animation: fade 0.2s reverse forwards; }
  .sheet-grab { display: none; }
}
@keyframes pop { from { opacity: 0; transform: scale(0.94); } to { opacity: 1; transform: none; } }

/* Список действий (action sheet) */
.actions { display: flex; flex-direction: column; gap: 8px; }
.actions .list .row { justify-content: center; text-align: center; font-size: 18px; min-height: 56px; color: var(--accent-ink); }
.actions .list .row.danger { color: var(--red); }
.actions .list .row.cancel { font-weight: 600; }
.actions .title { padding: 12px 16px; text-align: center; font-size: 13px; color: var(--label-2); }

/* Тост */
.toast-host { position: fixed; left: 0; right: 0; top: calc(10px + var(--safe-top)); z-index: 80; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; padding: 0 16px; }
.toast { background: rgba(28, 28, 30, 0.92); color: #fff; padding: 12px 18px; border-radius: 18px; font-size: 15px; font-weight: 500; max-width: 420px; box-shadow: var(--shadow-lg); animation: toast-in 0.35s var(--ease); display: flex; align-items: center; gap: 10px; backdrop-filter: blur(20px); }
.toast.error { background: rgba(215, 38, 30, 0.95); }
.toast svg { width: 20px; height: 20px; stroke-width: 2.4; flex: none; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-12px) scale(0.96); } to { opacity: 1; transform: none; } }

/* ---------- Календарь ---------- */
.cal-head { display: flex; align-items: center; justify-content: space-between; padding: 0 4px; }
.cal-head h2 { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; text-transform: capitalize; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); row-gap: 4px; text-align: center; }
.cal-wd { font-size: 12px; font-weight: 600; color: var(--label-3); padding: 6px 0; text-transform: uppercase; }
.cal-day { height: 46px; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 3px; padding-top: 4px; font-size: 17px; font-weight: 500; border-radius: 14px; position: relative; }
.cal-day .n { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; transition: background 0.2s; }
.cal-day.other { color: var(--label-3); }
.cal-day.today .n { color: var(--accent-ink); font-weight: 700; }
.cal-day.selected .n { background: var(--label); color: #fff; }
.cal-day.today.selected .n { background: var(--accent); color: #fff; }
.cal-dots { display: flex; gap: 3px; height: 5px; }
.cal-dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }

.kind-meeting { --k: var(--accent); --k-soft: var(--accent-soft); }
.kind-stream { --k: var(--purple); --k-soft: var(--purple-soft); }
.kind-deadline { --k: var(--red); --k-soft: var(--red-soft); }
.kind-other { --k: var(--blue); --k-soft: var(--blue-soft); }
.kind-task { --k: #ff9500; --k-soft: var(--yellow-soft); }
.ev-row { display: flex; gap: 12px; align-items: stretch; padding: 12px 14px; border-radius: 18px; background: var(--fill); width: 100%; text-align: left; }
.ev-row:active { transform: scale(0.985); }
.ev-row .stripe { width: 4px; border-radius: 2px; background: var(--k); flex: none; }
.ev-row .time { font-size: 14px; color: var(--label-2); width: 46px; flex: none; font-variant-numeric: tabular-nums; padding-top: 1px; }
.ev-row.cancelled .row-title { text-decoration: line-through; color: var(--label-2); }
.kdot { width: 10px; height: 10px; border-radius: 50%; background: var(--k); display: inline-block; flex: none; }

.date-tile { width: 52px; height: 56px; flex: none; border-radius: 14px; background: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; box-shadow: var(--shadow); }
.date-tile .m { font-size: 11px; font-weight: 700; color: var(--accent-ink); text-transform: uppercase; }
.date-tile .d { font-size: 22px; font-weight: 750; line-height: 1; letter-spacing: -0.02em; }

/* ---------- Профиль ---------- */
.profile-head { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 8px 20px 4px; }
.profile-head h1 { font-size: 26px; font-weight: 750; letter-spacing: -0.025em; display: flex; align-items: center; gap: 6px; }
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.info-tile { background: var(--fill); border-radius: 18px; padding: 12px 14px; }
.info-tile .k { font-size: 13px; color: var(--label-2); }
.info-tile .v { font-size: 17px; font-weight: 650; margin-top: 2px; }

/* Рейтинг */
.podium { display: grid; grid-template-columns: 1fr 1.15fr 1fr; align-items: end; gap: 8px; padding-top: 8px; }
.podium .p { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; min-width: 0; }
.podium .p .nm { font-size: 14px; font-weight: 600; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.podium .stand { width: 100%; border-radius: 16px 16px 6px 6px; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding-top: 10px; font-weight: 750; color: #fff; }
.podium .p1 .stand { height: 96px; background: var(--gradient); font-size: 26px; }
.podium .p2 .stand { height: 72px; background: linear-gradient(135deg, #b8b8c2, #d9d9e0); font-size: 22px; }
.podium .p3 .stand { height: 56px; background: linear-gradient(135deg, #d18b55, #e9b48a); font-size: 20px; }
.podium .pts { font-size: 13px; color: var(--label-2); }

.badge-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.badge-tile { background: var(--fill); border-radius: 20px; padding: 14px 8px 12px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.badge-tile .be { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; font-size: 30px; background: #fff; box-shadow: var(--shadow); }
.badge-tile.locked .be { filter: grayscale(1); opacity: 0.35; box-shadow: none; background: var(--fill-2); }
.badge-tile .bt { font-size: 13px; font-weight: 650; line-height: 1.2; }
.badge-tile .bd { font-size: 11px; color: var(--label-2); line-height: 1.25; }

/* Опросы */
.poll-opt { position: relative; width: 100%; min-height: 50px; border-radius: 14px; background: #fff; overflow: hidden; display: flex; align-items: center; gap: 10px; padding: 0 14px; text-align: left; box-shadow: 0 0 0 1px var(--separator) inset; }
.poll-opt .fillbar { position: absolute; inset: 0 auto 0 0; background: var(--accent-soft); transition: width 0.5s var(--ease); }
.poll-opt.mine { box-shadow: 0 0 0 2px var(--accent) inset; }
.poll-opt > *:not(.fillbar) { position: relative; }
.poll-opt .pct { font-weight: 650; font-variant-numeric: tabular-nums; color: var(--label-2); }
.poll-opt.mine .pct { color: var(--accent-ink); }

/* Материалы */
.folder-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.folder { background: var(--fill); border-radius: 20px; padding: 14px; display: flex; flex-direction: column; gap: 10px; text-align: left; min-height: 104px; }
.folder .fe { font-size: 30px; line-height: 1; }
.folder .fn { font-size: 16px; font-weight: 650; line-height: 1.2; }
.folder .fc { font-size: 13px; color: var(--label-2); }
.favicon { width: 36px; height: 36px; border-radius: 10px; background: #fff; display: grid; place-items: center; font-weight: 700; color: var(--accent-ink); flex: none; box-shadow: 0 0 0 0.5px var(--separator); overflow: hidden; }
.favicon img { width: 20px; height: 20px; }
.crumbs { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; padding: 0 4px; font-size: 15px; }
.crumbs button { color: var(--accent-ink); }
.crumbs span { color: var(--label-3); }

/* Логин */
.login { min-height: 100dvh; display: flex; flex-direction: column; justify-content: space-between; padding: calc(40px + var(--safe-top)) 24px calc(28px + var(--safe-bottom)); max-width: 460px; margin: 0 auto; gap: 28px; }
.login .hero-logo { font-size: clamp(28px, 9.4vw, 50px); }
.login .orbs { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.login .orbs i { position: absolute; border-radius: 50%; filter: blur(2px); background: radial-gradient(circle at 30% 30%, rgba(255, 138, 71, 0.55), rgba(255, 75, 15, 0.18) 60%, rgba(255, 75, 15, 0) 72%); }
.qr-box { background: #fff; border-radius: 22px; padding: 14px; box-shadow: var(--shadow); width: 220px; margin: 0 auto; }
.qr-box svg { width: 100%; height: auto; display: block; }

/* Онбординг: шаги */
.steps { display: flex; gap: 6px; justify-content: center; }
.steps i { width: 8px; height: 8px; border-radius: 4px; background: var(--fill-3); transition: all 0.3s var(--ease); }
.steps i.on { width: 24px; background: var(--accent); }

.leader-row .place { width: 26px; text-align: center; font-weight: 700; color: var(--label-2); flex: none; font-variant-numeric: tabular-nums; }
.leader-row.me { background: var(--accent-soft); }

.timeline { display: flex; flex-direction: column; gap: 0; }
.tl-item { display: flex; gap: 12px; padding-bottom: 14px; position: relative; }
.tl-item::before { content: ''; position: absolute; left: 5px; top: 16px; bottom: 0; width: 2px; background: var(--fill-2); }
.tl-item:last-child::before { display: none; }
.tl-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--accent); margin-top: 4px; flex: none; box-shadow: 0 0 0 3px var(--accent-soft); }

.banner { display: flex; gap: 12px; align-items: center; padding: 14px 16px; border-radius: 20px; background: var(--accent-soft); color: var(--label); text-align: left; width: 100%; }
.banner .bi { width: 36px; height: 36px; border-radius: 12px; background: var(--accent); color: #fff; display: grid; place-items: center; flex: none; }
.banner .bi svg { width: 20px; height: 20px; }
.banner.blue { background: var(--blue-soft); }
.banner.blue .bi { background: var(--blue); }
.banner.green { background: var(--green-soft); }
.banner.green .bi { background: var(--green); }

.stars { display: flex; gap: 6px; justify-content: center; }
.stars button { font-size: 40px; line-height: 1; filter: grayscale(1); opacity: 0.3; transition: transform 0.15s, filter 0.15s, opacity 0.15s; }
.stars button.on { filter: none; opacity: 1; }
.stars button:active { transform: scale(0.85); }

.dist-row { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.dist-row .bar { flex: 1; }

@media (min-width: 720px) {
  .large-title { padding-top: 12px; }
  .content { padding: 0 20px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
