/* «Ну и?» — ежедневник-трекер. Направление «Сорбет»: холодный белый, пастель по сферам, тёмно-сливовый текст. */
@font-face { font-family: "Onest"; src: url(/fonts/onest-cyrillic-wght-normal.woff2) format("woff2"); font-weight: 100 900; font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Onest"; src: url(/fonts/onest-latin-wght-normal.woff2) format("woff2"); font-weight: 100 900; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Unbounded"; src: url(/fonts/unbounded-cyrillic-wght-normal.woff2) format("woff2"); font-weight: 200 900; font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Unbounded"; src: url(/fonts/unbounded-latin-wght-normal.woff2) format("woff2"); font-weight: 200 900; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Caveat"; src: url(/fonts/caveat-cyrillic-wght-normal.woff2) format("woff2"); font-weight: 400 700; font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Caveat"; src: url(/fonts/caveat-latin-wght-normal.woff2) format("woff2"); font-weight: 400 700; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --bg: #F7F6FB; --surface: #FFFFFF; --surface-2: #EFEDF6; --line: #E4E1EE;
  --ink: #231F33; --ink-2: #5E5872; --ink-3: #8E88A1; --accent: #6E56CF; --accent-ink: #FFFFFF;
  --danger: #C2410C;
  --lilac: #E6DEFF; --lilac-s: #7B5CE0;
  --rose: #FFDCE8; --rose-s: #C93D74;
  --mint: #D5F2E6; --mint-s: #23845F;
  --cream: #FFF1C2; --cream-s: #9A7400;
  --sky: #DCEBFF; --sky-s: #2F6BC0;
  --peach: #FFE2D3; --peach-s: #C25A2C;
  --shadow: 0 12px 32px rgba(35, 31, 51, .12);
  --r-lg: 24px; --r-md: 16px; --r-sm: 12px;
  --ff: "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ff-d: "Unbounded", "Onest", system-ui, sans-serif;
  --ff-h: "Caveat", "Onest", cursive;
  --tab-h: 64px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #15131C; --surface: #1E1B27; --surface-2: #272333; --line: #332E42;
    --ink: #F2EFFA; --ink-2: #B5AEC8; --ink-3: #8A839E; --accent: #A08CF0; --accent-ink: #15131C; --danger: #FB923C;
    --lilac: rgba(140,112,240,.20); --lilac-s: #A992FF;
    --rose: rgba(232,92,146,.20); --rose-s: #F28AB3;
    --mint: rgba(52,178,130,.20); --mint-s: #5DD3A6;
    --cream: rgba(214,170,30,.20); --cream-s: #E8C455;
    --sky: rgba(70,140,230,.20); --sky-s: #7FB2F5;
    --peach: rgba(235,120,70,.20); --peach-s: #F5A07A;
    --shadow: none; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #15131C; --surface: #1E1B27; --surface-2: #272333; --line: #332E42;
  --ink: #F2EFFA; --ink-2: #B5AEC8; --ink-3: #8A839E; --accent: #A08CF0; --accent-ink: #15131C; --danger: #FB923C;
  --lilac: rgba(140,112,240,.20); --lilac-s: #A992FF;
  --rose: rgba(232,92,146,.20); --rose-s: #F28AB3;
  --mint: rgba(52,178,130,.20); --mint-s: #5DD3A6;
  --cream: rgba(214,170,30,.20); --cream-s: #E8C455;
  --sky: rgba(70,140,230,.20); --sky-s: #7FB2F5;
  --peach: rgba(235,120,70,.20); --peach-s: #F5A07A;
  --shadow: none; color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.45 var(--ff);
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; overscroll-behavior-y: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; touch-action: manipulation; }
input, textarea, select { font-size: 16px; }   /* меньше 16 — iOS приближает страницу при фокусе */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
svg.i { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.num { font-variant-numeric: tabular-nums; }

.boot { min-height: 100vh; display: grid; place-items: center; font: 600 28px var(--ff-d); color: var(--ink-3); }

/* ---------- каркас ---------- */
.page { max-width: 560px; margin: 0 auto; padding: calc(env(safe-area-inset-top) + 18px) 16px calc(var(--tab-h) + env(safe-area-inset-bottom) + 28px); }
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom); }
.tabbar nav { max-width: 560px; margin: 0 auto; display: grid; grid-template-columns: repeat(4, 1fr); height: var(--tab-h); }
.tabbar button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; font-weight: 500; color: var(--ink-3); }
.tabbar button[aria-current="page"] { color: var(--accent); }
.tabbar button[aria-current="page"] svg.i { stroke-width: 2.2; }

h1, h2, h3 { margin: 0; font-weight: 600; }
.title { font: 600 26px/1.15 var(--ff-d); letter-spacing: -.01em; }
.sub { color: var(--ink-2); font-size: 15px; margin-top: 4px; }
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 6px 0 18px; }
.head .act { flex: none; }
.icon-btn { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 999px; color: var(--ink-2); }
.icon-btn:active { background: var(--surface-2); }

.sec { margin-top: 28px; }
.sec-h { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 0 4px 10px; }
.sec-h h2 { font: 600 15px/1.2 var(--ff-d); letter-spacing: .01em; }
.sec-h .meta { color: var(--ink-3); font-size: 13px; }
.link { color: var(--accent); font-weight: 500; }
.sec-h .link { font-size: 14px; padding: 6px 0; }

.group { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.group > * + * { border-top: 1px solid var(--line); }
.empty { padding: 18px 16px; color: var(--ink-3); font-size: 15px; }

/* ---------- лента недели ---------- */
.week { display: grid; grid-template-columns: 32px repeat(7, 1fr) 32px; align-items: center; margin: 0 -8px; touch-action: pan-y; }
.week .nav { height: 56px; display: grid; place-items: center; color: var(--ink-3); }
.week .nav:disabled { opacity: .3; }
.wd { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 4px 0; border-radius: 14px; }
.wd .l { font-size: 11px; color: var(--ink-3); text-transform: lowercase; }
.wd .ring { position: relative; width: 38px; height: 38px; }
.wd .ring svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.wd .ring circle { fill: none; stroke-width: 3; }
.wd .ring .bg { stroke: var(--line); }
.wd .ring .fg { stroke: var(--accent); stroke-linecap: round; transition: stroke-dashoffset .4s ease; }
.wd .ring b { position: absolute; inset: 0; display: grid; place-items: center; font: 500 14px var(--ff); }
.wd.today .ring b { color: var(--accent); font-weight: 700; }
.wd[aria-current="date"] { background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.wd.rest .ring .bg { stroke-dasharray: 2 4; }
.wd:disabled { opacity: .35; }

/* ---------- разбор (ругань/похвала) ---------- */
.verdict { margin-top: 20px; position: relative; padding: 20px 18px 16px; border-radius: var(--r-lg); background: var(--v-bg, var(--lilac)); color: var(--ink); overflow: hidden; }
.verdict .k { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--v-s, var(--lilac-s)); }
.verdict q { display: block; quotes: none; margin-top: 10px; font: 600 19px/1.32 var(--ff-d); letter-spacing: -.005em; }
.verdict ul { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 6px; }
.verdict li { display: flex; gap: 10px; align-items: baseline; font-size: 14px; color: var(--ink-2); }
.verdict li .lv { flex: none; font: 600 12px var(--ff-d); color: var(--v-s, var(--lilac-s)); min-width: 6.2em; white-space: nowrap; }
.verdict .row { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.verdict.good { --v-bg: var(--mint); --v-s: var(--mint-s); }
.verdict.warn { --v-bg: var(--peach); --v-s: var(--peach-s); }
.verdict.bad { --v-bg: var(--rose); --v-s: var(--rose-s); }
.verdict.soft { --v-bg: var(--sky); --v-s: var(--sky-s); }
.verdict.slim { padding: 14px 16px 12px; margin-top: 10px; }
.verdict.slim q { font: 600 15px/1.35 var(--ff); margin-top: 6px; }
.verdict .x { position: absolute; top: 8px; right: 8px; }

/* ---------- привычки ---------- */
.habit { position: relative; display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 10px 10px 10px 12px; isolation: isolate; }
.habit::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--h-bg); transform-origin: left center;
  transform: scaleX(var(--p, 0)); transition: transform .28s cubic-bezier(.3,.7,.2,1); opacity: .9; }
.habit .chip { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--h-bg); color: var(--h-s); flex: none; }
.habit.done .chip { background: var(--h-s); color: var(--surface); }
.habit .t { flex: 1; min-width: 0; }
.habit .t b { display: block; font-weight: 500; font-size: 16px; line-height: 1.25; }
.habit .t small { display: block; color: var(--ink-3); font-size: 13px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.habit.done .t small { color: var(--ink-2); }
.habit.off { opacity: .55; }
.a-lilac { --h-bg: var(--lilac); --h-s: var(--lilac-s); }
.a-rose { --h-bg: var(--rose); --h-s: var(--rose-s); }
.a-mint { --h-bg: var(--mint); --h-s: var(--mint-s); }
.a-cream { --h-bg: var(--cream); --h-s: var(--cream-s); }
.a-sky { --h-bg: var(--sky); --h-s: var(--sky-s); }
.a-peach { --h-bg: var(--peach); --h-s: var(--peach-s); }

.tick { width: 44px; height: 44px; flex: none; display: grid; place-items: center; }
.tick svg { width: 32px; height: 32px; }
.tick circle { fill: var(--surface); stroke: var(--line); stroke-width: 2; transition: fill .2s, stroke .2s; }
.tick path { fill: none; stroke: var(--surface); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 20; stroke-dashoffset: 20; transition: stroke-dashoffset .25s ease .05s; }
.habit.done .tick circle { fill: var(--h-s); stroke: var(--h-s); }
.habit.done .tick path { stroke-dashoffset: 0; }
.tick:active svg { transform: scale(.92); }
.pop { animation: pop .34s cubic-bezier(.34,1.56,.64,1); }
@keyframes pop { 0% { transform: scale(.9); } 100% { transform: scale(1); } }

.counter { display: flex; align-items: center; gap: 2px; flex: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.counter button { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: var(--h-s); }
.counter button:active { background: var(--h-bg); }
.counter button:disabled { opacity: .3; }
.counter .v { min-width: 44px; text-align: center; font: 600 16px var(--ff-d); font-variant-numeric: tabular-nums; padding: 8px 2px; border-radius: 10px; }
.counter .v:active { background: var(--surface-2); }
.timer-on .chip { animation: breathe 1.6s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(.9); } }

/* ---------- кнопки и поля ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 20px; border-radius: var(--r-sm);
  background: var(--accent); color: var(--accent-ink); font-weight: 600; font-size: 16px; }
.btn:active { filter: brightness(.94); }
.btn:disabled { opacity: .5; }
.btn.ghost { background: var(--surface-2); color: var(--ink); }
.btn.line { background: transparent; box-shadow: inset 0 0 0 1px var(--line); color: var(--ink); }
.btn.small { min-height: 38px; padding: 0 14px; font-size: 14px; border-radius: 10px; }
.btn.danger { background: transparent; color: var(--danger); box-shadow: inset 0 0 0 1px var(--line); }
.btn.wide { width: 100%; }
.field { display: grid; gap: 6px; }
.field > span { font-size: 13px; color: var(--ink-2); font-weight: 500; }
.field small { color: var(--ink-3); font-size: 13px; }
.inp { width: 100%; min-height: 48px; padding: 12px 14px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--surface); outline: none; }
.inp:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
textarea.inp { min-height: 96px; resize: vertical; line-height: 1.5; }
.seg { display: flex; padding: 3px; gap: 3px; background: var(--surface-2); border-radius: 999px; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button { flex: 1 0 auto; min-height: 38px; padding: 0 14px; border-radius: 999px; font-size: 14px; font-weight: 500; color: var(--ink-2); white-space: nowrap; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.days7 { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.days7 button { min-height: 44px; border-radius: 12px; background: var(--surface-2); font-weight: 500; color: var(--ink-2); }
.days7 button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.stack { display: grid; gap: 16px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.err { color: var(--danger); font-size: 14px; min-height: 1.2em; }

/* ---------- задачи ---------- */
.task { display: flex; align-items: center; gap: 4px; min-height: 52px; padding: 4px 6px 4px 4px; }
.task .box { width: 44px; height: 44px; display: grid; place-items: center; flex: none; }
.task .box span { width: 22px; height: 22px; border-radius: 7px; border: 2px solid var(--ink-3); display: grid; place-items: center; transition: background .15s, border-color .15s; }
.task .box svg { width: 14px; height: 14px; stroke: var(--surface); stroke-width: 3; opacity: 0; }
.task.done .box span, .task.picked .box span { background: var(--accent); border-color: var(--accent); }
.task.done .box svg, .task.picked .box svg { opacity: 1; }
.task .txt { flex: 1; min-width: 0; padding: 8px 0; overflow-wrap: anywhere; }
.task.done .txt { color: var(--ink-3); text-decoration: line-through; text-decoration-color: var(--ink-3); }
.task.main .txt { font-weight: 600; }
.task .more { width: 40px; height: 40px; display: grid; place-items: center; color: var(--ink-3); border-radius: 10px; }
.add-row { display: flex; align-items: center; gap: 4px; padding: 4px 6px 4px 4px; }
.add-row .plus { width: 44px; height: 44px; display: grid; place-items: center; color: var(--ink-3); flex: none; }
.add-row input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; min-height: 48px; padding: 0; }
.tails { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; background: var(--surface-2); border-radius: var(--r-sm); margin-bottom: 10px; font-size: 14px; color: var(--ink-2); }

/* ---------- вечер ---------- */
.scale { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.scale button { min-height: 52px; border-radius: 14px; background: var(--surface-2); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font-size: 11px; color: var(--ink-2); padding: 4px 0; }
.scale button i { width: 14px; height: 14px; border-radius: 999px; background: var(--c); display: block; }
.scale button[aria-pressed="true"] { background: var(--c); color: #231F33; font-weight: 600; }
.scale button[aria-pressed="true"] i { background: #231F33; opacity: .7; }
.ev { padding: 16px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
.ev .lbl { font-size: 13px; font-weight: 500; color: var(--ink-2); margin-bottom: 8px; display: block; }
.hand { font-family: var(--ff-h); font-size: 22px; line-height: 1.3; }
textarea.hand { background: repeating-linear-gradient(transparent 0 28px, var(--line) 28px 29px); background-attachment: local; line-height: 29px; padding-top: 6px; }
.grat { display: grid; gap: 6px; }
.grat input { border: 0; border-bottom: 1px solid var(--line); background: transparent; outline: 0; min-height: 40px; padding: 0 2px; }
.grat input:focus { border-color: var(--accent); }
.rest-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.saved { font-size: 12px; color: var(--ink-3); transition: opacity .3s; }

/* ---------- вес ---------- */
.weigh { display: grid; grid-template-columns: 1fr auto auto auto; align-items: center; column-gap: 4px; row-gap: 2px; padding: 12px 8px 12px 16px; }
.weigh .note { grid-column: 1 / -1; color: var(--ink-3); font-size: 13px; }
.weigh .big { font: 600 28px var(--ff-d); font-variant-numeric: tabular-nums; }
.weigh .big small { font: 500 14px var(--ff); color: var(--ink-3); margin-left: 4px; }
.weigh input { width: 92px; text-align: center; margin-right: 2px; }

/* ---------- прогресс ---------- */
.stat-line { display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px; }
.stat-line::-webkit-scrollbar { display: none; }
.stat { flex: 1 0 128px; padding: 14px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line); }
.stat b { display: block; font: 600 26px/1.1 var(--ff-d); font-variant-numeric: tabular-nums; }
.stat span { display: block; font-size: 13px; color: var(--ink-2); margin-top: 6px; line-height: 1.3; }
.heat { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, auto); grid-template-columns: 22px; grid-auto-columns: minmax(0, 1fr); gap: 3px; padding: 4px 14px 12px; }
.heat b { font: 500 10px/1 var(--ff); color: var(--ink-3); align-self: center; }
.heat-m { display: grid; grid-template-columns: 22px repeat(17, minmax(0, 1fr)); gap: 3px; padding: 12px 14px 0; font-size: 10px; color: var(--ink-3); white-space: nowrap; }
.heat i { aspect-ratio: 1; border-radius: 3px; background: var(--surface-2); display: block; }
.heat i[data-l="1"] { background: color-mix(in srgb, var(--accent) 25%, var(--surface-2)); }
.heat i[data-l="2"] { background: color-mix(in srgb, var(--accent) 50%, var(--surface-2)); }
.heat i[data-l="3"] { background: color-mix(in srgb, var(--accent) 75%, var(--surface-2)); }
.heat i[data-l="4"] { background: var(--accent); }
.heat i[data-l="r"] { background: repeating-linear-gradient(45deg, var(--surface-2) 0 3px, var(--line) 3px 5px); }
.heat i.fut { visibility: hidden; }
.legend { display: flex; align-items: center; gap: 4px; justify-content: flex-end; padding: 0 14px 12px; font-size: 12px; color: var(--ink-3); }
.legend i { width: 12px; height: 12px; border-radius: 3px; display: block; }
.hstat { padding: 14px 14px 12px; display: grid; gap: 10px; }
.hstat .top { display: flex; align-items: center; gap: 12px; }
.hstat .top .t { flex: 1; min-width: 0; }
.hstat .top b { display: block; font-weight: 500; }
.hstat .top small { color: var(--ink-3); font-size: 13px; }
.hstat .pct { font: 600 18px var(--ff-d); color: var(--h-s); font-variant-numeric: tabular-nums; }
.bar { height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--h-s); border-radius: inherit; }
.strip { display: grid; grid-template-columns: repeat(28, 1fr); gap: 2px; }
.strip i { aspect-ratio: 1; border-radius: 3px; background: var(--surface-2); display: block; }
.strip i.y { background: var(--h-s); }
.strip i.p { background: color-mix(in srgb, var(--h-s) 45%, var(--surface-2)); }
.strip i.n { background: transparent; box-shadow: inset 0 0 0 1px var(--line); }
.strip i.r { background: repeating-linear-gradient(45deg, var(--surface-2) 0 2px, var(--line) 2px 4px); }
.chart { padding: 8px 6px 4px; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart .ax { font: 500 11px var(--ff); fill: var(--ink-3); }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .pt { fill: var(--ink-3); opacity: .45; }
.chart .trend { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.chart .goal { stroke: var(--rose-s); stroke-width: 1.5; stroke-dasharray: 5 5; }
.chart .goal-t { font: 600 11px var(--ff); fill: var(--rose-s); }
.chart .fc { fill: none; stroke: var(--accent); stroke-width: 2; stroke-dasharray: 2 5; stroke-linecap: round; opacity: .7; }
.wsum { padding: 0 16px 14px; color: var(--ink-2); font-size: 14px; }
.wsum b { color: var(--ink); }
.journal { padding: 14px 16px; }
.journal time { font-size: 12px; color: var(--ink-3); font-weight: 500; letter-spacing: .02em; }
.journal p { margin: 4px 0 0; }

/* ---------- список привычек ---------- */
.hrow { display: flex; align-items: center; gap: 12px; padding: 10px 6px 10px 12px; min-height: 60px; }
.hrow .t { flex: 1; min-width: 0; }
.hrow .t b { display: block; font-weight: 500; }
.hrow .t small { display: block; color: var(--ink-3); font-size: 13px; }
.hrow .chip { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: var(--h-bg); color: var(--h-s); flex: none; }
.hrow .mv { display: flex; flex-direction: column; }
.hrow .mv button { width: 36px; height: 24px; display: grid; place-items: center; color: var(--ink-3); }
.hrow .mv svg.i { width: 18px; height: 18px; }

/* ---------- профиль ---------- */
.prow { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; min-height: 56px; width: 100%; text-align: left; }
.prow .v { color: var(--ink-3); font-size: 15px; }
.prow.st { flex-direction: column; align-items: stretch; gap: 10px; }
.mode { display: grid; gap: 8px; padding: 12px; }
.mode button { text-align: left; padding: 12px 14px; border-radius: var(--r-sm); background: var(--surface-2); display: grid; gap: 2px; }
.mode button b { font-weight: 600; }
.mode button span { color: var(--ink-2); font-size: 14px; }
.mode button[aria-pressed="true"] { background: var(--lilac); box-shadow: inset 0 0 0 2px var(--lilac-s); }

/* ---------- вход ---------- */
.login { min-height: 100vh; min-height: 100dvh; display: grid; align-content: center; padding: 32px 20px; max-width: 420px; margin: 0 auto; }
.login .mark { font: 700 64px/0.95 var(--ff-d); letter-spacing: -.03em; }
.login .mark em { font-style: normal; color: var(--accent); }
.login .tag { color: var(--ink-2); margin: 14px 0 34px; font-size: 17px; max-width: 18em; }
.blobs { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.blobs i { position: absolute; border-radius: 50%; filter: blur(40px); opacity: .75; }

/* ---------- шторка ---------- */
.scrim { position: fixed; inset: 0; z-index: 40; background: rgba(21, 19, 28, .38); animation: fade .2s ease; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 41; max-height: 92vh; max-height: 92dvh; overflow-y: auto; overscroll-behavior: contain;
  background: var(--surface); border-radius: var(--r-lg) var(--r-lg) 0 0; box-shadow: var(--shadow);
  padding: 8px 16px calc(env(safe-area-inset-bottom) + 20px); animation: up .26s cubic-bezier(.2,.8,.2,1); }
@media (min-width: 600px) { .sheet { left: 50%; right: auto; width: 520px; transform: translateX(-50%); bottom: 24px; border-radius: var(--r-lg); animation: fade .2s ease; } }
.sheet .grab { width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 4px auto 12px; }
.sheet h3 { font: 600 20px/1.2 var(--ff-d); margin-bottom: 18px; }
.sheet .foot { display: flex; gap: 10px; margin-top: 22px; }
.sheet .foot .btn { flex: 1; }
@keyframes up { from { transform: translateY(40px); opacity: .4; } }
@keyframes fade { from { opacity: 0; } }

#toast { position: fixed; left: 50%; bottom: calc(var(--tab-h) + env(safe-area-inset-bottom) + 14px); z-index: 60; transform: translate(-50%, 20px);
  max-width: min(92vw, 440px); padding: 12px 16px; border-radius: 14px; background: var(--ink); color: var(--bg); font-size: 15px; line-height: 1.35;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .25s cubic-bezier(.2,.8,.2,1); }
#toast.on { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
#toast button { color: var(--accent); font-weight: 600; margin-left: 12px; }
#confetti { position: fixed; inset: 0; z-index: 70; pointer-events: none; width: 100%; height: 100%; }

.timer-pill { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--tab-h) + env(safe-area-inset-bottom) + 12px); z-index: 25;
  display: flex; align-items: center; gap: 10px; padding: 6px 6px 6px 16px; border-radius: 999px; background: var(--ink); color: var(--bg); font-size: 15px; box-shadow: var(--shadow); }
.timer-pill b { font: 600 16px var(--ff-d); font-variant-numeric: tabular-nums; }
.timer-pill button { background: var(--accent); color: var(--accent-ink); border-radius: 999px; min-height: 36px; padding: 0 14px; font-weight: 600; font-size: 14px; }

.twister { padding: 16px; }
.twister p { margin: 0; font: 500 18px/1.4 var(--ff); }
.twister .row { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; color: var(--ink-3); font-size: 13px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
