/* ============ Наша семья — дизайн-система ============ */
:root {
  --bg: #FBF7F1;
  --bg-2: #F4EDE3;
  --card: #FFFFFF;
  --ink: #2A2420;
  --ink-2: #6B625A;
  --ink-3: #A39A90;
  --line: #ECE4D9;
  --coral: #E07A5F;
  --coral-soft: #FBE3DB;
  --sage: #6FA287;
  --sage-soft: #DDEDE3;
  --sky: #5D8FCB;
  --sky-soft: #DDE8F6;
  --honey: #E9B44C;
  --honey-soft: #FBEFD3;
  --plum: #9A6FB0;
  --plum-soft: #EEE3F4;
  --shadow: 0 1px 2px rgba(60, 40, 20, .05), 0 8px 24px -8px rgba(60, 40, 20, .12);
  --shadow-lg: 0 2px 6px rgba(60, 40, 20, .06), 0 24px 48px -16px rgba(60, 40, 20, .22);
  --r: 22px;
  --r-sm: 14px;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --fs: 16px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #171412;
  --bg-2: #211D1A;
  --card: #26211E;
  --ink: #F3ECE4;
  --ink-2: #BDB2A6;
  --ink-3: #85796E;
  --line: #3A332E;
  --coral-soft: #4A2C24;
  --sage-soft: #23392D;
  --sky-soft: #22324A;
  --honey-soft: #46381C;
  --plum-soft: #382A42;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px -8px rgba(0, 0, 0, .5);
  --shadow-lg: 0 2px 6px rgba(0, 0, 0, .3), 0 24px 48px -16px rgba(0, 0, 0, .6);
  color-scheme: dark;
}
:root[data-big] { --fs: 19px; }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { font-size: var(--fs); }
body {
  margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); line-height: 1.5;
  -webkit-font-smoothing: antialiased; min-height: 100vh; overflow-x: hidden;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
a { color: var(--coral); text-decoration: none; }
img { display: block; max-width: 100%; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; letter-spacing: -.01em; margin: 0; line-height: 1.15; }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }
.small { font-size: .85rem; }
.hidden { display: none !important; }

/* ---------- загрузка ---------- */
.boot { min-height: 100vh; display: grid; place-items: center; }
.boot-heart {
  width: 46px; height: 46px; background: var(--coral); border-radius: 50%;
  animation: pulse 1.2s ease-in-out infinite; box-shadow: 0 0 0 0 rgba(224, 122, 95, .4);
}
@keyframes pulse { 0% { transform: scale(.85); box-shadow: 0 0 0 0 rgba(224,122,95,.45); }
  70% { transform: scale(1); box-shadow: 0 0 0 22px rgba(224,122,95,0); } 100% { transform: scale(.85); } }

/* ---------- каркас ---------- */
.shell { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; padding: 28px 18px; display: flex; flex-direction: column; gap: 6px;
  border-right: 1px solid var(--line); background: var(--bg);
}
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 10px 22px; }
.brand-mark {
  width: 40px; height: 40px; border-radius: 13px; background: linear-gradient(135deg, var(--coral), #EFA27E);
  display: grid; place-items: center; color: #fff; box-shadow: 0 6px 16px -6px rgba(224,122,95,.7);
}
.brand-mark svg { width: 22px; height: 22px; }
.brand b { font-family: var(--serif); font-size: 1.2rem; display: block; line-height: 1.1; }
.brand span { font-size: .8rem; color: var(--ink-3); }
.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 12px; color: var(--ink-2);
  font-weight: 600; transition: background .15s, color .15s;
}
.nav-item .ni { width: 22px; text-align: center; font-size: 1.1rem; }
.nav-item:hover { background: var(--bg-2); color: var(--ink); }
.nav-item.on { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
.side-foot { margin-top: auto; padding: 12px; display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: #fff;
  background: var(--sage); flex: none; font-size: .9rem;
}
.main { min-width: 0; padding: 32px 40px 80px; max-width: 1180px; width: 100%; }
.topbar { display: flex; align-items: center; gap: 14px; margin-bottom: 26px; }
.topbar h1 { font-size: 2rem; }
.topbar .grow { flex: 1; }
.search {
  display: flex; align-items: center; gap: 8px; background: var(--card); border: 1px solid var(--line);
  border-radius: 999px; padding: 9px 16px; width: 280px; box-shadow: var(--shadow);
}
.search input { border: 0; outline: 0; background: none; width: 100%; }
.tabbar { display: none; }
.mtop { display: none; }

/* ---------- карточки ---------- */
.grid { display: grid; gap: 18px; min-width: 0; }
.grid > * { min-width: 0; }
.g2 { grid-template-columns: 1.25fr 1fr; }
.g3 { grid-template-columns: repeat(3, 1fr); }
.card {
  background: var(--card); border-radius: var(--r); padding: 22px; box-shadow: var(--shadow);
  border: 1px solid var(--line); border: 1px solid color-mix(in srgb, var(--line) 60%, transparent); position: relative; overflow: hidden;
}
.card h3 { font-size: 1.15rem; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.card h3 .more { margin-left: auto; font-family: var(--sans); font-size: .85rem; font-weight: 700; color: var(--coral); }
.card.flat { box-shadow: none; }
.fade-in { animation: up .45s cubic-bezier(.2,.8,.2,1) both; }
.fade-in:nth-child(2) { animation-delay: .05s; } .fade-in:nth-child(3) { animation-delay: .1s; }
.fade-in:nth-child(4) { animation-delay: .15s; } .fade-in:nth-child(5) { animation-delay: .2s; }
@keyframes up { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------- герой: малыш ---------- */
.hero {
  padding: 30px; min-height: 250px; color: #3A2A22;
  background:
    radial-gradient(120% 90% at 100% 0%, #FFD9C7 0%, transparent 55%),
    radial-gradient(90% 80% at 0% 100%, #FCE7B8 0%, transparent 60%),
    linear-gradient(135deg, #FFF1E8, #FDE3D6);
}
.hero.boy {
  background:
    radial-gradient(120% 90% at 100% 0%, #CFE1F7 0%, transparent 55%),
    radial-gradient(90% 80% at 0% 100%, #D9F0E3 0%, transparent 60%),
    linear-gradient(135deg, #EEF5FD, #DCEBFA);
}
:root[data-theme="dark"] .hero { color: #F7E9E0; background:
    radial-gradient(120% 90% at 100% 0%, #6B3A2C 0%, transparent 55%),
    radial-gradient(90% 80% at 0% 100%, #5A4421 0%, transparent 60%), linear-gradient(135deg, #3A2620, #2E1F1A); }
:root[data-theme="dark"] .hero.boy { background:
    radial-gradient(120% 90% at 100% 0%, #24406A 0%, transparent 55%),
    radial-gradient(90% 80% at 0% 100%, #1F4A35 0%, transparent 60%), linear-gradient(135deg, #1E2B3D, #18222F); }
.hero-deco { position: absolute; right: -20px; bottom: -30px; width: 260px; opacity: .55; pointer-events: none; }
.hero .eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: .72rem; font-weight: 800; opacity: .65; }
.hero h2 { font-size: 3.1rem; margin: 6px 0 2px; font-weight: 700; }
.hero .age { font-family: var(--serif); font-size: 1.35rem; opacity: .85; }
.hero .chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; position: relative; z-index: 1; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 999px; font-weight: 700;
  background: rgba(255,255,255,.65); backdrop-filter: blur(8px); font-size: .92rem;
}
:root[data-theme="dark"] .chip { background: rgba(255,255,255,.08); }
.chip small { font-weight: 600; opacity: .6; }

/* ---------- дневник: большие кнопки ---------- */
.quick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.qbtn {
  border-radius: 18px; padding: 16px 10px 14px; display: flex; flex-direction: column; align-items: center; gap: 6px;
  font-weight: 700; transition: transform .12s, box-shadow .2s; background: var(--bg-2); text-align: center;
}
.qbtn .qi { font-size: 1.9rem; line-height: 1; }
.qbtn small { font-weight: 600; color: var(--ink-2); font-size: .78rem; }
.qbtn:active { transform: scale(.96); }
.qbtn.feed { background: var(--honey-soft); } .qbtn.sleep { background: var(--sky-soft); }
.qbtn.diaper { background: var(--sage-soft); } .qbtn.bath { background: var(--plum-soft); }
.qbtn.walk { background: var(--coral-soft); } .qbtn.undo { background: var(--bg-2); }
.qbtn.pop { animation: pop .5s; }
@keyframes pop { 30% { transform: scale(1.08); } 100% { transform: none; } }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.stat { background: var(--bg); border-radius: 14px; padding: 12px; text-align: center; }
.stat b { font-family: var(--serif); font-size: 1.6rem; display: block; line-height: 1.1; }
.stat span { font-size: .78rem; color: var(--ink-2); font-weight: 600; }

/* ---------- списки ---------- */
.list { display: flex; flex-direction: column; }
.row {
  display: flex; align-items: center; gap: 14px; padding: 12px 4px; border-bottom: 1px solid var(--line);
}
.row:last-child { border-bottom: 0; }
.row .ic {
  width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; font-size: 1.2rem; flex: none;
  background: var(--bg-2);
}
.row .body { flex: 1; min-width: 0; }
.row .t { font-weight: 700; overflow-wrap: anywhere; }
.row .s { font-size: .85rem; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .tail { font-size: .82rem; color: var(--ink-3); font-weight: 600; text-align: right; flex: none; }
.row.click { cursor: pointer; border-radius: 12px; transition: background .15s; }
.row.click:hover { background: var(--bg); }
.when {
  min-width: 54px; text-align: center; border-radius: 14px; padding: 6px 4px; background: var(--bg-2); flex: none;
}
.when b { font-family: var(--serif); font-size: 1.3rem; display: block; line-height: 1; }
.when span { font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 800; color: var(--ink-2); }
.when.today { background: var(--coral); color: #fff; } .when.today span { color: #fff; }
.tag { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .74rem; font-weight: 800; }
.tag.coral { background: var(--coral-soft); color: var(--coral); }
.tag.sage { background: var(--sage-soft); color: var(--sage); }
.tag.sky { background: var(--sky-soft); color: var(--sky); }
.tag.honey { background: var(--honey-soft); color: #B07F14; }
.tag.plum { background: var(--plum-soft); color: var(--plum); }
:root[data-theme="dark"] .tag.honey { color: var(--honey); }
.empty { text-align: center; padding: 28px 10px; color: var(--ink-2); }
.empty .ei { font-size: 2.4rem; margin-bottom: 6px; }

/* ---------- кнопки, поля ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 20px;
  border-radius: 999px; font-weight: 800; background: var(--ink); color: var(--bg); transition: transform .12s, opacity .2s;
}
.btn:active { transform: scale(.97); }
.btn.coral { background: var(--coral); color: #fff; box-shadow: 0 8px 20px -10px rgba(224,122,95,.9); }
.btn.ghost { background: var(--bg-2); color: var(--ink); }
.btn.sm { padding: 8px 14px; font-size: .88rem; }
.btn[disabled] { opacity: .5; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: .82rem; font-weight: 700; color: var(--ink-2); }
.input {
  width: 100%; padding: 13px 16px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--card);
  outline: none; transition: border .15s;
}
.input:focus { border-color: var(--coral); }
textarea.input { resize: vertical; min-height: 90px; }
.seg { display: inline-flex; background: var(--bg-2); border-radius: 999px; padding: 4px; gap: 2px; flex-wrap: wrap; }
.seg button { padding: 8px 16px; border-radius: 999px; font-weight: 700; color: var(--ink-2); }
.seg button.on { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
.toggle { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.toggle:last-child { border-bottom: 0; }
.toggle .body { flex: 1; } .toggle .t { font-weight: 700; } .toggle .s { font-size: .85rem; color: var(--ink-2); }
.sw { width: 50px; height: 30px; border-radius: 999px; background: var(--line); position: relative; flex: none; transition: background .2s; }
.sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .2s; }
.sw.on { background: var(--sage); } .sw.on::after { transform: translateX(20px); }

/* ---------- чат ---------- */
.chat { display: flex; flex-direction: column; height: calc(100vh - 140px); height: calc(100dvh - 140px); min-height: 380px; }
.msgs { flex: 1; overflow-y: auto; padding: 8px 4px 20px; display: flex; flex-direction: column; gap: 10px; scroll-behavior: smooth; }
.bubble {
  max-width: min(680px, 86%); padding: 12px 16px; border-radius: 20px; line-height: 1.55; word-wrap: break-word;
  animation: up .3s both;
}
.bubble.me { align-self: flex-end; background: var(--ink); color: var(--bg); border-bottom-right-radius: 6px; }
.bubble.bot { align-self: flex-start; background: var(--card); box-shadow: var(--shadow); border-bottom-left-radius: 6px; }
.bubble p { margin: 0 0 8px; } .bubble p:last-child { margin: 0; }
.bubble ul, .bubble ol { margin: 4px 0 8px; padding-left: 20px; }
.bubble li { margin: 2px 0; }
.bubble img { border-radius: 12px; margin-bottom: 6px; max-height: 260px; }
.bubble .acts { display: flex; gap: 6px; margin-top: 8px; }
.bubble .acts button { font-size: .8rem; font-weight: 700; color: var(--ink-2); padding: 4px 10px; border-radius: 999px; background: var(--bg); }
.saved { align-self: flex-start; display: flex; flex-direction: column; gap: 4px; max-width: 86%; animation: up .3s both; }
.saved .sv {
  background: var(--sage-soft); color: var(--ink); padding: 8px 14px; border-radius: 14px; font-size: .9rem; font-weight: 600;
}
.saved .undo { align-self: flex-start; font-size: .8rem; font-weight: 800; color: var(--ink-2); padding: 2px 8px; }
.insight-chip {
  align-self: flex-start; font-size: .85rem; font-weight: 700; color: var(--ink-2); padding: 6px 12px; border-radius: 999px;
  background: var(--honey-soft);
}
.typing { align-self: flex-start; display: flex; gap: 5px; padding: 16px 18px; background: var(--card); border-radius: 20px; box-shadow: var(--shadow); }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; } .typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 60%, 100% { opacity: .25; transform: none; } 30% { opacity: 1; transform: translateY(-3px); } }
.composer {
  display: flex; align-items: flex-end; gap: 8px; background: var(--card); border-radius: 26px; padding: 8px;
  box-shadow: var(--shadow-lg); border: 1px solid var(--line);
}
.composer textarea { flex: 1; border: 0; outline: 0; background: none; resize: none; padding: 10px 6px; max-height: 160px; min-height: 24px; line-height: 1.4; }
.cbtn { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; flex: none; color: var(--ink-2); font-size: 1.2rem; transition: background .15s; }
.cbtn:hover { background: var(--bg-2); }
.cbtn.send { background: var(--coral); color: #fff; }
.cbtn.rec { background: #E5484D; color: #fff; animation: pulse-r 1.2s infinite; }
@keyframes pulse-r { 0% { box-shadow: 0 0 0 0 rgba(229,72,77,.5); } 100% { box-shadow: 0 0 0 16px rgba(229,72,77,0); } }
.cbtn svg { width: 22px; height: 22px; }
.suggest { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 10px 0 16px; }
.suggest button { padding: 10px 16px; border-radius: 999px; background: var(--card); box-shadow: var(--shadow); font-weight: 600; font-size: .92rem; }
.chat-hello { text-align: center; margin: auto 0; padding: 20px; }
.chat-hello .big { font-size: 3rem; }
.chat-hello h2 { font-size: 1.8rem; margin: 8px 0 6px; }
.attach-prev { display: flex; align-items: center; gap: 8px; padding: 6px 10px; font-size: .85rem; }
.attach-prev img { width: 44px; height: 44px; object-fit: cover; border-radius: 10px; }

/* ---------- календарь ---------- */
.cal-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.cal-head h3 { margin: 0; text-transform: capitalize; flex: 1; font-size: 1.4rem; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal .dow { text-align: center; font-size: .72rem; font-weight: 800; color: var(--ink-3); text-transform: uppercase; padding-bottom: 4px; }
.day {
  aspect-ratio: 1 / .92; border-radius: 14px; padding: 6px; display: flex; flex-direction: column; align-items: center;
  gap: 4px; background: var(--bg); font-weight: 700; transition: background .15s; position: relative;
}
.day.out { opacity: .3; } .day.today { background: var(--coral); color: #fff; }
.day.sel { outline: 2.5px solid var(--ink); outline-offset: -2.5px; }
.day .dots { display: flex; gap: 3px; flex-wrap: wrap; justify-content: center; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--sky); }
.dot.birthday { background: var(--coral); } .dot.vaccine { background: var(--sage); }
.day.today .dot { background: #fff; }

/* ---------- разделы ---------- */
.sec-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.sec-card {
  background: var(--card); border-radius: var(--r); padding: 18px; box-shadow: var(--shadow); display: flex;
  flex-direction: column; gap: 6px; min-height: 140px; transition: transform .15s, box-shadow .2s; text-align: left;
  color: var(--ink);
}
.sec-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.sec-card .si { font-size: 1.7rem; width: 50px; height: 50px; border-radius: 16px; display: grid; place-items: center; background: var(--bg-2); }
.sec-card b { font-size: 1.05rem; margin-top: 6px; }
.sec-card .cnt { font-family: var(--serif); font-size: 1.5rem; margin-left: auto; color: var(--ink-3); }
.sec-card .s { font-size: .82rem; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.ins { background: var(--honey-soft); border-radius: 18px; padding: 16px 18px; margin-bottom: 10px; cursor: pointer; }
.ins b { display: block; margin-bottom: 4px; }
.ins .txt { white-space: pre-line; font-size: .92rem; color: var(--ink-2); }
.ins.closed .txt { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- альбом ---------- */
.photos { columns: 4 200px; column-gap: 12px; }
.photos .ph { break-inside: avoid; margin-bottom: 12px; border-radius: 16px; overflow: hidden; cursor: zoom-in; position: relative; background: var(--bg-2); }
.photos .ph img { width: 100%; transition: transform .4s; }
.photos .ph:hover img { transform: scale(1.04); }
.photos .ph span { position: absolute; left: 0; right: 0; bottom: 0; padding: 20px 12px 10px; color: #fff; font-size: .82rem; font-weight: 700;
  background: linear-gradient(transparent, rgba(0,0,0,.55)); }
.strip { display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; }
.strip img { width: 110px; height: 110px; object-fit: cover; border-radius: 16px; flex: none; cursor: zoom-in; background: var(--bg-2); }
.lightbox { position: fixed; inset: 0; background: rgba(10,8,6,.92); z-index: 90; display: grid; place-items: center; animation: fadein .2s; }
.lightbox img { max-width: 94vw; max-height: 86vh; border-radius: 12px; }
.lightbox .cap { position: absolute; bottom: calc(24px + var(--safe-b)); color: #fff; font-weight: 700; text-align: center; left: 0; right: 0; }
@keyframes fadein { from { opacity: 0; } }

/* ---------- подарки ---------- */
.bdays { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.bday { border-radius: 20px; padding: 16px; background: var(--coral-soft); }
.bday b { font-family: var(--serif); font-size: 2.2rem; display: block; line-height: 1; }
.bday .n { font-weight: 800; margin-top: 8px; } .bday .s { font-size: .82rem; color: var(--ink-2); }
.bday:nth-child(3n+2) { background: var(--sky-soft); } .bday:nth-child(3n) { background: var(--honey-soft); }

/* ---------- покупки ---------- */
.check { display: flex; align-items: center; gap: 14px; padding: 14px 6px; border-bottom: 1px solid var(--line); cursor: pointer; }
.check .box { width: 26px; height: 26px; border-radius: 9px; border: 2px solid var(--line); display: grid; place-items: center; flex: none; transition: all .2s; }
.check.done .box { background: var(--sage); border-color: var(--sage); color: #fff; }
.check.done .t { text-decoration: line-through; color: var(--ink-3); }

/* ---------- рост ---------- */
.chart { width: 100%; height: auto; overflow: hidden; }
.chart .band { opacity: .14; } .chart .mid { stroke-dasharray: 5 5; opacity: .5; fill: none; stroke-width: 1.5; }
.chart .line { fill: none; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.chart .axis { stroke: var(--line); } .chart text { fill: var(--ink-3); font-size: 11px; font-family: var(--sans); font-weight: 600; }
.chart .pt { stroke: var(--card); stroke-width: 2.5; }
.chart .lbl { font-family: var(--serif); font-size: 14px; font-weight: 700; }

/* ---------- прививки ---------- */
.vx { display: flex; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.vx:last-child { border-bottom: 0; }
.vx .mark { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex: none; font-size: 1rem; background: var(--bg-2); }
.vx.done .mark { background: var(--sage); color: #fff; }
.vx.soon .mark { background: var(--sky-soft); }
.vx.overdue .mark { background: var(--honey-soft); }
.vx .body { flex: 1; } .vx > .btn { align-self: center; flex: none; } .vx .t { font-weight: 700; } .vx .s { font-size: .84rem; color: var(--ink-2); }
.vx.done .t { color: var(--ink-2); }

/* ---------- шторка ---------- */
.overlay { position: fixed; inset: 0; background: rgba(20,14,10,.4); z-index: 80; animation: fadein .2s; backdrop-filter: blur(2px); }
.sheet {
  position: fixed; z-index: 81; background: var(--card); box-shadow: var(--shadow-lg); padding: 24px;
  left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(560px, 94vw); max-height: 88vh; overflow-y: auto;
  border-radius: 26px; animation: sheet-in .28s cubic-bezier(.2,.8,.2,1);
}
@keyframes sheet-in { from { opacity: 0; transform: translate(-50%, -46%); } }
.sheet h2 { font-size: 1.5rem; margin-bottom: 14px; padding-right: 30px; }
.sheet .x { position: absolute; top: 16px; right: 16px; width: 36px; height: 36px; border-radius: 50%; background: var(--bg-2); font-size: 1.1rem; }
.sheet .acts { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }

#toast {
  position: fixed; left: 50%; bottom: calc(96px + var(--safe-b)); transform: translateX(-50%) translateY(20px); opacity: 0;
  background: var(--ink); color: var(--bg); padding: 12px 20px; border-radius: 999px; font-weight: 700; z-index: 99;
  transition: all .3s; pointer-events: none; white-space: normal; text-align: center; max-width: 92vw; border-radius: 18px;
}
#toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- вход ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; text-align: center;
  background: radial-gradient(80% 60% at 50% 0%, var(--coral-soft), transparent 70%), var(--bg); }
.login .card { max-width: 440px; padding: 36px 30px; }
.login h1 { font-size: 2.2rem; margin: 18px 0 10px; }
.login .brand-mark { width: 72px; height: 72px; border-radius: 24px; margin: 0 auto; }
.login .brand-mark svg { width: 38px; height: 38px; }
.steps { text-align: left; margin: 20px 0; display: flex; flex-direction: column; gap: 10px; }
.steps div { display: flex; gap: 12px; align-items: flex-start; }
.steps i { font-style: normal; width: 26px; height: 26px; border-radius: 50%; background: var(--coral-soft); color: var(--coral); font-weight: 800; display: grid; place-items: center; flex: none; font-size: .85rem; }

.hello { margin-bottom: 22px; }
.hello h1 { font-size: 2.4rem; }
.hello p { margin: 4px 0 0; color: var(--ink-2); font-size: 1.05rem; }
.ask-box { display: flex; gap: 10px; align-items: center; background: var(--card); border-radius: 999px; padding: 8px 8px 8px 20px; box-shadow: var(--shadow-lg); border: 1px solid var(--line); margin-bottom: 22px; cursor: text; }
.ask-box span { flex: 1; color: var(--ink-3); }
.more-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.more-grid a { background: var(--card); border-radius: 20px; padding: 18px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 8px; color: var(--ink); font-weight: 800; }
.more-grid a .mi { font-size: 1.8rem; }
.more-grid a small { color: var(--ink-2); font-weight: 600; }
.report { white-space: pre-wrap; font-size: .9rem; background: var(--bg); border-radius: 14px; padding: 14px; max-height: 50vh; overflow: auto; }

/* ============ мобильная версия ============ */
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { display: none; }
  .main { padding: 14px 16px calc(100px + var(--safe-b)); }
  .topbar { display: none; }
  .mtop { display: flex; align-items: center; gap: 10px; margin: 2px 0 16px; min-height: 44px; }
  .mtop h1 { font-size: 1.65rem; flex: 1; }
  .mtop .back { width: 40px; height: 40px; border-radius: 50%; background: var(--card); box-shadow: var(--shadow); font-size: 1.2rem; display: grid; place-items: center; }
  .mtop .icon { width: 40px; height: 40px; border-radius: 50%; background: var(--card); box-shadow: var(--shadow); display: grid; place-items: center; font-size: 1.05rem; }
  .g2, .g3 { grid-template-columns: 1fr; }
  .hero { padding: 24px; min-height: 0; }
  .hero h2 { font-size: 2.5rem; }
  .card { padding: 18px; border-radius: 20px; }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 10px; right: 10px;
    bottom: calc(10px + var(--safe-b)); z-index: 50; background: var(--card); background: color-mix(in srgb, var(--card) 88%, transparent);
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-radius: 24px; box-shadow: var(--shadow-lg);
    padding: 6px; border: 1px solid var(--line);
  }
  .tab { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 6px 0; border-radius: 16px; font-size: .68rem; font-weight: 800; color: var(--ink-3); }
  .tab .ti { font-size: 1.3rem; line-height: 1.2; filter: grayscale(.6); opacity: .8; }
  .tab.on { color: var(--ink); background: var(--bg-2); }
  .tab.on .ti { filter: none; opacity: 1; }
  .tab.center .ti { width: 46px; height: 46px; margin-top: -20px; border-radius: 50%; background: var(--coral); display: grid; place-items: center; color: #fff;
    box-shadow: 0 8px 20px -6px rgba(224,122,95,.8); filter: none; opacity: 1; font-size: 1.25rem; }
  .tab.center.on { background: none; }
  .chat { height: calc(100vh - 190px - var(--safe-b)); height: calc(100dvh - 190px - var(--safe-b)); }
  .sheet { left: 0; right: 0; top: auto; bottom: 0; transform: none; width: 100%; border-radius: 26px 26px 0 0;
    padding-bottom: calc(24px + var(--safe-b)); animation: sheet-up .3s cubic-bezier(.2,.8,.2,1); max-height: 92vh; }
  @keyframes sheet-up { from { transform: translateY(100%); } }
  .photos { columns: 2 140px; column-gap: 8px; } .photos .ph { margin-bottom: 8px; }
  .hello h1 { font-size: 2rem; }
  .bubble { max-width: 90%; }
  .cal { gap: 4px; } .day { border-radius: 10px; padding: 4px 2px; font-size: .9rem; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

:root[data-big] .qbtn { font-size: .9rem; padding: 14px 4px 12px; }
:root[data-big] .stat b { font-size: 1.35rem; }
:root[data-big] .stat span { font-size: .72rem; }

/* ---------- подсказка «на экран Домой» ---------- */
.ihint { position: fixed; left: 12px; right: 12px; bottom: calc(92px + var(--safe-b)); z-index: 60; display: flex; align-items: center; gap: 12px;
  background: var(--card); border-radius: 20px; padding: 12px 12px 12px 14px; box-shadow: var(--shadow-lg); border: 1px solid var(--line); animation: up .4s both; }
.ihint img { width: 44px; height: 44px; border-radius: 12px; flex: none; }
.ihint .body { flex: 1; min-width: 0; font-size: .9rem; }
.ihint .x { width: 30px; height: 30px; border-radius: 50%; background: var(--bg-2); flex: none; font-size: .85rem; }
@media (display-mode: standalone) { .main { padding-top: calc(14px + env(safe-area-inset-top, 0px)); } }

/* ---------- лента ---------- */
.feed { max-width: 680px; display: flex; flex-direction: column; gap: 14px; }
.feed-day { font-family: var(--serif); font-size: 1.15rem; margin: 10px 0 -2px; color: var(--ink-2); }
.feed-day::first-letter { text-transform: uppercase; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.feed-item { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 16px 18px; animation: up .35s both; }
#feed-prev .feed-item { box-shadow: none; border: 1px solid var(--line); margin-bottom: 10px; }
.feed-item.milestone { background: linear-gradient(135deg, var(--honey-soft), var(--card) 70%); }
.feed-head { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.feed-body { cursor: pointer; }
.feed-body img { border-radius: 16px; margin-bottom: 10px; max-height: 420px; width: 100%; object-fit: cover; }
.feed-title { font-weight: 700; font-size: 1.05rem; margin-bottom: 2px; }
.feed-acts { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.heart { padding: 6px 12px; border-radius: 999px; background: var(--bg); font-weight: 800; font-size: .95rem; transition: transform .15s; }
.heart.on { background: var(--coral-soft); }
.heart.pop { animation: pop .5s; }
.avatar.sm { width: 34px; height: 34px; font-size: .85rem; background: var(--sage); }
.avatar.lg { width: 64px; height: 64px; font-size: 1.6rem; font-family: var(--serif); }
.avatar.xl { width: 92px; height: 92px; font-size: 2.4rem; font-family: var(--serif); flex: none; }
/* ---------- люди ---------- */
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.person-card { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 20px 14px; display: flex; flex-direction: column;
  align-items: center; text-align: center; gap: 2px; color: var(--ink); transition: transform .15s, box-shadow .2s; }
.person-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.person-card .avatar { margin-bottom: 8px; }
.person-hero { display: flex; gap: 22px; align-items: center; background: linear-gradient(135deg, var(--coral-soft), var(--card) 75%); }
.person-hero h2 { font-size: 2.2rem; }
.person-hero .chip { background: var(--card); }
/* ---------- память ---------- */
.filters { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.mrow { display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--line); }
.mrow .row { flex: 1; border-bottom: 0; min-width: 0; }
.mrow input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--coral); flex: none; }
.bulk { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 10px 12px; background: var(--bg-2); border-radius: 14px; margin-bottom: 8px; position: sticky; top: 8px; z-index: 5; }
/* ---------- панель ---------- */
.stat-card { display: flex; flex-direction: column; gap: 2px; }
.stat-card b { font-family: var(--serif); font-size: 2.2rem; line-height: 1.1; }
.bars { display: flex; align-items: flex-end; gap: 6px; height: 140px; }
.bar { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; }
.bar i { display: block; width: 100%; max-width: 34px; background: linear-gradient(var(--coral), #EFA27E); border-radius: 8px 8px 4px 4px; }
.bar span { font-size: .68rem; color: var(--ink-3); font-weight: 700; }
@media (max-width: 900px) {
  .filters { grid-template-columns: 1fr 1fr; } .filters #mq { grid-column: 1 / -1; }
  .person-hero { flex-direction: column; text-align: center; } .person-hero .chips { justify-content: center; }
  .people { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .seg button { padding: 7px 11px; font-size: .88rem; }
}

/* ---------- исправления после проверки ---------- */
.feed-title, .person-hero h2, .sec-card b, .bubble { overflow-wrap: anywhere; }
.chip { -webkit-backdrop-filter: blur(8px); }
.overlay { -webkit-backdrop-filter: blur(2px); }
.mem-card { overflow: visible; }
:root[data-big] .day { aspect-ratio: auto; min-height: 52px; padding: 4px 1px; font-size: .85rem; }
:root[data-big] .cal { gap: 3px; }
:root[data-big] .cal .dow { font-size: .62rem; }
