/* Переменные, сброс, типографика, утилиты и анимации */
:root {
  --bg: #FFF7EE;
  --card: #FFFFFF;
  --border: #E3E8F2;
  --ink: #1E2A4A;
  --ink-soft: #4A5570;
  --muted: #8A93A8;
  --primary: #2F6BFF;
  --blue-top: #3B7BFF;
  --blue-bottom: #2560F0;
  --blue-soft: #E6EEFF;
  --yellow: #FFC83D;
  --banner-top: #FFE08A;
  --banner-bottom: #FFC94D;
  --green: #22C55E;
  --sky: #38BDF8;
  --purple: #A78BFA;
  --orange: #FB923C;
  --tasks-bg: #EAF2FF;
  --tip-yellow: #FFF4D6;
  --tip-pink: #FFE8EC;
  --whatsapp: #25D366;
  --danger: #EF4444;

  --grad-blue: linear-gradient(180deg, var(--blue-top), var(--blue-bottom));
  --grad-banner: linear-gradient(135deg, var(--banner-top), var(--banner-bottom));
  --grad-sky: linear-gradient(180deg, #D6ECFF, #F1F8FF);

  --shadow: 0 8px 20px rgba(0, 0, 0, .06);
  --shadow-blue: 0 6px 14px rgba(47, 107, 255, .30);
  --radius: 24px;
  --radius-lg: 28px;
  --radius-md: 20px;
  --gutter: 20px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --font: 'Nunito', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-weight: 600;
  font-size: 16px;
  line-height: 1.25;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}
h1, h2, h3, h4, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; text-align: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid rgba(47, 107, 255, .45); outline-offset: 2px; border-radius: 12px; }
#app:focus { outline: none; }

/* Типографика (как textTheme во Flutter) */
.t-display { font-size: 30px; font-weight: 900; line-height: 1; }
.t-hm { font-size: clamp(24px, 5vw + 6px, 30px); font-weight: 800; }
.t-hs { font-size: clamp(20px, 2.4vw + 12px, 28px); font-weight: 800; }
.t-tl { font-size: clamp(18px, 1vw + 15px, 22px); font-weight: 800; }
.t-tm { font-size: 17px; font-weight: 800; }
.t-ts { font-size: 15px; font-weight: 800; }
.t-bl { font-size: 16px; font-weight: 600; }
.t-bm { font-size: 14px; font-weight: 600; color: var(--ink-soft); line-height: 1.4; }
.t-bs { font-size: 12px; font-weight: 600; color: var(--muted); }
.t-ll { font-size: 16px; font-weight: 800; }
.t-lm { font-size: 13px; font-weight: 700; }
.t-lsm { font-size: 11px; font-weight: 700; color: var(--muted); }

/* Утилиты */
.block { display: block; }
.center { text-align: center; }
.row { display: flex; align-items: center; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.wrap { display: flex; flex-wrap: wrap; gap: 8px; }
.grow { flex: 1 1 auto; min-width: 0; }
.min0 { min-width: 0; }
.spacer { flex: 1 1 auto; }
.grow-space { flex: 1 1 auto; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.clamp2, .clamp3 { display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }
.clamp2 { -webkit-line-clamp: 2; line-clamp: 2; }
.clamp3 { -webkit-line-clamp: 3; line-clamp: 3; }
.fit { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ic { flex: none; }

/* Анимации (аналог flutter_animate) */
@keyframes appear { from { opacity: 0; transform: translateY(14px); } }
@keyframes appear-x { from { opacity: 0; transform: translateX(24px); } }
@keyframes pop-in { from { opacity: 0; transform: scale(.7); } }
@keyframes bob { to { transform: translateY(-6px); } }
@keyframes pulse { to { transform: scale(1.08); } }
@keyframes wiggle { from { transform: rotate(-2.3deg); } to { transform: rotate(2.3deg); } }
@keyframes fade { from { opacity: 0; } }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-8px); }
  40%, 80% { transform: translateX(8px); }
}
@keyframes bump { 50% { transform: scale(1.08); } }
@keyframes burst {
  0% { transform: translate(-50%, -50%) scale(.3); opacity: 1; }
  60% { opacity: 1; }
  100% { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1.1) rotate(var(--rot)); opacity: 0; }
}

.appear { animation: appear .4s cubic-bezier(.2, .8, .2, 1) backwards; animation-delay: var(--d, 0ms); }
.appear-x { animation: appear-x .4s cubic-bezier(.2, .8, .2, 1) backwards; animation-delay: var(--d, 0ms); }
.pop-in { animation: pop-in .5s cubic-bezier(.34, 1.56, .64, 1) backwards; }
.bob { animation: bob .9s ease-in-out infinite alternate; }
.bob-slow { animation: bob 1.2s ease-in-out infinite alternate; }
.wiggle { animation: wiggle 1.2s ease-in-out infinite alternate; }
.breathe { animation: pulse .9s ease-in-out infinite alternate; }

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