/* Дневник Ами 3.0 — дизайн-токены и компоненты */
:root {
  color-scheme: light;
  --bg: #F6F4FA; --surface: #FFFFFF; --surface-2: #F1EEF8; --soft: #ECE6F7; --line: #EEEAF5; --frame: #E6E2EE;
  --ink: #2C2540; --ink-2: #6E6880; --ink-3: #A9A3BC; --ink-4: #3E345A; --ink-5: #4A3F66;
  --accent: #5B47B8; --accent-2: #8D78E6; --on-accent: #FFFFFF;
  --dark: #2C2540; --on-dark: #FFFFFF; --nav: #2C2540; --nav-on: #F1EEF8; --nav-on-ink: #2C2540; --nav-ink: #A9A3BC;
  --fab: #D9CCF6; --fab-ink: #2C2540; --scrim: rgba(44, 37, 64, .4); --dash: #C9C2DA; --grip: #D8D1E6;
  --glass: rgba(255, 255, 255, .72); --glass-2: rgba(255, 255, 255, .85);
  --bad: #C23434; --bad-bg: #FDE3E1; --bad-dot: #D94141; --bad-row: #FFF5F4; --bad-line: #E07A72;
  --soon: #8A5600; --soon-bg: #FFF1D6; --soon-dot: #E0A23A;
  --today: #A8481A; --today-bg: #FDEEE4; --today-dot: #F6A06B;
  --ok: #2F7D4F; --ok-bg: #E3F3E8; --ok-dot: #3FA56A;
  --neutral: #6E6880; --neutral-bg: #F1EEF8; --neutral-dot: #C9C2DA;
  --hero-a: #D9CCF6; --hero-b: #C7B6F0; --hero-c: #E9D9F3; --hero-d: #CDBEF3; --hero-peach: #FBC9A6; --hero-pink: #F3C6E4;
  --banner: linear-gradient(120deg, #D9CCF6, #FBD3B6); --hint: linear-gradient(120deg, #ECE6F7, #FDEEE4);
  --ext-bg: #E8F2D8; --ext: #4D6B1F; --int-bg: #FBE3EA; --int: #A3345E; --vacc-bg: #E3EAFB; --vacc: #3550A8;
  --vet-bg: #DDF2EC; --vet: #1E7360; --weight-bg: #FFF1D6; --weight: #8A5600; --meds-bg: #ECE6F7; --meds: #5B47B8;
  --hyg-bg: #DDF1F7; --hyg: #1D6A82; --stool-bg: #EFE8DF; --stool: #6F5640; --food-bg: #FDEEE4; --food: #A8481A; --sep-bg: #F6E3F3; --sep: #8E3A86;
  --t1-bg: #E1ECFD; --t1: #1F5FA8; --t2-bg: #EEE6FB; --t2: #6A43B5; --t3-bg: #DDF3E8; --t3: #23774D; --t4-bg: #FFF0DA; --t4: #94590E;
  --shadow: 0 10px 24px -8px rgba(141, 120, 230, .6);
  --r-tile: 26px; --r-card: 28px; --r-big: 32px; --r-sheet: 36px;
  --ease-pop: cubic-bezier(.3, 1.5, .5, 1);
  --font: 'Jost', system-ui, -apple-system, sans-serif;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #17151F; --surface: #221F2E; --surface-2: #2B2739; --soft: #2F2946; --line: #2E2A3C; --frame: #0F0D15;
  --ink: #F1EEF8; --ink-2: #A9A3BC; --ink-3: #6F6985; --ink-4: #CFC8E3; --ink-5: #C2BBD6;
  --accent: #A795F0; --accent-2: #A795F0; --on-accent: #17151F;
  --dark: #A795F0; --on-dark: #17151F; --nav: #2D2840; --nav-on: #A795F0; --nav-on-ink: #17151F; --nav-ink: #8D87A3;
  --fab: #A795F0; --fab-ink: #17151F; --scrim: rgba(0, 0, 0, .55); --dash: #4A4460; --grip: #4A4460;
  --glass: rgba(34, 31, 46, .78); --glass-2: rgba(34, 31, 46, .88);
  --bad: #FF9A92; --bad-bg: #3E2026; --bad-dot: #FF6B60; --bad-row: #2E1E24; --bad-line: #B4554E;
  --soon: #F5C46B; --soon-bg: #3A301E; --soon-dot: #F5C46B;
  --today: #FFB389; --today-bg: #3A2A24; --today-dot: #F6A06B;
  --ok: #8FDDB4; --ok-bg: #1D3328; --ok-dot: #5BC48A;
  --neutral: #A9A3BC; --neutral-bg: #2B2739; --neutral-dot: #55506A;
  --hero-a: #3B2F66; --hero-b: #2E2552; --hero-c: #3A2A4E; --hero-d: #33296A; --hero-peach: #6B3F3A; --hero-pink: #5A2F50;
  --banner: linear-gradient(120deg, #3B2F66, #5A3A30); --hint: linear-gradient(120deg, #2F2946, #3A2A24);
  --ext-bg: #26301D; --ext: #B5D98A; --int-bg: #3A2230; --int: #F2A3BF; --vacc-bg: #1F2740; --vacc: #A9BEF5;
  --vet-bg: #18322B; --vet: #8FD9C3; --weight-bg: #3A301E; --weight: #F5C46B; --meds-bg: #2A2440; --meds: #C2B5F5;
  --hyg-bg: #183039; --hyg: #8FD3E8; --stool-bg: #322A22; --stool: #D9BFA3; --food-bg: #3A2A24; --food: #FFB389; --sep-bg: #36203A; --sep: #E9A6DF;
  --t1-bg: #1E3350; --t1: #9CC3F5; --t2-bg: #33285A; --t2: #C7B2F7; --t3-bg: #183A2A; --t3: #8FDDB4; --t4-bg: #3E3018; --t4: #F2C27A;
  --shadow: 0 10px 24px -8px rgba(0, 0, 0, .7);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
/* На телефоне фон страницы = фон приложения: iOS красит полосу со временем в цвет фона страницы.
   Серо-сиреневая рамка вокруг колонки — только на широком экране. */
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 16px; }
@media (min-width: 600px) { html, body { background: var(--frame); } }
body { min-height: 100dvh; overscroll-behavior-y: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
input, textarea { border: 0; outline: 0; background: transparent; width: 100%; min-width: 0; padding: 0; }
input::placeholder, textarea::placeholder { color: var(--ink-3); }
a { color: var(--accent); }
.ms { font-family: 'Material Symbols Rounded'; font-weight: normal; font-style: normal; line-height: 1; letter-spacing: normal; text-transform: none; white-space: nowrap; direction: ltr; font-feature-settings: 'liga'; -webkit-font-smoothing: antialiased; display: inline-block; font-variation-settings: 'FILL' 0, 'wght' 400; user-select: none; }
.ms.fill { font-variation-settings: 'FILL' 1, 'wght' 400; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-2); }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Колонка приложения: на телефоне на весь экран, на широком — по центру */
#app { position: relative; max-width: 430px; margin: 0 auto; min-height: 100dvh; background: var(--bg); overflow-x: clip; }
@media (min-width: 600px) { #app { box-shadow: 0 0 60px -20px rgba(44, 37, 64, .35); } }
.fixed-col { position: fixed; left: 50%; transform: translateX(-50%); width: 100%; max-width: 430px; }

.tap { cursor: pointer; transition: transform .18s var(--ease-pop), background .2s, color .2s, box-shadow .2s; user-select: none; }
@media (hover: hover) { .tap:hover { transform: scale(.97); } }
.tap:active { transform: scale(.93); }
.tap.soft:active { transform: scale(.98); }
:focus-visible { outline: 2.5px solid var(--accent-2); outline-offset: 2px; }
/* у полей ввода фокус показывает сама скруглённая рамка .field — браузерную обводку убираем */
input:focus, input:focus-visible, textarea:focus, textarea:focus-visible, select:focus, select:focus-visible { outline: none; box-shadow: none; }

@keyframes screenIn { from { opacity: 0; transform: translateY(14px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes pushIn { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes heroFlow { 0% { background-position: 0% 0%, 100% 100%, 0% 50%; } 50% { background-position: 60% 40%, 30% 60%, 100% 50%; } 100% { background-position: 100% 10%, 0% 30%, 50% 100%; } }
@keyframes tabPop { 0% { transform: scale(1); } 30% { transform: scale(.7) rotate(-12deg); } 60% { transform: scale(1.22) rotate(6deg); } 100% { transform: scale(1) rotate(0); } }
@keyframes tabLbl { from { opacity: 0; transform: translateX(-6px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { 0% { background-position: -200px 0; } 100% { background-position: 200px 0; } }
@keyframes pop { 0% { transform: scale(.6); opacity: 0; } 60% { transform: scale(1.08); opacity: 1; } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

#screen { padding-bottom: calc(108px + env(safe-area-inset-bottom)); animation: screenIn .35s ease both; }
#screen.is-auth { padding-bottom: 0; } /* на входе нижнего меню нет — и отступ под него не нужен */
#screen.push { animation: pushIn .32s cubic-bezier(.2, .8, .2, 1) both; }

/* Шапка */
.topbar { display: flex; align-items: center; gap: 8px; padding: calc(14px + env(safe-area-inset-top)) 20px 0; position: relative; }
.dog-pill { display: flex; align-items: center; gap: 8px; background: var(--surface); border-radius: 999px; padding: 6px 12px 6px 6px; min-height: 44px; }
.hero .dog-pill, .hero .round { background: var(--glass-2); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff, #B9A6F0); color: #2C2540; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 14px; flex: none; background-size: cover; background-position: center; }
.round { width: 44px; height: 44px; border-radius: 50%; background: var(--surface); display: flex; align-items: center; justify-content: center; position: relative; flex: none; }
.round .ms { font-size: 22px; }
.count { position: absolute; top: 2px; right: 0; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: var(--accent); color: var(--on-accent); font-size: 11px; font-weight: 600; display: flex; align-items: center; justify-content: center; border: 2px solid var(--surface); }
.page-title { padding: 18px 20px 0; font-size: 34px; font-weight: 600; line-height: 1.05; }
.back { display: inline-flex; align-items: center; gap: 4px; height: 44px; padding: 0 14px 0 8px; border-radius: 999px; background: var(--surface); font-size: 14px; font-weight: 500; }
.back .ms { font-size: 20px; }

/* Шапка «Сегодня» */
.hero { position: relative; border-radius: 0 0 40px 40px; overflow: hidden; padding-bottom: 22px; will-change: opacity, transform; transform-origin: 50% 0;
  background: radial-gradient(45% 40% at 50% 50%, var(--hero-peach) 0%, transparent 100%), radial-gradient(40% 35% at 50% 50%, var(--hero-pink) 0%, transparent 100%), linear-gradient(170deg, var(--hero-a) 0%, var(--hero-b) 40%, var(--hero-c) 70%, var(--hero-d) 100%);
  background-size: 220% 220%, 240% 240%, 200% 200%; animation: heroFlow 14s ease-in-out infinite alternate; }
.hero::before { content: ''; position: absolute; inset: 0; opacity: .5; mix-blend-mode: multiply; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .3 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
:root[data-theme="dark"] .hero::before { mix-blend-mode: overlay; opacity: .35; }
.hero > * { position: relative; }
.greet { padding: 22px 22px 0; }
.greet .date { font-size: 15px; font-weight: 500; color: var(--ink-5); }
.greet h1 { margin: 2px 0 0; font-size: 32px; font-weight: 600; line-height: 1.05; }
.dog-card { margin: 18px 16px 0; background: var(--glass); border-radius: 30px; padding: 16px; display: flex; align-items: center; gap: 14px; }
.photo { width: 84px; height: 84px; border-radius: 26px; flex: none; overflow: hidden; background: repeating-linear-gradient(135deg, var(--soft) 0 6px, var(--surface-2) 6px 12px); display: flex; align-items: center; justify-content: center; text-align: center; font: 600 9px/1.3 ui-monospace, Menlo, monospace; color: var(--ink-2); background-size: cover; background-position: center; }
.dog-card .name { font-size: 22px; font-weight: 600; }
.dog-card .meta { font-size: 14px; color: var(--ink-5); line-height: 1.3; }
.bigw { font-size: 34px; font-weight: 300; line-height: 1; white-space: nowrap; }
.bigw small { font-size: 15px; font-weight: 500; }

/* Секции */
.sec { padding: 22px 16px 0; display: flex; flex-direction: column; gap: 10px; }
.sec-h { display: flex; align-items: baseline; justify-content: space-between; padding: 0 4px; gap: 8px; }
.sec-h h2 { margin: 0; font-size: 21px; font-weight: 600; }
.sec-h .aside { font-size: 14px; color: var(--ink-2); }
.link { display: inline-flex; align-items: center; gap: 2px; font-size: 14px; font-weight: 500; color: var(--accent); padding: 8px 0; }
.card { background: var(--surface); border-radius: var(--r-card); }
.card.pad { padding: 16px; }
.card.list { padding: 4px 16px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.hscroll { display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px; }
.hscroll::-webkit-scrollbar { display: none; }
.ic { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex: none; background: var(--glass-2); }
.ic .ms { font-size: 22px; }
.ic.lg { width: 48px; height: 48px; } .ic.lg .ms { font-size: 26px; }
.ic.sm { width: 32px; height: 32px; } .ic.sm .ms { font-size: 18px; }

/* Цвета категорий */
.c-ext { --cbg: var(--ext-bg); --cink: var(--ext); } .c-int { --cbg: var(--int-bg); --cink: var(--int); }
.c-vacc { --cbg: var(--vacc-bg); --cink: var(--vacc); } .c-vet { --cbg: var(--vet-bg); --cink: var(--vet); }
.c-weight { --cbg: var(--weight-bg); --cink: var(--weight); } .c-meds { --cbg: var(--meds-bg); --cink: var(--meds); }
.c-hyg { --cbg: var(--hyg-bg); --cink: var(--hyg); } .c-stool { --cbg: var(--stool-bg); --cink: var(--stool); }
.c-food { --cbg: var(--food-bg); --cink: var(--food); } .c-sep { --cbg: var(--sep-bg); --cink: var(--sep); }
.t-bad { --cbg: var(--bad-bg); --cink: var(--bad); --dot: var(--bad-dot); } .t-soon { --cbg: var(--soon-bg); --cink: var(--soon); --dot: var(--soon-dot); }
.t-today { --cbg: var(--today-bg); --cink: var(--today); --dot: var(--today-dot); } .t-ok { --cbg: var(--ok-bg); --cink: var(--ok); --dot: var(--ok-dot); }
.t-neutral { --cbg: var(--neutral-bg); --cink: var(--neutral); --dot: var(--neutral-dot); }
.tg-t1 { --cbg: var(--t1-bg); --cink: var(--t1); } .tg-t2 { --cbg: var(--t2-bg); --cink: var(--t2); } .tg-t3 { --cbg: var(--t3-bg); --cink: var(--t3); } .tg-t4 { --cbg: var(--t4-bg); --cink: var(--t4); }
.cbg { background: var(--cbg); } .cink { color: var(--cink); }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--dot, var(--neutral-dot)); display: inline-block; }

/* Плитки ухода */
.tile { border-radius: var(--r-tile); padding: 14px; display: flex; flex-direction: column; gap: 8px; min-height: 124px; background: var(--cbg); text-align: left; }
.tile .top { display: flex; justify-content: space-between; align-items: flex-start; }
.tile .ic { color: var(--cink); }
.tile .tn { font-size: 16px; font-weight: 500; line-height: 1.15; margin-top: auto; }
.tile .ts { font-size: 13px; font-weight: 500; color: var(--cink); display: flex; align-items: center; gap: 5px; }
.tile .ts.bad { color: var(--bad); }
.tile.wide { grid-column: span 2; }
.banner { margin: 14px 16px 0; border-radius: var(--r-card); padding: 16px; background: var(--banner); display: flex; align-items: center; gap: 12px; }
.banner b { font-size: 19px; font-weight: 600; display: block; }
.banner span.t { font-size: 14px; color: var(--ink-4); }
.go { width: 52px; height: 52px; border-radius: 50%; background: var(--dark); color: var(--on-dark); display: flex; align-items: center; justify-content: center; flex: none; }

/* «Требует внимания» */
.att { background: var(--cbg); border-radius: var(--r-tile); padding: 14px; display: flex; flex-direction: column; gap: 10px; min-height: 178px; }
.att .ic { background: var(--surface); color: var(--cink); }
.att .an { font-size: 17px; font-weight: 600; }
.att .as { font-size: 13px; color: var(--ink-5); }
.badge { align-self: flex-start; display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 999px; background: var(--surface); color: var(--cink); font-size: 12px; font-weight: 600; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.badge.fill { background: var(--cbg); }
.badge .ms { font-size: 14px; }

/* Кнопки */
.btn { height: 56px; border-radius: 999px; background: var(--accent); color: var(--on-accent); display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 16px; font-weight: 500; width: 100%; padding: 0 18px; }
.btn.lg { height: 58px; font-size: 17px; }
.btn.md { height: 46px; font-size: 15px; }
.btn.sm { height: 44px; font-size: 14px; }
.btn.dark { background: var(--dark); color: var(--on-dark); }
.btn.soft { background: var(--soft); color: var(--ink); }
.btn.white { background: var(--surface); color: var(--ink); }
.btn.ghost { background: transparent; color: var(--ink-4); }
.btn.danger { background: transparent; color: var(--bad); box-shadow: inset 0 0 0 1.5px var(--bad-line); }
.btn.danger-fill { background: var(--bad-dot); color: #fff; }
.btn[disabled], .btn.off { background: var(--dash); color: var(--surface); pointer-events: none; }
.btn .ms { font-size: 21px; }
.btn.loading { pointer-events: none; }
.btn.loading::after { content: ''; width: 18px; height: 18px; border: 2.5px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; }
.btn-row { display: grid; grid-template-columns: 1fr 1.4fr; gap: 8px; }

/* Чипы и сегменты */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { height: 40px; padding: 0 14px; border-radius: 999px; background: var(--surface-2); color: var(--ink); display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 500; white-space: nowrap; }
.chip.sm { height: 34px; padding: 0 12px; font-size: 13px; }
.chip.on { background: var(--dark); color: var(--on-dark); }
.chip.acc.on { background: var(--accent); color: var(--on-accent); }
.chip .ms { font-size: 18px; }
.chip.tag { background: var(--cbg); color: var(--cink); }
.chip.tag.on { box-shadow: inset 0 0 0 2px var(--cink); }
.chip.tag.on::before { content: 'check'; font-family: 'Material Symbols Rounded'; font-size: 16px; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); background: var(--surface-2); border-radius: 999px; padding: 4px; gap: 4px; }
.seg.white { background: var(--surface); }
.seg > button { height: 44px; border-radius: 999px; display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 15px; font-weight: 500; color: var(--ink-5); padding: 0 6px; white-space: nowrap; overflow: hidden; }
.seg.sm > button { height: 36px; font-size: 13px; }
.seg > button.on { background: var(--accent); color: var(--on-accent); }
.seg > button .ms { font-size: 19px; }

/* Поля */
.form { display: flex; flex-direction: column; gap: 12px; }
.group { background: var(--surface); border-radius: var(--r-card); padding: 6px; display: flex; flex-direction: column; }
.group.pad { padding: 16px; gap: 12px; }
.group .sep { height: 1px; background: var(--line); margin: 0 14px; }
.group h3, .glabel { margin: 0; font-size: 15px; font-weight: 500; }
.fw { min-width: 0; display: flex; flex-direction: column; }
.field { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 22px; min-height: 60px; cursor: text; transition: box-shadow .15s, background .15s; }
.field .fb { flex: 1; min-width: 0; }
.field .fl { display: block; font-size: 12px; font-weight: 500; color: var(--ink-2); }
.field input, .field textarea { font-size: 17px; font-weight: 500; padding: 2px 0; }
.field textarea { font-weight: 400; font-size: 16px; line-height: 1.4; resize: none; }
.field .unit { font-size: 15px; color: var(--ink-2); }
.field:focus-within { background: var(--bg); box-shadow: inset 0 0 0 2px var(--accent-2); }
.field:focus-within .fl { color: var(--accent); }
.field.err { background: var(--bad-row); box-shadow: inset 0 0 0 1.5px var(--bad-line); }
.field.err .fl { color: var(--bad); }
.field.dis { opacity: .5; pointer-events: none; }
.err-text { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--bad); padding: 6px 14px 4px; }
.err-text .ms { font-size: 16px; }
.mini { height: 36px; padding: 0 12px; border-radius: 999px; background: var(--soft); display: flex; align-items: center; font-size: 13px; font-weight: 500; flex: none; }
.cols2 { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 4px; }
.cols2e { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 4px; }
.suggest { display: flex; gap: 6px; padding: 8px 10px 10px; flex-wrap: wrap; }
.suggest button { padding: 7px 12px; border-radius: 999px; background: var(--surface-2); font-size: 13px; }
.suggest button.on { background: var(--dark); color: var(--on-dark); }
.hint { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 20px; background: var(--hint); font-size: 15px; font-weight: 500; }
.hint .ms { font-size: 24px; color: var(--accent); flex: none; }
.hint.sm { font-size: 13px; font-weight: 400; color: var(--ink-4); padding: 10px 14px; }
.hint.sm .ms { font-size: 20px; }
.stepper { display: flex; align-items: center; gap: 10px; }
.stepper .pm { width: 52px; height: 52px; border-radius: 50%; background: var(--soft); display: flex; align-items: center; justify-content: center; flex: none; }
.stepper .pm .ms { font-size: 24px; }
.stepper .pm.sm { width: 36px; height: 36px; } .stepper .pm.sm .ms { font-size: 18px; }
.bignum { flex: 1; min-width: 0; display: flex; align-items: baseline; justify-content: center; gap: 6px; border-radius: 20px; padding: 4px 0; }
.bignum input { width: 120px; text-align: right; font-size: 48px; font-weight: 300; }
.bignum .u { font-size: 20px; color: var(--ink-2); }
.scale { display: grid; gap: 4px; }
.scale button { height: 42px; border-radius: 12px; background: var(--surface-2); font-size: 15px; font-weight: 500; }
.scale button.on { background: var(--accent); color: var(--on-accent); }
.scale-legend { display: flex; justify-content: space-between; font-size: 11px; color: var(--ink-2); }

/* Переключатель «Дала» */
.switch { width: 56px; height: 32px; border-radius: 999px; background: var(--surface-2); position: relative; flex: none; transition: background .2s; }
:root:not([data-theme="dark"]) .switch:not(.on) { background: #E6E1F0; }
.switch i { position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform .22s var(--ease-pop); display: flex; align-items: center; justify-content: center; color: #5B47B8; font: normal 18px/1 'Material Symbols Rounded'; font-style: normal; }
.switch.on { background: var(--accent); }
.switch.on i { transform: translateX(24px); }
.switch.green.on { background: var(--ok-dot); }
.switch.sm { width: 46px; height: 28px; } .switch.sm i { width: 22px; height: 22px; } .switch.sm.on i { transform: translateX(18px); }

/* Строки списков */
.row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); min-height: 56px; width: 100%; text-align: left; }
.row:last-child { border-bottom: 0; }
.row .rb { flex: 1; min-width: 0; }
.row .rt { font-size: 16px; font-weight: 500; }
.row .rs { font-size: 13px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; }
.row .rr { font-size: 13px; text-align: right; color: var(--cink, var(--ink-2)); white-space: nowrap; }
.row .chev { font-size: 20px; color: var(--ink-3); }
.menu-row { display: flex; align-items: center; gap: 12px; padding: 10px 6px; border-radius: 18px; width: 100%; text-align: left; min-height: 56px; }
@media (hover: hover) { .menu-row:hover { background: var(--bg); } }
.menu-row .ic { background: var(--cbg, var(--soft)); color: var(--cink, var(--accent)); }
.menu-row .ml { flex: 1; font-size: 16px; font-weight: 500; }
.menu-row .mv { font-size: 14px; color: var(--ink-2); }

/* Препараты на сегодня */
.dose { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 24px; background: var(--surface); border: 1.5px solid var(--surface); width: 100%; text-align: left; }
.dose .tm { font-size: 24px; font-weight: 300; width: 62px; flex: none; }
.dose .dn { font-size: 16px; font-weight: 500; }
.dose .ds { font-size: 13px; color: var(--ink-2); }
.dose.given .ds { color: var(--accent); }
.dose.missed { background: var(--bad-row); border: 1.5px dashed var(--bad-line); }
.dose.missed .ds { color: var(--bad); }

/* Ежедневный уход */
.daily { display: flex; align-items: center; gap: 14px; padding: 8px; width: 100%; text-align: left; }
.daily .big { width: 56px; height: 56px; border-radius: 18px; background: var(--soft); display: flex; align-items: center; justify-content: center; color: var(--accent); transition: transform .25s var(--ease-pop); transform: scale(.94); flex: none; }
.daily .big .ms { font-size: 30px; }
.daily.done .big { background: linear-gradient(140deg, #8D78E6, #F6A06B); color: #fff; transform: scale(1); }
.daily .dn { font-size: 17px; font-weight: 500; }
.daily .ds { font-size: 13px; color: var(--ink-2); }
.daily .cta { font-size: 13px; color: var(--accent); font-weight: 500; }

/* Карточки-блоки */
.block { border-radius: var(--r-card); padding: 16px; background: var(--cbg); display: flex; flex-direction: column; gap: 14px; }
.block .bh { display: flex; align-items: center; gap: 10px; }
.block .bh .ic { color: var(--cink); }
.block .bh b { flex: 1; font-size: 17px; font-weight: 600; }
.pill { font-size: 12px; font-weight: 500; color: var(--cink, var(--accent)); background: var(--glass); border-radius: 999px; padding: 5px 10px; white-space: nowrap; }
.kpi-big { font-size: 40px; font-weight: 300; line-height: 1; }
.kpi-big small { font-size: 16px; font-weight: 500; }
.kpi-cap { font-size: 12px; color: var(--ink-5); }
.kv { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--ink-5); }
.kv span { display: flex; align-items: center; gap: 6px; }
.kv .ms { font-size: 18px; color: var(--cink); }
.soon-card { flex: none; width: 140px; background: var(--surface); border-radius: 24px; padding: 14px; display: flex; flex-direction: column; gap: 6px; }
.soon-card .w { font-size: 13px; font-weight: 500; color: var(--ink-2); }
.soon-card .w.hot { color: var(--weight); }
.soon-card .n { font-size: 16px; font-weight: 600; }
.stat { background: var(--surface); border-radius: 22px; padding: 12px; display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; }
.stat b { font-size: 24px; font-weight: 300; }
.stat span { font-size: 12px; color: var(--ink-2); }
.stat.l { align-items: flex-start; text-align: left; padding: 12px 14px; }
.fact { background: var(--surface); border-radius: 22px; padding: 12px 14px; display: flex; align-items: center; gap: 6px; text-align: left; }
.fact .fv { font-size: 17px; font-weight: 500; }
.fact .fl { font-size: 12px; color: var(--ink-2); }

/* Шапка подраздела ухода */
.subhead { margin: 14px 16px 0; border-radius: 30px; padding: 18px; background: var(--cbg); display: flex; flex-direction: column; gap: 12px; }
.subhead .shtop { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.subhead .ic { width: 44px; height: 44px; color: var(--cink); }
.subhead .chip-st { background: var(--surface); color: var(--cink); border-radius: 999px; padding: 0 16px; height: 44px; display: inline-flex; align-items: center; font-size: 14px; font-weight: 600; white-space: nowrap; }
.subhead .kick { font-size: 13px; color: var(--ink-4); }
.subhead .big { font-size: 40px; font-weight: 300; line-height: 1.05; }
.subhead .cap { font-size: 14px; color: var(--ink-4); margin-top: 2px; }
.tabs-sub { margin: 14px 16px 0; }

/* Графики */
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart text { font-family: var(--font); font-size: 11px; fill: var(--ink-4); }
.bars { position: relative; height: 130px; display: flex; align-items: flex-end; gap: 3px; }
.bars .b { flex: 1; min-width: 0; border-radius: 6px 6px 3px 3px; transition: height .35s cubic-bezier(.2, .8, .2, 1); }
.bars .goal { position: absolute; left: 0; right: 0; border-top: 1.5px dashed var(--accent-2); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--ink-5); }
.legend span { display: flex; align-items: center; gap: 5px; }

/* Календарь */
.cal { background: var(--surface); border-radius: 30px; padding: 14px; }
.cal-h { display: flex; align-items: center; justify-content: space-between; padding: 0 4px 10px; }
.cal-h b { font-size: 18px; font-weight: 600; }
.cal-nav { width: 40px; height: 40px; border-radius: 50%; background: var(--surface-2); display: flex; align-items: center; justify-content: center; }
.cal-wd, .cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; text-align: center; }
.cal-wd { font-size: 12px; color: var(--ink-2); padding-bottom: 4px; }
.cal-d { height: 46px; border-radius: 14px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 15px; position: relative; }
.cal-d.past { color: var(--ink-2); }
.cal-d.now { box-shadow: inset 0 0 0 1.5px var(--accent-2); font-weight: 600; }
.cal-d.sel { background: var(--accent); color: var(--on-accent); font-weight: 600; }
.cal-d.calm { background: var(--ok-bg); } .cal-d.anx { background: var(--soon-bg); }
.cal-d.bright { background: var(--ok-dot); color: #fff; } .cal-d.bright.anx { background: var(--soon-dot); }
.cal-d.rest { background: repeating-linear-gradient(135deg, transparent 0 4px, var(--line) 4px 6px); }
.cal-d.sel.calm, .cal-d.sel.anx, .cal-d.sel.bright, .cal-d.sel.rest { background: var(--accent); }
.cal-dots { display: flex; gap: 2px; height: 6px; align-items: center; font-size: 9px; line-height: 1; }
.cal-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--cink); display: block; }
.cal-dots i.f { background: transparent; box-shadow: inset 0 0 0 1.5px var(--cink); }
.cal-d.sel .cal-dots i { background: var(--on-accent); } .cal-d.sel .cal-dots i.f { background: transparent; box-shadow: inset 0 0 0 1.5px var(--on-accent); }

/* Нижнее меню */
#nav { bottom: 0; z-index: 3; pointer-events: none; padding: 0 16px max(10px, calc(env(safe-area-inset-bottom) - 8px)); } /* на iPhone — чуть выше полоски «домой», без неё — 10 px от края */
#nav::before { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 100px; background: linear-gradient(to bottom, transparent 0%, color-mix(in srgb, var(--bg) 92%, transparent) 45%, var(--bg) 70%); pointer-events: none; }
.navbar { position: relative; display: flex; align-items: center; gap: 10px; pointer-events: auto; }
.tabs { flex: 1; min-width: 0; height: 64px; border-radius: 999px; background: var(--nav); display: flex; align-items: center; justify-content: space-between; gap: 2px; padding: 0 8px; color: var(--nav-ink); }
.tab { display: flex; align-items: center; justify-content: center; gap: 4px; height: 48px; min-width: 44px; border-radius: 999px; font-size: 12px; font-weight: 600; flex: 1 1 0; white-space: nowrap; overflow: hidden; position: relative; }
.tab .ms { font-size: 21px; }
.tab.on { background: var(--nav-on); color: var(--nav-on-ink); flex: none; padding: 0 12px; }
.tab.on .ms { animation: tabPop .45s var(--ease-pop); font-variation-settings: 'FILL' 1; }
.tab.on .tl { animation: tabLbl .3s ease both; }
.tab .tl { display: none; } .tab.on .tl { display: inline; }
.tab .count { top: 4px; right: 4px; border-color: var(--nav); }
.fab { width: 64px; height: 64px; border-radius: 50%; background: var(--fab); color: var(--fab-ink); display: flex; align-items: center; justify-content: center; flex: none; box-shadow: var(--shadow); }
.fab .ms { font-size: 32px; }

/* Шторки */
.scrim { position: fixed; inset: 0; background: var(--scrim); opacity: 0; pointer-events: none; transition: opacity .25s; z-index: 5; }
.scrim.open { opacity: 1; pointer-events: auto; }
.sheet { bottom: 0; z-index: 6; background: var(--bg); border-radius: var(--r-sheet) var(--r-sheet) 0 0; transform: translate(-50%, 105%); transition: transform .32s cubic-bezier(.2, .8, .2, 1); max-height: 90dvh; display: flex; flex-direction: column; box-shadow: 0 -10px 30px -12px rgba(44, 37, 64, .3); }
.sheet.open { transform: translate(-50%, 0); }
.sheet .grip { width: 40px; height: 5px; border-radius: 3px; background: var(--grip); margin: 10px auto 4px; flex: none; }
.sheet .grip-zone { flex: none; padding: 10px 0 8px; cursor: grab; touch-action: none; } /* потянуть вниз или тапнуть — закрыть */
.sheet .grip-zone .grip { margin: 0 auto; }
.sheet .sb { overflow-y: auto; padding: 10px 16px calc(30px + env(safe-area-inset-bottom)); overscroll-behavior: contain; scrollbar-width: none; }
.sheet .sb::-webkit-scrollbar { display: none; }
.sh-t { font-size: 24px; font-weight: 600; margin: 0 4px 4px; line-height: 1.15; }
.sh-s { font-size: 14px; color: var(--ink-2); margin: 0 4px 14px; }
.sh-head { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.sh-head .sh-t { flex: 1; margin: 0; font-size: 22px; }
.sheet.s2 { z-index: 8; } .scrim.s2 { z-index: 7; }

/* Полноэкранные слои */
.layer { position: fixed; inset: 0; z-index: 9; display: flex; flex-direction: column; background: var(--bg); color: var(--ink); left: 50%; transform: translateX(-50%); width: 100%; max-width: 430px; animation: pushIn .3s cubic-bezier(.2, .8, .2, 1) both; }
.layer .lh { display: flex; align-items: center; gap: 10px; padding: calc(14px + env(safe-area-inset-top)) 16px 10px; }
.layer .lh .t { flex: 1; min-width: 0; font-size: 22px; font-weight: 600; }
.layer .lb { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 16px 30px; display: flex; flex-direction: column; gap: 12px; scrollbar-width: none; }
.layer.dark { background: #1E1930; color: #fff; }
.layer.dark .round { background: rgba(255, 255, 255, .12); color: #fff; }
.viewer-img { flex: 1; min-height: 0; margin: 8px 16px; border-radius: 12px; background-size: contain; background-position: center; background-repeat: no-repeat; }
.viewer-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 12px 16px calc(24px + env(safe-area-inset-bottom)); }
.viewer-nav button { height: 52px; border-radius: 999px; background: rgba(255, 255, 255, .12); color: #fff; display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 15px; font-weight: 500; }
.viewer-nav button[disabled] { opacity: .35; }

/* Таймер */
.timer { background: radial-gradient(90% 60% at 80% 0%, var(--hero-peach) 0%, transparent 60%), linear-gradient(170deg, var(--hero-a), var(--hero-b) 60%, var(--hero-c)); align-items: center; padding: calc(40px + env(safe-area-inset-top)) 20px calc(30px + env(safe-area-inset-bottom)); gap: 18px; animation: fadeIn .25s ease both; }
.ring { width: 264px; height: 264px; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin-top: 12px; }
.ring > div { width: 232px; height: 232px; border-radius: 50%; background: var(--glass-2); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; }
.ring b { font-size: 64px; font-weight: 300; line-height: 1; }

/* Фото */
.thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.thumb { position: relative; width: 76px; height: 76px; border-radius: 16px; overflow: hidden; background: var(--surface-2) center/cover no-repeat; flex: none; }
.thumb .x { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border-radius: 50%; background: rgba(255, 255, 255, .92); color: #C23434; display: flex; align-items: center; justify-content: center; }
.thumb .x .ms { font-size: 16px; }
.thumb.blur { filter: none; }
.thumb.blur::before { content: ''; position: absolute; inset: -10px; background: inherit; filter: blur(14px); }
.thumb .show { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 12px; font-weight: 600; color: #fff; background: rgba(44, 37, 64, .35); }
.thumb .show .ms { font-size: 18px; }
.thumb.loading::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .5), transparent) var(--surface-2); background-size: 200px 100%; animation: shimmer 1s linear infinite; }
.add-photo { width: 76px; height: 76px; border-radius: 16px; border: 2px dashed var(--dash); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--accent); font-size: 12px; font-weight: 500; flex: none; }
.add-photo .ms { font-size: 24px; }
.file-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 16px; background: var(--bg); }
.file-row .fi { width: 40px; height: 40px; border-radius: 10px; background: var(--soft) center/cover; color: var(--accent); display: flex; align-items: center; justify-content: center; flex: none; }

/* Тост и плашки */
#toast { bottom: calc(86px + env(safe-area-inset-bottom)); z-index: 20; padding: 0 16px; pointer-events: none; }
.toast { background: #2C2540; color: #fff; border-radius: 22px; padding: 12px 14px; display: flex; align-items: center; gap: 10px; transform: translateY(20px); opacity: 0; transition: transform .3s, opacity .3s; box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .4); }
:root[data-theme="dark"] .toast { background: #3A3352; }
.toast.show { transform: none; opacity: 1; pointer-events: auto; }
.toast .ms { font-size: 22px; color: #8FDDB4; }
.toast.err .ms { color: #FF9A92; }
.toast span.tt { flex: 1; font-size: 14px; font-weight: 500; }
.toast button { font-size: 14px; font-weight: 600; color: #C9B4FF; padding: 8px 4px; }
.offline { margin: 10px 16px 0; padding: 10px 14px; border-radius: 18px; background: var(--soon-bg); color: var(--soon); font-size: 13px; font-weight: 500; display: flex; gap: 8px; align-items: center; }

/* Пустые состояния и загрузка */
.empty { background: var(--surface); border-radius: var(--r-card); padding: 28px 20px; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.empty .ill { width: 72px; height: 72px; border-radius: 50%; background: var(--cbg, var(--soft)); color: var(--cink, var(--accent)); display: flex; align-items: center; justify-content: center; }
.empty .ill .ms { font-size: 34px; }
.empty p { margin: 0; font-size: 15px; color: var(--ink-2); max-width: 280px; text-wrap: pretty; }
.empty .btn { margin-top: 6px; }
.skel { border-radius: 18px; background: linear-gradient(90deg, var(--surface-2), var(--surface), var(--surface-2)); background-size: 400px 100%; animation: shimmer 1.2s linear infinite; }

/* Поздравление */
.congrats { position: fixed; inset: 0; z-index: 30; display: flex; align-items: center; justify-content: center; background: var(--scrim); animation: fadeIn .2s ease both; padding: 24px; }
.congrats .box { background: var(--surface); border-radius: 32px; padding: 28px 22px 20px; max-width: 340px; width: 100%; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; animation: pop .45s var(--ease-pop) both; }
.medal { width: 96px; height: 96px; border-radius: 50%; background: linear-gradient(140deg, #8D78E6, #F6A06B); color: #fff; display: flex; align-items: center; justify-content: center; box-shadow: 0 12px 30px -10px rgba(141, 120, 230, .8); }
.medal .ms { font-size: 46px; }
.ach { background: var(--surface); border-radius: 24px; padding: 14px 10px; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.ach .m { width: 60px; height: 60px; border-radius: 50%; background: linear-gradient(140deg, #8D78E6, #F6A06B); color: #fff; display: flex; align-items: center; justify-content: center; }
.ach .m .ms { font-size: 28px; }
.ach.off .m { background: var(--surface-2); color: var(--ink-3); }
.ach b { font-size: 13px; font-weight: 600; line-height: 1.2; }
.ach span { font-size: 11px; color: var(--ink-2); }

/* Чат кинолога */
.msg { display: flex; flex-direction: column; gap: 4px; }
.msg.me { align-items: flex-end; } .msg.tr { align-items: flex-start; }
.msg .bub { max-width: 84%; padding: 11px 14px; border-radius: 20px 20px 20px 6px; background: var(--surface); font-size: 15px; line-height: 1.4; text-wrap: pretty; }
.msg.me .bub { border-radius: 20px 20px 6px 20px; background: var(--accent); color: var(--on-accent); }
.msg .meta { font-size: 11px; color: var(--ink-2); padding: 0 6px; }
.composer { padding: 10px 12px calc(16px + env(safe-area-inset-bottom)); background: var(--surface); border-radius: 24px 24px 0 0; display: flex; flex-direction: column; gap: 8px; box-shadow: 0 -4px 16px rgba(44, 37, 64, .06); }
.composer .in { display: flex; align-items: center; gap: 8px; }
.composer input, .cmt-in { flex: 1; min-width: 0; height: 48px; border-radius: 999px; background: var(--bg); padding: 0 18px; font-size: 15px; }
.send { width: 48px; height: 48px; border-radius: 50%; background: var(--accent); color: var(--on-accent); display: flex; align-items: center; justify-content: center; flex: none; }
.send.off { background: var(--dash); pointer-events: none; }

/* Вход */
.auth { min-height: 100dvh; box-sizing: border-box; display: flex; flex-direction: column; padding: calc(40px + env(safe-area-inset-top)) 20px 30px; gap: 14px; }
.auth .logo { width: 84px; height: 84px; border-radius: 28px; background: linear-gradient(140deg, #D9CCF6, #FBC9A6); display: flex; align-items: center; justify-content: center; color: #2C2540; margin-bottom: 8px; }
.auth .logo .ms { font-size: 44px; }
.auth h1 { margin: 0; font-size: 32px; line-height: 1.1; font-weight: 600; }
.auth p { margin: 0; color: var(--ink-2); font-size: 15px; }
.auth .links { display: flex; justify-content: space-between; padding: 0 6px; }
.dots { display: flex; gap: 6px; justify-content: center; }
.dots i { width: 8px; height: 8px; border-radius: 4px; background: var(--dash); transition: width .2s; }
.dots i.on { width: 22px; background: var(--accent); }

/* Печать отчёта */
@media print { body { background: #fff; } }
