@font-face {
  font-family: "Manrope";
  src: url("fonts/manrope.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}

:root {
  --bg: #f3f0ea;
  --surface: #ffffff;
  --surface-2: #f7f5f0;
  --surface-3: #efebe4;
  --ink: #1b1c1e;
  --ink-2: #5a5751;
  --muted: #9c978f;
  --line: #e7e2d9;
  --free: #2e8b66;
  --free-bg: #dcefe4;
  --free-ink: #1d6a4b;
  --gym: #e0653c;
  --gym-bg: #fbe4d9;
  --gym-ink: #a8431f;
  --warn: #b97c12;
  --warn-bg: #f7ecd5;
  --danger: #d0453b;
  --now: #e0453b;
  --shadow: 0 1px 2px rgba(40, 30, 10, 0.05), 0 10px 30px -8px rgba(40, 30, 10, 0.1);
  --shadow-lg: 0 20px 60px -10px rgba(30, 20, 0, 0.25);
  --r: 22px;
  --r-sm: 14px;
  --tab-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #101112;
  --surface: #191a1c;
  --surface-2: #1f2023;
  --surface-3: #26272a;
  --ink: #f1eee8;
  --ink-2: #bcb7ae;
  --muted: #7f7b74;
  --line: #2b2c2f;
  --free: #4cb38a;
  --free-bg: rgba(76, 179, 138, 0.16);
  --free-ink: #7fd3ae;
  --gym: #f07a52;
  --gym-bg: rgba(240, 122, 82, 0.16);
  --gym-ink: #ffa98a;
  --warn: #e0a83c;
  --warn-bg: rgba(224, 168, 60, 0.14);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 30px -8px rgba(0, 0, 0, 0.5);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.35;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior-y: none;
}

body {
  min-height: 100dvh;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: 0;
  background: none;
  padding: 0;
}

.app {
  max-width: 560px;
  margin: 0 auto;
  min-height: 100dvh;
  padding: calc(var(--safe-t) + 14px) 18px calc(var(--tab-h) + var(--safe-b) + 28px);
}

.view {
  animation: viewIn 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes viewIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

/* ---------- типографика ---------- */

.eyebrow {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.01em;
}

.h1 {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin: 4px 0 6px;
}

.h2 {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0;
}

.lead {
  color: var(--ink-2);
  font-size: 15px;
  margin: 0;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 13px;
}

.tnum {
  font-variant-numeric: tabular-nums;
}

.section {
  margin-top: 26px;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 0 4px 10px;
}

.section-head .link {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-2);
}

/* ---------- карточки, списки ---------- */

.card {
  background: var(--surface);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  padding: 18px;
}

.card + .card {
  margin-top: 12px;
}

.card.flat {
  box-shadow: none;
  background: var(--surface-2);
}

.list {
  background: var(--surface);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  min-height: 58px;
  position: relative;
  width: 100%;
  text-align: left;
}

.row + .row::before {
  content: "";
  position: absolute;
  top: 0;
  left: 64px;
  right: 0;
  border-top: 1px solid var(--line);
}

.row.plain + .row.plain::before {
  left: 16px;
}

.row .grow {
  flex: 1;
  min-width: 0;
}

.row .t {
  font-weight: 700;
  font-size: 15.5px;
}

.row .s {
  color: var(--muted);
  font-size: 13.5px;
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.row .chev {
  color: var(--muted);
  flex: none;
}

button.row:active {
  background: var(--surface-2);
}

/* ---------- аватары ---------- */

.av {
  --c: #999;
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--c) 18%, var(--surface));
  color: var(--c);
  font-weight: 800;
  font-size: 17px;
  position: relative;
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--c) 35%, transparent);
}

.av.sm {
  width: 28px;
  height: 28px;
  font-size: 13px;
}

.av.xs {
  width: 22px;
  height: 22px;
  font-size: 11px;
}

.av.lg {
  width: 84px;
  height: 84px;
  font-size: 38px;
}

.av .emo {
  font-size: 1.15em;
  line-height: 1;
}

.av .dot {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2.5px solid var(--surface);
  background: var(--muted);
}

.av .dot.free {
  background: var(--free);
}

.av .dot.busy {
  background: var(--warn);
}

.av .dot.gym {
  background: var(--gym);
}

.stack {
  display: flex;
}

.stack .av {
  box-shadow: 0 0 0 2.5px var(--surface);
}

.stack .av + .av {
  margin-left: -8px;
}

/* ---------- кнопки, чипы ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 50px;
  padding: 0 22px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font-weight: 800;
  font-size: 15.5px;
  letter-spacing: -0.01em;
  transition: transform 0.12s, opacity 0.2s;
  white-space: nowrap;
}

.btn:active {
  transform: scale(0.97);
}

.btn.block {
  width: 100%;
}

.btn.soft {
  background: var(--surface-3);
  color: var(--ink);
}

.btn.free {
  background: var(--free);
  color: #fff;
}

.btn.gym {
  background: var(--gym);
  color: #fff;
}

.btn.ghost {
  background: transparent;
  color: var(--ink-2);
}

.btn.sm {
  height: 38px;
  padding: 0 16px;
  font-size: 14px;
}

.btn.danger {
  background: transparent;
  color: var(--danger);
}

.btn[disabled] {
  opacity: 0.45;
  pointer-events: none;
}

.btn-row {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.btn-row .btn {
  flex: 1;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 11px;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.chip.good {
  background: var(--free-bg);
  color: var(--free-ink);
}

.chip.warn {
  background: var(--warn-bg);
  color: var(--warn);
}

.chip.gym {
  background: var(--gym-bg);
  color: var(--gym-ink);
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--surface);
  box-shadow: var(--shadow);
  color: var(--ink);
  flex: none;
}

.icon-btn:active {
  transform: scale(0.94);
}

svg.i {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

svg.i.sm {
  width: 18px;
  height: 18px;
}

/* ---------- таббар ---------- */

.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  padding: 0 14px calc(var(--safe-b) + 10px);
  pointer-events: none;
}

.tabbar nav {
  max-width: 420px;
  margin: 0 auto;
  height: var(--tab-h);
  border-radius: 26px;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  backdrop-filter: blur(18px) saturate(1.6);
  -webkit-backdrop-filter: blur(18px) saturate(1.6);
  box-shadow: var(--shadow-lg), inset 0 0 0 1px color-mix(in srgb, var(--line) 70%, transparent);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  pointer-events: auto;
  padding: 6px;
}

.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border-radius: 20px;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 700;
  transition: color 0.2s, background 0.2s;
}

.tab.on {
  color: var(--ink);
  background: var(--surface-3);
}

/* ---------- шапки экранов ---------- */

.top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

/* ---------- сегодня ---------- */

.hero {
  position: relative;
  overflow: hidden;
  padding: 20px;
}

.hero.gym {
  background: linear-gradient(140deg, var(--gym) 0%, color-mix(in srgb, var(--gym) 70%, #7a2a10) 100%);
  color: #fff;
}

.hero.gym .muted,
.hero.gym .eyebrow {
  color: rgba(255, 255, 255, 0.78);
}

.hero.free {
  background: linear-gradient(140deg, var(--free) 0%, color-mix(in srgb, var(--free) 70%, #0b3a28) 100%);
  color: #fff;
}

.hero.free .eyebrow,
.hero.free .muted {
  color: rgba(255, 255, 255, 0.78);
}

.hero .big {
  font-size: 40px;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  margin: 8px 0 6px;
}

.hero .btn {
  background: rgba(255, 255, 255, 0.96);
  color: #1b1c1e;
}

.hero .btn.soft {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.hero .deco {
  position: absolute;
  right: -30px;
  top: -30px;
  width: 170px;
  height: 170px;
  opacity: 0.16;
  pointer-events: none;
}

.hero .chips .chip {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.progress {
  height: 4px;
  border-radius: 4px;
  background: var(--surface-3);
  overflow: hidden;
  margin-top: 7px;
}

.progress i {
  display: block;
  height: 100%;
  background: var(--warn);
  border-radius: 4px;
}

.win-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  margin: 0 -18px;
  padding: 2px 18px 6px;
}

.win-chips::-webkit-scrollbar {
  display: none;
}

.win {
  flex: none;
  background: var(--free-bg);
  color: var(--free-ink);
  border-radius: 18px;
  padding: 12px 15px;
  min-width: 132px;
  text-align: left;
}

.win b {
  display: block;
  font-size: 18px;
  letter-spacing: -0.02em;
}

.win span {
  font-size: 13px;
  font-weight: 700;
  opacity: 0.8;
}

.empty {
  text-align: center;
  padding: 26px 18px;
  color: var(--muted);
  font-size: 14.5px;
}

.empty .em {
  font-size: 34px;
  display: block;
  margin-bottom: 6px;
}

/* ---------- неделя ---------- */

.weeknav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.weeknav .label {
  font-weight: 800;
  font-size: 15px;
  min-width: 128px;
  text-align: center;
}

.people {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  margin: 0 -18px 14px;
  padding: 2px 18px 4px;
}

.people::-webkit-scrollbar {
  display: none;
}

.person-tog {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding: 0 14px 0 5px;
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--shadow);
  font-weight: 700;
  font-size: 14px;
  flex: none;
  transition: opacity 0.2s, transform 0.12s;
}

.person-tog.off {
  opacity: 0.42;
  box-shadow: none;
  background: var(--surface-3);
}

.person-tog:active {
  transform: scale(0.96);
}

.days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
  margin-bottom: 14px;
}

.day {
  border-radius: 16px;
  padding: 8px 0 9px;
  text-align: center;
  background: var(--surface);
  box-shadow: var(--shadow);
  position: relative;
  transition: background 0.2s, color 0.2s;
}

.day .wd {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.day .n {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.day .marks {
  display: flex;
  justify-content: center;
  gap: 3px;
  height: 6px;
  margin-top: 2px;
}

.day .marks i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--free);
}

.day .marks i.g {
  background: var(--gym);
}

.day.today .n {
  color: var(--now);
}

.day.on {
  background: var(--ink);
  color: var(--bg);
}

.day.on .wd {
  color: color-mix(in srgb, var(--bg) 70%, transparent);
}

.day.on .n {
  color: var(--bg);
}

.day.past:not(.on) {
  opacity: 0.55;
}

.seg {
  display: inline-grid;
  grid-auto-flow: column;
  background: var(--surface-3);
  border-radius: 999px;
  padding: 3px;
}

.seg button {
  height: 32px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink-2);
}

.seg button.on {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.tl {
  position: relative;
  background: var(--surface);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  padding: 12px 10px 14px 0;
  touch-action: pan-y;
}

.tl-head {
  display: grid;
  margin-left: 46px;
  margin-bottom: 6px;
  gap: 6px;
}

.tl-head > div {
  display: flex;
  justify-content: center;
}

.tl-body {
  position: relative;
  margin-left: 46px;
}

.tl-hour {
  position: absolute;
  left: -46px;
  right: 0;
  border-top: 1px dashed var(--line);
}

.tl-hour span {
  position: absolute;
  left: 8px;
  top: -8px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  background: var(--surface);
  padding-right: 4px;
}

.tl-cols {
  position: absolute;
  inset: 0;
  display: grid;
  gap: 6px;
}

.tl-col {
  position: relative;
}

.tl-free {
  position: absolute;
  left: -2px;
  right: -4px;
  border-radius: 12px;
  background: repeating-linear-gradient(135deg, var(--free-bg) 0 8px, color-mix(in srgb, var(--free-bg) 55%, transparent) 8px 16px);
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--free) 35%, transparent);
  z-index: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tl-free span {
  font-size: 12px;
  font-weight: 800;
  color: var(--free-ink);
  background: var(--surface);
  padding: 3px 9px;
  border-radius: 999px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
  white-space: nowrap;
}

.ev {
  --c: #888;
  position: absolute;
  left: 0;
  right: 0;
  border-radius: 10px;
  background: color-mix(in srgb, var(--c) 16%, var(--surface));
  border-left: 3.5px solid var(--c);
  padding: 4px 6px;
  overflow: hidden;
  z-index: 1;
  text-align: left;
  font-size: 11.5px;
  line-height: 1.2;
}

.ev b {
  display: block;
  font-weight: 800;
  font-size: 12px;
  color: color-mix(in srgb, var(--c) 60%, var(--ink));
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.ev span {
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.ev.busy {
  background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--c) 14%, var(--surface)) 0 6px, color-mix(in srgb, var(--c) 8%, var(--surface)) 6px 12px);
}

.ev.plan {
  --c: var(--gym);
  background: var(--gym-bg);
  border-left-color: var(--gym);
  z-index: 2;
}

.ev.plan.meet {
  --c: #5b7fd6;
  background: color-mix(in srgb, #5b7fd6 16%, var(--surface));
  border-left-color: #5b7fd6;
}

.ev.tiny b {
  -webkit-line-clamp: 1;
}

.ev.tiny span {
  display: none;
}

.tl-now {
  position: absolute;
  left: -8px;
  right: -10px;
  height: 2px;
  background: var(--now);
  z-index: 5;
  pointer-events: none;
}

.tl-now::before {
  content: "";
  position: absolute;
  left: -4px;
  top: -4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--now);
}

/* мини-неделя */
.wk {
  display: grid;
  grid-template-columns: 34px repeat(7, 1fr);
  gap: 5px;
  background: var(--surface);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  padding: 12px 10px 12px 4px;
}

.wk-col {
  position: relative;
  display: block;
  width: 100%;
  border-radius: 9px;
  background: var(--surface-2);
}

.wk-col.today {
  box-shadow: inset 0 0 0 1.5px var(--now);
}

.wk-busy {
  position: absolute;
  left: 3px;
  right: 3px;
  border-radius: 5px;
  background: color-mix(in srgb, var(--ink) 16%, transparent);
}

.wk-free {
  position: absolute;
  left: 0;
  right: 0;
  border-radius: 7px;
  background: var(--free-bg);
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--free) 40%, transparent);
}

.wk-gym {
  position: absolute;
  left: 2px;
  right: 2px;
  border-radius: 6px;
  background: var(--gym);
  z-index: 2;
}

.wk-h {
  position: relative;
}

.wk-h span {
  position: absolute;
  right: 4px;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--muted);
  transform: translateY(-50%);
  font-variant-numeric: tabular-nums;
}

.wk-head {
  text-align: center;
  font-size: 11px;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
  padding-bottom: 4px;
}

.wk-head.today {
  color: var(--now);
}

.legend {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--muted);
  margin: 10px 4px 0;
}

.legend i {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 4px;
  vertical-align: -2px;
  margin-right: 5px;
}

/* ---------- зал ---------- */

.gym-pick {
  display: flex;
  align-items: center;
  gap: 14px;
}

.gym-pick .date {
  width: 54px;
  flex: none;
  text-align: center;
  border-radius: 16px;
  padding: 7px 0;
  background: var(--gym-bg);
  color: var(--gym-ink);
}

.gym-pick .date .wd {
  font-size: 11.5px;
  font-weight: 800;
  text-transform: uppercase;
}

.gym-pick .date .n {
  font-size: 22px;
  font-weight: 800;
  line-height: 1.05;
}

.gym-pick.done .date {
  background: var(--gym);
  color: #fff;
}

.gym-pick .time {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.gym-day {
  padding: 12px 16px;
}

.gym-day + .gym-day {
  border-top: 1px solid var(--line);
}

.gym-day .line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.bar {
  position: relative;
  height: 14px;
  border-radius: 7px;
  background: var(--surface-3);
  margin-top: 9px;
  overflow: hidden;
}

.bar i {
  position: absolute;
  top: 0;
  bottom: 0;
  border-radius: 7px;
  background: var(--free);
  opacity: 0.85;
}

.bar i.p {
  background: var(--gym);
  opacity: 1;
}

.bar-scale {
  display: flex;
  justify-content: space-between;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--muted);
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
}

.ends {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin-top: 6px;
  font-size: 12.5px;
  color: var(--muted);
  font-weight: 600;
}

.ends span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.ends i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

/* ---------- формы ---------- */

.field {
  display: block;
  margin-top: 14px;
}

.field > span {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  margin: 0 4px 6px;
}

.input {
  width: 100%;
  height: 52px;
  border-radius: 16px;
  border: 1.5px solid var(--line);
  background: var(--surface);
  padding: 0 16px;
  font-size: 16.5px;
  font-weight: 600;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.input:focus {
  border-color: var(--ink);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--ink) 8%, transparent);
}

select.input {
  appearance: none;
  -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 22px) 23px, calc(100% - 16px) 23px;
  background-size: 6px 6px;
  background-repeat: no-repeat;
}

.two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.stepper {
  display: flex;
  align-items: center;
  gap: 10px;
}

.stepper button {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--surface-3);
  font-size: 22px;
  font-weight: 700;
  display: grid;
  place-items: center;
}

.stepper b {
  min-width: 72px;
  text-align: center;
  font-size: 17px;
}

.switch {
  position: relative;
  width: 50px;
  height: 30px;
  flex: none;
  border-radius: 999px;
  background: var(--surface-3);
  transition: background 0.2s;
}

.switch::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transition: transform 0.22s cubic-bezier(0.3, 1.3, 0.5, 1);
}

.switch.on {
  background: var(--free);
}

.switch.on::after {
  transform: translateX(20px);
}

.emoji-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 6px;
}

.emoji-grid button {
  aspect-ratio: 1;
  border-radius: 12px;
  font-size: 22px;
  background: var(--surface-2);
  transition: transform 0.12s;
}

.emoji-grid button.on {
  background: var(--ink);
  transform: scale(1.06);
}

.colors {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.colors button {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--c);
  box-shadow: 0 0 0 3px var(--surface), 0 0 0 3px transparent;
  transition: box-shadow 0.2s;
}

.colors button.on {
  box-shadow: 0 0 0 3px var(--surface), 0 0 0 5.5px var(--c);
}

.choice {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  text-align: left;
  padding: 16px;
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow);
  margin-top: 10px;
  transition: transform 0.12s, box-shadow 0.2s;
}

.choice:active {
  transform: scale(0.985);
}

.choice.on {
  box-shadow: 0 0 0 2.5px var(--ink), var(--shadow);
}

.choice .logo {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 13px;
  color: #fff;
  flex: none;
  letter-spacing: -0.02em;
}

.suggest {
  margin-top: 8px;
  max-height: 290px;
  overflow-y: auto;
}

.suggest button {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  border-radius: 14px;
  font-weight: 800;
}

.suggest button:active,
.suggest button.on {
  background: var(--surface-3);
}

.suggest button span {
  font-weight: 600;
  color: var(--muted);
  font-size: 13px;
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- шторка, тосты ---------- */

.backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 8, 5, 0.38);
  z-index: 40;
  animation: fade 0.22s;
}

.backdrop.out {
  animation: fadeOut 0.22s forwards;
}

.sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 41;
  max-width: 560px;
  margin: 0 auto;
  background: var(--bg);
  border-radius: 28px 28px 0 0;
  padding: 10px 20px calc(var(--safe-b) + 22px);
  max-height: 92dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
  animation: up 0.34s cubic-bezier(0.2, 0.9, 0.25, 1);
  box-shadow: var(--shadow-lg);
}

.sheet.out {
  animation: down 0.24s ease-in forwards;
}

.sheet .grab {
  width: 40px;
  height: 5px;
  border-radius: 3px;
  background: var(--line);
  margin: 0 auto 14px;
}

.sheet .h2 {
  font-size: 22px;
}

@keyframes up {
  from {
    transform: translateY(100%);
  }
}

@keyframes down {
  to {
    transform: translateY(100%);
  }
}

@keyframes fade {
  from {
    opacity: 0;
  }
}

@keyframes fadeOut {
  to {
    opacity: 0;
  }
}

.toast {
  position: fixed;
  left: 50%;
  top: calc(var(--safe-t) + 14px);
  transform: translateX(-50%);
  z-index: 60;
  background: var(--ink);
  color: var(--bg);
  padding: 12px 18px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 14.5px;
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.3s cubic-bezier(0.2, 0.9, 0.3, 1.2);
  max-width: calc(100% - 32px);
  text-align: center;
}

.toast.out {
  animation: fadeOut 0.25s forwards;
}

@keyframes toastIn {
  from {
    transform: translate(-50%, -20px);
    opacity: 0;
  }
}

.skel {
  border-radius: 12px;
  background: linear-gradient(90deg, var(--surface-3), var(--surface-2), var(--surface-3));
  background-size: 200% 100%;
  animation: sh 1.2s infinite;
}

@keyframes sh {
  to {
    background-position: -200% 0;
  }
}

.spin {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2.5px solid currentColor;
  border-right-color: transparent;
  animation: rot 0.7s linear infinite;
  display: inline-block;
}

@keyframes rot {
  to {
    transform: rotate(360deg);
  }
}

/* ---------- онбординг ---------- */

.welcome {
  min-height: calc(100dvh - 60px);
  display: flex;
  flex-direction: column;
}

.welcome .art {
  margin: 18px auto 8px;
  width: 100%;
  max-width: 340px;
}

.welcome .h1 {
  font-size: 40px;
}

.welcome .bottom {
  margin-top: auto;
  padding-top: 20px;
}

.steps {
  display: flex;
  gap: 6px;
  margin-bottom: 18px;
}

.steps i {
  height: 4px;
  flex: 1;
  border-radius: 2px;
  background: var(--line);
}

.steps i.on {
  background: var(--ink);
}

.lesson-prev {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.lesson-prev:first-child {
  border-top: 0;
}

.lesson-prev .tm {
  font-weight: 800;
  font-size: 13.5px;
  width: 48px;
  flex: none;
  font-variant-numeric: tabular-nums;
}

.kv {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 14px;
  font-size: 15px;
}

.kv dt {
  color: var(--muted);
  font-weight: 600;
}

.kv dd {
  margin: 0;
  font-weight: 700;
}

@media (min-width: 600px) {
  .app {
    padding-top: 30px;
  }
}
