/* ================= Внутри приложения ================= */

:root {
  --glass: rgba(255, 255, 255, .04);
  --glass-2: rgba(255, 255, 255, .07);
  --line: rgba(255, 255, 255, .08);
  --radius: 22px;
  --ink: #061212;
}

.app {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100dvh;
}

.screen {
  max-width: 520px;
  margin: 0 auto;
  padding:
    calc(env(safe-area-inset-top) + 8px)
    max(18px, env(safe-area-inset-right))
    calc(env(safe-area-inset-bottom) + 36px)
    max(18px, env(safe-area-inset-left));
  animation: screen-in .55s var(--ease-out) backwards; /* без «both»: иначе transform остаётся и ломает position: fixed внутри */
}
@keyframes screen-in { from { opacity: 0; transform: translateY(12px); } }

.screen > * + * { margin-top: 14px; }

/* ---------- иконки и кнопки ---------- */

.ic {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--glass);
  color: var(--text);
  cursor: pointer;
  transition: transform .2s var(--ease-out), background .2s;
}
.icon-btn:active { transform: scale(.92); background: var(--glass-2); }
.icon-btn--sm { width: 38px; height: 38px; }
.icon-btn--sm .ic { width: 18px; height: 18px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  padding: 0 22px;
  border-radius: 999px;
  border: 1px solid transparent;
  font: 600 15px/1.2 var(--font-ui);
  letter-spacing: .01em;
  cursor: pointer;
  transition: transform .2s var(--ease-out), opacity .2s, box-shadow .3s;
  -webkit-user-select: none;
  user-select: none;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; }
.btn .ic { width: 19px; height: 19px; }
.btn-primary {
  background: linear-gradient(120deg, var(--tiffany), var(--pink));
  color: var(--ink);
  box-shadow: 0 8px 26px rgba(255, 141, 193, .18);
}
.btn-primary.is-on {
  background: rgba(255, 141, 193, .12);
  border-color: rgba(255, 141, 193, .55);
  color: var(--pink);
  box-shadow: none;
}
.btn-ghost {
  background: var(--glass);
  border-color: var(--line);
  color: var(--text);
}
.btn-block { display: flex; width: 100%; }
.btn-row { display: flex; gap: 10px; }
.btn-row > .btn { flex: 1; padding: 0 14px; }

:where(button, a, input, select):focus-visible { outline: 2px solid var(--pink); outline-offset: 3px; }

/* ---------- шапка ---------- */

.top {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  min-height: 56px;
}
.top-title {
  margin: 0;
  text-align: center;
  font: 500 22px/1.2 var(--font-display);
  letter-spacing: .01em;
}
.top-side { display: block; width: 44px; }

.top--home .logo { justify-self: center; }

.logo {
  display: block;
  height: 22px;
  width: auto;
  overflow: visible;
  fill: var(--tiffany);
  stroke: var(--pink);
  stroke-width: 14;
  paint-order: stroke;
}

/* ---------- карточки ---------- */

.card {
  display: block;
  padding: 18px;
  border-radius: var(--radius);
  background: var(--glass);
  border: 1px solid var(--line);
  color: inherit;
  text-decoration: none;
}

.fine {
  margin: 14px 4px 0;
  font-size: 12.5px;
  line-height: 1.55;
  color: rgba(244, 247, 247, .56);
}
.center { text-align: center; }

/* ---------- главная ---------- */

.hello-block { padding: 6vh 4px 6px; }
.hello-block .today {
  margin: 0 0 12px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--muted);
}
.hello {
  margin: 0;
  font: 400 clamp(40px, 11.5vw, 58px)/1.04 var(--font-display);
  letter-spacing: -.01em;
}
.hello-name {
  background: linear-gradient(100deg, var(--tiffany) 10%, var(--pink) 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.today-card { padding: 6px 6px; }
.today-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px;
  border-radius: 16px;
  color: inherit;
  text-decoration: none;
  transition: background .2s;
}
.today-row:active { background: var(--glass-2); }
.today-row + .today-row { border-top: 1px solid var(--line); border-radius: 0 0 16px 16px; }
.today-row b, .push-hint b { display: block; font-size: 15px; font-weight: 600; }
.today-row small, .push-hint small { display: block; margin-top: 3px; font-size: 13px; color: var(--muted); }

.dot {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  flex: none;
}
.dot .ic { width: 20px; height: 20px; }
.dot--work { background: rgba(129, 216, 208, .1); color: var(--tiffany); }
.dot--work.is-on { background: linear-gradient(135deg, var(--wa, var(--tiffany)), var(--wb, var(--tiffany-deep))); color: var(--ink); }
.dot--cycle { background: rgba(255, 141, 193, .1); color: var(--pink); }
.dot--cycle.is-on { background: linear-gradient(135deg, var(--pink), var(--pink-hot)); color: #2a0614; }

.push-hint {
  display: flex;
  align-items: center;
  gap: 14px;
  border-color: rgba(255, 141, 193, .3);
  background: linear-gradient(120deg, rgba(129, 216, 208, .07), rgba(255, 141, 193, .08));
}
.push-hint > .ic { color: var(--pink); }

.tiles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 26px;
  min-height: 150px;
  padding: 18px;
  border-radius: 24px;
  background: var(--glass);
  border: 1px solid var(--line);
  color: inherit;
  text-decoration: none;
  overflow: hidden;
  isolation: isolate;
  transition: transform .25s var(--ease-out);
}
.tile:active { transform: scale(.97); }
.tile::before {
  content: '';
  position: absolute;
  inset: auto -30% -60% auto;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: radial-gradient(closest-side, var(--glow), transparent);
  z-index: -1;
}
.tile b { display: block; font: 500 23px/1.1 var(--font-display); }
.tile small { display: block; margin-top: 6px; font-size: 13px; color: var(--muted); }
.tile-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 16px;
  background: var(--tint);
  color: var(--accent);
}
.tile--cycle { --accent: var(--pink); --tint: rgba(255, 141, 193, .12); --glow: rgba(255, 95, 162, .22); }
.tile--work { --accent: var(--tiffany); --tint: rgba(129, 216, 208, .12); --glow: rgba(10, 186, 181, .24); }
.tile--love {
  --accent: #fff;
  --tint: linear-gradient(135deg, var(--tiffany), var(--pink));
  --glow: rgba(255, 141, 193, .28);
  grid-column: 1 / -1;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
  min-height: 0;
  border: 1px solid transparent;
  background:
    linear-gradient(#080a0b, #080a0b) padding-box,
    linear-gradient(110deg, rgba(129, 216, 208, .55), rgba(255, 141, 193, .6)) border-box;
}
.tile--love .tile-icon { color: var(--ink); }
.tile-heart {
  margin-left: auto;
  color: var(--pink);
  animation: kisa-beat 1.6s ease-in-out infinite;
}
.tile-heart .ic { fill: currentColor; stroke: none; }

/* ---------- календарь ---------- */

.cal-card { padding: 12px 10px 14px; }
.cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px 12px;
}
.cal-title {
  margin: 0;
  font: 500 21px/1 var(--font-display);
  text-transform: capitalize;
}
.cal-title small { font: 500 13px var(--font-ui); color: var(--muted); margin-left: 4px; }

.cal-week,
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.cal-week {
  margin-bottom: 6px;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}
.cal-week .is-weekend { color: rgba(255, 141, 193, .7); }

.cal-grid.slide-l { animation: cal-l .35s var(--ease-out); }
.cal-grid.slide-r { animation: cal-r .35s var(--ease-out); }
@keyframes cal-l { from { opacity: 0; transform: translateX(24px); } }
@keyframes cal-r { from { opacity: 0; transform: translateX(-24px); } }

.cal-day {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text);
  font: 500 15px/1 var(--font-ui);
  cursor: pointer;
  transition: transform .18s var(--ease-out), background .25s, box-shadow .25s;
  -webkit-user-select: none;
  user-select: none;
}
.cal-day:active { transform: scale(.88); }
.cal-day.is-blank { visibility: hidden; }
.cal-day.is-past { color: rgba(244, 247, 247, .62); }
.cal-day.is-weekend:not([class*='k-']) { color: rgba(255, 175, 210, .8); }
.cal-day.is-today::after {
  content: '';
  position: absolute;
  inset: 2px;
  border-radius: inherit;
  border: 1.5px solid rgba(255, 255, 255, .85);
  pointer-events: none;
}

.k-period {
  background: linear-gradient(135deg, #FFA3CD, var(--pink-hot));
  color: #2a0614 !important;
  font-weight: 700;
  box-shadow: 0 0 16px rgba(255, 95, 162, .35);
}
.k-predicted {
  background: rgba(255, 141, 193, .07);
  color: var(--pink) !important;
}
.k-predicted::before {
  content: '';
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  border: 1.5px dashed rgba(255, 141, 193, .75);
}
.k-fertile { background: rgba(129, 216, 208, .11); color: var(--tiffany) !important; }
.k-ovulation {
  background: rgba(129, 216, 208, .2);
  color: var(--tiffany) !important;
  font-weight: 700;
  box-shadow: inset 0 0 0 1.5px var(--tiffany), 0 0 14px rgba(10, 186, 181, .25);
}
.k-work {
  border-radius: 14px;
  background: linear-gradient(135deg, var(--wa, var(--tiffany)), var(--wb, var(--tiffany-deep)));
  color: var(--ink) !important;
  font-weight: 700;
  box-shadow: 0 0 16px color-mix(in srgb, var(--wb, var(--tiffany-deep)) 35%, transparent);
}

.legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 16px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
  font-size: 12.5px;
  color: var(--muted);
}
.legend li { display: inline-flex; align-items: center; gap: 7px; }
.lg { display: inline-block; width: 13px; height: 13px; border-radius: 50%; }
.lg-period { background: linear-gradient(135deg, #FFA3CD, var(--pink-hot)); }
.lg-predicted { border: 1.5px dashed var(--pink); }
.lg-fertile { background: rgba(129, 216, 208, .3); }
.lg-ovulation { border: 1.5px solid var(--tiffany); background: rgba(129, 216, 208, .25); }
.lg-work { border-radius: 4px; background: linear-gradient(135deg, var(--wa, var(--tiffany)), var(--wb, var(--tiffany-deep))); }
.lg-note { width: 6px; height: 6px; background: var(--pink); }
.lg-today { border: 1.5px solid #fff; }

/* ---------- цикл ---------- */

.ring-card { padding: 22px 18px 18px; text-align: center; }
.ring-box {
  position: relative;
  width: min(64vw, 250px);
  margin: 0 auto;
}
.ring { display: block; width: 100%; height: auto; overflow: visible; }
.ring circle { fill: none; stroke-width: 13; stroke-linecap: round; }
.ring .ring-track { stroke: rgba(255, 255, 255, .07); stroke-linecap: butt; }
.ring .ring-period { stroke: var(--pink); filter: drop-shadow(0 0 6px rgba(255, 95, 162, .5)); }
.ring .ring-fertile { stroke: var(--tiffany); opacity: .8; }
.ring .ring-knob {
  fill: #fff;
  stroke: none;
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, .7));
}
.ring .ring-knob.is-late { fill: var(--pink); animation: kisa-beat 1.4s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }

.ring-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.ring-center b {
  font: 400 58px/1 var(--font-display);
  background: linear-gradient(160deg, #fff 20%, var(--pink));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.ring-center span {
  margin-top: 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
}
.ring-center small { margin-top: 8px; font-size: 12.5px; color: rgba(244, 247, 247, .4); }

.chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 18px;
}
.chips:empty { display: none; }
.chip {
  padding: 8px 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--glass);
  color: var(--text);
  font: 500 13px/1.2 var(--font-ui);
}
.chips--pick { justify-content: flex-start; margin-top: 0; }
.chips--pick .chip { cursor: pointer; min-height: 40px; padding: 0 15px; }
.chips--pick .chip.is-on {
  border-color: rgba(129, 216, 208, .7);
  background: rgba(129, 216, 208, .12);
  color: var(--tiffany);
}

.phase-note {
  margin: 16px 6px 0;
  font-size: 14px;
  line-height: 1.55;
  color: rgba(244, 247, 247, .7);
}

/* ---------- смены ---------- */

.work-card { display: flex; align-items: center; gap: 16px; }
.work-card b { display: block; font: 500 19px/1.25 var(--font-display); font-variant-numeric: lining-nums; }
.work-card small { display: block; margin-top: 4px; font-size: 13px; color: var(--muted); }
.work-badge {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 18px;
  flex: none;
  background: rgba(255, 141, 193, .1);
  color: var(--pink);
}
.work-badge .ic { width: 24px; height: 24px; }
.work-badge.is-work { background: linear-gradient(135deg, var(--wa, var(--tiffany)), var(--wb, var(--tiffany-deep))); color: var(--ink); }

.custom-pattern { display: flex; gap: 10px; margin-top: 12px; }
.custom-pattern label { flex: 1; display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 14px; color: var(--muted); }
.custom-pattern input { width: 64px; }

/* ---------- поля ввода ---------- */

.input,
.custom-pattern input,
.time,
.select {
  height: 46px;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .05);
  color: var(--text);
  font: 500 16px var(--font-ui);
  color-scheme: dark;
}
.input { width: 100%; }
.time { width: 104px; padding: 0 10px; }
.select { padding: 0 10px; max-width: 120px; }

/* ---------- настройки ---------- */

.group { padding: 18px 16px; }
.group-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 2px 8px;
  font: 500 20px/1.2 var(--font-display);
}
.group-title .ic { color: var(--pink); }
.group-text { margin: 0 2px 14px; font-size: 14px; line-height: 1.55; color: var(--muted); }
.group .btn-row:empty { display: none; }

.rows { margin-top: 12px; transition: opacity .3s; }
.rows.is-dim { opacity: .45; }
.row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 62px;
  padding: 8px 2px;
  border-top: 1px solid var(--line);
}
.row-main { flex: 1; min-width: 0; }
.row-main b { display: block; font-size: 15px; font-weight: 600; }
.row-main small { display: block; margin-top: 2px; font-size: 12.5px; color: var(--muted); }

.switch {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  flex: none;
  width: 52px;
  height: 32px;
  margin: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, .14);
  cursor: pointer;
  transition: background .3s;
}
.switch::before {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .35);
  transition: transform .3s var(--ease-out);
}
.switch:checked { background: linear-gradient(120deg, var(--tiffany), var(--pink)); }
.switch:checked::before { transform: translateX(20px); }

.stepper {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .04);
}
.stepper button {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .06);
  color: var(--text);
  cursor: pointer;
}
.stepper button:active { transform: scale(.9); }
.stepper .ic { width: 16px; height: 16px; }
.stepper output { min-width: 30px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---------- шторка снизу ---------- */

.sheet-wrap { position: fixed; inset: 0; z-index: 50; }
.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .6);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity .3s;
}
.sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  max-width: 520px;
  max-height: 88dvh;
  margin: 0 auto;
  padding: 10px 18px calc(env(safe-area-inset-bottom) + 22px);
  overflow-y: auto;
  border-radius: 28px 28px 0 0;
  background: #0b0e0f;
  border: 1px solid var(--line);
  border-bottom: 0;
  transform: translateY(100%);
  transition: transform .4s var(--ease-out);
}
.sheet-wrap.is-open .sheet-backdrop { opacity: 1; }
.sheet-wrap.is-open .sheet { transform: none; }
.sheet-grip { width: 40px; height: 4px; margin: 0 auto 10px; border-radius: 4px; background: rgba(255, 255, 255, .2); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.sheet-head h2 { margin: 0; font: 500 22px/1.2 var(--font-display); }
.sheet-label { margin: 18px 2px 10px; font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.sheet-text { margin: 16px 2px; font-size: 14px; line-height: 1.55; color: rgba(244, 247, 247, .7); }
body.has-sheet { overflow: hidden; }

/* ---------- тост ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom) + 24px);
  z-index: 60;
  max-width: calc(100vw - 40px);
  padding: 12px 18px;
  border-radius: 999px;
  background: rgba(20, 24, 25, .92);
  border: 1px solid var(--line);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  font-size: 14px;
  text-align: center;
  opacity: 0;
  transform: translate(-50%, 12px);
  transition: opacity .3s, transform .3s var(--ease-out);
  pointer-events: none;
}
.toast.is-shown { opacity: 1; transform: translate(-50%, 0); }

/* ================= Послание ================= */

.love-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: calc(100dvh - 140px);
  justify-content: center;
}

.env {
  position: relative;
  width: min(76vw, 310px);
  aspect-ratio: 3 / 2;
  padding: 0;
  border: 0;
  background: none;
  perspective: 900px;
  cursor: pointer;
  animation: env-float 4s ease-in-out infinite;
  filter: drop-shadow(0 24px 40px rgba(10, 186, 181, .25));
}
@keyframes env-float { 50% { transform: translateY(-6px) rotate(-.6deg); } }
.env > span { position: absolute; display: block; }
.env-back { inset: 0; border-radius: 12px; background: linear-gradient(160deg, #5ec7be, #3fb2a9); }
.env-paper {
  left: 7%;
  right: 7%;
  top: 7%;
  height: 84%;
  z-index: 1;
  border-radius: 6px;
  background: linear-gradient(#fffaf4, #f6ece4);
  transition: transform 1s var(--ease-out) .55s;
}
.env-front {
  inset: 0;
  z-index: 2;
  border-radius: 12px;
  background: linear-gradient(170deg, #8adbd2, #62c6bc);
  clip-path: polygon(0 0, 50% 54%, 100% 0, 100% 100%, 0 100%);
}
.env-flap {
  left: 0;
  right: 0;
  top: 0;
  height: 60%;
  z-index: 3;
  background: linear-gradient(180deg, #ccf4ef, #9be2da);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  border-radius: 12px 12px 0 0;
  transform-origin: top;
  transition: transform .8s var(--ease-io), z-index 0s .4s;
}
.env-seal {
  left: 50%;
  top: 56%;
  z-index: 4;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  margin: -29px 0 0 -29px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffb0d2, #e2508e 62%, #c23a75);
  box-shadow: 0 4px 12px rgba(0, 0, 0, .35), inset 0 -3px 6px rgba(0, 0, 0, .18), inset 0 2px 4px rgba(255, 255, 255, .35);
  color: #ffe3ef;
  transition: transform .45s var(--ease-out), opacity .45s;
  animation: seal-pulse 2.4s ease-in-out infinite;
}
.env-seal .ic { width: 26px; height: 26px; fill: currentColor; stroke: none; }
@keyframes seal-pulse { 50% { transform: scale(1.06); } }

.env.is-open { animation: none; }
.env.is-open .env-seal { opacity: 0; transform: scale(1.6); animation: none; }
.env.is-open .env-flap { transform: rotateX(180deg); z-index: 0; }
.env.is-open .env-paper { transform: translateY(-58%); }

.env-hint {
  margin: 36px 0 0;
  font: 400 26px/1.2 var(--font-script);
  color: var(--pink);
  transition: opacity .4s;
}
.env-hint.is-hidden { opacity: 0; }

.letter {
  position: relative;
  width: 100%;
  padding: 34px 26px 30px;
  border-radius: 20px;
  background:
    radial-gradient(120% 60% at 0% 0%, rgba(129, 216, 208, .14), transparent 60%),
    radial-gradient(100% 50% at 100% 100%, rgba(255, 141, 193, .16), transparent 60%),
    linear-gradient(#fffaf4, #f8efe7);
  color: #3b2a31;
  box-shadow: 0 30px 80px rgba(255, 141, 193, .2), 0 0 0 1px rgba(255, 255, 255, .5) inset;
  animation: letter-in 1s var(--ease-out) both;
}
@keyframes letter-in { from { opacity: 0; transform: translateY(40px) scale(.96); } }

.letter-to {
  margin: 0 0 18px;
  font: 400 36px/1.1 var(--font-script);
  color: #d9467f;
}
.letter-p,
.letter-finale,
.letter-sign,
.reasons-open {
  opacity: 0;
  animation: reveal .9s var(--ease-out) forwards;
  animation-delay: calc(.6s + var(--i) * .7s);
}
@keyframes reveal { from { opacity: 0; transform: translateY(10px); filter: blur(3px); } to { opacity: 1; transform: none; filter: none; } }

.letter-p {
  margin: 0 0 14px;
  font: italic 500 20.5px/1.5 var(--font-letter);
}
.letter-finale {
  position: relative;
  margin: 26px 0 10px;
  text-align: center;
  font: 400 clamp(38px, 11vw, 50px)/1.1 var(--font-script);
  background: linear-gradient(95deg, #0ABAB5, #ff5fa2);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.letter-heart {
  display: block;
  width: 34px;
  margin: 10px auto 0;
  color: #ff5fa2;
  animation: kisa-beat 1.3s ease-in-out infinite;
}
.letter-heart .ic { width: 34px; height: 34px; fill: currentColor; stroke: none; filter: drop-shadow(0 4px 10px rgba(255, 95, 162, .45)); }
.letter-sign {
  margin: 20px 0 0;
  text-align: right;
  white-space: pre-line;
  font: 400 25px/1.3 var(--font-script);
  color: #7a5563;
}
.reasons-open { margin-top: 22px; }

.reasons { width: 100%; text-align: center; }
.reasons-title {
  margin: 0 0 22px;
  font: 400 34px/1.15 var(--font-script);
  background: linear-gradient(95deg, var(--tiffany), var(--pink));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.reason-deck { position: relative; height: min(110vw, 380px); perspective: 1000px; }
.reason-card {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 30px 26px;
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, .12);
  background:
    radial-gradient(90% 70% at 20% 0%, rgba(129, 216, 208, .22), transparent 70%),
    radial-gradient(90% 70% at 100% 100%, rgba(255, 141, 193, .22), transparent 70%),
    #0c1011;
  color: var(--text);
  box-shadow: 0 30px 70px rgba(0, 0, 0, .5);
  cursor: pointer;
  font: inherit;
}
.reason-card.is-enter { animation: card-in .6s var(--ease-out) both; }
.reason-card.is-leaving { pointer-events: none; transition: transform .6s var(--ease-io), opacity .6s; opacity: 0; }
.reason-card.to-right { transform: translateX(70%) rotate(14deg); }
.reason-card.to-left { transform: translateX(-70%) rotate(-14deg); }
@keyframes card-in { from { opacity: 0; transform: scale(.9) translateY(20px); } }
.reason-num { font: 400 30px/1 var(--font-script); color: var(--pink); }
.reason-text { font: 400 clamp(21px, 6vw, 25px)/1.4 var(--font-display); }
.reason-count { font-size: 12px; letter-spacing: .14em; color: var(--muted); }
.reasons-hint { margin: 20px 0 0; font-size: 13px; color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  .letter-p, .letter-finale, .letter-sign, .reasons-open { opacity: 1; }
}

/* ================= Настроение ================= */

.mood-orb {
  --size: 76px;
  position: relative;
  display: grid;
  place-items: center;
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 25%, rgba(255, 255, 255, .55), transparent 42%),
    linear-gradient(140deg, var(--c1), var(--c2));
  box-shadow:
    0 10px 28px color-mix(in srgb, var(--c2) 38%, transparent),
    inset 0 -6px 14px rgba(0, 0, 0, .14);
  flex: none;
}
.mood-emoji { font-size: calc(var(--size) * .44); line-height: 1; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .18)); }
.mood-orb--xs { --size: 30px; box-shadow: 0 4px 10px color-mix(in srgb, var(--c2) 30%, transparent); }
.mood-orb--tile { --size: 46px; }
.mood-orb--big {
  --size: 118px;
  animation: orb-glow 3.2s ease-in-out infinite;
}
@keyframes orb-glow {
  50% { box-shadow: 0 14px 48px color-mix(in srgb, var(--c2) 60%, transparent), inset 0 -6px 14px rgba(0, 0, 0, .14); transform: scale(1.04); }
}

.mood-pick { padding-top: 2vh; text-align: center; }
.mood-q { margin: 0; font: 400 clamp(32px, 9vw, 42px)/1.1 var(--font-display); }
.mood-sub { margin: 10px 0 26px; font-size: 14px; color: var(--muted); }

.mood-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px 8px;
}
.mood-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  border: 0;
  background: none;
  color: var(--text);
  cursor: pointer;
  animation: orb-in .6s var(--ease-out) both;
  animation-delay: calc(var(--i) * 45ms);
  -webkit-user-select: none;
  user-select: none;
}
.mood-btn .mood-orb { transition: transform .25s var(--ease-out); }
.mood-btn:active .mood-orb { transform: scale(.9); }
.mood-label { font-size: 13.5px; font-weight: 600; }
@keyframes orb-in { from { opacity: 0; transform: translateY(14px) scale(.9); } }

.mood-week { margin-top: 26px; }
.mood-week-title { margin: 0 0 14px; font: 500 18px/1.2 var(--font-display); }
.week-strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.week-day { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.week-day small { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.week-day.is-today small { color: var(--text); }
.week-empty { width: 30px; height: 30px; border-radius: 50%; border: 1.5px dashed rgba(255, 255, 255, .16); }
.week-day.is-today .week-empty { border-color: rgba(255, 255, 255, .5); }

.mood-hero {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 22px 12px 8px;
  text-align: center;
  isolation: isolate;
}
.mood-hero::before {
  content: '';
  position: absolute;
  inset: -10% -10% 20%;
  z-index: -1;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--c2) 22%, transparent), transparent);
}
.mood-now { margin: 20px 0 4px; font-size: 12px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.mood-title {
  margin: 0;
  font: 400 clamp(36px, 10vw, 46px)/1.1 var(--font-display);
  background: linear-gradient(110deg, #fff 10%, var(--c1) 55%, var(--c2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.mood-msg {
  max-width: 30ch;
  margin: 14px auto 0;
  font: italic 500 21px/1.45 var(--font-letter);
  color: rgba(244, 247, 247, .88);
  animation: reveal .8s var(--ease-out) both .2s;
}

.mood-cards { display: grid; gap: 12px; }
.mood-card {
  padding: 16px 18px 18px;
  border-radius: var(--radius);
  background: var(--glass);
  border: 1px solid var(--line);
  animation: card-in .55s var(--ease-out) both;
  animation-delay: calc(var(--i, 0) * 60ms);
}
.mood-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
}
.mood-card-ic {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  background: rgba(129, 216, 208, .1);
  color: var(--tiffany);
}
.mood-card-ic .ic { width: 17px; height: 17px; }
.mood-card[data-type='us'] .mood-card-ic,
.mood-card[data-type='treat'] .mood-card-ic { background: rgba(255, 141, 193, .12); color: var(--pink); }
.mood-swap {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  margin-left: auto;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: transform .4s var(--ease-out), color .2s;
}
.mood-swap .ic { width: 15px; height: 15px; }
.mood-swap:active { transform: rotate(180deg); color: var(--text); }
.mood-card h3 { margin: 12px 0 0; font: 500 19px/1.3 var(--font-display); }
.mood-card p { margin: 6px 0 0; font-size: 14.5px; line-height: 1.55; color: rgba(244, 247, 247, .7); }
.mood-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--tiffany);
  text-decoration: none;
}
.mood-link .ic { width: 15px; height: 15px; }
.mood-practice { margin-top: 14px; }
.mood-card--cycle {
  border-color: rgba(255, 141, 193, .3);
  background: linear-gradient(120deg, rgba(255, 141, 193, .08), rgba(129, 216, 208, .05));
}
.mood-card--cycle .mood-card-head { color: var(--pink); }
.mood-card--cycle .mood-card-ic { background: rgba(255, 141, 193, .12); color: var(--pink); }

.tile--mood {
  --glow: rgba(255, 210, 122, .2);
  grid-column: 1 / -1;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
  min-height: 0;
}
.tile--mood .tile-icon { --tint: linear-gradient(140deg, #FFD27A, #FF8DC1); color: var(--ink); }
.tile-arrow { margin-left: auto; color: var(--muted); }

/* дыхание */
.breath { display: flex; flex-direction: column; align-items: center; padding-top: 10px; }
.breath-stage {
  position: relative;
  display: grid;
  place-items: center;
  width: min(62vw, 230px);
  aspect-ratio: 1;
  margin: 18px 0 8px;
}
.breath-circle {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, rgba(255, 255, 255, .35), transparent 45%),
    linear-gradient(140deg, var(--tiffany), var(--pink));
  box-shadow: 0 0 60px rgba(129, 216, 208, .35), 0 0 120px rgba(255, 141, 193, .2);
  transform: scale(.55);
  transition-property: transform;
  transition-timing-function: ease-in-out;
}
.breath-text { position: relative; display: flex; flex-direction: column; align-items: center; text-shadow: 0 1px 12px rgba(0, 0, 0, .45); }
.breath-phase { font: 500 26px/1.1 var(--font-display); color: #fff; }
.breath-count { min-height: 1.2em; margin-top: 6px; font-size: 18px; font-weight: 700; color: rgba(255, 255, 255, .85); font-variant-numeric: tabular-nums; }


/* ================= Доработки: профили, записки, смены, цикл ================= */

.ic-inline { width: 15px; height: 15px; vertical-align: -3px; }
.btn-sm { min-height: 40px; padding: 0 16px; font-size: 14px; }
.textarea { width: 100%; height: auto; min-height: 84px; padding: 12px 14px; line-height: 1.5; resize: vertical; font-family: var(--font-ui); }
.input--sm { height: 40px; max-width: 170px; font-size: 15px; }
.row--first { border-top: 0; }
.row--sub { min-height: 52px; padding-top: 0; border-top: 0; }
.sheet-save { margin-top: 18px; }
.section-title { margin: 26px 4px 12px; font: 500 20px/1.2 var(--font-display); }
.card-label { margin: 6px 12px 4px; font-size: 11.5px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.field-label { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; font-size: 13px; font-weight: 600; color: rgba(244, 247, 247, .8); }
.field-label small { font-weight: 500; color: var(--muted); }

/* главная: комплимент дня, записки */
.compliment {
  margin: 14px 0 0;
  font: italic 500 20px/1.4 var(--font-letter);
  color: rgba(244, 247, 247, .78);
  animation: reveal .9s var(--ease-out) both .2s;
}
.inbox-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  border-color: rgba(255, 141, 193, .45);
  background: linear-gradient(120deg, rgba(255, 141, 193, .14), rgba(129, 216, 208, .07));
  animation: card-in .6s var(--ease-out) both;
}
.inbox-banner b { display: block; font-size: 15px; }
.inbox-banner small { display: -webkit-box; margin-top: 3px; font-size: 13.5px; color: rgba(244, 247, 247, .75); -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.inbox-ic {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 15px;
  background: linear-gradient(135deg, var(--pink), var(--pink-hot));
  color: #2a0614;
  animation: kisa-beat 1.6s ease-in-out infinite;
}

.tile--notes { --accent: var(--pink); --tint: rgba(255, 141, 193, .12); --glow: rgba(255, 141, 193, .2); }
.tile--half { grid-column: auto; flex-direction: column; align-items: stretch; justify-content: space-between; min-height: 150px; }
.tile--wide { grid-column: 1 / -1; }
.tile--wide-row { grid-column: 1 / -1; flex-direction: row; align-items: center; justify-content: flex-start; gap: 16px; min-height: 0; }
.tile-badge {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--pink-hot);
  box-shadow: 0 0 12px var(--pink-hot);
}

/* записки */
.daily-card {
  padding: 22px 20px;
  text-align: center;
  background:
    radial-gradient(90% 80% at 0% 0%, rgba(129, 216, 208, .12), transparent 70%),
    radial-gradient(90% 80% at 100% 100%, rgba(255, 141, 193, .14), transparent 70%),
    var(--glass);
}
.daily-label { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 0; font-size: 12px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.daily-label .ic { width: 16px; height: 16px; color: var(--pink); }
.daily-text { margin: 14px 0 0; font: 400 30px/1.25 var(--font-script); color: #ffd3e6; }

.notes-list { display: grid; gap: 12px; }
.note-card {
  position: relative;
  padding: 18px 20px 14px;
  border-radius: 20px;
  background: linear-gradient(#fffaf4, #f8efe7);
  color: #3b2a31;
  animation: card-in .5s var(--ease-out) both;
  animation-delay: calc(var(--i, 0) * 60ms);
}
.note-card.is-new { box-shadow: 0 0 0 2px var(--pink), 0 14px 40px rgba(255, 141, 193, .25); }
.note-text { margin: 0; white-space: pre-line; font: italic 500 20px/1.45 var(--font-letter); }
.note-meta { display: flex; align-items: center; gap: 8px; margin: 10px 0 0; font-size: 12px; color: #9a7f89; }
.note-new { padding: 2px 8px; border-radius: 999px; background: var(--pink); color: #fff; font-weight: 700; font-size: 11px; }
.note-status { margin-left: auto; }
.note-status.is-read { color: #0a9f9a; font-weight: 600; }
.note-card--scheduled { background: var(--glass); border: 1px dashed rgba(255, 255, 255, .2); color: var(--text); }
.note-card--scheduled .note-meta { color: var(--muted); }
.note-cancel { margin-left: auto; padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--pink); font: 600 12px var(--font-ui); cursor: pointer; }

/* смены: кисть, статистика, типы */
.brush { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.brush-label { font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-right: 2px; }
.brush-chip { display: inline-flex; align-items: center; gap: 7px; min-height: 38px; cursor: pointer; }
.brush-chip small { font-size: 11px; color: var(--muted); }
.brush-chip.is-on { border-color: var(--wa); background: color-mix(in srgb, var(--wa) 16%, transparent); color: #fff; }
.brush-dot { width: 11px; height: 11px; border-radius: 4px; background: linear-gradient(135deg, var(--wa), var(--wb)); }

.work-stats { padding: 16px 18px; }
.work-stats-title { margin: 0 0 12px; font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.work-stats-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; align-items: center; }
.work-stats-row b { display: block; font: 700 19px/1.2 var(--font-ui); font-variant-numeric: tabular-nums; white-space: nowrap; letter-spacing: -.01em; }
.work-stats-row small { font-size: 12px; color: var(--muted); }
.work-pay-hint { display: inline-flex; align-items: center; gap: 4px; padding: 6px 10px; border: 1px dashed var(--line); border-radius: 12px; background: none; color: var(--tiffany); font: 600 12px var(--font-ui); cursor: pointer; }
.work-pay-hint .ic { width: 14px; height: 14px; }

.types { display: grid; gap: 10px; }
.type-row {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 8px 10px;
  align-items: center;
  padding: 12px;
  border-radius: 18px;
  border: 1px solid color-mix(in srgb, var(--wa) 40%, transparent);
  background: color-mix(in srgb, var(--wa) 7%, transparent);
}
.type-color { width: 36px; height: 36px; padding: 0; border: 0; border-radius: 12px; background: linear-gradient(135deg, var(--wa), var(--wb)); cursor: pointer; }
.type-name { height: 40px; }
.type-times { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; }
.type-times small { margin-left: auto; color: var(--muted); font-size: 13px; }
.type-pay, .pay-hourly { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.type-pay .input, .pay-hourly .input { width: 120px; height: 40px; }
.pay-hourly { margin-top: 12px; }
.type-del { grid-row: 1; grid-column: 3; }

/* цикл: заметки в календаре, история, врач */
.cal-day .note-dot { position: absolute; bottom: 4px; left: 50%; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; background: var(--pink); }
.k-period .note-dot { background: #fff; }
.history-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.history-head .group-title { margin: 0; }
.history-list { margin: 0; padding: 0; list-style: none; }
.history-list li { display: flex; justify-content: space-between; gap: 12px; padding: 12px 2px; border-top: 1px solid var(--line); font-size: 14px; }
.history-dates { font-weight: 600; }
.history-meta { color: var(--muted); text-align: right; }
.doctor-text {
  margin: 4px 0 16px;
  padding: 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, .04);
  border: 1px solid var(--line);
  white-space: pre-wrap;
  font: 500 13.5px/1.6 var(--font-ui);
  color: rgba(244, 247, 247, .85);
  -webkit-user-select: text;
  user-select: text;
}

/* настроение: календарь, статистика, заметка, позвать */
.mood-orb--cal { --size: 34px; box-shadow: 0 4px 12px color-mix(in srgb, var(--c2) 35%, transparent); }
.mood-cal .cal-day.has-mood { background: none; }
.mood-day { margin: 0; padding: 0; list-style: none; }
.mood-day li { display: flex; gap: 14px; align-items: flex-start; padding: 12px 0; border-top: 1px solid var(--line); }
.mood-day li:first-child { border-top: 0; }
.mood-day b { display: block; font-size: 15px; }
.mood-day small { color: var(--muted); font-size: 12.5px; }
.mood-day p { margin: 6px 0 0; font: italic 500 18px/1.45 var(--font-letter); color: rgba(244, 247, 247, .85); }
.mood-stats .group-title { margin-bottom: 12px; }
.stat-top { display: flex; align-items: center; gap: 14px; }
.stat-top small { display: block; font-size: 12px; color: var(--muted); }
.stat-top b { font: 500 20px/1.2 var(--font-display); }
.stat-phases { margin: 0; padding: 0; list-style: none; }
.stat-phases li { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 14px; }
.stat-phases li span:first-child { flex: 1; color: rgba(244, 247, 247, .75); }
.mood-extra { display: grid; gap: 10px; }
.mood-extra .btn-sm { justify-self: start; }
.call-btn { margin-top: 6px; background: linear-gradient(120deg, var(--pink), var(--pink-hot)); color: #2a0614; box-shadow: 0 10px 30px rgba(255, 95, 162, .3); }
.call-btn .ic { fill: currentColor; stroke: none; }
.call-hint { margin: 0; }

/* он: главная, сигналы, записки, тексты */
.hello-block--partner .hello { font-size: clamp(40px, 11vw, 56px); }
.signal-card {
  display: grid;
  gap: 12px;
  border-color: rgba(255, 141, 193, .45);
  background: linear-gradient(120deg, rgba(255, 141, 193, .14), rgba(129, 216, 208, .06));
  animation: card-in .6s var(--ease-out) both;
}
.signal-row { display: flex; align-items: center; gap: 12px; }
.signal-row b { display: block; font-size: 15px; }
.signal-row small { font-size: 12.5px; color: var(--muted); }
a.btn { text-decoration: none; }

.compose { display: grid; gap: 12px; }
.compose-text { min-height: 120px; font-size: 16px; }
.compose-presets .chip { min-height: 36px; font-size: 13px; }
.compose-later { display: grid; gap: 10px; }
.compose .sheet-label { margin: 6px 2px 0; }
.author-intro { margin: 4px 4px 0; }
.author-actions { display: grid; gap: 10px; }

.ring-center b, .stat-top b, .hello { font-variant-numeric: lining-nums; }

/* ================= Умный календарь: главная, отметки, ИИ, статистика, отчёт ================= */

/* главная: кольцо + шанс + быстрые отметки */
.hello-block--compact { padding: 2.5vh 4px 2px; }
.hello-block--compact .hello { font-size: clamp(34px, 9.5vw, 46px); }
.hello-block--compact .compliment { margin-top: 10px; }

.hero-cycle {
  display: grid;
  grid-template-columns: 112px 1fr;
  align-items: center;
  gap: 4px 16px;
  padding: 18px 16px 16px;
  border-color: rgba(255, 141, 193, .22);
  background:
    radial-gradient(120% 90% at 0% 0%, rgba(255, 141, 193, .1), transparent 60%),
    radial-gradient(100% 80% at 100% 100%, rgba(129, 216, 208, .08), transparent 60%),
    var(--glass);
}
.hero-ring { position: relative; display: block; width: 112px; color: inherit; text-decoration: none; }
.hero-ring .ring circle { stroke-width: 15; }
.ring-center--sm b { font-size: 34px; }
.ring-center--sm span { margin-top: 3px; max-width: 74px; font-size: 8.5px; line-height: 1.25; letter-spacing: .1em; text-align: center; }
.hero-text b { display: block; font: 500 21px/1.18 var(--font-display); }
.hero-text small { display: block; margin-top: 6px; font-size: 13px; line-height: 1.45; color: var(--muted); }
.hero-text .hero-acc { margin-top: 6px; font-size: 11.5px; color: var(--tiffany); opacity: .8; }
.hero-cycle .chance, .hero-cycle .qlog { grid-column: 1 / -1; }

.chance {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  align-items: end;
  gap: 5px;
  height: 92px;
  margin: 14px 0 0;
}
.chance-day { display: grid; grid-template-rows: 1fr auto auto; height: 100%; text-align: center; }
.chance-day i {
  align-self: end;
  display: block;
  height: var(--h);
  min-height: 3px;
  border-radius: 6px 6px 3px 3px;
  background: linear-gradient(180deg, var(--pink), rgba(255, 95, 162, .25));
  opacity: .85;
  transform-origin: bottom;
  animation: chance-grow .7s var(--ease-out) both;
}
.chance-day:nth-child(2) i { animation-delay: .03s; }
.chance-day:nth-child(3) i { animation-delay: .06s; }
.chance-day:nth-child(4) i { animation-delay: .09s; }
.chance-day:nth-child(5) i { animation-delay: .12s; }
.chance-day:nth-child(6) i { animation-delay: .15s; }
.chance-day:nth-child(7) i { animation-delay: .18s; }
.chance-day:nth-child(8) i { animation-delay: .21s; }
.chance-day:nth-child(9) i { animation-delay: .24s; }
.chance-day:nth-child(10) i { animation-delay: .27s; }
@keyframes chance-grow { from { transform: scaleY(0); } }
.chance-day b { min-height: 12px; margin-top: 4px; font-size: 9.5px; font-weight: 700; color: rgba(244, 247, 247, .7); font-variant-numeric: tabular-nums; }
.chance-day small { font-size: 10px; color: var(--muted); }
.chance-day.is-today small { color: var(--pink); font-weight: 700; }

.qlog { display: flex; gap: 8px; margin-top: 14px; padding-bottom: 2px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.qlog::-webkit-scrollbar { display: none; }
.qlog-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .05);
  color: var(--text);
  font: 600 13px/1 var(--font-ui);
  cursor: pointer;
  transition: transform .2s var(--ease-out), background .2s, border-color .2s;
}
.qlog-btn .ic { width: 17px; height: 17px; }
.qlog-btn:active { transform: scale(.94); }
.qlog-btn.is-on { border-color: rgba(255, 141, 193, .6); background: rgba(255, 141, 193, .14); color: var(--pink); }
.qlog-btn:first-child.is-on { border-color: transparent; background: linear-gradient(120deg, var(--pink), var(--pink-hot)); color: #2a0614; }
.qlog-btn--ai { border-color: rgba(129, 216, 208, .35); color: var(--tiffany); }
.qlog-btn--more { color: var(--muted); }

.tip-card { position: relative; display: flex; gap: 14px; align-items: flex-start; }
.tip-emoji { flex: none; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 14px; background: rgba(255, 255, 255, .06); font-size: 22px; }
.tip-card b { display: block; font-size: 15px; font-weight: 600; }
.tip-card small { display: block; margin-top: 4px; font-size: 13.5px; line-height: 1.5; color: rgba(244, 247, 247, .72); }
.tip-card--ai { padding-right: 52px; border-color: rgba(129, 216, 208, .3); background: linear-gradient(130deg, rgba(129, 216, 208, .08), rgba(255, 141, 193, .06)); }
.tip-ask { position: absolute; top: 14px; right: 14px; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; color: var(--tiffany); background: rgba(129, 216, 208, .1); }
.tip-ask .ic { width: 16px; height: 16px; }

.warn b { display: block; font-size: 15px; font-weight: 600; }
.warn p { margin: 6px 0 0; font-size: 13.5px; line-height: 1.5; color: rgba(244, 247, 247, .72); }
.warn--doctor { border-color: rgba(255, 196, 120, .35); background: rgba(255, 196, 120, .06); }
.warn--info { border-color: rgba(129, 216, 208, .25); }
.warn--urgent { border-color: rgba(255, 95, 120, .6); background: rgba(255, 95, 120, .1); }

.signal-card b { font-size: 15px; }
.signal-card p { margin: 0; font-size: 13.5px; line-height: 1.5; color: rgba(244, 247, 247, .78); }

.mode-card b { display: block; font: 500 19px/1.25 var(--font-display); }
.mode-card p { margin: 8px 0 0; font-size: 13.5px; line-height: 1.55; color: rgba(244, 247, 247, .75); }
.mode-card .fine { margin: 10px 0 0; }
a.mode-card { border-style: dashed; }
.mode-card--pregnant { border-color: rgba(255, 255, 255, .18); background: radial-gradient(120% 100% at 100% 0%, rgba(255, 255, 255, .07), transparent 60%), var(--glass); }
.pill-pack { display: grid; grid-template-columns: repeat(var(--cols), 1fr); gap: 7px; max-width: 236px; margin: 14px 0 4px; }
.pill-cell { aspect-ratio: 1; border-radius: 50%; border: 1.5px solid rgba(129, 216, 208, .4); background: rgba(129, 216, 208, .06); }
.pill-cell.is-pause { border-color: rgba(255, 255, 255, .14); background: none; }
.pill-cell.is-done { border-color: var(--tiffany); background: var(--tiffany); }
.pill-cell.is-today { border-color: var(--pink); box-shadow: 0 0 0 3px rgba(255, 141, 193, .5); }

.tiles--small .tile { min-height: 124px; gap: 16px; padding: 16px; }
.tiles--small .tile b { font-size: 20px; }
.tile--ai { --accent: var(--tiffany); --tint: rgba(129, 216, 208, .14); --glow: rgba(129, 216, 208, .28); border-color: rgba(129, 216, 208, .22); }
.tile--stats { --accent: #c9b6ff; --tint: rgba(201, 182, 255, .12); --glow: rgba(150, 120, 255, .22); }

/* шторка дня */
.sheet--log .log-sec { padding: 4px 0 14px; border-bottom: 1px solid var(--line); }
.sheet--log .log-sec + .log-sec { padding-top: 6px; }
.sheet--log .chips--pick { margin-top: 10px; }
.pain-val { margin-left: 6px; color: var(--pink); font-size: 13px; letter-spacing: 0; text-transform: none; }
.range { width: 100%; height: 32px; margin: 0; background: none; appearance: none; -webkit-appearance: none; }
.range::-webkit-slider-runnable-track { height: 6px; border-radius: 6px; background: linear-gradient(90deg, var(--tiffany), var(--pink), var(--pink-hot)); opacity: .8; }
.range::-moz-range-track { height: 6px; border-radius: 6px; background: linear-gradient(90deg, var(--tiffany), var(--pink), var(--pink-hot)); }
.range::-webkit-slider-thumb { width: 26px; height: 26px; margin-top: -10px; border-radius: 50%; background: #fff; box-shadow: 0 2px 10px rgba(0, 0, 0, .5); -webkit-appearance: none; }
.range::-moz-range-thumb { width: 26px; height: 26px; border: 0; border-radius: 50%; background: #fff; }
.log-group { margin-top: 10px; border-radius: 16px; border: 1px solid var(--line); background: rgba(255, 255, 255, .03); }
.log-group summary { display: flex; align-items: center; gap: 8px; min-height: 46px; padding: 0 14px; font-size: 14px; font-weight: 600; list-style: none; cursor: pointer; }
.log-group summary::-webkit-details-marker { display: none; }
.log-group summary::after { content: ''; width: 8px; height: 8px; margin-left: auto; border-right: 1.8px solid var(--muted); border-bottom: 1.8px solid var(--muted); transform: rotate(45deg) translate(-2px, -2px); transition: transform .25s var(--ease-out); }
.log-group[open] summary::after { transform: rotate(-135deg) translate(-2px, -2px); }
.log-group summary i { font-style: normal; font-size: 12px; font-weight: 700; color: var(--tiffany); }
.log-group > :not(summary) { margin: 0 12px 12px; }
.log-group > .fine { margin: 0 14px 14px; }
.log-group--big { margin-top: 12px; }
.log-scales { display: grid; gap: 4px; }
.scale-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; font-size: 14px; font-weight: 600; }
.dots { display: flex; align-items: center; gap: 7px; }
.dot5 { width: 26px; height: 26px; padding: 0; border-radius: 50%; border: 1.5px solid rgba(255, 255, 255, .2); background: none; cursor: pointer; transition: background .2s, border-color .2s, transform .15s; }
.dot5:active { transform: scale(.85); }
.dot5.is-on { border-color: transparent; background: linear-gradient(135deg, var(--tiffany), var(--pink)); }
.dots small { min-width: 74px; margin-left: 4px; font-size: 11.5px; font-weight: 500; color: var(--muted); }
.bbt-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 14px; font-weight: 600; }
.bbt-row .bbt { width: 110px; }
.log-group > .med-add { display: flex; gap: 8px; margin-top: 10px; }
.med-add .input { height: 42px; }

/* ИИ */
.ai-tools { display: flex; flex-wrap: wrap; gap: 8px; }
.ai-tools .chip { display: inline-flex; align-items: center; gap: 6px; min-height: 38px; border-color: rgba(129, 216, 208, .3); color: var(--tiffany); cursor: pointer; }
.ai-tools .chip .ic { width: 16px; height: 16px; }
.ai-tools--sheet { margin: 0 0 6px; }
.say-box { position: relative; }
.say-box .textarea { padding-right: 56px; font-size: 16px; }
.say-mic { position: absolute; right: 8px; bottom: 10px; color: var(--tiffany); }
.say-mic.is-on { background: rgba(255, 95, 162, .2); color: var(--pink); animation: kisa-beat 1.2s ease-in-out infinite; }
.typing { display: inline-flex; align-items: center; gap: 4px; height: 18px; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .4; animation: typing 1.1s ease-in-out infinite; }
.typing i:nth-child(2) { animation-delay: .15s; }
.typing i:nth-child(3) { animation-delay: .3s; }
@keyframes typing { 30% { opacity: 1; transform: translateY(-3px); } }
.test-result { margin-top: 14px; }
.test-result b { font-size: 16px; }
.test-result p { margin: 6px 0 0; font-size: 13.5px; color: rgba(244, 247, 247, .75); }
.test-result + .btn { margin-top: 12px; }

.ai-orb {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin: 0 auto 14px;
  border-radius: 50%;
  color: var(--ink);
  background: conic-gradient(from 210deg, var(--tiffany), var(--pink), #c9b6ff, var(--tiffany));
  box-shadow: 0 0 40px rgba(129, 216, 208, .35), 0 0 70px rgba(255, 141, 193, .2);
  animation: orb-spin 8s linear infinite;
}
.ai-orb .ic { width: 28px; height: 28px; animation: orb-spin 8s linear infinite reverse; }
@keyframes orb-spin { to { transform: rotate(360deg); } }
.ai-consent { padding: 26px 18px 20px; text-align: center; }
.ai-consent h2 { margin: 0 0 14px; font: 500 24px/1.2 var(--font-display); }
.ai-consent .row, .ai-consent details, .ai-consent .fine { text-align: left; }
.ai-consent .btn { margin-top: 16px; }
.ai-list { margin: 0 0 14px; padding: 0; list-style: none; text-align: left; }
.ai-list li { position: relative; padding: 8px 0 8px 22px; font-size: 14px; line-height: 1.5; color: rgba(244, 247, 247, .82); }
.ai-list li::before { content: ''; position: absolute; left: 4px; top: 15px; width: 7px; height: 7px; border-radius: 50%; background: linear-gradient(135deg, var(--tiffany), var(--pink)); }
.ai-hello { padding: 22px 10px 6px; text-align: center; }
.ai-hello p { max-width: 300px; margin: 0 auto; font-size: 14.5px; line-height: 1.55; color: rgba(244, 247, 247, .72); }
.chat { display: flex; flex-direction: column; gap: 10px; padding-bottom: 96px; }
.msg {
  max-width: 86%;
  padding: 11px 15px;
  border-radius: 20px;
  font-size: 15px;
  line-height: 1.5;
  overflow-wrap: anywhere;
  -webkit-user-select: text;
  user-select: text;
  animation: msg-in .35s var(--ease-out) both;
}
@keyframes msg-in { from { opacity: 0; transform: translateY(8px); } }
.msg--me { align-self: flex-end; border-bottom-right-radius: 6px; background: linear-gradient(120deg, rgba(129, 216, 208, .22), rgba(255, 141, 193, .2)); }
.msg--ai { align-self: flex-start; border-bottom-left-radius: 6px; border: 1px solid var(--line); background: var(--glass-2); color: rgba(244, 247, 247, .9); }
.msg--urgent { border-color: rgba(255, 95, 120, .7); background: rgba(255, 95, 120, .12); }
.chips--suggest { justify-content: flex-start; margin-top: 4px; }
.chips--suggest .chip { text-align: left; cursor: pointer; }
.ai-actions { display: grid; gap: 8px; }
.ai-action { display: grid; justify-items: start; gap: 8px; padding: 12px 14px; border-radius: 18px; border: 1px dashed rgba(129, 216, 208, .4); background: rgba(129, 216, 208, .05); }
.ai-action small { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--tiffany); }
.ai-action small .ic { width: 15px; height: 15px; }
.ai-action p { margin: 0; font-size: 14px; }
.ai-action .chips { justify-content: flex-start; margin: 0; }
.ai-action .chip { padding: 6px 10px; font-size: 12px; }
.reminders { margin-top: 8px; }
.reminders .sheet-label { display: flex; align-items: center; gap: 6px; margin-top: 0; }
.reminder { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.reminder span { flex: 1; }
.reminder b { display: block; font-size: 14px; }
.reminder small { font-size: 12px; color: var(--muted); }
.chat-input {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 20;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  width: min(520px, 100%);
  padding: 10px max(14px, env(safe-area-inset-right)) calc(env(safe-area-inset-bottom) + 10px) max(14px, env(safe-area-inset-left));
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, .85) 30%);
  transform: translateX(-50%);
}
.chat-input .input { min-height: 46px; max-height: 140px; padding: 12px 16px; border-radius: 23px; background: rgba(20, 24, 25, .95); line-height: 1.4; resize: none; }
.icon-btn--accent { flex: none; width: 46px; height: 46px; border: 0; background: linear-gradient(120deg, var(--tiffany), var(--pink)); color: var(--ink); }
.ai-fine { margin-bottom: 70px; }
.ai-summary b { display: block; margin-bottom: 4px; font-size: 15px; }

/* статистика */
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat { padding: 16px; border-radius: 20px; border: 1px solid var(--line); background: var(--glass); }
.stat b { display: block; font: 400 34px/1 var(--font-display); font-variant-numeric: lining-nums; background: linear-gradient(160deg, #fff 30%, var(--tiffany)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat small { display: block; margin-top: 8px; font-size: 12px; line-height: 1.4; color: var(--muted); }
.stat.is-dim b { opacity: .4; }
.chart { display: block; width: 100%; height: auto; margin-top: 6px; overflow: visible; }
.chart-band { fill: rgba(129, 216, 208, .07); }
.chart-axis { fill: rgba(244, 247, 247, .38); font: 600 9px var(--font-ui); }
.chart-bar { fill: var(--pink); opacity: .8; }
.chart-bar.is-odd { fill: #ffc478; }
.chart-val { fill: rgba(244, 247, 247, .8); font: 700 9.5px var(--font-ui); text-anchor: middle; }
.chart-mean { stroke: var(--tiffany); stroke-width: 1.5; stroke-dasharray: 4 4; }
.chart-line { fill: none; stroke: var(--tiffany); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart-dot { fill: #fff; }
.chart-start { stroke: rgba(255, 141, 193, .6); stroke-width: 1.5; }
.chart-ov { stroke: var(--tiffany); stroke-width: 1.5; stroke-dasharray: 3 3; }
.insight-list { margin: 0; padding: 0; list-style: none; }
.insight-list li { padding: 10px 0; border-top: 1px solid var(--line); font-size: 14px; line-height: 1.5; color: rgba(244, 247, 247, .82); }
.insight-list li:first-child { border-top: 0; }
.heat { display: grid; grid-template-columns: minmax(84px, auto) 1fr; align-items: center; gap: 5px 8px; margin-top: 12px; }
.heat-label { max-width: 110px; overflow: hidden; font-size: 11.5px; color: rgba(244, 247, 247, .75); white-space: nowrap; text-overflow: ellipsis; }
.heat-row { display: grid; grid-template-columns: repeat(var(--days), 1fr); gap: 1.5px; }
.heat-row i { display: block; height: 16px; border-radius: 3px; background: rgba(255, 141, 193, var(--a)); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .04); }
.heat-axis { position: relative; height: 14px; }
.heat-axis b { position: absolute; left: calc((var(--d) - .5) / var(--days) * 100%); transform: translateX(-50%); font-size: 9px; font-weight: 600; color: var(--muted); }
.bars { display: grid; grid-template-columns: repeat(7, 1fr); align-items: end; gap: 8px; height: 110px; margin-top: 12px; }
.bar { display: grid; grid-template-rows: 1fr auto auto; height: 100%; text-align: center; }
.bar i { align-self: end; height: var(--h); min-height: 2px; border-radius: 8px 8px 3px 3px; background: linear-gradient(180deg, var(--pink-hot), rgba(255, 141, 193, .3)); }
.bar b { min-height: 13px; margin-top: 4px; font-size: 11px; color: rgba(244, 247, 247, .8); }
.bar small { font-size: 10.5px; color: var(--muted); }
.phase-mood { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-top: 1px solid var(--line); font-size: 14px; }
.group-title + .phase-mood { border-top: 0; }
.phase-mood b { display: flex; gap: 4px; font-size: 22px; }
.phase-mood i { font-style: normal; }
.mini-table { width: 100%; margin-top: 8px; border-collapse: collapse; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.mini-table th { padding: 6px 4px; font-size: 11px; font-weight: 600; color: var(--muted); text-align: right; }
.mini-table td { padding: 9px 4px; border-top: 1px solid var(--line); text-align: right; }
.mini-table th:first-child, .mini-table td:first-child { text-align: left; }
.empty-card { display: grid; justify-items: center; gap: 14px; padding: 30px 20px; text-align: center; }
.empty-card p { margin: 0; font-size: 14.5px; line-height: 1.55; color: rgba(244, 247, 247, .75); }
.empty-ic { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 18px; background: rgba(201, 182, 255, .12); color: #c9b6ff; }
.link-card { display: flex; align-items: center; gap: 14px; }
.link-card > .ic { color: var(--pink); }
.link-card b { display: block; font-size: 15px; }
.link-card small { display: block; margin-top: 3px; font-size: 13px; color: var(--muted); }

/* отчёт для врача */
.report-tools { display: grid; gap: 12px; }
.report {
  padding: 22px 18px;
  border-radius: var(--radius);
  background: #f7f9f9;
  color: #14191a;
  font-size: 13.5px;
  line-height: 1.5;
  -webkit-user-select: text;
  user-select: text;
}
.report h2 { margin: 0; font: 600 21px/1.2 var(--font-display); color: #0c1213; }
.report h3 { margin: 18px 0 8px; font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: #5b6a6b; }
.report p, .report ul, .report ol { margin: 0; }
.report ul, .report ol { padding-left: 20px; }
.report li { margin: 3px 0; }
.report-head { padding-bottom: 12px; border-bottom: 2px solid #81d8d0; }
.report-head p { margin-top: 6px; font-size: 12px; color: #6c7a7b; }
.report-table { width: 100%; border-collapse: collapse; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.report-table th { padding: 6px 4px; border-bottom: 1px solid #cfd8d8; font-size: 10.5px; font-weight: 700; text-align: left; color: #5b6a6b; }
.report-table td { padding: 6px 4px; border-bottom: 1px solid #e3e9e9; }
.report .btn-ghost { margin-top: 10px; border-color: #c4e3e0; background: #e9f3f2; color: #0c4a47; }
.report .report-fine { margin-top: 18px; font-size: 11px; color: #8a9798; }

@media print {
  @page { margin: 14mm; }
  html, body { background: #fff !important; }
  .sky, .no-print, .top, .toast, .splash, .sheet-wrap, .lock { display: none !important; }
  .screen { max-width: none; padding: 0; animation: none; }
  .report { padding: 0; border-radius: 0; background: #fff; font-size: 11.5pt; }
  .report-table tr { page-break-inside: avoid; }
}

/* настройки */
.mode-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 6px; }
.mode-opt {
  display: grid;
  align-content: start;
  gap: 4px;
  min-height: 78px;
  padding: 12px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .03);
  color: var(--text);
  font-family: var(--font-ui);
  text-align: left;
  cursor: pointer;
  transition: border-color .2s, background .2s, transform .2s var(--ease-out);
}
.mode-opt:active { transform: scale(.97); }
.mode-opt b { font-size: 14px; font-weight: 600; }
.mode-opt small { font-size: 11.5px; line-height: 1.35; color: var(--muted); }
.mode-opt.is-on { border-color: rgba(255, 141, 193, .6); background: linear-gradient(130deg, rgba(255, 141, 193, .12), rgba(129, 216, 208, .06)); }
.mode-opt.is-on b { color: var(--pink); }
.btn-col { display: grid; gap: 10px; }
label.btn { cursor: pointer; }
.key-box { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; border: 1px solid var(--line); background: rgba(255, 255, 255, .05); }
.key-box code { flex: 1; min-width: 0; overflow-wrap: anywhere; font-size: 13px; color: var(--tiffany); -webkit-user-select: all; user-select: all; }
.steps { margin: 16px 0 0; padding-left: 20px; }
.steps li { margin: 0 0 12px; font-size: 14px; line-height: 1.55; color: rgba(244, 247, 247, .8); }
.steps code { padding: 1px 6px; border-radius: 6px; background: rgba(255, 255, 255, .07); font-size: 12.5px; color: var(--tiffany); overflow-wrap: anywhere; }
.past-list { margin: 12px 0; padding: 0; list-style: none; }
.past-list li { display: flex; align-items: center; gap: 8px; padding: 6px 2px; font-size: 14px; color: rgba(244, 247, 247, .8); }
.past-list .ic { width: 16px; height: 16px; color: var(--tiffany); }

/* код-пароль */
.lock {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: calc(env(safe-area-inset-top) + 20px) 20px calc(env(safe-area-inset-bottom) + 20px);
  background: rgba(0, 0, 0, .92);
  -webkit-backdrop-filter: blur(24px);
  backdrop-filter: blur(24px);
  opacity: 0;
  transition: opacity .25s;
}
.lock.is-open { opacity: 1; }
body.is-locked { overflow: hidden; }
.lock-box { display: grid; justify-items: center; gap: 18px; width: min(300px, 100%); }
.lock-ic { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 50%; background: rgba(255, 141, 193, .12); color: var(--pink); }
.lock-box h2 { margin: 0; font: 500 24px/1.2 var(--font-display); }
.lock-dots { display: flex; gap: 16px; height: 16px; }
.lock-dots i { width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid rgba(255, 255, 255, .45); transition: background .15s, border-color .15s; }
.lock-dots i.is-on { border-color: transparent; background: linear-gradient(135deg, var(--tiffany), var(--pink)); }
.lock-dots.is-wrong { animation: kisa-shake .45s; }
.lock-pad { display: grid; grid-template-columns: repeat(3, 76px); gap: 14px 22px; margin-top: 8px; }
.lock-pad button { width: 76px; height: 76px; border-radius: 50%; border: 1px solid var(--line); background: rgba(255, 255, 255, .06); color: var(--text); font: 400 30px/1 var(--font-display); cursor: pointer; transition: background .15s, transform .15s; }
.lock-pad button:active { background: rgba(255, 255, 255, .16); transform: scale(.94); }
.lock-pad .lock-text { border: 0; background: none; color: var(--muted); font: 600 14px var(--font-ui); }

@media (max-width: 360px) {
  .hero-cycle { grid-template-columns: 96px 1fr; }
  .hero-ring { width: 96px; }
  .lock-pad { grid-template-columns: repeat(3, 68px); gap: 12px 18px; }
  .lock-pad button { width: 68px; height: 68px; }
}
@media (prefers-reduced-motion: reduce) {
  .ai-orb, .ai-orb .ic, .chance-day i, .msg { animation: none; }
}
.chat-input .input { scrollbar-width: none; }
.chat-input .input::-webkit-scrollbar { display: none; }
.lock-pad button { font-variant-numeric: lining-nums; }

/* ================= Минимальный интерфейс: вкладки снизу ================= */

:root { --tabbar-h: calc(64px + env(safe-area-inset-bottom)); }

body.has-tabs .screen { padding-bottom: calc(var(--tabbar-h) + 28px); }
.screen.is-root .top [data-back] { visibility: hidden; }

.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  max-width: 520px;
  height: var(--tabbar-h);
  margin: 0 auto;
  padding: 6px max(10px, env(safe-area-inset-right)) env(safe-area-inset-bottom) max(10px, env(safe-area-inset-left));
  border-top: 1px solid var(--line);
  background: rgba(6, 8, 9, .82);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  backdrop-filter: blur(18px) saturate(1.4);
}
.tab {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: rgba(244, 247, 247, .5);
  font: 600 10.5px/1 var(--font-ui);
  letter-spacing: .02em;
  text-decoration: none;
  -webkit-user-select: none;
  user-select: none;
  transition: color .2s;
}
.tab .ic { width: 24px; height: 24px; transition: transform .25s var(--ease-out); }
.tab:active .ic { transform: scale(.88); }
.tab.is-on { color: var(--pink); }
.tab.is-on .ic { filter: drop-shadow(0 0 8px rgba(255, 141, 193, .45)); }
.tab-badge { position: absolute; top: 4px; left: calc(50% + 8px); width: 9px; height: 9px; border-radius: 50%; background: var(--pink); box-shadow: 0 0 0 2px #060809; }
/* клавиатура открыта — панель не мешает */
body.has-tabs:has(input:focus, textarea:focus) .tabbar { display: none; }

/* главная */
.home-head { padding: 14px 4px 2px; }
.home-head .today { margin: 0 0 6px; font-size: 11.5px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.hello--sm { font-size: clamp(30px, 8.5vw, 40px); }
.mini-row { display: flex; align-items: center; gap: 14px; padding: 12px 14px; }
.mini-row b { display: block; font-size: 14.5px; font-weight: 600; }
.mini-row small { display: block; margin-top: 2px; font-size: 12.5px; color: var(--muted); }
.mini-row .dot { width: 36px; height: 36px; border-radius: 12px; }
.mini-row .dot .ic { width: 18px; height: 18px; }
.chips--left { justify-content: flex-start; margin-top: 0; }

/* «Ещё» — список разделов */
.list { padding: 6px 0 4px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--glass); }
.list-title { margin: 10px 18px 4px; font-size: 11.5px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.list-row { display: flex; align-items: center; gap: 14px; min-height: 60px; padding: 8px 16px; color: inherit; text-decoration: none; transition: background .2s; }
.list-row:active { background: var(--glass-2); }
.list-row + .list-row { border-top: 1px solid var(--line); }
.list-ic { display: grid; place-items: center; flex: none; width: 38px; height: 38px; border-radius: 12px; background: rgba(255, 141, 193, .1); color: var(--pink); }
.list-ic .ic { width: 19px; height: 19px; }
.list-main { flex: 1; min-width: 0; }
.list-main b { display: block; font-size: 15px; font-weight: 600; }
.list-main small { display: block; margin-top: 2px; font-size: 12.5px; color: var(--muted); }
.list-badge { min-width: 22px; height: 22px; padding: 0 7px; border-radius: 11px; background: var(--pink); color: #2a0614; font-size: 12px; font-weight: 700; line-height: 22px; text-align: center; }
.list-go { width: 18px; height: 18px; color: rgba(244, 247, 247, .3); }

/* чат над нижней панелью */
body.has-tabs .chat-input { bottom: var(--tabbar-h); padding-bottom: 10px; }
body.has-tabs:has(.chat-input textarea:focus) .chat-input { bottom: 0; padding-bottom: calc(env(safe-area-inset-bottom) + 10px); }
body.has-tabs .ai-fine { margin-bottom: 64px; }

@media print { .tabbar { display: none !important; } }
.screen--cycle .legend { gap: 6px 12px; font-size: 11.5px; }
.screen--cycle .legend li { gap: 5px; }
.screen--cycle .lg { width: 11px; height: 11px; }
.hello-block--partner { padding: 2vh 4px 2px; }
body.has-tabs .hello-block--partner .hello { font-size: clamp(30px, 8.5vw, 40px); }

/* ================= Главная: круг по центру, ИИ внизу ================= */

.screen--home {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}
.screen--home > * + * { margin-top: 12px; }
.home-date { margin: 18px 0 0; text-align: center; font-size: 11.5px; font-weight: 600; letter-spacing: .22em; text-transform: uppercase; color: var(--muted); }


.orb-wrap { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 10px 0; }
.orb {
  position: relative;
  display: block;
  width: min(76vw, 320px, 46dvh);
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: inherit;
  cursor: pointer;
  transition: transform .35s var(--ease-out);
  -webkit-tap-highlight-color: transparent;
}
.orb:active { transform: scale(.965); }
.orb::before {
  content: '';
  position: absolute;
  inset: 8%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(129, 216, 208, .13), rgba(255, 141, 193, .08) 45%, transparent 70%);
  filter: blur(6px);
  animation: orb-breathe 6s ease-in-out infinite;
}
.orb.is-period::before { background: radial-gradient(circle, rgba(255, 95, 162, .22), rgba(255, 141, 193, .1) 45%, transparent 70%); }
@keyframes orb-breathe { 50% { transform: scale(1.08); opacity: .7; } }
.orb .ring { position: relative; }
.orb .ring circle { stroke-width: 9; }
.orb-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.orb-center b {
  font: 400 clamp(64px, 22vw, 92px)/1 var(--font-display);
  font-variant-numeric: lining-nums;
  background: linear-gradient(160deg, #fff 25%, var(--pink));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.orb-center span { max-width: 62%; margin-top: 8px; font-size: 12px; font-weight: 600; line-height: 1.35; letter-spacing: .14em; text-transform: uppercase; text-align: center; color: var(--muted); }
.orb-line { max-width: 300px; margin: 22px auto 0; font-size: 15px; line-height: 1.5; text-align: center; color: rgba(244, 247, 247, .78); }

.ai-cta {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 4px;
  padding: 14px 16px;
  border-radius: 24px;
  border: 1px solid rgba(129, 216, 208, .32);
  background: linear-gradient(120deg, rgba(129, 216, 208, .1), rgba(255, 141, 193, .1));
  color: inherit;
  text-decoration: none;
  transition: transform .2s var(--ease-out);
}
.ai-cta:active { transform: scale(.98); }
.ai-cta b { display: block; font: 500 20px/1.15 var(--font-display); }
.ai-cta small { display: block; margin-top: 3px; font-size: 12.5px; color: var(--muted); }
.ai-cta > span:nth-child(2) { flex: 1; }
.ai-cta-orb {
  display: grid;
  place-items: center;
  flex: none;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  color: var(--ink);
  background: conic-gradient(from 210deg, var(--tiffany), var(--pink), #c9b6ff, var(--tiffany));
  box-shadow: 0 0 24px rgba(129, 216, 208, .3);
}
.ai-cta-orb .ic { width: 22px; height: 22px; }
.ai-cta-go { color: rgba(244, 247, 247, .35); }

/* шторка с подробностями */
.sheet--cycle .cs-sub { margin: 2px 2px 4px; }
.sheet--cycle .chance { height: 84px; margin-top: 10px; }
.facts { display: grid; gap: 0; margin: 14px 0 0; }
.facts > div { display: flex; justify-content: space-between; gap: 12px; padding: 11px 2px; border-top: 1px solid var(--line); font-size: 14px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 600; text-align: right; }
.qlog--wrap { flex-wrap: wrap; overflow: visible; margin-top: 0; }
.sheet--cycle .card { margin-top: 12px; }
.cs-links { margin-top: 16px; }
.cs-links .btn { flex: 1; }
@media (prefers-reduced-motion: reduce) { .orb::before { animation: none; } }

/* записка от него на главной — карточка-письмо */
.love-note {
  position: relative;
  display: block;
  margin: 26px 4px 0;
  padding: 22px 20px 14px;
  border-radius: 22px;
  border: 1px solid rgba(255, 141, 193, .35);
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(255, 141, 193, .16), transparent 65%),
    linear-gradient(160deg, rgba(255, 255, 255, .045), rgba(129, 216, 208, .04));
  box-shadow: 0 12px 40px rgba(255, 95, 162, .12);
  color: inherit;
  text-decoration: none;
  transform-origin: top center;
  animation: note-in .9s var(--ease-out) both;
  transition: transform .25s var(--ease-out);
}
.love-note:active { transform: scale(.98); }
@keyframes note-in { from { opacity: 0; transform: translateY(-12px) rotate(-1.5deg) scale(.96); } }
.love-note-seal {
  position: absolute;
  top: -15px;
  left: 0;
  right: 0;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  margin: 0 auto;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--pink), var(--pink-hot));
  color: #2a0614;
  box-shadow: 0 4px 16px rgba(255, 95, 162, .5);
  animation: seal-pulse 2.6s ease-in-out infinite;
}
.love-note-seal .ic { width: 15px; height: 15px; fill: currentColor; stroke: none; }
.love-note-text {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  font: italic 500 21px/1.35 var(--font-letter);
  text-align: center;
  color: rgba(255, 255, 255, .93);
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}
.love-note-meta { display: block; margin-top: 8px; font-size: 12px; text-align: center; color: var(--muted); }
@media (prefers-reduced-motion: reduce) { .love-note, .love-note-seal { animation: none; } }

/* ================= Его главная: «Киса» по центру, записка внизу ================= */

.her-orb {
  --c1: var(--tiffany);
  --c2: var(--pink);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: min(62vw, 250px, 38dvh);
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  background:
    radial-gradient(circle at 32% 26%, rgba(255, 255, 255, .5), transparent 40%),
    linear-gradient(140deg, var(--c1), var(--c2));
  box-shadow:
    0 18px 60px color-mix(in srgb, var(--c2) 40%, transparent),
    inset 0 -14px 30px rgba(0, 0, 0, .16);
  transition: transform .35s var(--ease-out);
  animation: her-breathe 6s ease-in-out infinite;
  -webkit-tap-highlight-color: transparent;
}
.her-orb:active { transform: scale(.96); }
@keyframes her-breathe { 50% { transform: scale(1.035); } }
.her-orb::after {
  content: '';
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  border: 1.5px solid color-mix(in srgb, var(--c2) 60%, transparent);
  opacity: 0;
}
.her-orb.is-calling::after { animation: her-call 1.8s var(--ease-out) infinite; }
@keyframes her-call { from { opacity: .9; transform: scale(.94); } to { opacity: 0; transform: scale(1.18); } }
.her-orb-face { font-size: clamp(52px, 17vw, 72px); line-height: 1; filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .2)); }
.her-orb-face .ic { width: 64px; height: 64px; fill: rgba(255, 255, 255, .92); stroke: none; }
.her-orb-label { font-size: 12px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: rgba(255, 255, 255, .9); text-shadow: 0 1px 4px rgba(0, 0, 0, .25); }

.quick-note { margin-bottom: 4px; }
.quick-note-presets { margin: 0 -2px 10px; }
.quick-note-presets .qlog-btn { min-height: 36px; padding: 0 13px; font-weight: 500; }
.quick-note-row { display: flex; align-items: flex-end; gap: 8px; }
.quick-note-row .input { flex: 1; min-height: 46px; max-height: 120px; padding: 12px 16px; border-radius: 23px; line-height: 1.4; resize: none; scrollbar-width: none; }
.quick-note-row .icon-btn { width: 46px; height: 46px; flex: none; }
.quick-note-status { margin: 8px 4px 0; font-size: 12px; text-align: center; color: var(--muted); }
.her-rows .today-row { padding: 12px 4px; }
.her-rows .today-row + .today-row { border-radius: 0; }
.sheet .signal-row { padding: 8px 2px; }
@media (prefers-reduced-motion: reduce) { .her-orb, .her-orb::after { animation: none; } }

/* «Совет на сейчас» и новый разговор */
.now-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid rgba(129, 216, 208, .35);
  background: rgba(129, 216, 208, .08);
  color: var(--tiffany);
  font: 600 14px/1 var(--font-ui);
  cursor: pointer;
  transition: transform .2s var(--ease-out), background .2s;
}
.now-btn .ic { width: 17px; height: 17px; }
.now-btn:active { transform: scale(.95); background: rgba(129, 216, 208, .16); }
.now-wait { padding: 26px 0; }
.now-card { margin-top: 4px; text-align: center; border-color: rgba(129, 216, 208, .3); background: linear-gradient(150deg, rgba(129, 216, 208, .08), rgba(255, 141, 193, .07)); }
.now-emoji { display: block; font-size: 38px; line-height: 1.1; }
.now-card b { display: block; margin-top: 8px; font: 500 21px/1.25 var(--font-display); }
.now-card p { margin: 10px 0 0; font-size: 14.5px; line-height: 1.55; color: rgba(244, 247, 247, .8); }
.now-list { margin: 12px 0 0; padding: 0; list-style: none; text-align: left; }
.now-list li { position: relative; padding: 8px 0 8px 22px; font-size: 14.5px; line-height: 1.5; color: rgba(244, 247, 247, .88); border-top: 1px solid var(--line); }
.now-list li:first-child { border-top: 0; }
.now-list li::before { content: ''; position: absolute; left: 4px; top: 16px; width: 7px; height: 7px; border-radius: 50%; background: linear-gradient(135deg, var(--tiffany), var(--pink)); }
.now-why { font-size: 13px !important; color: var(--muted) !important; }
.sheet .btn-row { margin-top: 14px; }
.chat-new { align-self: center; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; color: var(--muted); }
.chat-new .ic { width: 15px; height: 15px; }
.chat-divider { align-self: center; display: flex; align-items: center; gap: 10px; margin: 14px 0 4px; font-size: 10.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: rgba(244, 247, 247, .4); }
.chat-divider::before, .chat-divider::after { content: ''; width: 28px; height: 1px; background: var(--line); }
.chat-day { align-self: center; margin: 12px 0 2px; font-size: 11px; font-weight: 600; color: var(--muted); }

/* настройки — меню разделов и пункты-кнопки в списках */
button.list-row, label.list-row { width: 100%; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.rows--flush { margin-top: 0; }
.screen--settings .group { padding: 14px 16px; }
.screen--settings .group .sheet-label:first-child { margin-top: 2px; }

/* шторка дня: месячные одной строкой, «Сохранить» всегда внизу */
.seg { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 4px; border-radius: 16px; border: 1px solid var(--line); background: rgba(255, 255, 255, .04); }
.seg-btn { min-height: 42px; padding: 0 4px; border: 0; border-radius: 12px; background: none; color: var(--muted); font: 600 13px/1.1 var(--font-ui); cursor: pointer; transition: background .2s, color .2s, transform .15s; }
.seg-btn:active { transform: scale(.95); }
.seg-btn.is-on { background: linear-gradient(120deg, var(--pink), var(--pink-hot)); color: #2a0614; }
.seg-btn[data-flowpick="0"].is-on { background: rgba(255, 255, 255, .12); color: var(--text); }
.log-extra { margin-top: 10px; }
.log-sub { margin: 12px 2px 8px; font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.log-group > .log-scales { margin: 0 12px 10px; }
.sheet-save-bar {
  position: sticky;
  bottom: 0;
  z-index: 2;
  margin: 14px -18px 0;
  padding: 16px 18px 6px;
  background: linear-gradient(180deg, rgba(11, 14, 15, 0), #0b0e0f 38%);
}

/* переходы между экранами: вкладки — мягко, вложенные — въезжают справа, «Назад» — слева */
.screen.enter-tab { animation: screen-fade .32s ease backwards; }
.screen.enter-push { animation: screen-push .42s var(--ease-out) backwards; }
.screen.enter-back { animation: screen-back .42s var(--ease-out) backwards; }
@keyframes screen-fade { from { opacity: 0; } }
@keyframes screen-push { from { opacity: 0; transform: translateX(32px); } }
@keyframes screen-back { from { opacity: 0; transform: translateX(-32px); } }

/* активная вкладка — светящаяся черта сверху */
.tab::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  width: 22px;
  height: 2px;
  margin-left: -11px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--tiffany), var(--pink));
  box-shadow: 0 0 10px rgba(255, 141, 193, .6);
  opacity: 0;
  transform: scaleX(.3);
  transition: opacity .25s, transform .35s var(--ease-out);
}
.tab.is-on::before { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .screen.enter-tab, .screen.enter-push, .screen.enter-back { animation: none; }
  .tab::before { transition: none; }
}
