/* Меровген-с · стили (design tokens, layout, компоненты) */

.sticky-cta {
  position: sticky;
  bottom: calc(var(--tabbar-h) + 12px);
  z-index: 20;
  margin-top: var(--sp-4);
  padding: var(--sp-3);
  background: linear-gradient(180deg, rgba(244,246,249,0), var(--bg-page) 35%);
}

@media (min-width: 1024px) {
  .sticky-cta {
    bottom: 12px;
  }
}

.btn--cta {
  width: 100%;
  height: 60px;
  font-size: 18px;
  font-weight: 700;
  box-shadow: var(--sh-brand-glow);
}

.btn--cta:hover {
  transform: translateY(-1px);
}

.btn--cta:active {
  transform: scale(.98);
}

.cta-hint {
  text-align: center;
  margin-top: 8px;
  color: var(--text-3);
  font-size: 13px;
}

.date-selects .input {
  min-height: 52px;
  font-size: 16px;
}

.day-card {
  min-width: 0;
  overflow: hidden;
}

.day-card * {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
  hyphens: auto;
}

.day-card .text-small {
  font-size: 11px;
  line-height: 1.2;
}

.day-card .btn--small {
  font-size: 11px;
  padding: 0 8px;
  height: 34px;
  white-space: normal;
  line-height: 1.15;
  text-align: center;
}

.grid-week {
  grid-template-columns: repeat(7, minmax(86px, 1fr));
}

@media (max-width: 480px) {
  .grid-week {
    grid-template-columns: repeat(7, minmax(76px, 1fr));
  }

  .day-card {
    padding: 10px;
    min-height: 128px;
  }

  .day-card .icon-chip {
    width: 32px;
    height: 32px;
    font-size: 14px;
  }
}

.day-card .focus-label {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.block-progress {
  margin-top: 10px;
  padding: 12px;
  border-radius: var(--r-lg, 14px);
  background: var(--bg-soft, rgba(30,136,255,.07));
}

.block-big {
  font-size: 18px;
  font-weight: 700;
}

.block-detail {
  color: var(--text-2, #47506b);
  font-size: 14px;
  margin-top: 2px;
}

.block-rest {
  color: var(--text-3, #6b7488);
  font-size: 13px;
  margin-top: 2px;
}

.block-done-note {
  color: var(--success, #28C76F);
  font-size: 13px;
  font-weight: 600;
  margin-top: 6px;
}

.block-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.btn--block {
  min-height: 48px;
  font-size: 15px;
  font-weight: 700;
  flex: 1 1 auto;
}

.confetti-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 200;
  overflow: hidden;
}

.confetti-piece {
  position: absolute;
  width: 10px;
  height: 14px;
  border-radius: 3px;
  opacity: .95;
  animation: confettiFall 1.2s ease-out forwards;
}

@keyframes confettiFall {
  0% {
    transform: translateY(-20px) rotate(0deg) scale(.8);
    opacity: 1;
  }
  100% {
    transform: translateY(110vh) rotate(720deg) scale(1.1);
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .confetti-layer,
  .confetti-piece {
    display: none !important;
    animation: none !important;
  }
}
.row {
  display: flex;
  gap: var(--sp-2);
  flex-wrap: wrap;
  align-items: center;
}

.phase-title {
  margin: var(--sp-4) 0 var(--sp-2);
  font: 700 12px/1 var(--font-ui);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-eyebrow);
}

.fade-in {
  animation: fadeIn .25s cubic-bezier(.2,.7,.3,1);
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .fade-in {
    animation: none;
  }
}
    :root {
      --bg-page: #F4F6F9;
      --bg-page-2: #EEF2F8;
      --surface: #FFFFFF;
      --surface-2: #F7F9FC;
      --border: #E4E7EC;
      --border-soft: #EEF1F5;

      --text-1: #212B36;
      --text-2: #5A6677;
      --text-3: #8A94A6;
      --text-eyebrow: #9AA5B1;

      --brand: #1E88FF;
      --brand-600: #1668D6;
      --brand-tint: #E8F2FF;

      --success: #28C76F;
      --success-tint: #E4F8EE;

      --warning: #FFB020;
      --warning-tint: #FFF3DA;

      --danger: #F4516C;
      --danger-tint: #FFE7EB;

      --violet: #7C4DFF;
      --teal: #00C2CB;
      --accent-indigo: #14108C;

      --neu-bg: #E9EDF6;
      --neu-light: rgba(255, 255, 255, .9);
      --neu-dark: rgba(163, 177, 198, .5);

      --energy-grad: linear-gradient(135deg, #28C76F 0%, #FFD23F 50%, #FF8A5B 100%);
      --donut-grad: conic-gradient(from 220deg, #7C3AED, #EC4899, #FB923C, #FACC15, #28C76F);

      --font-head: 'Poppins', system-ui, sans-serif;
      --font-ui: 'Inter', system-ui, sans-serif;

      --r-card: 16px;
      --r-btn: 12px;
      --r-input: 12px;
      --r-chip: 999px;
      --r-iconchip: 16px;
      --r-modal: 20px;
      --r-avatar: 999px;

      --sh-card: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .07);
      --sh-card-up: 0 6px 16px rgba(16, 24, 40, .08), 0 2px 6px rgba(16, 24, 40, .06);
      --sh-float: 0 14px 30px rgba(31, 45, 90, .14), 0 4px 10px rgba(31, 45, 90, .08);
      --neu-raised: -6px -6px 12px var(--neu-light), 6px 6px 12px var(--neu-dark);
      --neu-inset: inset -4px -4px 8px rgba(255, 255, 255, .85), inset 4px 4px 8px rgba(163, 177, 198, .45);
      --sh-brand-glow: 0 6px 18px rgba(30, 136, 255, .35);

      --sp-1: 4px;
      --sp-2: 8px;
      --sp-3: 12px;
      --sp-4: 16px;
      --sp-5: 20px;
      --sp-6: 24px;
      --sp-8: 32px;

      --tabbar-h: 64px;
      --sidebar-w: 232px;
      --topbar-h: 60px;
    }

    [data-theme="dark"] {
      --bg-page: #10141C;
      --surface: #1A2230;
      --surface-2: #222C3C;
      --border: #2C3849;
      --border-soft: #2C3849;
      --text-1: #E6EAF2;
      --text-2: #AEB8C6;
      --text-3: #8A94A6;
      --text-eyebrow: #6B7280;
      --neu-bg: #1A2230;
      --neu-light: rgba(255, 255, 255, .06);
      --neu-dark: rgba(0, 0, 0, .5);
      --brand-tint: rgba(30, 136, 255, .15);
      --success-tint: rgba(40, 199, 111, .15);
      --warning-tint: rgba(255, 176, 32, .15);
      --danger-tint: rgba(244, 81, 108, .15);
    }

    * {
      box-sizing: border-box;
      margin: 0;
      padding: 0;
      -webkit-tap-highlight-color: transparent;
    }

    html, body {
      height: 100%;
      overflow-x: hidden;
    }

    body {
      font-family: var(--font-ui);
      background: var(--bg-page);
      color: var(--text-1);
      line-height: 1.5;
      font-size: 16px;
      -webkit-font-smoothing: antialiased;
    }

    h1, h2, h3, h4 {
      font-family: var(--font-head);
      font-weight: 700;
      line-height: 1.15;
    }

    button {
      font-family: inherit;
      cursor: pointer;
      border: none;
      background: none;
      color: inherit;
    }

    input, select, textarea {
      font-family: inherit;
      font-size: 16px;
      color: inherit;
    }

    a {
      text-decoration: none;
      color: var(--brand);
    }

    :focus-visible {
      outline: none;
      box-shadow: 0 0 0 3px var(--brand-tint);
      border-radius: 10px;
    }

    .flex { display: flex; }
    .col { flex-direction: column; }
    .center { align-items: center; justify-content: center; }
    .between { justify-content: space-between; }
    .wrap { flex-wrap: wrap; }
    .gap-1 { gap: var(--sp-1); }
    .gap-2 { gap: var(--sp-2); }
    .gap-3 { gap: var(--sp-3); }
    .gap-4 { gap: var(--sp-4); }
    .gap-6 { gap: var(--sp-6); }
    .mt-1 { margin-top: var(--sp-1); }
    .mt-2 { margin-top: var(--sp-2); }
    .mt-3 { margin-top: var(--sp-3); }
    .mt-4 { margin-top: var(--sp-4); }
    .mb-2 { margin-bottom: var(--sp-2); }
    .mb-4 { margin-bottom: var(--sp-4); }
    .mb-6 { margin-bottom: var(--sp-6); }
    .hidden { display: none !important; }
    .relative { position: relative; }
    .full-w { width: 100%; }
    .text-center { text-align: center; }
    .text-muted { color: var(--text-2); }
    .text-small { font-size: 13px; }
    .text-brand { color: var(--brand); }
    .text-success { color: var(--success); }
    .text-danger { color: var(--danger); }
    .font-bold { font-weight: 700; }
    .tnum { font-variant-numeric: tabular-nums; }

    .eyebrow {
      font: 600 12px/1 var(--font-ui);
      letter-spacing: .10em;
      text-transform: uppercase;
      color: var(--text-eyebrow);
      margin-bottom: var(--sp-1);
    }

    .h-hero {
      font: 700 32px/1.15 var(--font-head);
      color: var(--text-1);
    }

    .h-section {
      font: 700 20px/1.2 var(--font-head);
      color: var(--text-1);
    }

    .card {
      background: var(--surface);
      border-radius: var(--r-card);
      box-shadow: var(--sh-card);
      padding: var(--sp-5);
      border: 1px solid transparent;
      transition: all .2s ease-out;
    }

    .card--interactive:hover {
      box-shadow: var(--sh-card-up);
      transform: translateY(-2px);
      border-color: var(--border-soft);
    }

    .card--neu {
      background: var(--neu-bg);
      box-shadow: var(--neu-raised);
      border: none;
    }

    .card--neu:active {
      box-shadow: var(--neu-inset);
    }

    .btn {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: var(--sp-2);
      height: 48px;
      padding: 0 var(--sp-5);
      border-radius: var(--r-btn);
      font: 600 16px var(--font-ui);
      transition: all .18s ease-out;
      min-width: 48px;
    }

    .btn--primary {
      background: var(--brand);
      color: white;
      box-shadow: var(--sh-brand-glow);
    }

    .btn--primary:hover { background: var(--brand-600); }
    .btn--primary:active { transform: scale(.98); }

    .btn--ghost {
      background: var(--surface);
      border: 1px solid var(--border);
      color: var(--brand);
    }

    .btn--ghost:hover { background: var(--surface-2); }

    .btn--large {
      height: 56px;
      font-size: 18px;
      width: 100%;
    }

    .btn--icon {
      width: 48px;
      padding: 0;
      border-radius: var(--r-btn);
    }

    .btn--small {
      height: 38px;
      padding: 0 12px;
      font-size: 13px;
    }

    .input-group { margin-bottom: var(--sp-4); }

    .label {
      display: block;
      font-size: 13px;
      font-weight: 600;
      color: var(--text-2);
      margin-bottom: var(--sp-2);
    }

    .input, textarea, select {
      width: 100%;
      min-height: 48px;
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: var(--r-input);
      padding: 12px var(--sp-3);
      color: var(--text-1);
      transition: all .2s;
    }

    textarea {
      min-height: 86px;
      resize: vertical;
    }

    .input:focus, textarea:focus, select:focus {
      outline: none;
      border-color: var(--brand);
      box-shadow: 0 0 0 3px var(--brand-tint);
    }

    .input--neu {
      background: var(--neu-bg);
      border: none;
      box-shadow: var(--neu-inset);
    }

    .chips {
      display: flex;
      flex-wrap: wrap;
      gap: var(--sp-2);
    }

    .chip {
      position: relative;
      display: inline-flex;
      align-items: center;
      gap: 6px;
      min-height: 38px;
      padding: 8px 12px;
      border-radius: var(--r-chip);
      font: 600 13px var(--font-ui);
      background: var(--surface-2);
      color: var(--text-2);
      border: 1px solid transparent;
      cursor: pointer;
      transition: all .2s;
      user-select: none;
    }

    .chip input {
      position: absolute;
      opacity: 0;
      pointer-events: none;
    }

    .chip.active,
    .chip:has(input:checked) {
      background: var(--brand-tint);
      color: var(--brand-600);
      border-color: var(--brand);
    }

    .alert {
      display: flex;
      gap: var(--sp-3);
      padding: var(--sp-4);
      border-radius: var(--r-btn);
      font-size: 14px;
      line-height: 1.45;
      margin-bottom: var(--sp-4);
    }

    .alert--stop { background: var(--danger-tint); color: #B02542; }
    .alert--warn { background: var(--warning-tint); color: #9A6200; }
    .alert--info { background: var(--brand-tint); color: var(--brand-600); }
    .alert--success { background: var(--success-tint); color: #0F7A43; }

    .readiness-container {
      position: relative;
      width: 180px;
      height: 180px;
      margin: 0 auto;
    }

    .readiness-svg {
      width: 100%;
      height: 100%;
      transform: rotate(-90deg);
    }

    .readiness-track {
      fill: none;
      stroke: var(--border-soft);
      stroke-width: 12;
    }

    .readiness-arc {
      fill: none;
      stroke: url(#gradient-readiness);
      stroke-width: 12;
      stroke-linecap: round;
      stroke-dasharray: 502;
      stroke-dashoffset: 502;
      transition: stroke-dashoffset 1s ease-out;
    }

    .readiness-center {
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      text-align: center;
    }

    .readiness-score {
      font: 700 44px/1 var(--font-head);
      color: var(--text-1);
      font-variant-numeric: tabular-nums;
    }

    .readiness-label {
      font-size: 12px;
      color: var(--text-3);
      text-transform: uppercase;
      letter-spacing: .05em;
      margin-top: 4px;
    }

    .stepper {
      display: flex;
      gap: var(--sp-2);
      margin-bottom: var(--sp-4);
      overflow-x: auto;
      padding-bottom: 4px;
    }

    .step-pill {
      flex-shrink: 0;
      padding: 8px 12px;
      border-radius: var(--r-chip);
      font-size: 12px;
      font-weight: 700;
      background: var(--surface-2);
      color: var(--text-3);
      border: 1px solid transparent;
      cursor: pointer;
    }

    .step-pill.active {
      background: var(--brand-tint);
      color: var(--brand-600);
      border-color: var(--brand);
    }

    .step-pill.warmup { border-left: 3px solid var(--teal); }
    .step-pill.main { border-left: 3px solid var(--violet); }
    .step-pill.cooldown { border-left: 3px solid var(--warning); }

    .ex-card {
      background: var(--surface);
      border-radius: var(--r-card);
      padding: var(--sp-4);
      margin-bottom: var(--sp-3);
      box-shadow: var(--sh-card);
      border: 1px solid var(--border-soft);
      transition: all .2s;
    }

    .ex-card.done {
      opacity: .65;
      background: var(--surface-2);
    }

    .ex-header {
      display: flex;
      justify-content: space-between;
      align-items: flex-start;
      gap: var(--sp-3);
      margin-bottom: var(--sp-2);
    }

    .ex-title {
      font-weight: 700;
      font-size: 16px;
      color: var(--text-1);
    }

    .ex-meta {
      font-size: 13px;
      color: var(--text-2);
      margin-top: 2px;
    }

    .ex-dose {
      font-weight: 700;
      color: var(--brand-600);
      background: var(--brand-tint);
      padding: 6px 10px;
      border-radius: 8px;
      font-size: 13px;
      display: inline-block;
      margin-top: 8px;
    }

    .ex-checkbox {
      width: 32px;
      height: 32px;
      min-width: 32px;
      border-radius: 50%;
      border: 2px solid var(--border);
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      transition: all .2s;
      font-weight: 900;
      color: transparent;
    }

    .ex-checkbox.checked {
      background: var(--success);
      border-color: var(--success);
      color: white;
    }

    .help-block {
      margin-top: var(--sp-3);
      padding: var(--sp-3);
      background: var(--surface-2);
      border-radius: var(--r-btn);
      font-size: 14px;
      color: var(--text-2);
    }

    .help-block ol,
    .help-block ul {
      margin: 6px 0 0 18px;
    }

    .help-block li {
      margin: 4px 0;
    }

    .rest-overlay {
      position: fixed;
      bottom: calc(var(--tabbar-h) + 16px);
      left: 16px;
      right: 16px;
      background: var(--surface);
      border-radius: var(--r-modal);
      box-shadow: var(--sh-float);
      z-index: 100;
      padding: var(--sp-5);
      animation: slideUp .3s cubic-bezier(.2,.7,.3,1);
      max-width: 420px;
      margin: 0 auto;
    }

    @keyframes slideUp {
      from { transform: translateY(100%); opacity: 0; }
      to { transform: translateY(0); opacity: 1; }
    }

    .rest-number {
      font: 700 64px/1 var(--font-head);
      color: var(--text-1);
      text-align: center;
      font-variant-numeric: tabular-nums;
      margin: var(--sp-3) 0;
    }

    .rest-controls {
      display: flex;
      gap: var(--sp-2);
      justify-content: center;
      flex-wrap: wrap;
    }

    .app-shell {
      display: flex;
      flex-direction: column;
      min-height: 100dvh;
      padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
    }

    .top-bar {
      height: var(--topbar-h);
      background: var(--surface);
      border-bottom: 1px solid var(--border-soft);
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 0 var(--sp-4);
      position: sticky;
      top: 0;
      z-index: 50;
    }

    .logo-mark {
      font: 700 18px var(--font-head);
      color: var(--brand);
      display: flex;
      align-items: center;
      gap: 8px;
    }

    .avatar-btn {
      width: 40px;
      height: 40px;
      border-radius: var(--r-avatar);
      background: var(--brand-tint);
      color: var(--brand);
      display: flex;
      align-items: center;
      justify-content: center;
      font-weight: 800;
      font-size: 15px;
      border: 1px solid transparent;
      transition: all .2s;
    }

    .avatar-btn:hover {
      border-color: var(--brand);
      box-shadow: var(--sh-card-up);
    }

    .main-content {
      flex: 1;
      padding: var(--sp-4);
      max-width: 1200px;
      margin: 0 auto;
      width: 100%;
    }

    .tab-bar {
      position: fixed;
      bottom: 0;
      left: 0;
      right: 0;
      height: var(--tabbar-h);
      background: var(--surface);
      border-top: 1px solid var(--border-soft);
      display: flex;
      justify-content: space-around;
      align-items: center;
      padding-bottom: env(safe-area-inset-bottom);
      z-index: 60;
      box-shadow: 0 -4px 20px rgba(0,0,0,.05);
    }

    .tab-item {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 4px;
      color: var(--text-3);
      font-size: 10px;
      font-weight: 700;
      width: 64px;
      height: 100%;
      transition: color .2s;
    }

    .tab-item svg {
      width: 24px;
      height: 24px;
      fill: currentColor;
    }

    .tab-item.active {
      color: var(--brand);
    }

    .sidebar {
      display: none;
    }

    .nav-link {
      display: flex;
      align-items: center;
      gap: var(--sp-3);
      padding: 12px 16px;
      border-radius: var(--r-btn);
      color: var(--text-2);
      font-weight: 600;
      margin-bottom: 4px;
      transition: all .2s;
      cursor: pointer;
    }

    .nav-link:hover {
      background: var(--surface-2);
      color: var(--text-1);
    }

    .nav-link.active {
      background: var(--brand-tint);
      color: var(--brand-600);
      border-left: 3px solid var(--brand);
    }

    .nav-link svg {
      width: 20px;
      height: 20px;
      fill: currentColor;
    }

    .grid2 {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: var(--sp-3);
    }

    .grid3 {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: var(--sp-3);
    }

    .grid-kpi {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
      gap: var(--sp-4);
    }

    .grid-week {
      display: grid;
      grid-template-columns: repeat(7, minmax(88px, 1fr));
      gap: var(--sp-2);
      overflow-x: auto;
      padding-bottom: 4px;
    }

    .day-card {
      min-width: 88px;
      min-height: 136px;
      padding: var(--sp-3);
      border-radius: var(--r-card);
      background: var(--surface);
      border: 1px solid var(--border-soft);
      box-shadow: var(--sh-card);
      display: flex;
      flex-direction: column;
      gap: 8px;
      align-items: center;
      justify-content: flex-start;
      text-align: center;
    }

    .day-card.today {
      border-color: var(--brand);
      box-shadow: var(--sh-card-up);
    }

    .icon-chip {
      width: 40px;
      height: 40px;
      border-radius: var(--r-iconchip);
      display: grid;
      place-items: center;
      color: white;
      font-weight: 800;
    }

    .list-row {
      display: flex;
      align-items: center;
      gap: var(--sp-3);
      padding: 12px 0;
      border-bottom: 1px solid var(--border-soft);
    }

    .list-row:last-child {
      border-bottom: none;
    }

    .meter {
      height: 8px;
      background: var(--border-soft);
      border-radius: 999px;
      overflow: hidden;
    }

    .meter > div {
      height: 100%;
      background: var(--brand);
      border-radius: 999px;
    }

    .sparkline {
      width: 100%;
      height: 42px;
      display: block;
    }

    .section-title {
      margin: var(--sp-6) 0 var(--sp-3);
    }

    .compact-form .input-group {
      margin-bottom: var(--sp-3);
    }

    @media (max-width: 760px) {
      .grid2, .grid3 {
        grid-template-columns: 1fr;
      }
      .h-hero { font-size: 28px; }
      .readiness-container { width: 160px; height: 160px; }
      .readiness-score { font-size: 38px; }
    }

    @media (min-width: 1024px) {
      .app-shell {
        flex-direction: row;
        padding-bottom: 0;
      }

      .sidebar {
        display: flex;
        flex-direction: column;
        width: var(--sidebar-w);
        background: var(--surface);
        border-right: 1px solid var(--border-soft);
        height: 100dvh;
        position: fixed;
        left: 0;
        top: 0;
        padding: var(--sp-6) var(--sp-4);
        z-index: 50;
      }

      .mobile-only { display: none !important; }
      .desktop-only { display: block !important; }

      .main-wrapper {
        margin-left: var(--sidebar-w);
        flex: 1;
        display: flex;
        flex-direction: column;
        min-height: 100dvh;
      }

      .top-bar {
        position: relative;
        border-bottom: none;
        padding: 0 var(--sp-8);
        height: 80px;
        background: transparent;
      }

      .main-content {
        padding: var(--sp-8);
        flex: 1;
      }

      .tab-bar { display: none; }
    }

    @media (prefers-reduced-motion: reduce) {
      * {
        transition: none !important;
        animation: none !important;
        scroll-behavior: auto !important;
      }
    }
