/* Тема «Морозный фарфор»: кобальт и небесно-голубой, узоры гжели. Оранжевая — data-accent="orange".
   Цвета — только через переменные ниже; тёмная тема — prefers-color-scheme и data-theme. */
:root {
  --bg: #f3f7ff;
  --bg-grad: linear-gradient(180deg, #d3e5ff 0px, #e8f1ff 280px, #f3f7ff 560px);
  --card: #ffffff;
  --card-2: #e9f1ff;
  --text: #0d1a55;
  --muted: #6472ab;
  --line: #dfe7fb;
  --accent: #1844e0;
  --accent-2: #10a4ff;
  --accent-soft: #dae6ff;
  --accent-shadow: rgba(24, 68, 224, .38);
  --hero: linear-gradient(140deg, #0e28aa 0%, #1a4fea 48%, #10a4ff 100%);
  --hero-shadow: 0 14px 30px rgba(20, 58, 210, .32);
  --orn: #2246d8;
  --ico-ring: #c4d0f6;
  --ico-bg: #f2f6ff;
  --expense: #e0294d;
  --income: #1844e0;
  --transfer: #7a4fe8;
  --shadow: 0 6px 20px rgba(24, 60, 190, .08);
  --overlay: rgba(8, 20, 70, .38);
  --radius: 22px;
  --tabbar-h: 64px;
  --serif: ui-serif, "New York", Georgia, "Times New Roman", serif;
  color-scheme: light;
}
:root[data-accent="orange"] {
  --bg: #fff7f2; --bg-grad: linear-gradient(180deg, #ffe4d6 0px, #fff1e9 280px, #fff7f2 560px);
  --card-2: #fff0e8; --text: #3a2320; --muted: #957f78; --line: #f3e3da;
  --accent: #f0612e; --accent-2: #ffb03a; --accent-soft: #ffe1d4; --accent-shadow: rgba(240, 97, 46, .4);
  --hero: linear-gradient(140deg, #e2481c 0%, #f97a3a 50%, #ffb03a 100%); --hero-shadow: 0 14px 30px rgba(230, 90, 40, .3);
  --orn: #f0612e; --ico-ring: #f6d3c4; --ico-bg: #fff6f1; --income: #13996f; --transfer: #5b74f0;
  --shadow: 0 6px 20px rgba(140, 70, 40, .08); --overlay: rgba(40, 15, 5, .35);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #070f2a; --bg-grad: linear-gradient(180deg, #0f1d52 0px, #0a153c 300px, #070f2a 620px);
    --card: #0f1a46; --card-2: #17245c; --text: #eaefff; --muted: #8f9cd6; --line: #223070;
    --accent: #4d7dff; --accent-2: #2cc2ff; --accent-soft: #1b2b6c; --accent-shadow: rgba(60, 110, 255, .4);
    --hero: linear-gradient(140deg, #1a36d4 0%, #2463f6 50%, #1cb1ff 100%); --hero-shadow: 0 14px 34px rgba(30, 80, 240, .38);
    --orn: #7193ff; --ico-ring: #34438f; --ico-bg: #142056;
    --expense: #ff6987; --income: #7eaaff; --transfer: #b49cff; --shadow: 0 6px 20px rgba(0, 0, 0, .35); --overlay: rgba(0, 0, 0, .55); color-scheme: dark;
  }
  :root[data-accent="orange"]:not([data-theme="light"]) {
    --bg: #17110f; --bg-grad: linear-gradient(180deg, #2c1a12 0px, #1d1411 300px, #17110f 620px);
    --card: #241a17; --card-2: #2f231f; --text: #fbefe9; --muted: #b19c94; --line: #3b2c27;
    --accent: #ff7a45; --accent-2: #ffb03a; --accent-soft: #4a2c22; --accent-shadow: rgba(255, 110, 60, .35);
    --hero: linear-gradient(140deg, #d8441a 0%, #f2733a 50%, #f7a83a 100%); --orn: #ff8a5c; --ico-ring: #4f3a33; --ico-bg: #2c211d;
    --income: #4fd29a; --transfer: #8aa4ff;
  }
}
:root[data-theme="dark"] {
  --bg: #070f2a; --bg-grad: linear-gradient(180deg, #0f1d52 0px, #0a153c 300px, #070f2a 620px);
  --card: #0f1a46; --card-2: #17245c; --text: #eaefff; --muted: #8f9cd6; --line: #223070;
  --accent: #4d7dff; --accent-2: #2cc2ff; --accent-soft: #1b2b6c; --accent-shadow: rgba(60, 110, 255, .4);
  --hero: linear-gradient(140deg, #1a36d4 0%, #2463f6 50%, #1cb1ff 100%); --hero-shadow: 0 14px 34px rgba(30, 80, 240, .38);
  --orn: #7193ff; --ico-ring: #34438f; --ico-bg: #142056;
  --expense: #ff6987; --income: #7eaaff; --transfer: #b49cff; --shadow: 0 6px 20px rgba(0, 0, 0, .35); --overlay: rgba(0, 0, 0, .55); color-scheme: dark;
}
:root[data-theme="dark"][data-accent="orange"] {
  --bg: #17110f; --bg-grad: linear-gradient(180deg, #2c1a12 0px, #1d1411 300px, #17110f 620px);
  --card: #241a17; --card-2: #2f231f; --text: #fbefe9; --muted: #b19c94; --line: #3b2c27;
  --accent: #ff7a45; --accent-2: #ffb03a; --accent-soft: #4a2c22; --accent-shadow: rgba(255, 110, 60, .35);
  --hero: linear-gradient(140deg, #d8441a 0%, #f2733a 50%, #f7a83a 100%); --orn: #ff8a5c; --ico-ring: #4f3a33; --ico-bg: #2c211d;
  --income: #4fd29a; --transfer: #8aa4ff;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg); color: var(--text);
  font: 16px/1.35 -apple-system, BlinkMacSystemFont, "SF Pro Rounded", "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased; overscroll-behavior-y: none;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }

.screen {
  padding: calc(env(safe-area-inset-top) + 12px) 16px calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 24px);
  max-width: 640px; margin: 0 auto;
}
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; min-height: 40px; }
.topbar h1 { font-size: 26px; margin: 0; letter-spacing: -.3px; }
.month-switch { display: flex; align-items: center; gap: 4px; font-weight: 700; font-size: 18px; }
.month-switch button { width: 36px; height: 36px; border-radius: 50%; background: var(--card); box-shadow: var(--shadow); font-size: 18px; }
.month-switch span { min-width: 130px; text-align: center; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 10px; margin: 0 -16px; padding-left: 16px; padding-right: 16px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; padding: 7px 14px; border-radius: 999px; background: var(--card); box-shadow: var(--shadow); font-size: 14px; white-space: nowrap; }
.chip.on { background: var(--accent); color: #fff; }

.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin-bottom: 14px; }
.card h3 { margin: 0 0 12px; font-size: 16px; }
.summary { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.summary .big { grid-column: 1 / -1; }
.stat .label { color: var(--muted); font-size: 13px; }
.stat .val { font-weight: 700; font-size: 18px; word-break: break-word; }
.stat.big .val { font-size: 28px; }
.expense { color: var(--expense); }
.income { color: var(--income); }
.transfer { color: var(--transfer); }
.muted { color: var(--muted); }
.small { font-size: 13px; }

.day { margin-bottom: 14px; }
.day-head { display: flex; justify-content: space-between; color: var(--muted); font-size: 13px; padding: 0 6px 6px; }
.list { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; width: 100%; text-align: left; }
.row + .row { border-top: 1px solid var(--line); }
.ico { flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-size: 20px; }
.row .mid { flex: 1; min-width: 0; }
.row .title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .sub { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .amt { font-weight: 700; text-align: right; white-space: nowrap; }
.row .amt .sub { font-weight: 400; }
.chev { color: var(--muted); }

.empty { text-align: center; color: var(--muted); padding: 40px 20px; }
.empty .e { font-size: 48px; margin-bottom: 8px; }

/* Tab bar */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  background: color-mix(in srgb, var(--card) 92%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(5, 1fr); align-items: center;
}
.tab { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; color: var(--muted); }
.tab .ti { font-size: 22px; line-height: 1; filter: grayscale(1); opacity: .7; }
.tab.on { color: var(--accent); font-weight: 600; }
.tab.on .ti { filter: none; opacity: 1; }
.fab { justify-self: center; width: 56px; height: 56px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 32px; line-height: 1; box-shadow: 0 6px 18px var(--accent-shadow); transform: translateY(-14px); }

/* Sheet */
.overlay { position: fixed; inset: 0; background: var(--overlay); z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.overlay.anim { animation: fade .15s; }
.sheet.anim { animation: up .2s ease-out; }
.sheet {
  background: var(--bg); width: 100%; max-width: 640px; max-height: 94vh; overflow-y: auto; border-radius: 24px 24px 0 0;
  padding: 10px 16px calc(16px + env(safe-area-inset-bottom));
}
.sheet .grab { width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 10px; }
.sheet-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.sheet-head h2 { margin: 0; font-size: 19px; }
.link { color: var(--accent); font-weight: 600; padding: 6px; }
@keyframes up { from { transform: translateY(40px); opacity: .4; } }
@keyframes fade { from { opacity: 0; } }

.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--card-2); border-radius: 12px; padding: 3px; margin-bottom: 12px; }
.seg button { padding: 8px; border-radius: 10px; font-weight: 600; font-size: 14px; color: var(--muted); }
.seg button.on { background: var(--card); color: var(--text); box-shadow: var(--shadow); }

.amount-box { background: var(--card); border-radius: var(--radius); padding: 12px 16px; display: flex; align-items: baseline; justify-content: flex-end; gap: 8px; box-shadow: var(--shadow); margin-bottom: 10px; }
.amount-box .expr { font-size: 32px; font-weight: 700; word-break: break-all; text-align: right; }
.amount-box .cur { color: var(--muted); font-weight: 600; }
.amount-box.sel { outline: 2px solid var(--accent); }
.amount-label { font-size: 12px; color: var(--muted); margin: 0 4px 4px; }

.cat-grid { display: grid; grid-template-rows: repeat(2, auto); grid-auto-flow: column; grid-auto-columns: calc((100% - 24px) / 4.4); gap: 6px 8px; margin: 0 -16px 10px; padding: 0 16px; overflow-x: auto; scrollbar-width: none; }
.cat-grid::-webkit-scrollbar { display: none; }
.cat { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 2px; border-radius: 14px; font-size: 12px; text-align: center; }
.cat .ico { width: 44px; height: 44px; font-size: 22px; }
.cat.on { background: var(--accent-soft); }
.cat span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }

.field { display: flex; align-items: center; gap: 10px; background: var(--card); border-radius: 14px; padding: 10px 14px; margin-bottom: 8px; box-shadow: var(--shadow); }
.field label { color: var(--muted); font-size: 14px; flex: none; min-width: 84px; }
.field input, .field select { flex: 1; min-width: 0; border: 0; background: transparent; outline: none; font-size: 16px; text-align: right; }
.field select { direction: rtl; }
.field input[type="color"] { flex: none; width: 44px; height: 30px; padding: 0; border-radius: 8px; }

.keypad { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 6px; }
.keypad button { height: 46px; border-radius: 14px; background: var(--card); box-shadow: var(--shadow); font-size: 22px; font-weight: 600; }
.keypad .op { background: var(--card-2); color: var(--accent); }
.keypad .ok { background: var(--accent); color: #fff; grid-row: span 2; height: auto; }

.btn { display: block; width: 100%; padding: 14px; border-radius: 14px; background: var(--accent); color: #fff; font-weight: 700; text-align: center; margin-top: 8px; }
.btn.ghost { background: var(--card); color: var(--text); box-shadow: var(--shadow); }
.btn.danger { background: transparent; color: var(--expense); box-shadow: none; }
.btn-row { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 8px; }
.btn-row > * { min-width: 0; }

.acc-card { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: var(--radius); margin-bottom: 10px; background: var(--card); box-shadow: var(--shadow); width: 100%; text-align: left; }
.acc-card .bal { font-weight: 700; text-align: right; white-space: nowrap; }

.icon-pick { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; margin-bottom: 10px; }
.icon-pick button { font-size: 22px; height: 40px; border-radius: 10px; background: var(--card); }
.icon-pick button.on { background: var(--accent-soft); outline: 2px solid var(--accent); }
.color-pick { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.color-pick button { width: 32px; height: 32px; border-radius: 50%; }
.color-pick button.on { outline: 3px solid var(--text); outline-offset: 2px; }

/* Charts */
.donut-wrap { display: flex; justify-content: center; margin: 4px 0 12px; position: relative; }
.donut-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; pointer-events: none; }
.donut-center .val { font-weight: 800; font-size: 18px; max-width: 130px; word-break: break-word; }
.legend .row { padding: 9px 2px; }
.bar-track { height: 6px; background: var(--card-2); border-radius: 3px; margin-top: 4px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 3px; }
svg:not(.bi) text { fill: var(--muted); font-size: 10px; }
.chart-legend { display: flex; gap: 14px; justify-content: center; font-size: 12px; color: var(--muted); margin-top: 6px; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 4px; vertical-align: -1px; }

.section-title { color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .4px; margin: 18px 6px 8px; }
.note-box { background: var(--card-2); border-radius: 14px; padding: 12px 14px; font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.toast { position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 24px); transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 999px; font-size: 14px; z-index: 100; animation: fade .2s; max-width: calc(100% - 32px); text-align: center; }

.field.compact { padding: 10px 12px; }
.field.compact select, .field.compact input { text-align: left; direction: ltr; font-size: 15px; }
.btn-row .field { margin-bottom: 8px; }

/* Платежи */
.gear { font-size: 20px; margin-left: 4px; }
.tab .ti { position: relative; }
.badge { position: absolute; top: -4px; right: -12px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--expense); color: #fff; font-size: 11px; font-style: normal; line-height: 17px; text-align: center; filter: none; }
.tab .ti:has(.badge) { opacity: 1; }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; font-size: 17px; }
.cal-head button { width: 34px; height: 34px; border-radius: 50%; background: var(--card-2); font-size: 18px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal-wd { text-align: center; font-size: 11px; color: var(--muted); padding: 4px 0; }
.cal-day { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 3px; height: 46px; padding-top: 5px; border-radius: 12px; font-size: 15px; }
.cal-day span { width: 26px; height: 26px; line-height: 26px; border-radius: 50%; text-align: center; }
.cal-day.today span { background: var(--accent); color: #fff; font-weight: 700; }
.cal-day.sel { background: var(--accent-soft); }
.cal-day.over span { color: var(--expense); font-weight: 700; box-shadow: inset 0 0 0 1.5px var(--expense); }
.cal-day.today.over span { color: #fff; }
.cal-dots { display: flex; gap: 2px; height: 6px; }
.cal-dots i { width: 6px; height: 6px; border-radius: 50%; }
.cal-dots i.done { opacity: .3; }
.occ.paid .title, .occ.skipped .title, .occ.old .title { opacity: .55; }
.occ.skipped .title { text-decoration: line-through; }
.st-overdue { color: var(--expense); font-weight: 600; }
.st-today { color: var(--accent); font-weight: 600; }
.st-paid { color: var(--income); font-weight: 600; }
.st-skipped { font-weight: 400; }
.occ-btns { display: flex; gap: 6px; justify-content: flex-end; margin-top: 6px; }
.occ-btns button { min-width: 34px; height: 30px; padding: 0 8px; border-radius: 10px; background: var(--card-2); color: var(--muted); font-size: 14px; font-weight: 600; }
.occ-btns button.pay { background: var(--income); color: #fff; }
.field.toggle { justify-content: space-between; cursor: pointer; }
.field.toggle input { flex: none; width: 22px; height: 22px; accent-color: var(--accent); }

/* Иконки банков и валют */
.bi { width: 100%; height: 100%; display: block; border-radius: 50%; }
.bi text { fill: #fff; font-family: -apple-system, "SF Pro Rounded", "Segoe UI", Roboto, sans-serif; }
.bi-inline { display: inline-block; width: 18px; height: 18px; vertical-align: -4px; }
.icon-pick.brands button { padding: 3px; background: transparent; }
.icon-pick.brands button.on { background: var(--accent-soft); }

.amount-input { flex: 1; min-width: 0; border: 0; background: transparent; outline: none; font-size: 32px; font-weight: 700; text-align: right; }

.today-btn { flex: none; font-size: 13px; padding: 2px 0 2px 6px; }
.date-field { position: relative; }
.date-label { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 15px; }
.date-label.past { color: var(--accent); font-weight: 600; }
.date-overlay { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; z-index: 1; }
.today-btn { position: relative; z-index: 2; }

/* Копилка */
.note-box.remind { color: var(--text); background: var(--accent-soft); }
.note-box.remind .btn { margin-top: 10px; }
form.card .field, form .field { box-shadow: none; background: var(--card-2); }
form .field input { text-align: left; }

/* Цели */
.goal { display: block; width: 100%; text-align: left; padding: 10px 0; }
.goal + .goal { border-top: 1px solid var(--line); }
.goal-top { display: flex; align-items: center; gap: 8px; }
.goal-ico { font-size: 22px; }
.goal-name { flex: 1; font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.goal-pct { font-weight: 800; color: var(--accent); }
.goal-bar { height: 10px; border-radius: 5px; background: var(--card-2); margin: 8px 0 6px; overflow: hidden; }
.goal-bar div { height: 100%; border-radius: 5px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .4s; }
.goal-sum { font-size: 14px; }
.goal-hint { font-size: 13px; color: var(--muted); margin-top: 4px; line-height: 1.4; }

.stepper { flex: 1; display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.stepper button { width: 34px; height: 34px; border-radius: 50%; background: var(--card-2); color: var(--accent); font-size: 20px; font-weight: 700; }
.stepper b { min-width: 24px; text-align: center; font-size: 18px; }
/* ключ синхронизации: крупно, моноширинно, переносится по группам */
.sync-key { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 18px; font-weight: 600; letter-spacing: .5px; line-height: 1.5;
  text-align: center; background: var(--card); border-radius: 14px; padding: 12px; margin: 4px 0 8px; box-shadow: var(--shadow); word-spacing: 4px; user-select: all; -webkit-user-select: all; }


/* ================= Оформление «Морозный фарфор» ================= */
body { background: var(--bg-grad) no-repeat, var(--bg); }
.screen { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 40px); }

/* Заголовки с засечками и узор-разделитель под ними */
.topbar { position: relative; margin-bottom: 26px; }
.topbar h1, .month-switch h1 { font-family: var(--serif); font-weight: 600; font-size: 30px; letter-spacing: -.3px; margin: 0; }
.topbar::before, .topbar::after { content: ""; position: absolute; left: 0; right: 0; bottom: -17px; height: 14px; pointer-events: none; }
.topbar::after {
  background: linear-gradient(var(--orn), var(--orn)) left center / calc(50% - 30px) 1px no-repeat,
              linear-gradient(var(--orn), var(--orn)) right center / calc(50% - 30px) 1px no-repeat;
  opacity: .7;
}
.topbar::before {
  background: var(--orn);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 52 14'%3E%3Cg fill='none' stroke='%23000' stroke-width='1.3'%3E%3Ccircle cx='26' cy='7' r='4'/%3E%3Cpath d='M10 7q8-8 16 0q8 8 16 0'/%3E%3C/g%3E%3Ccircle cx='6' cy='7' r='1.7'/%3E%3Ccircle cx='46' cy='7' r='1.7'/%3E%3C/svg%3E") center / 52px 14px no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 52 14'%3E%3Cg fill='none' stroke='%23000' stroke-width='1.3'%3E%3Ccircle cx='26' cy='7' r='4'/%3E%3Cpath d='M10 7q8-8 16 0q8 8 16 0'/%3E%3C/g%3E%3Ccircle cx='6' cy='7' r='1.7'/%3E%3Ccircle cx='46' cy='7' r='1.7'/%3E%3C/svg%3E") center / 52px 14px no-repeat;
}
.month-switch { flex: 1; display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.ms-nav { display: flex; align-items: center; gap: 2px; color: var(--accent); font-weight: 600; font-size: 15px; }
.ms-nav span { min-width: 40px; text-align: center; }
.ms-nav button, .month-switch button { width: 32px; height: 32px; border-radius: 50%; background: var(--card); box-shadow: var(--shadow); color: var(--accent); font-size: 18px; }
.sheet-head h2, .card h3 { font-family: var(--serif); font-weight: 600; }
.card h3 { font-size: 17px; }
.day-head { font-family: var(--serif); font-style: italic; font-size: 14px; }
.section-title { color: var(--orn); font-size: 11.5px; letter-spacing: 1.2px; }

/* Яркая карточка-«льдинка» с фарфоровой каймой и цветком */
.hero { position: relative; overflow: hidden; border-radius: 26px; padding: 18px 18px 16px; margin-bottom: 14px; color: #fff; background: var(--hero); box-shadow: var(--hero-shadow); }
.hero::after { content: ""; position: absolute; inset: 6px; border-radius: 21px; border: 1px solid rgba(255, 255, 255, .38); pointer-events: none; }
.hero .flower { position: absolute; right: -26px; top: -26px; width: 150px; height: 150px; color: rgba(255, 255, 255, .34); pointer-events: none; }
.hero .label { font-size: 11.5px; letter-spacing: 1.3px; text-transform: uppercase; color: rgba(255, 255, 255, .82); position: relative; }
.hero .big { font-family: var(--serif); font-size: 36px; font-weight: 600; letter-spacing: -.5px; margin: 2px 0 12px; position: relative; word-break: break-word; }
.hero .pills { display: flex; gap: 10px; position: relative; }
.hero .pills.wrap { flex-wrap: wrap; }
.hero .pills > div { flex: 1; min-width: 0; background: rgba(255, 255, 255, .16); border-radius: 14px; padding: 8px 11px; font-size: 12px; color: rgba(255, 255, 255, .85); }
.hero .pills.wrap > div { flex: 1 1 40%; }
.hero .pills b { display: block; font-size: 16px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hero-note { position: relative; font-size: 13px; color: rgba(255, 255, 255, .85); margin-top: -4px; }
.hero-note b { color: #fff; }
.hero-btn { position: relative; display: block; width: 100%; margin-top: 14px; padding: 12px; border-radius: 14px; background: rgba(255, 255, 255, .2); color: #fff; font-weight: 700; }

/* Карточки и списки: белый фарфор с тонкой кобальтовой линией */
.card, .list, .acc-card { box-shadow: var(--shadow); border: 1px solid var(--line); }
.row + .row { border-top-color: color-mix(in srgb, var(--line) 70%, transparent); }
.ico { box-shadow: inset 0 0 0 1.5px var(--ico-ring); background: var(--ico-bg); }
.ico[style*="--c:"] { background: color-mix(in srgb, var(--c) 15%, var(--card)); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--c) 42%, transparent); }
.acc-card { padding: 12px 14px; }
.acc-card .ico { width: 46px; height: 46px; }

/* Кнопки и переключатели */
.chip { background: var(--card); border: 1px solid var(--line); box-shadow: none; color: var(--text); }
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn { background: var(--hero); box-shadow: 0 6px 16px var(--accent-shadow); }
.btn.ghost { background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); }
.btn.danger { background: transparent; border: 0; box-shadow: none; }
.keypad .ok { background: var(--hero); }
.field { border: 1px solid var(--line); box-shadow: none; }
form .field { border: 0; }
.sheet { background: var(--bg-grad) no-repeat, var(--bg); }
.sheet .grab { background: var(--ico-ring); }
.goal-bar div { background: var(--hero); }

/* Нижнее меню парит над экраном */
.tabbar {
  left: 12px; right: 12px; bottom: calc(env(safe-area-inset-bottom) + 8px); height: var(--tabbar-h); padding-bottom: 0;
  border-radius: 26px; border: 1px solid var(--line); background: color-mix(in srgb, var(--card) 94%, transparent);
  box-shadow: 0 10px 30px rgba(20, 50, 160, .16); max-width: 616px; margin: 0 auto;
}
.tab { color: var(--muted); }
.tab .ti { filter: none; opacity: 1; width: 24px; height: 24px; font-size: 0; }
.tab .ti svg { width: 24px; height: 24px; }
.tab.on { color: var(--accent); }
.fab { background: var(--hero); transform: translateY(-20px); box-shadow: 0 0 0 5px var(--bg), 0 0 0 6.5px var(--ico-ring), 0 10px 22px var(--accent-shadow); }
.badge { font-size: 11px; }
.toast { bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 30px); }

/* Круглые кнопки-иконки в шапке экрана */
.top-actions { display: flex; gap: 8px; }
.icon-btn { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); color: var(--accent); }
.icon-btn svg { width: 21px; height: 21px; }
