/* ═══════════════════════════════════════════════════════════════════
   МЕДВЕДИКУС — Aurora Health
   Биолюминесцентный медтех: стекло, свечение, движение.
   Шрифты: Unbounded (display) + Manrope (body). Тёмная + светлая.
   ═══════════════════════════════════════════════════════════════════ */

@import url("https://fonts.googleapis.com/css2?family=Unbounded:wght@400;500;600;700;800&family=Manrope:wght@400;500;600;700;800&display=swap");

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

/* ════════════ ТЕМЫ ════════════ */
:root,
[data-theme="dark"] {
  --bg: #0b1110;
  --aurora-1: rgba(45, 212, 191, 0.16);
  --aurora-2: rgba(102, 126, 234, 0.08);
  --aurora-3: rgba(250, 204, 21, 0.06);
  --aurora-4: rgba(13, 148, 136, 0.1);

  --glass: rgba(255, 255, 255, 0.055);
  --glass-2: rgba(255, 255, 255, 0.085);
  --glass-press: rgba(255, 255, 255, 0.13);
  --glass-brd: rgba(255, 255, 255, 0.12);
  --glass-hi: rgba(255, 255, 255, 0.1);

  --text: #f3f7f6;
  --text-2: #9fb0ad;
  --text-3: #61716e;

  --accent: #2dd4bf;
  --accent-2: #10b981;
  --accent-grad: linear-gradient(135deg, #2dd4bf 0%, #10b981 100%);
  --accent-soft: rgba(45, 212, 191, 0.16);
  --accent-glow: 0 10px 24px rgba(45, 212, 191, 0.2);

  --green: #34d399;
  --yellow: #fbbf24;
  --red: #fb7185;
  --green-glow: rgba(52, 211, 153, 0.6);
  --yellow-glow: rgba(251, 191, 36, 0.6);
  --red-glow: rgba(251, 113, 133, 0.6);

  --card-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
  --grain-opacity: 0.026;
  --noise-blend: overlay;
  --nav-bg: rgba(22, 34, 31, 0.97);
}

[data-theme="light"] {
  --bg: #f4f7f7;
  --aurora-1: rgba(45, 212, 191, 0.12);
  --aurora-2: rgba(102, 126, 234, 0.06);
  --aurora-3: rgba(250, 204, 21, 0.08);
  --aurora-4: rgba(20, 184, 166, 0.08);

  --glass: rgba(255, 255, 255, 0.88);
  --glass-2: rgba(255, 255, 255, 0.95);
  --glass-press: rgba(247, 250, 249, 0.98);
  --glass-brd: rgba(12, 26, 23, 0.08);
  --glass-hi: rgba(255, 255, 255, 1);

  --text: #0c1a17;
  --text-2: #4a5d59;
  --text-3: #8a9b97;

  --accent: #0d9488;
  --accent-2: #059669;
  --accent-grad: linear-gradient(135deg, #14b8a6 0%, #059669 100%);
  --accent-soft: rgba(13, 148, 136, 0.12);
  --accent-glow: 0 8px 30px rgba(13, 148, 136, 0.28);

  --green: #10b981;
  --yellow: #f59e0b;
  --red: #f43f5e;
  --green-glow: rgba(16, 185, 129, 0.45);
  --yellow-glow: rgba(245, 158, 11, 0.45);
  --red-glow: rgba(244, 63, 94, 0.45);

  --card-shadow: 0 12px 28px rgba(15, 60, 50, 0.08);
  --grain-opacity: 0.02;
  --noise-blend: multiply;
  --nav-bg: rgba(255, 255, 255, 0.98);
}

:root {
  --radius: 8px;
  --radius-sm: 8px;
  --nav-h: 68px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --font-display: "Unbounded", -apple-system, sans-serif;
  --font-body: "Manrope", -apple-system, BlinkMacSystemFont, sans-serif;
}

html,
body {
  height: 100%;
}

html {
  background: var(--bg);
  transition: background-color 0.5s ease;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  max-width: 440px;
  margin: 0 auto;
  min-height: 100dvh;
  position: relative;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition:
    background-color 0.5s ease,
    color 0.4s ease;
}

/* ════════════ ФОН: AURORA + GRAIN ════════════ */
.aurora {
  position: fixed;
  inset: -30%;
  z-index: -2;
  pointer-events: none;
  display: block;
  filter: blur(70px) saturate(140%);
  opacity: 0.9;
  will-change: transform;
  transition: transform 0.5s var(--ease);
}
.aurora::before,
.aurora::after,
.aurora i {
  content: "";
  position: absolute;
  border-radius: 50%;
  mix-blend-mode: screen;
}
[data-theme="light"] .aurora {
  opacity: 0.55;
  filter: blur(80px) saturate(120%);
}
[data-theme="light"] .aurora::before,
[data-theme="light"] .aurora::after,
[data-theme="light"] .aurora i {
  mix-blend-mode: normal;
}
.aurora::before {
  width: 70%;
  height: 50%;
  top: 2%;
  left: -10%;
  background: radial-gradient(ellipse, var(--aurora-1), transparent 70%);
  animation: drift1 18s var(--ease) infinite alternate;
}
.aurora::after {
  width: 75%;
  height: 55%;
  top: 25%;
  right: -20%;
  background: radial-gradient(ellipse, var(--aurora-2), transparent 70%);
  animation: drift2 22s var(--ease) infinite alternate;
}
.aurora i {
  display: block;
  width: 65%;
  height: 50%;
  bottom: -5%;
  left: 10%;
  background: radial-gradient(ellipse, var(--aurora-3), transparent 70%);
  animation: drift3 26s var(--ease) infinite alternate;
}
@keyframes drift1 {
  to {
    transform: translate(18%, 22%) scale(1.25);
  }
}
@keyframes drift2 {
  to {
    transform: translate(-22%, 18%) scale(1.3);
  }
}
@keyframes drift3 {
  to {
    transform: translate(15%, -20%) scale(1.2);
  }
}

.grain {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: var(--grain-opacity);
  mix-blend-mode: var(--noise-blend);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ════════════ SCREENS / ROUTING ════════════ */
.screen {
  display: none;
  flex-direction: column;
  min-height: 100dvh;
  padding-bottom: calc(var(--nav-h) + 28px + env(safe-area-inset-bottom, 0px));
}
.screen.active {
  display: flex;
}
.screen.no-nav {
  padding-bottom: 0;
}

.scroll {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px));
}
.scroll::-webkit-scrollbar {
  display: none;
}

/* Staggered reveal — крупные блоки появляются каскадом */
.screen.active .reveal {
  opacity: 0;
  animation: rise 0.7s var(--ease) forwards;
}
.screen.active .reveal:nth-child(1) {
  animation-delay: 0.04s;
}
.screen.active .reveal:nth-child(2) {
  animation-delay: 0.11s;
}
.screen.active .reveal:nth-child(3) {
  animation-delay: 0.18s;
}
.screen.active .reveal:nth-child(4) {
  animation-delay: 0.25s;
}
.screen.active .reveal:nth-child(5) {
  animation-delay: 0.32s;
}
.screen.active .reveal:nth-child(6) {
  animation-delay: 0.39s;
}
.screen.active .reveal:nth-child(7) {
  animation-delay: 0.46s;
}
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(22px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .aurora,
  .screen.active .reveal {
    animation: none !important;
  }
  .screen.active .reveal {
    opacity: 1;
  }
}

/* ════════════ HEADER ════════════ */
.header {
  padding: calc(34px + env(safe-area-inset-top, 0px)) 22px 16px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}
.header .eyebrow {
  font-size: 13px;
  color: var(--text-2);
  margin-bottom: 7px;
  font-weight: 600;
  letter-spacing: 0;
}
.header h1 {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1;
}

.badge {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--glass-brd);
  border-radius: 100px;
  padding: 6px 13px;
  white-space: nowrap;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* ════════════ SECTION LABEL ════════════ */
.label {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0;
  padding: 22px 24px 10px;
}

/* ════════════ GLASS CARD ════════════ */
.card {
  background: var(--glass);
  border: 1px solid var(--glass-brd);
  border-radius: var(--radius);
  margin: 0 16px 12px;
  overflow: hidden;
  backdrop-filter: blur(24px) saturate(150%);
  -webkit-backdrop-filter: blur(24px) saturate(150%);
  box-shadow:
    var(--card-shadow),
    inset 0 1px 0 var(--glass-hi);
}

.row {
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: background 0.2s;
}
.row:active {
  background: var(--glass-press);
}
.row + .row {
  border-top: 1px solid var(--glass-brd);
}

.mini-history-more {
  width: 100%;
  border: none;
  border-top: 1px solid var(--glass-brd);
  background: transparent;
  color: var(--accent);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 800;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
}
.mini-history-more:active {
  background: var(--glass-press);
}

.doc-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
  position: relative;
  color: var(--text);
  box-shadow: inset 0 1px 0 var(--glass-hi);
}
.doc-icon.blood {
  background: linear-gradient(
    135deg,
    rgba(251, 113, 133, 0.18),
    rgba(251, 113, 133, 0.08)
  );
}
.doc-icon.uzi {
  background: linear-gradient(
    135deg,
    rgba(56, 189, 248, 0.18),
    rgba(56, 189, 248, 0.08)
  );
}
.doc-icon.bio {
  background: linear-gradient(
    135deg,
    rgba(52, 211, 153, 0.18),
    rgba(52, 211, 153, 0.08)
  );
}

.row-main {
  flex: 1;
  min-width: 0;
}
.row-title {
  font-size: 15.5px;
  font-weight: 700;
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0;
}
.row-sub {
  font-size: 13px;
  color: var(--text-2);
  font-weight: 500;
}
.chev {
  color: var(--text-3);
  font-size: 20px;
  flex-shrink: 0;
}

/* ════════════ TRAFFIC DOTS (светящиеся) ════════════ */
.dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  flex-shrink: 0;
  position: relative;
}
.dot.green {
  background: var(--green);
  box-shadow: 0 0 12px 1px var(--green-glow);
}
.dot.yellow {
  background: var(--yellow);
  box-shadow: 0 0 12px 1px var(--yellow-glow);
}
.dot.red {
  background: var(--red);
  box-shadow: 0 0 12px 1px var(--red-glow);
  animation: throb 2s ease-in-out infinite;
}
@keyframes throb {
  0%,
  100% {
    box-shadow: 0 0 12px 1px var(--red-glow);
  }
  50% {
    box-shadow: 0 0 20px 3px var(--red-glow);
  }
}

/* ════════════ BUTTONS ════════════ */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  padding: 17px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  letter-spacing: 0;
  transition:
    transform 0.18s var(--ease-spring),
    box-shadow 0.25s,
    filter 0.2s;
}
.btn:active {
  transform: scale(0.97);
}
.btn:disabled {
  cursor: not-allowed;
  filter: grayscale(0.8);
  opacity: 0.48;
  box-shadow: none;
}
.btn:disabled::before {
  display: none;
}
.btn-primary {
  background: var(--accent-grad);
  color: #03100d;
  box-shadow:
    var(--accent-glow),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
}
.btn-primary::before {
  content: "";
  position: absolute;
  top: 0;
  left: -120%;
  width: 80%;
  height: 100%;
  background: linear-gradient(
    100deg,
    transparent,
    rgba(255, 255, 255, 0.55),
    transparent
  );
  transform: skewX(-18deg);
  display: none;
}
@keyframes shine {
  0%,
  55% {
    left: -120%;
  }
  80%,
  100% {
    left: 130%;
  }
}
.btn-ghost {
  background: var(--glass-2);
  border: 1px solid var(--glass-brd);
  color: var(--text);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.btn-ghost:active {
  background: var(--glass-press);
}
.btn-danger {
  background: rgba(251, 113, 133, 0.12);
  color: var(--red);
  border: 1px solid rgba(251, 113, 133, 0.2);
}
.btn-danger:active {
  background: rgba(251, 113, 133, 0.22);
}
.btn-lg {
  padding: 19px;
  font-size: 17px;
}

/* ═══════════════════════════════════════════════════════
   ОНБОРДИНГ
   ═══════════════════════════════════════════════════════ */
#onboarding {
  justify-content: space-between;
  padding: calc(56px + env(safe-area-inset-top, 0px)) 24px
    calc(30px + env(safe-area-inset-bottom, 0px));
  text-align: center;
}
.ob-top {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.ob-logo {
  width: 82px;
  height: 82px;
  border-radius: 18px;
  background: var(--accent-grad);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 25px;
  font-weight: 800;
  color: #03100d;
  margin-bottom: 28px;
  box-shadow:
    0 14px 34px rgba(45, 212, 191, 0.24),
    inset 0 2px 4px rgba(255, 255, 255, 0.5);
  animation: none;
}
@keyframes floaty {
  50% {
    transform: translateY(-12px);
  }
}
@keyframes glowpulse {
  50% {
    box-shadow:
      0 26px 80px rgba(45, 212, 191, 0.65),
      inset 0 2px 4px rgba(255, 255, 255, 0.5);
  }
}
.ob-title {
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1;
  margin-bottom: 16px;
  background: linear-gradient(180deg, var(--text), var(--text-2));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.ob-sub {
  font-size: 16px;
  color: var(--text-2);
  line-height: 1.55;
  max-width: 310px;
  font-weight: 500;
}
.ob-features {
  margin-top: 32px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 350px;
}
.ob-feat {
  display: flex;
  align-items: center;
  gap: 15px;
  text-align: left;
  font-size: 14.5px;
  font-weight: 600;
  padding: 13px 14px;
  background: var(--glass);
  border: 1px solid var(--glass-brd);
  border-radius: var(--radius-sm);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: inset 0 1px 0 var(--glass-hi);
}
.ob-feat .ic {
  width: 38px;
  height: 38px;
  border-radius: var(--radius);
  background: var(--accent-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  flex-shrink: 0;
}
.ob-bottom {
  width: 100%;
}
.ob-disclaimer {
  font-size: 11.5px;
  color: var(--text-3);
  line-height: 1.5;
  margin-bottom: 16px;
  padding: 0 8px;
}
.consent-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0 0 14px;
  padding: 12px 13px;
  border: 1px solid var(--glass-brd);
  border-radius: var(--radius-sm);
  background: var(--glass);
  color: var(--text-2);
  font-size: 12px;
  line-height: 1.45;
  text-align: left;
  cursor: pointer;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.consent-row input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.consent-box {
  width: 20px;
  height: 20px;
  border: 1px solid var(--glass-brd);
  border-radius: 7px;
  background: var(--glass-2);
  flex-shrink: 0;
  position: relative;
  margin-top: 1px;
}
.consent-box::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 3px;
  width: 5px;
  height: 10px;
  border: solid #03100d;
  border-width: 0 2px 2px 0;
  transform: rotate(42deg) scale(0);
  transition: transform 0.18s var(--ease-spring);
}
.consent-row input:checked + .consent-box {
  background: var(--accent-grad);
}
.consent-row input:checked + .consent-box::after {
  transform: rotate(42deg) scale(1);
}

/* ═══════════════════════════════════════════════════════
   ГЛАВНАЯ / РАЗБОР
   ═══════════════════════════════════════════════════════ */
.hero-upload {
  margin: 6px 16px 0;
  background: var(--glass);
  border: 1px solid var(--glass-brd);
  border-radius: var(--radius);
  padding: 28px 20px 22px;
  text-align: center;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(24px) saturate(150%);
  -webkit-backdrop-filter: blur(24px) saturate(150%);
  box-shadow:
    var(--card-shadow),
    inset 0 1px 0 var(--glass-hi);
}
.hero-upload::after {
  display: none;
}
.hero-bear {
  width: 54px;
  height: 54px;
  border-radius: var(--radius);
  margin: 0 auto 16px;
  background: var(--accent-soft);
  border: 1px solid var(--glass-brd);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
  filter: none;
  animation: none;
}
.hero-upload h2 {
  font-family: var(--font-display);
  font-size: 23px;
  font-weight: 700;
  letter-spacing: 0;
  margin-bottom: 8px;
}
.hero-upload p {
  font-size: 14.5px;
  color: var(--text-2);
  line-height: 1.55;
  margin-bottom: 24px;
  font-weight: 500;
  position: relative;
}
.upload-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 11px;
  position: relative;
}
.upload-actions .input-main {
  grid-column: 1 / -1;
}
.file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.upload-status {
  margin-top: 13px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
  text-align: left;
}
.upload-status:empty {
  display: none;
}
.upload-status.error {
  background: rgba(251, 113, 133, 0.12);
  color: var(--red);
}

.usage-card {
  margin: 12px 16px 0;
  padding: 14px 16px;
  border: 1px solid var(--glass-brd);
  border-radius: var(--radius-sm);
  background: var(--glass);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  box-shadow: inset 0 1px 0 var(--glass-hi);
}
.usage-kicker {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
  color: var(--text-3);
  margin-bottom: 3px;
}
.usage-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}
.usage-pill {
  padding: 7px 10px;
  border-radius: 100px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.tip {
  margin: 16px 16px 0;
  background: var(--accent-soft);
  border: 1px solid var(--glass-brd);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-size: 13px;
  color: var(--text);
  line-height: 1.5;
  display: flex;
  gap: 11px;
  font-weight: 500;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.tip .ic {
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════
   ВВОД ТЕКСТОМ
   ═══════════════════════════════════════════════════════ */
.text-panel {
  margin: 16px;
  padding: 14px;
  border: 1px solid var(--glass-brd);
  border-radius: var(--radius);
  background: var(--glass);
  backdrop-filter: blur(24px) saturate(150%);
  -webkit-backdrop-filter: blur(24px) saturate(150%);
  box-shadow:
    var(--card-shadow),
    inset 0 1px 0 var(--glass-hi);
}
.text-panel textarea {
  width: 100%;
  min-height: 220px;
  resize: vertical;
  border: 1px solid var(--glass-brd);
  border-radius: var(--radius-sm);
  background: var(--glass-2);
  color: var(--text);
  padding: 15px;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  outline: none;
}
.text-panel textarea::placeholder {
  color: var(--text-3);
}
.text-panel textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.voice-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}
.voice-btn {
  border: 1px solid var(--glass-brd);
  border-radius: var(--radius-sm);
  background: var(--glass-2);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 800;
  padding: 11px 13px;
  cursor: pointer;
  white-space: nowrap;
}
.voice-btn.active {
  background: var(--accent-grad);
  color: #03100d;
}
.voice-status {
  color: var(--text-2);
  font-size: 12px;
  line-height: 1.35;
}
.voice-status.error {
  color: var(--red);
}
.input-error {
  min-height: 20px;
  padding: 8px 2px 0;
  color: var(--red);
  font-size: 12px;
  font-weight: 700;
}
.text-actions {
  display: flex;
  gap: 10px;
}
.text-actions .btn {
  flex: 1;
}

/* ═══════════════════════════════════════════════════════
   ЛОАДЕР
   ═══════════════════════════════════════════════════════ */
#loader {
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 24px;
}
.loader-orb {
  position: relative;
  width: 118px;
  height: 118px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.loader-orb .ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: var(--accent);
  border-right-color: var(--accent-2);
  animation: spin 1.4s linear infinite;
}
.loader-orb .ring.r2 {
  inset: 16px;
  border-top-color: var(--accent-2);
  border-right-color: transparent;
  animation-duration: 2s;
  animation-direction: reverse;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.pulse-bear {
  width: 58px;
  height: 58px;
  border-radius: var(--radius);
  background: var(--accent-soft);
  border: 1px solid var(--glass-brd);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
  animation: pulse 1.6s ease-in-out infinite;
  filter: none;
}
@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.12);
  }
}
#loader .l-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  margin-top: 28px;
  letter-spacing: 0;
}
#loader .l-sub {
  font-size: 14px;
  color: var(--text-2);
  margin-top: 8px;
  font-weight: 500;
}

/* ═══════════════════════════════════════════════════════
   РЕЗУЛЬТАТ / ДЕТАЛИ
   ═══════════════════════════════════════════════════════ */
.detail-head {
  padding: calc(22px + env(safe-area-inset-top, 0px)) 16px 4px;
  display: flex;
  align-items: center;
  gap: 13px;
}
.back-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  background: var(--glass-2);
  border: 1px solid var(--glass-brd);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  font-size: 20px;
  flex-shrink: 0;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition:
    background 0.2s,
    transform 0.18s var(--ease-spring);
}
.back-btn:active {
  background: var(--glass-press);
  transform: scale(0.92);
}
.detail-head .dh-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0;
}
.detail-head .dh-date {
  font-size: 13px;
  color: var(--text-2);
  margin-top: 2px;
  font-weight: 500;
}

.summary {
  margin: 16px 16px 0;
  background: var(--glass);
  border: 1px solid var(--glass-brd);
  border-radius: var(--radius);
  padding: 18px;
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--text);
  font-weight: 500;
  position: relative;
  backdrop-filter: blur(24px) saturate(150%);
  -webkit-backdrop-filter: blur(24px) saturate(150%);
  box-shadow:
    var(--card-shadow),
    inset 0 1px 0 var(--glass-hi);
}
.summary::before {
  content: "";
  position: absolute;
  left: 0;
  top: 18px;
  bottom: 18px;
  width: 3px;
  border-radius: 3px;
  background: var(--accent-grad);
}

.ind {
  padding: 16px;
  cursor: pointer;
  transition: background 0.2s;
}
.ind:active {
  background: var(--glass-press);
}
.ind + .ind {
  border-top: 1px solid var(--glass-brd);
}
.ind-head {
  display: flex;
  align-items: center;
  gap: 13px;
}
.ind-name {
  font-size: 15px;
  font-weight: 700;
  flex: 1;
  letter-spacing: 0;
}
.ind-value {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}
.ind-chev {
  color: var(--text-3);
  font-size: 16px;
  transition: transform 0.3s var(--ease);
}
.ind.open .ind-chev {
  transform: rotate(90deg);
}
.ind-body {
  max-height: 0;
  overflow: hidden;
  transition:
    max-height 0.35s var(--ease),
    opacity 0.3s,
    margin 0.3s;
  opacity: 0;
  padding-left: 24px;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text-2);
  font-weight: 500;
}
.ind.open .ind-body {
  max-height: 260px;
  opacity: 1;
  margin-top: 10px;
}
.ind-norm {
  display: block;
  font-size: 12px;
  color: var(--accent);
  margin-top: 6px;
  font-weight: 600;
}

.q-card {
  margin: 12px 16px;
  background: var(--glass);
  border: 1px solid var(--glass-brd);
  border-radius: var(--radius);
  padding: 18px;
  backdrop-filter: blur(24px) saturate(150%);
  -webkit-backdrop-filter: blur(24px) saturate(150%);
  box-shadow:
    var(--card-shadow),
    inset 0 1px 0 var(--glass-hi);
}
.q-card h3 {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 14px;
  letter-spacing: 0;
}
.q-item {
  display: flex;
  gap: 11px;
  font-size: 13.5px;
  color: var(--text-2);
  line-height: 1.55;
  font-weight: 500;
}
.q-item + .q-item {
  margin-top: 12px;
}
.q-num {
  font-family: var(--font-display);
  color: var(--accent);
  font-weight: 600;
  flex-shrink: 0;
}

.disclaimer {
  margin: 0 16px 14px;
  font-size: 12px;
  color: var(--text-3);
  background: var(--glass);
  border: 1px solid var(--glass-brd);
  border-radius: var(--radius-sm);
  padding: 13px 15px;
  line-height: 1.5;
  font-weight: 500;
}

.result-actions {
  margin: 4px 16px 16px;
  display: flex;
  gap: 11px;
}
.result-actions .btn {
  flex: 1;
}

/* ═══════════════════════════════════════════════════════
   ПРОФИЛЬ
   ═══════════════════════════════════════════════════════ */
.profile-hero {
  margin: 6px 16px 0;
  background: var(--glass);
  border: 1px solid var(--glass-brd);
  border-radius: var(--radius);
  padding: 22px;
  display: flex;
  align-items: center;
  gap: 17px;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(24px) saturate(150%);
  -webkit-backdrop-filter: blur(24px) saturate(150%);
  box-shadow:
    var(--card-shadow),
    inset 0 1px 0 var(--glass-hi);
}
.profile-hero::after {
  display: none;
}
.avatar {
  width: 62px;
  height: 62px;
  border-radius: var(--radius);
  background: var(--accent-grad);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  color: #03100d;
  flex-shrink: 0;
  box-shadow:
    0 8px 24px rgba(45, 212, 191, 0.4),
    inset 0 2px 3px rgba(255, 255, 255, 0.4);
}
.profile-name {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0;
}
.profile-plan {
  font-size: 13px;
  color: var(--accent);
  margin-top: 3px;
  font-weight: 600;
}

.stats {
  display: flex;
  gap: 11px;
  margin: 11px 16px;
}
.stat {
  flex: 1;
  background: var(--glass);
  border: 1px solid var(--glass-brd);
  border-radius: var(--radius-sm);
  padding: 17px 14px;
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  box-shadow: inset 0 1px 0 var(--glass-hi);
}
.stat-num {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0;
  background: var(--accent-grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.stat-label {
  font-size: 11px;
  color: var(--text-2);
  margin-top: 4px;
  line-height: 1.3;
  font-weight: 600;
}

.opt-row {
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: background 0.2s;
}
.opt-row:active {
  background: var(--glass-press);
}
.opt-row + .opt-row {
  border-top: 1px solid var(--glass-brd);
}
.opt-row .opt-label {
  flex: 1;
  font-size: 15px;
  font-weight: 600;
}
.opt-row .opt-val {
  font-size: 13.5px;
  color: var(--text-2);
  font-weight: 500;
}
.opt-row.danger .opt-label {
  color: var(--red);
}

.theme-toggle {
  display: flex;
  background: var(--glass-2);
  border: 1px solid var(--glass-brd);
  border-radius: var(--radius);
  padding: 3px;
  gap: 2px;
}
.theme-toggle button {
  border: none;
  background: transparent;
  color: var(--text-2);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  padding: 7px 14px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.25s var(--ease);
}
.theme-toggle button.active {
  background: var(--accent-grad);
  color: #03100d;
  box-shadow: 0 4px 14px rgba(45, 212, 191, 0.35);
}

/* ═══════════════════════════════════════════════════════
   ПОДПИСКА + PAYWALL
   ═══════════════════════════════════════════════════════ */
.current-plan {
  margin: 6px 16px 0;
  border-radius: var(--radius);
  padding: 24px;
  background: var(--accent-grad);
  color: #03100d;
  position: relative;
  overflow: hidden;
  box-shadow:
    0 14px 34px rgba(45, 212, 191, 0.22),
    inset 0 2px 4px rgba(255, 255, 255, 0.4);
}
.current-plan::after {
  display: none;
}
.cp-label {
  font-size: 11.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
  opacity: 0.65;
  margin-bottom: 8px;
}
.cp-name {
  font-family: var(--font-display);
  font-size: 25px;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: 0;
}
.cp-renew {
  font-size: 13.5px;
  opacity: 0.85;
  font-weight: 600;
  position: relative;
}

.tariff {
  padding: 17px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: background 0.2s;
}
.tariff:active {
  background: var(--glass-press);
}
.tariff + .tariff {
  border-top: 1px solid var(--glass-brd);
}
.tariff.active-plan {
  background: var(--accent-soft);
}
.t-name {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0;
}
.t-desc {
  font-size: 13px;
  color: var(--text-2);
  margin-top: 3px;
  font-weight: 500;
}
.t-right {
  display: flex;
  align-items: center;
  gap: 9px;
}
.t-price {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  color: var(--accent);
}
.t-price small {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
}
.t-check {
  color: var(--accent);
  font-size: 18px;
}

#paywall {
  justify-content: center;
  text-align: center;
  padding: 24px;
}
.pw-lock {
  width: 82px;
  height: 82px;
  margin: 0 auto 22px;
  border-radius: var(--radius);
  background: var(--glass);
  border: 1px solid var(--glass-brd);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  color: var(--accent);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow:
    var(--card-shadow),
    inset 0 1px 0 var(--glass-hi);
  animation: none;
}
.pw-title {
  font-family: var(--font-display);
  font-size: 25px;
  font-weight: 700;
  letter-spacing: 0;
  margin-bottom: 12px;
  line-height: 1.15;
}
.pw-sub {
  font-size: 15px;
  color: var(--text-2);
  line-height: 1.55;
  max-width: 320px;
  margin: 0 auto 28px;
  font-weight: 500;
}
/* Кнопки paywall: 320px по центру (раньше max-width без auto-полей прижимал влево) */
#paywall .btn {
  width: 100%;
  max-width: 320px;
  margin-left: auto;
  margin-right: auto;
}

/* ═══════════════════════════════════════════════════════
   ПЛАВАЮЩАЯ НАВИГАЦИЯ
   ═══════════════════════════════════════════════════════ */
.nav {
  position: fixed;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 408px;
  height: var(--nav-h);
  background: var(--nav-bg);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  border: 1px solid var(--glass-brd);
  border-radius: 14px;
  display: flex;
  align-items: center;
  padding: 0 6px;
  z-index: 100;
  box-shadow:
    0 16px 44px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 var(--glass-hi);
}
.nav.hidden {
  display: none;
}
.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  padding: 9px 0;
  border-radius: var(--radius);
  position: relative;
  transition: background 0.25s var(--ease);
}
.nav-item.active {
  background: var(--accent-soft);
}
.nav-ic {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  color: var(--text-3);
  filter: none;
  transition:
    filter 0.25s,
    transform 0.25s var(--ease-spring);
}
.nav-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-3);
  letter-spacing: 0;
  transition: color 0.25s;
}
.nav-item.active .nav-ic {
  color: var(--accent);
  filter: none;
  transform: translateY(-1px) scale(1.08);
}
.nav-item.active .nav-label {
  color: var(--accent);
}

/* ════════════ ИСТОРИЯ (суб-экран) ════════════ */
#history .detail-head {
  margin-bottom: 8px;
}

/* ════════════ ДАШБОРД ════════════ */
.streak-badge {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 20px;
  padding: 5px 12px;
  min-width: 52px;
  text-align: center;
  white-space: nowrap;
}

.affirmation-card {
  margin: 0 16px 14px;
  background: var(--accent-soft);
  border: 1px solid rgba(45, 212, 191, 0.22);
  border-radius: var(--radius);
  padding: 14px 16px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  font-weight: 500;
}

/* Ряд из 2 тайлов: чекин + вода */
.dash-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 0 16px 12px;
}

.dash-tile {
  background: var(--glass);
  border: 1px solid var(--glass-brd);
  border-radius: var(--radius);
  padding: 14px;
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  box-shadow: var(--card-shadow), inset 0 1px 0 var(--glass-hi);
}

.checkin-tile {
  cursor: pointer;
  transition: background 0.2s;
}
.checkin-tile:active {
  background: var(--glass-press);
}

.dt-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 6px;
}
.dt-value {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.1;
  margin-bottom: 3px;
}
.dt-sub {
  font-size: 11px;
  color: var(--text-3);
}

/* Вода */
.water-bar {
  height: 4px;
  background: var(--glass-2);
  border-radius: 2px;
  margin: 8px 0 6px;
  overflow: hidden;
}
.water-fill {
  height: 100%;
  background: var(--accent-grad);
  border-radius: 2px;
  transition: width 0.4s var(--ease);
}
.water-btns {
  display: flex;
  gap: 5px;
  margin-top: 2px;
}
.water-btns button {
  flex: 1;
  background: var(--accent-soft);
  border: none;
  border-radius: 6px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-body);
  padding: 5px 0;
  cursor: pointer;
  transition: background 0.2s;
}
.water-btns button:active {
  background: var(--glass-press);
}

/* Метрики */
.metric-row {
  padding: 13px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: background 0.2s;
}
.metric-row:active {
  background: var(--glass-press);
}
.metric-row.active-metric {
  background: var(--accent-soft);
}
.metric-left {
  flex: 1;
  min-width: 0;
}
.metric-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.metric-norm {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 2px;
}
.metric-val {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  text-align: right;
  white-space: nowrap;
}
.metric-unit {
  font-size: 10px;
  font-weight: 400;
  color: var(--text-3);
  display: block;
  text-align: right;
}

/* Chart card */
.chart-card {
  padding: 16px;
  margin-bottom: 24px;
}
.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 12px;
}
.chart-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-2);
}
.chart-value {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}
.chart-area {
  width: 100%;
  overflow: hidden;
}
.chart-area svg {
  width: 100%;
  height: 72px;
  display: block;
}
.chart-dates {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  font-size: 10px;
  color: var(--text-3);
}

/* ════════════ ЧЕКИН (модал) ════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: flex-end;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s var(--ease);
}
.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}
.modal-sheet {
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  background: var(--glass-2);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  border: 1px solid var(--glass-brd);
  border-radius: 20px 20px 0 0;
  padding: 12px 20px calc(28px + env(safe-area-inset-bottom, 0px));
  transform: translateY(40px);
  transition: transform 0.35s var(--ease-spring);
}
.modal-overlay.open .modal-sheet {
  transform: none;
}
.modal-handle {
  width: 36px;
  height: 4px;
  background: var(--glass-brd);
  border-radius: 2px;
  margin: 0 auto 18px;
}
.modal-title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 20px;
  text-align: center;
}
.checkin-section {
  margin-bottom: 20px;
}
.checkin-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-3);
  margin-bottom: 10px;
}
.checkin-hint {
  font-size: 12px;
  color: var(--text-3);
  text-align: center;
  margin-top: 6px;
  min-height: 16px;
}
.energy-scale {
  display: flex;
  gap: 5px;
}
.energy-dot {
  flex: 1;
  height: 32px;
  border-radius: 6px;
  background: var(--glass);
  border: 1px solid var(--glass-brd);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-3);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.energy-dot.selected {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}
.sleep-inputs {
  display: flex;
  gap: 12px;
}
.sleep-field {
  flex: 1;
  background: var(--glass);
  border: 1px solid var(--glass-brd);
  border-radius: var(--radius);
  padding: 10px 12px;
}
.sf-label {
  font-size: 11px;
  color: var(--text-3);
  font-weight: 600;
  margin-bottom: 8px;
}
.sf-stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.sf-stepper button {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--accent-soft);
  border: none;
  color: var(--accent);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--font-body);
  transition: background 0.15s;
}
.sf-stepper button:active {
  background: var(--glass-press);
}
.sf-stepper span {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
}
.sleep-quality {
  display: flex;
  gap: 4px;
}
.sq-star {
  flex: 1;
  font-size: 16px;
  text-align: center;
  cursor: pointer;
  opacity: 0.35;
  transition: opacity 0.15s, transform 0.15s;
}
.sq-star.on {
  opacity: 1;
  transform: scale(1.15);
}

/* ════════════ ЧАТ ════════════ */
#chat {
  display: none;
  flex-direction: column;
  height: 100dvh;
  overflow: hidden;
}
#chat.active {
  display: flex;
}
.chat-wrap {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 0 16px 12px;
  -webkit-overflow-scrolling: touch;
}
.chat-messages::-webkit-scrollbar {
  display: none;
}
.chat-bubble {
  max-width: 82%;
  padding: 11px 14px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 8px;
  white-space: pre-wrap;
}
.chat-bubble.bot {
  background: var(--glass);
  border: 1px solid var(--glass-brd);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 4px 16px 16px 16px;
  align-self: flex-start;
}
.chat-bubble.user {
  background: var(--accent-grad);
  color: #fff;
  border-radius: 16px 16px 4px 16px;
  margin-left: auto;
}
.chat-msg-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin-bottom: 4px;
}
.chat-msg-wrap.user-msg {
  align-items: flex-end;
}
.chat-typing {
  display: flex;
  gap: 4px;
  padding: 12px 14px;
  background: var(--glass);
  border: 1px solid var(--glass-brd);
  border-radius: 4px 16px 16px 16px;
  width: fit-content;
  margin-bottom: 8px;
}
.chat-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-3);
  animation: typingDot 1.2s ease infinite;
}
.chat-typing span:nth-child(2) { animation-delay: 0.2s; }
.chat-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingDot {
  0%, 60%, 100% { transform: none; opacity: 0.4; }
  30% { transform: translateY(-4px); opacity: 1; }
}
.chat-avatar {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--accent-grad);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 13px;
  color: #fff;
  flex-shrink: 0;
}
.chat-suggestions {
  display: flex;
  gap: 7px;
  padding: 8px 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.chat-suggestions::-webkit-scrollbar { display: none; }
.chat-suggestion {
  white-space: nowrap;
  background: var(--glass);
  border: 1px solid var(--glass-brd);
  border-radius: 18px;
  padding: 7px 13px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s, color 0.2s;
}
.chat-suggestion:active {
  background: var(--accent-soft);
  color: var(--accent);
}
.chat-input-bar {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 10px 16px calc(16px + env(safe-area-inset-bottom, 0px));
  background: var(--glass-2);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--glass-brd);
}
.chat-input {
  flex: 1;
  background: var(--glass);
  border: 1px solid var(--glass-brd);
  border-radius: 18px;
  padding: 10px 14px;
  font-size: 14px;
  font-family: var(--font-body);
  color: var(--text);
  resize: none;
  max-height: 100px;
  line-height: 1.4;
  outline: none;
  transition: border-color 0.2s;
}
.chat-input::placeholder { color: var(--text-3); }
.chat-input:focus { border-color: var(--accent); }
.chat-send {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent-grad);
  border: none;
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: opacity 0.2s, transform 0.15s;
  box-shadow: var(--accent-glow);
}
.chat-send:active { transform: scale(0.92); }
.chat-send:disabled { opacity: 0.4; }

/* ════════════ ПРОФИЛЬ — ПОЛЯ ════════════ */
.profile-fields {}
.pf-row {
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: background 0.2s;
}
.pf-row:active { background: var(--glass-press); }
.pf-label {
  flex: 1;
  font-size: 14px;
  color: var(--text-2);
}
.pf-val {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

/* ════════════ ПОДПИСКА — СЕМЕЙНАЯ ЗАМЕТКА ════════════ */
.family-note {
  margin: 0 16px 14px;
  background: var(--accent-soft);
  border: 1px solid rgba(45, 212, 191, 0.18);
  border-radius: var(--radius);
  padding: 12px 14px;
  font-size: 12px;
  color: var(--text-2);
  display: flex;
  gap: 8px;
  align-items: flex-start;
  line-height: 1.5;
}
.family-note .ic {
  color: var(--accent);
  font-weight: 700;
  flex-shrink: 0;
}

/* ════════════ ТАРИФЫ — обновлённый дизайн ════════════ */
.tariff-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  background: var(--accent-grad);
  color: #fff;
  border-radius: 4px;
  padding: 2px 6px;
  margin-top: 3px;
}

/* ════════════ ЖИВОСТЬ — анимации ════════════ */

/* chat-bubble: появляется снизу */
@keyframes bubbleIn {
  from { opacity: 0; transform: translateY(8px) scale(0.97); }
  to   { opacity: 1; transform: none; }
}
.chat-msg-wrap {
  animation: bubbleIn 0.25s var(--ease-spring) both;
}

/* chat suggestion — hover/focus подсветка */
.chat-suggestion:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

/* streak badge — пульсация огня */
@keyframes streakPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(251, 191, 36, 0); }
  50%       { box-shadow: 0 0 0 6px rgba(251, 191, 36, 0.15); }
}
.streak-badge {
  animation: streakPulse 2.4s ease-in-out infinite;
}

/* кнопка -250 воды — приглушённая */
.water-btn-minus {
  color: var(--text-3) !important;
  background: var(--glass) !important;
}
.water-btn-minus:active {
  background: var(--glass-press) !important;
}

/* checkin hint — мигает когда пусто */
.checkin-add-hint {
  color: var(--accent);
  font-size: 10px;
  font-weight: 700;
  animation: blink 1.8s ease-in-out infinite;
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}

/* кнопки — bounce при нажатии */
.btn:active {
  transform: scale(0.96);
  transition: transform 0.1s;
}
.btn-primary:active {
  transform: scale(0.96);
}

/* water-fill: animate при изменении (уже есть transition 0.4s) */
/* Добавим небольшой bounce */
.water-fill {
  transition: width 0.45s var(--ease-spring) !important;
}

/* аффирмация — небольшой slide-in при появлении */
@keyframes affirmIn {
  from { opacity: 0; transform: translateX(-6px); }
  to   { opacity: 1; transform: none; }
}
.affirmation-card {
  animation: affirmIn 0.5s var(--ease) both;
}

/* dash-tile — лёгкий scale при нажатии */
.dash-tile:active {
  transform: scale(0.98);
  transition: transform 0.12s;
}

/* метрики — highlight row при выборе */
.metric-row.active-metric {
  border-left: 2px solid var(--accent);
}
