/* ==========================================================
   forever v4 — уютная версия
   Любимый цвет — светло-голубой, он везде главный.
   Разделы различаются только оттенком голубого:
   Для души — небесный, Школа — васильковый, Канал — морозный
   ========================================================== */

:root {
  --ink: #2f4257;
  --ink-2: #51667c;
  --muted: #8497ab;
  --sky: #e3f0fb;
  --mist: #f4f9fe;
  --paper: #fbfdff;
  --line: #dcebf8;
  --white: #ffffff;
  --danger: #d9687a;
  --ok: #6fbf9b;

  --acc: #6f9fd2;
  --acc-deep: #557fb5;
  --acc-soft: #dcebf8;

  --font-h: 'Comfortaa', 'Nunito', system-ui, sans-serif;
  --font-b: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --shadow: 0 12px 30px -14px rgba(70, 110, 160, 0.35);
  --shadow-sm: 0 6px 16px -10px rgba(70, 110, 160, 0.35);
}

body[data-sec="soul"]    { --acc: #8cc1ec; --acc-deep: #5b9bd3; --acc-soft: #e0effc; }
body[data-sec="school"]  { --acc: #6fa8de; --acc-deep: #4a86c4; --acc-soft: #d9e9f8; }
body[data-sec="channel"] { --acc: #78c2dd; --acc-deep: #4fa2c6; --acc-soft: #dcf1f8; }

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

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-b);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  min-height: 100vh;
  min-height: 100dvh;
  background:
    radial-gradient(120% 55% at 88% -8%, var(--acc-soft) 0%, transparent 62%),
    linear-gradient(170deg, var(--sky) 0%, #eaf3fc 50%, var(--mist) 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  transition: background-color .4s ease;
}

.hidden { display: none !important; }

h1, h2, h3 { font-family: var(--font-h); font-weight: 700; letter-spacing: .1px; line-height: 1.25; }
h2 { font-size: 22px; }
h3 { font-size: 17px; }
p  { line-height: 1.55; }
.muted { color: var(--muted); font-size: 14px; }
small  { font-size: 13px; color: var(--muted); }

button { font: inherit; color: inherit; cursor: pointer; border: none; background: none; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--acc) 55%, white);
  outline-offset: 2px;
}

/* ---------- сердечки на фоне ---------- */
#hearts { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 25; }
.heart {
  position: absolute; top: 0;
  width: var(--s); height: var(--s);
  margin-top: calc(var(--s) * -1.5);
  opacity: 0;
  will-change: transform, opacity;
  filter: drop-shadow(0 3px 5px rgba(80, 140, 210, .35));
  animation: fall var(--dur) linear var(--delay) infinite;
}
.heart svg { width: 100%; height: 100%; display: block; overflow: visible;
  animation: sway var(--sdur) ease-in-out infinite alternate; }
@keyframes fall {
  0%   { transform: translate3d(0, 0, 0); opacity: 0; }
  10%  { opacity: var(--o); }
  90%  { opacity: var(--o); }
  100% { transform: translate3d(0, calc(100vh + 80px), 0); opacity: 0; }
}
@keyframes sway {
  from { transform: translateX(calc(var(--sway) * -1)) rotate(-12deg); }
  to   { transform: translateX(var(--sway)) rotate(12deg); }
}

/* ---------- вход ---------- */
.screen { min-height: 100dvh; position: relative; z-index: 1; }
#login-screen { display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-box { width: 100%; max-width: 330px; display: flex; flex-direction: column; gap: 12px; text-align: center; }
.login-mark { font-size: 44px; line-height: 1; }
.login-box h1 { font-size: 34px; letter-spacing: 3px; margin-bottom: 14px; color: var(--acc-deep); }
.error { color: var(--danger); font-size: 14px; min-height: 20px; }

/* ---------- поля ввода ---------- */
input, textarea, select {
  width: 100%; font: inherit; color: var(--ink);
  background: var(--white);
  border: 1.5px solid var(--line);
  border-radius: 16px;
  padding: 13px 16px;
  min-height: 48px;
  outline: none;
  transition: border-color .15s ease;
}
input:focus, textarea:focus, select:focus { border-color: var(--acc); }
textarea { resize: vertical; line-height: 1.6; }
input[type="time"], input[type="date"], input[type="number"] { padding: 11px 10px; }
input[type="time"]::-webkit-calendar-picker-indicator { display: none; }
input::placeholder, textarea::placeholder { color: #a7b6c6; }

/* ---------- кнопки ---------- */
.btn-primary, .btn-soft {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 46px; padding: 0 20px; border-radius: 16px;
  font-weight: 700; font-size: 15px;
  transition: transform .12s ease, box-shadow .12s ease;
}
.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--acc), var(--acc-deep));
  box-shadow: 0 8px 18px -8px var(--acc-deep);
}
.btn-soft { color: var(--acc-deep); background: var(--acc-soft); }
.btn-primary:active, .btn-soft:active { transform: scale(.97); }
.btn-quiet { color: var(--muted); font-size: 14px; padding: 8px 10px; border-radius: 12px; }
.btn-quiet:active { background: rgba(0,0,0,.04); }
.btn-danger { color: var(--danger); }
.btn-block { width: 100%; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 14px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 17px; background: var(--acc-soft);
}
.icon-btn:active { transform: scale(.92); }

/* ---------- шапка ---------- */
.head {
  position: sticky; top: 0; z-index: 30;
  background: linear-gradient(to bottom, rgba(234,244,252,.94) 70%, rgba(234,244,252,0));
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  padding-top: env(safe-area-inset-top, 0px);
}
.topbar {
  max-width: 480px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 20px 6px;
}
.hello { display: flex; flex-direction: column; min-width: 0; flex: 1 1 auto; }
.head-actions { display: flex; align-items: center; gap: 4px; }
.bell { position: relative; font-size: 19px; padding: 8px; border-radius: 12px; }
.bell.on { color: var(--acc-deep); }
.bell .dot { position: absolute; top: 6px; right: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); }
.notify-info { background: var(--acc-soft); border-radius: 16px; padding: 12px 14px; font-size: 14px; color: var(--ink-2); line-height: 1.5; }
#greeting { font-family: var(--font-h); font-weight: 700; font-size: 19px; }
.hello small { text-transform: none; }
.subnav {
  max-width: 480px; margin: 0 auto;
  display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none;
  padding: 8px 20px 12px;
}
.subnav::-webkit-scrollbar { display: none; }
.subnav button {
  flex: 0 0 auto; padding: 8px 16px; border-radius: 999px;
  font-weight: 700; font-size: 14px; color: var(--ink-2);
  background: rgba(255,255,255,.7); border: 1.5px solid transparent;
  transition: background .15s ease, color .15s ease;
}
.subnav button.active { background: var(--acc); color: #fff; box-shadow: 0 6px 14px -8px var(--acc-deep); }

.banner {
  max-width: 440px; margin: 4px auto 0; padding: 12px 16px;
  background: #fff3d6; color: #7a5a12; border-radius: 16px; font-size: 14px;
  position: relative; z-index: 1;
}

/* ---------- основная область ---------- */
main {
  max-width: 480px; margin: 0 auto;
  padding: 6px 20px calc(140px + env(safe-area-inset-bottom, 0px));
  display: flex; flex-direction: column; gap: 16px;
}
/* мягкое появление карточек при заходе на экран */
.box > * { animation: rise-in .38s ease both; }
.box > *:nth-child(1) { animation-delay: 0s; }
.box > *:nth-child(2) { animation-delay: .05s; }
.box > *:nth-child(3) { animation-delay: .1s; }
.box > *:nth-child(4) { animation-delay: .15s; }
.box > *:nth-child(n+5) { animation-delay: .18s; }
@keyframes rise-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.box { display: contents; }

.card {
  background: rgba(255,255,255,.92);
  border: 1px solid rgba(255,255,255,.9);
  border-radius: 24px;
  padding: 18px;
  box-shadow: var(--shadow);
}
.card > h3 { margin-bottom: 4px; }
.card > .muted { margin-bottom: 12px; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.empty { text-align: center; color: var(--muted); padding: 26px 12px; font-size: 15px; }
.add-row { display: flex; gap: 8px; }
.add-row .btn-primary { min-width: 48px; padding: 0 16px; }

/* ---------- записка (Для души) ---------- */
.note {
  position: relative;
  background: var(--paper);
  border-radius: 6px 22px 6px 22px;
  padding: 26px 22px 24px;
  box-shadow: 0 14px 26px -16px rgba(70, 110, 160, .5);
  transform: rotate(-.7deg);
  border: 1px solid #d6e6f5;
}
.note::before {
  content: ""; position: absolute; top: -10px; left: 50%;
  width: 86px; height: 22px; margin-left: -43px; transform: rotate(-2deg);
  background: color-mix(in srgb, var(--acc) 45%, white); opacity: .75;
  border-radius: 3px;
}
.note-label { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.note-text { font-family: var(--font-h); font-weight: 500; font-size: 17px; line-height: 1.6; color: var(--ink); }

/* ---------- как ты сегодня ---------- */
.moods { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.mood {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 14px 6px 12px; border-radius: 18px;
  background: #f4f8fc; border: 2px solid transparent;
  font-size: 13px; font-weight: 700; color: var(--ink-2); text-align: center; line-height: 1.25;
  transition: transform .12s ease, border-color .15s ease, background .15s ease;
}
.mood .e { font-size: 28px; line-height: 1; }
.mood:active { transform: scale(.96); }
.mood.on { background: var(--acc-soft); border-color: var(--acc); color: var(--acc-deep); }
.mood-reply { margin-top: 12px; padding: 12px 14px; background: var(--acc-soft); border-radius: 16px; font-size: 15px; }

/* ---------- вода ---------- */
.drops { display: flex; justify-content: space-between; gap: 4px; }
.drop { font-size: 26px; line-height: 1; padding: 6px 2px; opacity: .28; filter: grayscale(1); transition: opacity .15s, filter .15s, transform .15s; }
.drop.on { opacity: 1; filter: none; }
.drop:active { transform: scale(.85); }

/* ---------- баночка радостей ---------- */
.joy-out { margin-top: 12px; padding: 14px; border-radius: 18px; background: #eaf4fd; color: #2f5680; font-size: 15px; }
.joy-out small { display: block; margin-top: 6px; color: #6f8fb0; }
.breathe-cta {
  width: 100%; padding: 18px; border-radius: 24px; font-weight: 700; font-size: 16px;
  color: var(--acc-deep);
  background: linear-gradient(135deg, var(--acc-soft), #fff);
  border: 1.5px dashed var(--acc);
}
.breathe-cta:active { transform: scale(.98); }

/* ---------- списки ---------- */
.list-card {
  width: 100%; text-align: left; display: block;
  background: rgba(255,255,255,.94); border-radius: 20px; padding: 14px 16px 12px;
  box-shadow: var(--shadow-sm);
}
.list-card + .list-card { margin-top: 10px; }
.list-card:active { transform: scale(.99); }
.lc-top { display: flex; align-items: center; gap: 12px; }
.lc-top .emoji { font-size: 24px; line-height: 1; }
.lc-top .title { flex: 1; font-weight: 700; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lc-top .counter { font-size: 13px; font-weight: 800; color: var(--acc-deep); background: var(--acc-soft); padding: 3px 10px; border-radius: 999px; }
.bar { height: 5px; border-radius: 99px; background: var(--line); overflow: hidden; margin-top: 10px; }
.bar > i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--acc), var(--acc-deep)); transition: width .3s ease; }

.items { display: flex; flex-direction: column; gap: 8px; }
.item {
  display: flex; align-items: center; gap: 12px;
  background: #fff; border-radius: 18px; padding: 8px 8px 8px 12px;
  box-shadow: var(--shadow-sm);
}
.check {
  width: 30px; height: 30px; min-width: 30px; border-radius: 50%;
  border: 2px solid #b9d0e8; background: #fff; color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 15px;
  transition: background .2s ease, border-color .2s ease, transform .15s ease;
}
.check:active { transform: scale(.85); }
.item.done .check { background: var(--acc); border-color: var(--acc); }
.item-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.item-text { overflow-wrap: anywhere; }
.item.done .item-text { text-decoration: line-through; color: var(--muted); }
.item .del { opacity: .4; width: 38px; height: 38px; border-radius: 12px; font-size: 15px; }

/* ---------- письмо ---------- */
.letter {
  background: var(--paper); border: 1px solid #d6e6f5; border-radius: 22px;
  padding: 20px; min-height: 46vh; white-space: pre-wrap; overflow-wrap: anywhere;
  font-size: 17px; line-height: 1.75; box-shadow: var(--shadow-sm);
}
.letter.blank { color: var(--muted); }
textarea.letter-edit { min-height: 46vh; border-radius: 22px; padding: 20px; font-size: 17px; line-height: 1.75; background: var(--paper); }

/* ---------- от Заи ---------- */
.zaya { background: rgba(255,255,255,.94); border-radius: 22px; padding: 16px; box-shadow: var(--shadow-sm); }
.zaya .top { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.zaya .top .btn-quiet { margin-left: auto; }
.zaya .who { font-weight: 800; color: var(--acc-deep); }
.zaya.mine { background: var(--acc-soft); }
.zaya p { white-space: pre-wrap; overflow-wrap: anywhere; }
.zaya img { width: 100%; border-radius: 16px; margin-top: 10px; display: block; cursor: zoom-in; }

/* ---------- расписание ---------- */
.now {
  border-radius: 28px; padding: 22px 20px 20px;
  background: linear-gradient(150deg, #ffffff 0%, var(--acc-soft) 100%);
  box-shadow: var(--shadow);
}
.now-title { font-family: var(--font-h); font-weight: 700; font-size: 23px; line-height: 1.3; }
.now-sub { margin-top: 6px; color: var(--ink-2); }
.now-msg { margin-top: 14px; padding: 12px 14px; border-radius: 16px; background: rgba(255,255,255,.75); font-size: 15px; }
.now .bar { height: 8px; margin-top: 14px; background: rgba(255,255,255,.8); }

.timeline { list-style: none; margin-top: 16px; padding-left: 4px; }
.tl {
  position: relative; display: grid; grid-template-columns: 108px 1fr; gap: 8px;
  padding: 8px 0 8px 22px;
}
.tl::before { content: ""; position: absolute; left: 6px; top: 0; bottom: 0; width: 2px; background: var(--line); }
.tl::after {
  content: ""; position: absolute; left: 0; top: 17px; width: 14px; height: 14px; border-radius: 50%;
  background: #fff; border: 3px solid #c8d9ea;
}
.tl.past { opacity: .5; }
.tl.past::after { background: var(--acc); border-color: var(--acc); }
.tl.cur::after { background: var(--acc-deep); border-color: #fff; box-shadow: 0 0 0 4px var(--acc-soft); }
.tl .t { font-weight: 800; font-size: 14px; color: var(--ink-2); padding-top: 4px; white-space: nowrap; }
.tl .d { font-weight: 700; }
.tl .d small { display: block; font-weight: 600; }

.sch-actions { display: flex; gap: 8px; margin-top: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  padding: 7px 14px; border-radius: 999px; font-weight: 700; font-size: 14px;
  background: #f0f5fa; color: var(--ink-2);
}
.chip.on { background: var(--acc); color: #fff; }

.lrow {
  display: grid; grid-template-columns: 44px minmax(0, 1fr) 10px minmax(0, 1fr) 38px; gap: 6px; align-items: center;
  padding: 10px; background: #f6f9fc; border-radius: 18px;
}
.lrow .c { grid-column: 1 / 4; }
.lrow .r { grid-column: 4 / 6; }
.lrow input { min-width: 0; min-height: 42px; padding: 8px 8px; border-radius: 12px; }
.lrow .n { padding: 8px 4px; text-align: center; }
.lrow .dash { text-align: center; color: var(--muted); }
.lrow .x { width: 38px; height: 38px; border-radius: 12px; color: var(--danger); font-size: 18px; }

/* ---------- отсчёт ---------- */
.cds { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cd { position: relative; padding: 16px 14px 14px; border-radius: 20px; background: #f6f9fc; }
.cd .num { font-family: var(--font-h); font-weight: 700; font-size: 34px; line-height: 1; color: var(--acc-deep); }
.cd .unit { font-size: 13px; color: var(--muted); margin-top: 2px; }
.cd .name { font-weight: 700; margin-top: 8px; font-size: 15px; overflow-wrap: anywhere; }
.cd .x { position: absolute; top: 6px; right: 6px; width: 30px; height: 30px; font-size: 13px; color: var(--muted); border-radius: 10px; }
.cd.auto { background: var(--acc-soft); }

/* ---------- фразы ---------- */
.gen-opts { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.seg { display: inline-flex; background: #f0f5fa; border-radius: 14px; padding: 3px; }
.seg button { padding: 0 14px; min-height: 42px; border-radius: 11px; font-size: 20px; }
.seg button.on { background: #fff; box-shadow: var(--shadow-sm); }
.sits { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sit {
  display: flex; align-items: center; gap: 10px; text-align: left;
  padding: 12px 12px; border-radius: 18px; background: #fff; box-shadow: var(--shadow-sm);
  font-weight: 700; font-size: 14px; line-height: 1.25; border: 2px solid transparent;
}
.sit .e { font-size: 22px; }
.sit.on { border-color: var(--acc); background: var(--acc-soft); }
.sit[data-tone="good"] .e { filter: none; }
.phrase { background: #fff; border-radius: 20px; padding: 16px; box-shadow: var(--shadow-sm); }
.phrase p { margin-bottom: 12px; overflow-wrap: anywhere; }

/* ---------- мастерская канала ---------- */
.seg3 { display: grid; grid-template-columns: 1fr 1fr 1.6fr; gap: 6px; background: rgba(255,255,255,.7); padding: 4px; border-radius: 18px; }
.seg3 button { padding: 10px 4px; border-radius: 14px; font-weight: 700; font-size: 13px; color: var(--ink-2); line-height: 1.2; white-space: nowrap; }
.seg3 button.on { background: var(--acc); color: #fff; }
.seg3 b { font-weight: 800; }
.idea { background: #fff; border-radius: 20px; padding: 14px 14px 10px; box-shadow: var(--shadow-sm); border-left: 5px solid var(--acc); }
.idea[data-st="work"] { border-left-color: #f0b15c; }
.idea[data-st="done"] { border-left-color: var(--ok); }
.idea-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; }
.tag { font-size: 12.5px; font-weight: 800; color: var(--acc-deep); background: var(--acc-soft); padding: 3px 10px; border-radius: 999px; }
.idea-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.idea-actions { display: flex; align-items: center; gap: 4px; margin-top: 10px; flex-wrap: wrap; }
.idea-actions .grow { flex: 1; }
.idea-actions .btn-soft { min-height: 38px; padding: 0 14px; font-size: 14px; }
.idea-actions .icon-btn { background: transparent; width: 38px; height: 38px; }
.rub { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.rub::-webkit-scrollbar { display: none; }
.rub .chip { flex: 0 0 auto; }

/* ---------- план недели ---------- */
.today-plan { border-radius: 26px; padding: 20px; background: linear-gradient(150deg, #fff, var(--acc-soft)); box-shadow: var(--shadow); }
.today-plan .big { font-family: var(--font-h); font-weight: 700; font-size: 21px; line-height: 1.35; margin-top: 4px; overflow-wrap: anywhere; }
.day { background: #fff; border-radius: 20px; padding: 12px 14px; box-shadow: var(--shadow-sm); display: grid; grid-template-columns: 44px 1fr; gap: 10px; align-items: start; }
.day.today { outline: 2px solid var(--acc); }
.day .dn { font-family: var(--font-h); font-weight: 700; padding-top: 12px; color: var(--acc-deep); }
.day .f { display: grid; grid-template-columns: minmax(0, 1fr) 104px; gap: 6px; }
.day .f input { min-width: 0; }
.day .f input { min-height: 44px; padding: 8px 12px; border-radius: 14px; }
.day .foot { grid-column: 1 / -1; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.st { padding: 6px 12px; border-radius: 999px; font-size: 13px; font-weight: 800; background: #f0f5fa; color: var(--muted); }
.st[data-s="1"] { background: #fff1d6; color: #9a6a12; }
.st[data-s="2"] { background: #dff3ea; color: #2f7d5b; }

/* ---------- шаблоны ---------- */
.tpl { background: #fff; border-radius: 20px; padding: 14px; box-shadow: var(--shadow-sm); }
.tpl h3 { font-size: 16px; }
.tpl pre { font-family: var(--font-b); white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ink-2); font-size: 14.5px; margin: 6px 0 10px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.tpl .acts { display: flex; gap: 6px; align-items: center; }
.tpl .acts .btn-primary { flex: 1; min-height: 42px; }

/* ---------- нижнее меню ---------- */
.dock {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  width: calc(100% - 28px); max-width: 420px; margin: 0 auto;
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  display: flex; gap: 4px; padding: 6px;
  background: rgba(255,255,255,.88);
  -webkit-backdrop-filter: blur(18px) saturate(160%); backdrop-filter: blur(18px) saturate(160%);
  border: 1px solid rgba(255,255,255,.95); border-radius: 30px;
  box-shadow: 0 16px 36px -14px rgba(60, 100, 150, .5);
}
.dock button {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 8px 4px 7px; border-radius: 24px;
  font-size: 12.5px; font-weight: 700; color: var(--muted);
  transition: background .2s ease, color .2s ease;
}
.dock .ico { font-size: 22px; line-height: 1.1; }
.dock button.active { background: linear-gradient(135deg, var(--acc), var(--acc-deep)); color: #fff; box-shadow: 0 8px 16px -8px var(--acc-deep); }

/* ---------- окно ввода (снизу) ---------- */
.sheet { position: fixed; inset: 0; z-index: 80; display: flex; align-items: flex-end; justify-content: center; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(40, 60, 90, .35); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.sheet-card {
  position: relative; width: 100%; max-width: 480px; max-height: 88dvh; overflow-y: auto;
  background: #fff; border-radius: 28px 28px 0 0;
  padding: 22px 20px calc(20px + env(safe-area-inset-bottom, 0px));
  display: flex; flex-direction: column; gap: 12px;
  animation: rise .25s ease both;
}
@keyframes rise { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 14px; font-weight: 700; color: var(--ink-2); }
.field .counter { text-align: right; }
.field .counter.warn { color: var(--danger); font-weight: 800; }
.sheet-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 4px; }
.pick { display: flex; flex-direction: column; gap: 8px; }
.pick button { text-align: left; padding: 12px 14px; border-radius: 16px; background: #f4f8fc; font-size: 15px; overflow-wrap: anywhere; }
.pick button:active { background: var(--acc-soft); }

/* ---------- выдох ---------- */
.breathe {
  position: fixed; inset: 0; z-index: 90; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(90% 60% at 50% 30%, #f4faff 0%, #dcecfa 55%, #cfe3f6 100%);
  padding: 24px;
}
.br-x { position: absolute; top: calc(14px + env(safe-area-inset-top, 0px)); right: 14px; font-size: 20px; }
.br-body { text-align: center; max-width: 340px; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.br-title { font-family: var(--font-h); font-weight: 700; font-size: 22px; }
.br-stage { position: relative; width: 240px; height: 240px; display: flex; align-items: center; justify-content: center; margin: 6px 0; }
.br-circle {
  position: absolute; inset: 0; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffffff 0%, #cfe3f7 45%, #a9c9ec 100%);
  box-shadow: 0 0 60px 10px rgba(140, 180, 230, .45);
  transform: scale(.55);
}
.br-circle.run { animation: breath 10s ease-in-out infinite; }
@keyframes breath { 0% { transform: scale(.55); } 40% { transform: scale(1); } 100% { transform: scale(.55); } }
.br-word { position: relative; font-family: var(--font-h); font-weight: 700; font-size: 24px; color: #3d5a7a; }
.br-time { font-weight: 800; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.br-msg { color: var(--ink-2); min-height: 52px; }

/* ---------- просмотр фото ---------- */
#lightbox { position: fixed; inset: 0; z-index: 95; background: rgba(15, 25, 40, .92); display: flex; align-items: center; justify-content: center; padding: 16px; }
#lightbox img { max-width: 100%; max-height: 100%; border-radius: 12px; }

/* ---------- всплывашка ---------- */
#toast {
  position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom, 0px)); z-index: 99;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 999px; font-size: 14px; font-weight: 700;
  transition: opacity .2s ease, transform .2s ease; max-width: 88%; text-align: center;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- сердечко при нажатии ---------- */
.pop { position: fixed; z-index: 99; pointer-events: none; font-size: 18px; animation: pop .8s ease-out forwards; }
@keyframes pop {
  from { transform: translate(0, 0) scale(.6); opacity: 1; }
  to   { transform: translate(var(--dx), -70px) scale(1.2); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .box > * { animation: none; }
  * { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .heart { animation-duration: var(--dur) !important; animation-iteration-count: infinite !important; }
  .heart svg { animation-duration: var(--sdur) !important; animation-iteration-count: infinite !important; }
  .br-circle.run { animation: none; transform: scale(.8); }
}

/* ---------- Режим «только Для души» (для пользователя Заи) ---------- */
body.soul-only .dock button[data-sec="school"],
body.soul-only .dock button[data-sec="channel"] {
  display: none !important;
}
