/* Onest (SIL Open Font License 1.1), лежит рядом — не зависим от Google Fonts */
@font-face {
  font-family: "Onest";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(fonts/onest-cyrillic.woff2) format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Onest";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(fonts/onest-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --paper: #F3F5F7;
  --surface: #FFFFFF;
  --ink: #18222E;
  --ink-2: #5B6773;
  --ink-3: #95A0AB;
  --line: #E3E7EB;
  --green: #0F7B5F;
  --green-soft: #E2F2EC;
  --amber: #D98E1F;
  --amber-soft: #FBF0DD;
  --bead-idle: #D5DBE1;
  --on-green: #FFFFFF;
  --shadow: 0 1px 0 rgba(24, 34, 46, .04), 0 8px 24px -16px rgba(24, 34, 46, .28);
  --r-lg: 22px;
  --r-md: 14px;
  --r-sm: 10px;
  --font: "Onest", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --paper: #101418;
  --surface: #1A2027;
  --ink: #E9EEF2;
  --ink-2: #A3AEB9;
  --ink-3: #6E7A86;
  --line: #28303A;
  --green: #3CC497;
  --green-soft: #173A30;
  --amber: #F0B04F;
  --amber-soft: #3A2D17;
  --bead-idle: #2E3742;
  --on-green: #08261D;
  --shadow: 0 1px 0 rgba(0, 0, 0, .2);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--paper);
  color: var(--ink);
  font: 400 16px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; border-radius: 8px; }
.num { font-variant-numeric: tabular-nums; letter-spacing: -.01em; white-space: nowrap; }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }
.pos { color: var(--green); }
.warn { color: var(--amber); }
[hidden] { display: none !important; }

/* --- шапка --- */
.top {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px 8px;
  background: var(--paper);
}
.wallet-switch {
  display: inline-flex; align-items: center; gap: 8px;
  border: 0; background: none; padding: 6px 2px;
  font-weight: 600; font-size: 17px;
}
.wallet-switch .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--green); }
.wallet-switch .dot.family { background: var(--amber); }
.wallet-switch .emoji { font-size: 18px; line-height: 1; }
.wallet-switch svg { color: var(--ink-3); }
.icon-btn {
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center;
  border: 0; background: var(--surface); color: var(--ink-2);
  box-shadow: var(--shadow);
}

.view { padding: 4px 16px calc(110px + var(--safe-b)); max-width: 640px; margin: 0 auto; outline: none; }

/* --- нижняя навигация --- */
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 6;
  display: grid; grid-template-columns: 1fr 1fr 72px 1fr 1fr; align-items: end;
  padding: 6px 8px calc(8px + var(--safe-b));
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
}
.tab {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  border: 0; background: none; color: var(--ink-3);
  font-size: 11px; font-weight: 500; padding: 4px 0;
}
.tab svg { width: 24px; height: 24px; }
.tab[aria-current="page"] { color: var(--ink); }
/* pull-to-refresh: индикатор вверху */
.ptr {
  position: fixed; top: -40px; left: 50%; margin-left: -110px; width: 220px; z-index: 8;
  padding: 8px 12px; border-radius: 999px; text-align: center; font-size: 13px;
  background: var(--surface); color: var(--ink-3); border: 1px solid var(--line);
  opacity: 0; pointer-events: none; transition: opacity .15s;
}
.ptr.show { opacity: 1; }
.ptr.ready { color: var(--ink); }
/* группа: две вкладки — «Итог» слева, «Траты» справа от «+» */
.tabs.group { grid-template-columns: 1fr 72px 1fr; }
.tabs.group .tab[data-tab="home"] { order: 0; }
.tabs.group .fab { order: 1; }
.tabs.group .tab[data-tab="ops"] { order: 2; }
.fab {
  justify-self: center; width: 56px; height: 56px; margin-bottom: 4px;
  border-radius: 50%; border: 0;
  background: var(--green); color: var(--on-green);
  display: grid; place-items: center;
  box-shadow: 0 10px 22px -10px var(--green);
}
.fab svg { width: 26px; height: 26px; }
.fab:active { transform: scale(.94); }

/* --- блоки --- */
.block { margin-top: 18px; }
.trial-banner { display: flex; align-items: center; gap: 10px; width: 100%; margin-top: 12px; padding: 10px 14px; border: 0; background: var(--green-soft); color: var(--ink); font: inherit; font-size: 14px; font-weight: 600; text-align: left; cursor: pointer; }
.trial-banner .tx { flex: 1; min-width: 0; }
.trial-banner .chev { color: var(--green); font-size: 20px; line-height: 1; }
.block-head { display: flex; align-items: baseline; justify-content: space-between; margin: 0 2px 8px; }
.block-head h2 { margin: 0; font-size: 15px; font-weight: 600; color: var(--ink-2); }
.link { border: 0; background: none; color: var(--green); font-weight: 500; font-size: 14px; padding: 4px 0; }
.panel { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.panel.pad { padding: 16px; }

/* --- главный экран: счёты --- */
.hero { padding: 20px 18px 18px; }
.hero-label { font-size: 14px; color: var(--ink-2); }
.hero-sum { font-size: 44px; line-height: 1.05; font-weight: 700; margin: 6px 0 2px; }
.hero-sum.over { color: var(--amber); }
.hero-sub { font-size: 14px; color: var(--ink-2); }
.abacus { margin-top: 18px; }
.abacus-rod { position: relative; display: flex; gap: 4px; align-items: center; padding: 6px 0; }
.abacus-rod::before {
  content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 2px; margin-top: -1px;
  background: var(--line);
}
.bead {
  position: relative; flex: 1 1 0; height: 16px; max-width: 26px; border-radius: 8px;
  background: var(--bead-idle);
}
.bead.done { background: var(--ink); opacity: .82; }
.bead.today { background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.bead.pay { background: var(--amber); }
.bead.income { background: transparent; border: 2px solid var(--green); }
.abacus-legend { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-3); margin-top: 6px; }
.hero-cta { margin-top: 14px; }
.hero-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.hero-meta div { font-size: 13px; color: var(--ink-2); }
.hero-meta b { display: block; font-size: 17px; color: var(--ink); font-weight: 600; }

.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat { padding: 14px 16px; }
.stat .k { font-size: 13px; color: var(--ink-2); }
.stat .v { font-size: 20px; font-weight: 650; margin-top: 2px; }

/* счета — горизонтальная лента */
.accounts { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -16px; padding: 2px 16px 6px; scrollbar-width: none; }
.accounts::-webkit-scrollbar { display: none; }
.acc {
  flex: 0 0 auto; min-width: 140px; scroll-snap-align: start;
  padding: 12px 14px; border: 0; text-align: left;
  background: var(--surface); border-radius: var(--r-md); box-shadow: var(--shadow);
}
.acc .n { font-size: 13px; color: var(--ink-2); max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acc .b { font-size: 17px; font-weight: 600; margin-top: 2px; }
.acc.add { display: grid; place-items: center; min-width: 64px; color: var(--green); font-size: 26px; background: transparent; box-shadow: inset 0 0 0 1.5px var(--line); }

/* --- строки списков --- */
.rows { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow); overflow: hidden; }
.row {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 12px 16px; border: 0; background: none; text-align: left;
}
.row + .row { border-top: 1px solid var(--line); }
.row:active { background: color-mix(in srgb, var(--ink) 5%, transparent); }
.ico {
  flex: 0 0 40px; height: 40px; border-radius: 12px;
  display: grid; place-items: center; font-size: 19px;
  background: var(--paper);
}
.ico.letter { font-weight: 700; font-size: 17px; color: var(--green); background: var(--green-soft); }
.row .main { flex: 1; min-width: 0; }
.row .t { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .s { font-size: 13px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .amt { font-weight: 600; text-align: right; }
.row .amt small { display: block; font-weight: 400; font-size: 12px; color: var(--ink-3); }
.row .amt small.pos { color: var(--green); }
.row .amt small.warn { color: var(--amber); }
.day-head { display: flex; justify-content: space-between; font-size: 13px; color: var(--ink-2); margin: 16px 4px 6px; }

.badge { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 99px; background: var(--amber-soft); color: var(--amber); vertical-align: 2px; }
.badge.green { background: var(--green-soft); color: var(--green); }
.badge.grey { background: var(--paper); color: var(--ink-2); }

/* --- сегменты --- */
.seg { display: flex; gap: 4px; padding: 4px; background: color-mix(in srgb, var(--ink) 6%, transparent); border-radius: 12px; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button { flex: 1 0 auto; border: 0; background: none; padding: 7px 12px; border-radius: 9px; 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 3px rgba(0,0,0,.08); }

/* --- отчёт --- */
.report-total { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px; }
.report-total > div { min-width: 0; max-width: 100%; }
.report-total .big { font-size: clamp(24px, 8vw, 32px); font-weight: 700; line-height: 1.1; overflow-wrap: anywhere; }
.delta { font-size: 13px; }
.bars { margin-top: 16px; display: grid; gap: 12px; }
.bar-row { display: grid; grid-template-columns: 26px 1fr auto; gap: 4px 10px; align-items: center; border: 0; background: none; padding: 0; text-align: left; width: 100%; }
.bar-row .e { font-size: 18px; grid-row: span 2; }
.bar-row .l { font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-row .v { font-size: 14px; font-weight: 600; }
.track { grid-column: 2 / 4; height: 6px; border-radius: 3px; background: var(--paper); overflow: hidden; position: relative; }
.track i { display: block; height: 100%; border-radius: 3px; background: var(--ink); opacity: .8; }
.track i.over { background: var(--amber); opacity: 1; }
.track .limit { position: absolute; top: -2px; bottom: -2px; width: 2px; background: var(--amber); }
.spark { display: flex; align-items: flex-end; gap: 2px; height: 56px; margin-top: 14px; }
.spark i { flex: 1; background: var(--bead-idle); border-radius: 2px 2px 0 0; min-height: 2px; }
.spark i.on { background: var(--ink); opacity: .75; }

/* --- пустые состояния --- */
.empty { padding: 26px 18px; text-align: center; color: var(--ink-2); }
.empty p { margin: 0 0 12px; }
.locked { padding: 18px; display: grid; gap: 10px; }
.locked h3 { margin: 0; font-size: 17px; }
.locked p { margin: 0; color: var(--ink-2); font-size: 14px; }

/* --- кнопки --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 18px; border-radius: var(--r-md); border: 0;
  background: var(--green); color: var(--on-green); font-weight: 600; font-size: 16px;
}
.btn.block-btn { width: 100%; }
.btn.ghost { background: color-mix(in srgb, var(--ink) 6%, transparent); color: var(--ink); }
.btn.danger { background: var(--amber-soft); color: var(--amber); }
.btn.small { min-height: 38px; font-size: 14px; padding: 0 14px; border-radius: 11px; }
.btn:disabled { opacity: .5; }
.btn-row { display: flex; gap: 8px; }
.btn-row > * { flex: 1; }

/* --- нижний лист --- */
.sheet-layer { position: fixed; inset: 0; z-index: 20; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(10, 16, 22, .42); animation: fade .18s ease-out; }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0;
  max-height: 92vh; overflow-y: auto; overscroll-behavior: contain;
  background: var(--surface); border-radius: 24px 24px 0 0;
  padding: 8px 16px calc(20px + var(--safe-b));
  animation: rise .24s cubic-bezier(.2, .8, .2, 1);
  max-width: 640px; margin: 0 auto;
}
.sheet .grip { width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 2px auto 10px; }
.sheet h2 { margin: 4px 0 14px; font-size: 20px; font-weight: 650; }
.sheet .sub { margin: -8px 0 14px; color: var(--ink-2); font-size: 14px; }
@keyframes rise { from { transform: translateY(40px); opacity: .4; } }
@keyframes fade { from { opacity: 0; } }

/* --- формы --- */
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field > span { font-size: 13px; color: var(--ink-2); font-weight: 500; }
.input, .select, textarea.input {
  width: 100%; min-height: 48px; padding: 11px 14px;
  border: 1.5px solid var(--line); border-radius: var(--r-md); background: var(--paper);
  outline: none; font-size: 16px;
}
.input:focus, .select:focus { border-color: var(--green); }
.amount-input { font-size: 34px; font-weight: 700; text-align: center; min-height: 64px; background: transparent; border: 0; border-bottom: 2px solid var(--line); border-radius: 0; }
.amount-input:focus { border-color: var(--green); }
.hint { font-size: 13px; color: var(--ink-3); margin: -6px 0 12px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 14px; }
.cat {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 10px 2px 8px; border-radius: var(--r-md); border: 1.5px solid transparent;
  background: var(--paper); font-size: 11.5px; line-height: 1.2; text-align: center; color: var(--ink-2);
}
.cat .e { font-size: 21px; }
.cat[aria-pressed="true"] { border-color: var(--green); background: var(--green-soft); color: var(--ink); }
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.toggle input { width: 46px; height: 28px; appearance: none; -webkit-appearance: none; border-radius: 14px; background: var(--bead-idle); position: relative; transition: background .15s; flex: 0 0 auto; }
.toggle input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.toggle input:checked { background: var(--green); }
.toggle input:checked::after { transform: translateX(18px); }
.choice { display: grid; gap: 6px; margin-bottom: 14px; }
.choice button { text-align: left; padding: 12px 14px; border-radius: var(--r-md); border: 1.5px solid var(--line); background: none; }
.choice button b { display: block; font-weight: 600; font-size: 15px; }
.choice button span { font-size: 13px; color: var(--ink-2); }
.choice button[aria-pressed="true"] { border-color: var(--green); background: var(--green-soft); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips button { width: 44px; height: 44px; border-radius: 12px; border: 1.5px solid transparent; background: var(--paper); font-size: 22px; }
.chips button[aria-pressed="true"] { border-color: var(--green); background: var(--green-soft); }
.quick { display: flex; gap: 8px; margin-bottom: 16px; }
.quick .input { flex: 1; }
.days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-bottom: 14px; }
.days button { aspect-ratio: 1; border-radius: 50%; border: 0; background: var(--paper); font-weight: 500; font-size: 14px; }
.days button[aria-pressed="true"] { background: var(--green); color: var(--on-green); }
.kv { display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; margin: 0 0 16px; font-size: 15px; }
.kv dt { color: var(--ink-2); }
.kv dd { margin: 0; text-align: right; font-weight: 500; }
.note { font-size: 12.5px; color: var(--ink-3); margin: 10px 0 0; }
.search-list { max-height: 46vh; overflow-y: auto; margin: 0 -16px; padding: 0 16px; }
.list-plain .row { padding-left: 2px; padding-right: 2px; }
.callout { padding: 12px 14px; border-radius: var(--r-md); background: var(--amber-soft); color: var(--ink); font-size: 14px; margin-bottom: 12px; }
.callout .btn-row { margin-top: 10px; }
.progress { height: 6px; border-radius: 3px; background: var(--paper); overflow: hidden; margin-top: 8px; }
.progress i { display: block; height: 100%; background: var(--green); }

.toast {
  position: fixed; left: 50%; bottom: calc(96px + var(--safe-b)); z-index: 30;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: 12px;
  font-size: 14px; font-weight: 500; max-width: calc(100% - 32px);
  transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast button { margin-left: 12px; border: 0; background: none; color: var(--green); font-weight: 600; }

.skeleton { height: 120px; border-radius: var(--r-lg); background: var(--surface); opacity: .6; margin-top: 12px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media (min-width: 420px) {
  .cats { grid-template-columns: repeat(5, 1fr); }
}

/* --- список покупок --- */
.shop-chk { flex: 0 0 28px; width: 28px; height: 28px; padding: 0; border-radius: 50%; border: 2px solid var(--ink-3); background: none; color: var(--on-green); font-size: 16px; line-height: 1; display: grid; place-items: center; }
.shop-chk[aria-pressed="true"] { background: var(--green); border-color: var(--green); }
.shop-main { border: 0; background: none; padding: 0; text-align: left; font: inherit; color: inherit; }
.shop-done .t { text-decoration: line-through; color: var(--ink-3); }
.shop-done .shop-main .s { text-decoration: none; }

/* deposits */
.dep-bank { font-size: 12px; color: var(--ink-3); margin-top: 1px; }
.dep-hint { margin: -6px 0 12px; }

/* ops-period */
.ops-screen > .seg { margin-bottom: 8px; }
.ops-nav { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; touch-action: pan-y; }
.ops-nav .arr { flex: 0 0 auto; width: 36px; height: 36px; border: 0; border-radius: 12px; background: var(--surface); box-shadow: var(--shadow); font-size: 18px; color: var(--ink-2); display: grid; place-items: center; padding: 0; }
.ops-nav .arr:disabled { opacity: .35; }
.ops-nav .arr.lupa[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.ops-per { flex: 1; min-width: 0; display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; background: var(--surface); box-shadow: var(--shadow); border-radius: 12px; height: 36px; padding: 0 12px; font-weight: 600; font-size: 16px; color: var(--ink); }
.ops-per .c { color: var(--ink-3); font-size: 11px; }
.ops-pk { margin: 0 0 8px; }
.ops-search { display: flex; flex-direction: column; gap: 8px; margin: 0 0 10px; }
.ops-search[hidden], .ops-search .chip-btn[hidden] { display: none !important; }
.ops-q { width: 100%; }
.chip-btn { align-self: flex-start; border: 0; padding: 7px 13px; border-radius: 99px; background: var(--surface); box-shadow: var(--shadow); color: var(--ink-2); font-size: 14px; font-weight: 500; }
.ops-years { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 8px; }
.ops-years::-webkit-scrollbar { display: none; }
.ops-years button { flex: 0 0 auto; border: 0; padding: 5px 12px; border-radius: 99px; background: var(--paper); color: var(--ink-2); font-weight: 500; font-size: 14px; }
.ops-years button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.ops-months { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; }
.ops-months button { border: 0; padding: 9px 0; border-radius: 10px; background: var(--paper); color: var(--ink); font-size: 14px; font-weight: 500; position: relative; }
.ops-months button[aria-pressed="true"] { background: var(--green); color: var(--on-green); font-weight: 600; }
.ops-months button.lock { color: var(--ink-3); }
.ops-months button.lock::after { content: "PRO"; position: absolute; top: 1px; right: 4px; font-size: 8px; font-weight: 700; color: var(--amber); }
.ops-months button:disabled { opacity: .35; }
.ops-pk-row { display: flex; gap: 5px; margin-top: 6px; }
.ops-wide { flex: 1 1 0; border: 0; padding: 9px 4px; border-radius: 10px; background: var(--paper); font-weight: 500; font-size: 13px; color: var(--ink); position: relative; white-space: nowrap; }
.ops-wide[aria-pressed="true"] { background: var(--green); color: var(--on-green); }
.ops-wide.lock { color: var(--ink-3); }
.ops-wide.lock::after { content: "PRO"; position: absolute; top: 1px; right: 4px; font-size: 8px; font-weight: 700; color: var(--amber); }
.ops-foot { font-size: 12px; color: var(--ink-3); margin-top: 6px; }
.ops-total { padding: 12px 14px; }
/* home-week */
.hw-car { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; }
.hw-car::-webkit-scrollbar { display: none; }
.hw-car > * { flex: 0 0 100%; scroll-snap-align: center; scroll-snap-stop: always; min-width: 0; }
.hw-dots { display: flex; justify-content: center; gap: 6px; margin-top: 10px; }
.hw-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--bead-idle); transition: .15s; }
.hw-dots i.on { background: var(--ink); width: 16px; border-radius: 3px; }

.hw-cap { padding: 16px 18px 12px; text-align: center; }
.hw-slide { display: block; width: 100%; border: 0; background: none; padding: 0; font: inherit; color: inherit; text-align: center; }
.hw-slide .lbl { font-size: 14px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hw-slide .big { font-size: clamp(26px, 9vw, 36px); font-weight: 700; line-height: 1.1; margin-top: 4px; overflow-wrap: anywhere; }
.hw-slide .sub { font-size: 13px; color: var(--ink-3); margin-top: 2px; }

.hw-week { margin-top: 12px; padding: 16px 18px 14px; }
.wk-label { font-size: 14px; color: var(--ink-2); display: flex; justify-content: space-between; gap: 8px; }
.wk-sum { font-size: clamp(30px, 10vw, 40px); font-weight: 700; line-height: 1.05; margin: 6px 0 2px; overflow-wrap: anywhere; }
.hw-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-top: 14px; text-align: center; }
.hw-day { display: flex; flex-direction: column; align-items: center; gap: 5px; font-size: 11px; color: var(--ink-3); min-width: 0; }
.hw-day .bead { flex: none; width: 100%; max-width: 30px; height: 16px; }
.hw-day b { font-size: 11px; font-weight: 500; color: var(--ink-2); white-space: nowrap; }
.hw-seg { display: inline-flex; gap: 2px; padding: 2px; margin-bottom: 8px; border-radius: 999px; background: var(--bead-idle); }
.hw-seg button { border: 0; background: transparent; color: var(--ink-2); font: inherit; font-size: 12px; padding: 3px 12px; border-radius: 999px; cursor: pointer; }
.hw-seg button.on { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.hw-weeks .hw-day .bead { max-width: 56px; }
.hw-week .small-line { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 13px; color: var(--ink-2); }
.hw-week .small-line b { font-size: 15px; color: var(--ink); font-weight: 600; }
.hw-week .small-line b.warn { color: var(--amber); }
.hw-sub { font-size: 12px; color: var(--ink-3); margin-top: 4px; }

.stat.tap { border: 0; font: inherit; color: inherit; text-align: left; width: 100%; min-width: 0; }
.stat.tap:active { transform: scale(.98); }
.acc.cur { box-shadow: 0 0 0 2px var(--green), var(--shadow); }

.hw-chain-card { margin-top: 12px; padding: 12px 14px 12px; }
.hw-chain-btn { display: block; width: 100%; border: 0; background: none; padding: 0; font: inherit; color: inherit; text-align: left; }
.hw-chain-btn .hd { display: flex; justify-content: space-between; align-items: baseline; }
.hw-chain-btn .hd b { font-size: 15px; font-weight: 600; }
.hw-chain-btn .hd span { font-size: 13px; color: var(--green); }
.hw-chain { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; padding: 16px 0 2px; }
.hw-chain::-webkit-scrollbar { display: none; }
.cd { flex: 0 0 auto; width: 34px; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 11px; color: var(--ink-2); position: relative; }
.cd .bead { flex: none; width: 100%; max-width: none; height: 14px; }
.cd .dw { font-size: 10px; color: var(--ink-3); }
.cd.we { color: var(--ink-3); }
.cd.we .bead { background: transparent; box-shadow: inset 0 0 0 1.5px var(--bead-idle); }
.cd.hol { color: var(--amber); font-weight: 600; }
.cd.hol .dw { color: var(--amber); }
.cd.hol .bead { background: var(--amber); }
.cd.sal { color: var(--green); font-weight: 600; }
.cd.sal .bead { background: var(--green); }
.cd.today .bead { background: var(--ink); box-shadow: 0 0 0 3px var(--green-soft); }
.cd.dot::after { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--ink); }
.cd.mon-s { margin-left: 8px; }
.cd.mon-s::before { content: attr(data-mon); position: absolute; top: -13px; left: 0; font-size: 9px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; }
.hw-chain-card .hero-meta { margin-top: 10px; padding-top: 10px; }
.hw-chain-card .hero-cta { margin-top: 10px; }

details.hw-up { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow); overflow: hidden; }
details.hw-up summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 12px 16px; cursor: pointer; }
details.hw-up summary::-webkit-details-marker { display: none; }
details.hw-up .one { flex: 1; min-width: 0; font-size: 14px; line-height: 1.3; }
details.hw-up .one b { font-weight: 600; }
details.hw-up .more-c { color: var(--ink-3); font-size: 13px; white-space: nowrap; }
details.hw-up .chev { color: var(--ink-3); transition: transform .15s; }
details.hw-up[open] .chev { transform: rotate(90deg); }
details.hw-up .rows { border-radius: 0; box-shadow: none; border-top: 1px solid var(--line); }
details.hw-up .hw-all { justify-content: center; }
.tick { flex: 0 0 auto; width: 8px; height: 8px; border-radius: 50%; background: var(--amber); }

.cal-year { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.cal-year h2 { margin: 0; font-size: 20px; font-weight: 650; }
.cal-year button { border: 0; background: var(--paper); width: 34px; height: 34px; border-radius: 50%; color: var(--ink-2); font-size: 18px; }
.cal-year button:disabled { opacity: .35; }
.cal-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.mm { background: var(--paper); border-radius: var(--r-md); padding: 6px 5px 5px; min-width: 0; }
.mm h4 { margin: 0 0 3px 2px; font-size: 11px; font-weight: 600; color: var(--ink-2); }
.mm.cur h4 { color: var(--green); }
.mm .g { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; font-size: 9.5px; line-height: 15px; }
.mm .g .w { color: var(--ink-3); font-size: 8px; line-height: 12px; }
.mm .g .e { color: var(--ink-3); }
.mm .g .h { background: var(--amber-soft); color: var(--amber); font-weight: 700; border-radius: 4px; }
.mm .g .s { position: relative; font-weight: 700; color: var(--green); }
.mm .g .s::after { content: ""; position: absolute; left: 50%; bottom: 0; width: 3px; height: 3px; margin-left: -1.5px; border-radius: 50%; background: var(--green); }
.mm .g .t { box-shadow: inset 0 0 0 1.5px var(--ink); border-radius: 4px; font-weight: 700; }
.cal-sched { margin-top: 12px; padding: 12px 14px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 14px; }
.cal-sched .l { flex: 1 1 140px; min-width: 0; }
.cal-sched small { display: block; color: var(--ink-3); font-size: 12px; }
.cal-wd { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.cal-wd button { min-width: 44px; height: 44px; border-radius: 12px; border: 1.5px solid transparent; background: var(--paper); color: var(--ink); font-size: 15px; }
.cal-wd button[aria-pressed="true"] { border-color: var(--green); background: var(--green-soft); }

/* Главная: стрелки-подсказки на карточке-карусели и легенда точки в цепочке дней */
.hw-cap { position: relative; }
.hw-arr { position: absolute; top: 50%; transform: translateY(-60%); width: 32px; height: 44px; border: 0; background: none; color: var(--ink-3); font-size: 26px; line-height: 1; padding: 0; opacity: .7; }
.hw-arr.l { left: 2px; }
.hw-arr.r { right: 2px; }
.hw-legend { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 12px; color: var(--ink-3); }
.hw-legend .lg-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--ink); flex: none; }
