:root {
  --bg: #f3f3ee; --surface: #ffffff; --surface-2: #f6f6f1; --ink: #121211; --muted: #75756e; --line: #e7e7e0;
  --accent: #d2ff4d; --accent-ink: #121211; --dark: #161614; --dark-ink: #f5f5f0; --dark-muted: #a3a39a; --dark-line: rgba(255,255,255,.1);
  --pos: #16874a; --pos-bg: #e2f5e9; --warn: #a75f00; --warn-bg: #fff0d3; --neg: #d1343b; --neg-bg: #fdE7e8; --info: #2456c9; --info-bg: #e6eeff;
  --shadow: 0 1px 2px rgba(20,20,10,.04), 0 10px 28px -14px rgba(20,20,10,.16);
  --radius: 22px; --radius-sm: 14px; --ease: cubic-bezier(.2,.8,.2,1);
  --safe-top: max(env(safe-area-inset-top, 0px), var(--tg-safe-area-inset-top, 0px), var(--tg-content-safe-area-inset-top, 0px));
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0e0e0d; --surface: #1a1a18; --surface-2: #232320; --ink: #f2f2ed; --muted: #97978f; --line: #2c2c28;
  --dark: #222220; --pos: #4cd27e; --pos-bg: #16301f; --warn: #f0b24a; --warn-bg: #362a10; --neg: #ff7378; --neg-bg: #3a1a1c; --info: #86a8ff; --info-bg: #182240;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 28px -14px rgba(0,0,0,.6);
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: var(--bg); }
body { margin: 0; background: var(--bg); color: var(--ink); font: 500 15px/1.4 Manrope, -apple-system, "SF Pro Text", "Segoe UI", Roboto, sans-serif; letter-spacing: -.01em; -webkit-font-smoothing: antialiased; overscroll-behavior-y: none; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
[hidden] { display: none !important; }
svg.i { width: 1.25em; height: 1.25em; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }

/* ── каркас ── */
.app { max-width: 560px; margin: 0 auto; padding: calc(var(--safe-top) + 14px) 16px calc(104px + var(--safe-bottom)); min-height: 100vh; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.group-pill { display: flex; align-items: center; gap: 10px; min-width: 0; max-width: calc(100% - 56px); padding: 6px 12px 6px 6px; border-radius: 999px; background: var(--surface); box-shadow: var(--shadow); }
.group-pill .g-badge { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); font-weight: 800; font-size: 14px; flex: none; }
.group-pill .g-name { font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.group-pill .i { color: var(--muted); width: 1em; height: 1em; }
.avatar { position: relative; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--surface-2); color: var(--ink); font-weight: 800; font-size: 14px; background-size: cover; background-position: center; flex: none; overflow: hidden; }
.avatar.lg { width: 52px; height: 52px; font-size: 18px; }
.avatar.accent { background-color: var(--accent); color: var(--accent-ink); }
.sync-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--pos); box-shadow: 0 0 0 3px var(--pos-bg); }
.sync-dot.off { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-bg); }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.page-head h1 { margin: 0; font-size: 30px; line-height: 1.1; font-weight: 800; letter-spacing: -.04em; }
.page-head p { margin: 0 0 4px; color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.page { display: none; }
.page.active { display: block; animation: rise .28s var(--ease); }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

/* ── период ── */
.period { margin-bottom: 14px; }
.segmented { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--line); }
.segmented button { padding: 9px 4px; border-radius: 12px; font-weight: 700; font-size: 13px; color: var(--muted); transition: .18s; }
.segmented button.on { background: var(--ink); color: var(--bg); box-shadow: 0 2px 8px rgba(0,0,0,.18); }
.stepper { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; }
.stepper .label { font-weight: 800; font-size: 15px; text-align: center; flex: 1; }
.step-btn { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; background: var(--surface); box-shadow: var(--shadow); }
.step-btn:disabled { opacity: .35; cursor: default; }

/* ── карточки ── */
.card { background: var(--surface); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.card + .card, .block + .block { margin-top: 12px; }
.block { margin-top: 22px; }
.block-head { display: flex; align-items: baseline; justify-content: space-between; margin: 0 4px 10px; gap: 10px; }
.block-head h2 { margin: 0; font-size: 17px; font-weight: 800; letter-spacing: -.03em; }
.link-btn { color: var(--muted); font-weight: 700; font-size: 13px; display: inline-flex; align-items: center; gap: 2px; }
.link-btn:active { color: var(--ink); }
.hero { position: relative; overflow: hidden; background: var(--dark); color: var(--dark-ink); border-radius: 28px; padding: 22px; box-shadow: var(--shadow); border: 1px solid var(--dark-line); }
.hero::after { content: ""; position: absolute; right: -60px; top: -60px; width: 200px; height: 200px; border-radius: 50%; background: radial-gradient(circle, rgba(210,255,77,.28), transparent 70%); pointer-events: none; }
.hero .label { color: var(--dark-muted); font-size: 13px; font-weight: 700; margin: 0 0 6px; }
.hero .amount { font-size: 40px; line-height: 1.05; font-weight: 800; letter-spacing: -.05em; margin: 0; }
.hero .amount small { font-size: 16px; color: var(--dark-muted); margin-left: 4px; letter-spacing: 0; }
.hero-foot { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin-top: 16px; color: var(--dark-muted); font-size: 13px; font-weight: 600; }
.hero-foot b { color: var(--dark-ink); }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 800; background: var(--surface-2); }
.chip.pos { background: var(--pos-bg); color: var(--pos); } .chip.neg { background: var(--neg-bg); color: var(--neg); }
.chip.warn { background: var(--warn-bg); color: var(--warn); } .chip.info { background: var(--info-bg); color: var(--info); }
.hero .chip.pos { background: rgba(76,210,126,.16); color: #6fe59b; } .hero .chip.neg { background: rgba(255,115,120,.16); color: #ff9296; }
.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.stat { padding: 16px; border-radius: 22px; background: var(--surface); box-shadow: var(--shadow); min-width: 0; }
.stat .ic { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: var(--surface-2); margin-bottom: 12px; }
.stat.accent { background: var(--accent); color: var(--accent-ink); }
.stat.accent .ic { background: rgba(0,0,0,.09); }
.stat .label { margin: 0; font-size: 13px; font-weight: 700; color: var(--muted); }
.stat.accent .label, .stat.accent .sub { color: rgba(18,18,17,.62); }
.stat .value { margin: 2px 0 0; font-size: 22px; font-weight: 800; letter-spacing: -.04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat .value small { font-size: 12px; font-weight: 700; margin-left: 3px; opacity: .6; letter-spacing: 0; }
.stat .sub { margin: 4px 0 0; font-size: 12px; color: var(--muted); font-weight: 600; }
.banner { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 13px 16px; border-radius: 18px; background: var(--warn-bg); color: var(--warn); font-weight: 700; margin-top: 12px; }
.banner span { flex: 1; } .banner .i { flex: none; }

/* ── график ── */
.chart { display: flex; align-items: flex-end; gap: 4px; height: 140px; padding-top: 8px; }
.chart .col { flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; cursor: pointer; }
.chart .bar { width: 100%; max-width: 34px; min-height: 4px; border-radius: 8px 8px 4px 4px; background: var(--line); transition: height .5s var(--ease), background .2s; }
.chart .col.has .bar { background: color-mix(in srgb, var(--ink) 78%, transparent); }
.chart .col.now .bar { background: var(--accent); box-shadow: 0 0 0 1px rgba(0,0,0,.08) inset; }
.chart .col.sel .bar { background: var(--ink); }
.chart .lbl { font-size: 10.5px; font-weight: 700; color: var(--muted); height: 12px; white-space: nowrap; }
.chart.dense .lbl { visibility: hidden; } .chart.dense .col:nth-child(5n+1) .lbl, .chart.dense .col:last-child .lbl { visibility: visible; }
.chart-caption { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; min-height: 22px; font-size: 13px; font-weight: 700; color: var(--muted); }
.chart-caption b { color: var(--ink); }

/* ── список заказов ── */
.list { display: flex; flex-direction: column; }
.list.card { padding: 6px 4px; }
.row { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 16px; text-align: left; width: 100%; transition: background .15s; }
.row:active { background: var(--surface-2); }
.row + .row { border-top: 1px solid var(--line); border-radius: 0; }
.row .ic { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; background: var(--surface-2); flex: none; font-weight: 800; font-size: 16px; }
.row.st-pending .ic { background: var(--warn-bg); color: var(--warn); } .row.st-cancelled .ic, .row.st-refunded .ic { background: var(--neg-bg); color: var(--neg); }
.row .body { flex: 1; min-width: 0; }
.row .title { font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .meta { display: flex; flex-wrap: wrap; gap: 2px 8px; align-items: center; color: var(--muted); font-size: 12.5px; font-weight: 600; margin-top: 2px; }
.row .meta .i { width: 1em; height: 1em; vertical-align: -2px; }
.row .end { text-align: right; flex: none; }
.row .sum { font-weight: 800; letter-spacing: -.03em; white-space: nowrap; }
.row.st-cancelled .sum, .row.st-refunded .sum { text-decoration: line-through; color: var(--muted); }
.row .st { display: inline-block; margin-top: 3px; font-size: 11px; font-weight: 800; padding: 2px 7px; border-radius: 999px; }
.st.pending { background: var(--warn-bg); color: var(--warn); } .st.cancelled, .st.refunded { background: var(--neg-bg); color: var(--neg); } .st.paid { background: var(--pos-bg); color: var(--pos); }
.day-head { display: flex; justify-content: space-between; align-items: baseline; margin: 18px 6px 8px; font-size: 13px; font-weight: 800; color: var(--muted); }
.day-head:first-child { margin-top: 4px; }
.day-head b { color: var(--ink); font-weight: 800; }

/* ── формы ── */
.toolbar { display: flex; gap: 8px; margin-bottom: 10px; }
.search { flex: 1; position: relative; }
.search .i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search input { padding-left: 42px; }
input, select, textarea { width: 100%; padding: 13px 14px; border-radius: 15px; border: 1.5px solid var(--line); background: var(--surface); outline: none; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { border-color: var(--ink); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 45%, transparent); }
input::placeholder, textarea::placeholder { color: color-mix(in srgb, var(--muted) 75%, transparent); }
textarea { resize: none; min-height: 68px; }
.icon-btn { width: 48px; height: 48px; flex: none; display: grid; place-items: center; border-radius: 15px; background: var(--surface); box-shadow: var(--shadow); position: relative; }
.icon-btn.on { background: var(--ink); color: var(--bg); }
.icon-btn .dot { position: absolute; top: 9px; right: 9px; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); border: 2px solid var(--ink); }
.chips { display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px 12px; padding: 2px 16px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips button { flex: none; padding: 8px 14px; border-radius: 999px; background: var(--surface); box-shadow: var(--shadow); font-weight: 700; font-size: 13px; color: var(--muted); white-space: nowrap; }
.chips button.on { background: var(--ink); color: var(--bg); }
.field { display: block; margin-bottom: 14px; }
.field > span, .field > .lab { display: block; margin: 0 2px 7px; font-size: 12px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.field small { display: block; margin: 6px 2px 0; color: var(--muted); font-size: 12px; font-weight: 600; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.money-input { position: relative; }
.money-input input { font-size: 26px; font-weight: 800; letter-spacing: -.03em; padding: 14px 64px 14px 16px; }
.money-input em { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); font-style: normal; font-weight: 800; color: var(--muted); }
.switch { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border-radius: 15px; border: 1.5px solid var(--line); background: var(--surface); text-align: left; font-weight: 700; }
.switch .i { color: var(--muted); }
.switch .knob { margin-left: auto; width: 46px; height: 28px; border-radius: 999px; background: var(--line); position: relative; transition: .2s; flex: none; }
.switch .knob::after { content: ""; position: absolute; left: 3px; top: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: .2s var(--ease); }
.switch[aria-checked="true"] .knob { background: var(--pos); } .switch[aria-checked="true"] .knob::after { transform: translateX(18px); }
.switch[aria-checked="true"] { border-color: var(--pos); }
.preview { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 14px; border-radius: 18px; background: var(--surface-2); margin: 4px 0 16px; }
.preview p { margin: 0; font-size: 12px; font-weight: 700; color: var(--muted); } .preview b { display: block; font-size: 17px; letter-spacing: -.03em; margin-top: 1px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 15px 18px; border-radius: 17px; font-weight: 800; background: var(--ink); color: var(--bg); transition: transform .12s, opacity .15s; }
.btn:active { transform: scale(.98); } .btn:disabled { opacity: .5; cursor: default; }
.btn.accent { background: var(--accent); color: var(--accent-ink); }
.btn.soft { background: var(--surface-2); color: var(--ink); border: 1px solid var(--line); }
.btn.danger { background: var(--neg-bg); color: var(--neg); }
.btn.sm { width: auto; padding: 10px 14px; border-radius: 13px; font-size: 13px; }
.btns { display: grid; gap: 10px; margin-top: 8px; } .btns.two { grid-template-columns: 1fr 1fr; }
.suggest { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.suggest button { padding: 6px 11px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); font-size: 13px; font-weight: 700; }
.suggest button:active { background: var(--accent); color: var(--accent-ink); }
.seg-status { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 4px; border-radius: 15px; background: var(--surface-2); border: 1px solid var(--line); }
.seg-status button { padding: 9px 2px; border-radius: 11px; font-size: 12px; font-weight: 800; color: var(--muted); }
.seg-status button.on { color: #fff; }
.seg-status button.on[data-v="paid"] { background: var(--pos); } .seg-status button.on[data-v="pending"] { background: #d68a12; } .seg-status button.on[data-v="cancelled"], .seg-status button.on[data-v="refunded"] { background: var(--neg); }

/* ── календарь ── */
.calendar { margin-bottom: 14px; }
.cal-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.cal-top strong { font-weight: 800; }
.cal-week, .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; }
.cal-week span { font-size: 11px; font-weight: 800; color: var(--muted); padding-bottom: 4px; }
.cal-grid button, .cal-grid i { aspect-ratio: 1; border-radius: 12px; display: grid; place-items: center; font-weight: 700; font-size: 14px; position: relative; }
.cal-grid button:active { background: var(--surface-2); }
.cal-grid button.has::after { content: ""; position: absolute; bottom: 5px; width: 5px; height: 5px; border-radius: 50%; background: var(--pos); }
.cal-grid button.today { box-shadow: inset 0 0 0 1.5px var(--ink); }
.cal-grid button.sel { background: var(--ink); color: var(--bg); } .cal-grid button.sel::after { background: var(--accent); }
.cal-grid button.future { color: color-mix(in srgb, var(--muted) 60%, transparent); }
.cal-foot { margin-top: 10px; font-size: 13px; font-weight: 700; color: var(--muted); text-align: center; }

/* ── выплаты ── */
.split-bar { display: flex; height: 10px; border-radius: 999px; overflow: hidden; background: var(--dark-line); margin: 18px 0 12px; }
.split-bar i { display: block; height: 100%; transition: width .5s var(--ease); } .split-bar .s { background: var(--accent); } .split-bar .o { background: #fff; opacity: .85; }
.split-legend { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; font-weight: 700; color: var(--dark-muted); }
.split-legend b { display: block; color: var(--dark-ink); font-size: 18px; letter-spacing: -.03em; }
.split-legend .r { text-align: right; }
.calc .line { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 9px 0; }
.calc .line + .line { border-top: 1px dashed var(--line); }
.calc .line span { color: var(--muted); font-weight: 600; } .calc .line b { font-weight: 800; white-space: nowrap; letter-spacing: -.02em; }
.calc .line.total { border-top: 1.5px solid var(--ink); margin-top: 4px; padding-top: 13px; } .calc .line.total span { color: var(--ink); font-weight: 800; } .calc .line.total b { font-size: 18px; }
.calc .line.plus b { color: var(--pos); } .calc .line.minus b { color: var(--neg); }
.note-card { display: flex; gap: 12px; padding: 14px 16px; border-radius: 18px; background: var(--info-bg); color: var(--info); font-size: 13px; font-weight: 600; margin-top: 12px; }
.note-card b { display: block; font-weight: 800; } .note-card .i { margin-top: 2px; }
.ledger { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; }
.ledger div { padding: 12px 6px; border-radius: 16px; background: var(--surface-2); min-width: 0; }
.ledger p { margin: 0; font-size: 11px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.ledger b { display: block; margin-top: 3px; font-size: 15px; letter-spacing: -.03em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ledger .bal { background: var(--accent); color: var(--accent-ink); } .ledger .bal p { color: rgba(18,18,17,.62); }
.ledger .bal.neg-bal { background: var(--neg-bg); color: var(--neg); } .ledger .bal.neg-bal p { color: var(--neg); }
.week-row { display: flex; justify-content: space-between; gap: 12px; padding: 12px 4px; } .week-row + .week-row { border-top: 1px solid var(--line); }
.week-row b { display: block; font-weight: 800; } .week-row small { color: var(--muted); font-weight: 600; } .week-row .r { text-align: right; }

/* ── группа ── */
.member { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; text-align: left; }
.member + .member { border-top: 1px solid var(--line); }
.member .body { flex: 1; min-width: 0; } .member .title { font-weight: 800; display: flex; gap: 6px; align-items: center; } .member .meta { color: var(--muted); font-size: 12.5px; font-weight: 600; }
.role { font-size: 11px; font-weight: 800; padding: 3px 9px; border-radius: 999px; background: var(--surface-2); white-space: nowrap; border: 1px solid var(--line); }
.role.owner { background: var(--accent); color: var(--accent-ink); border-color: transparent; } .role.programmer { background: var(--info-bg); color: var(--info); border-color: transparent; }
.you { font-size: 11px; color: var(--muted); font-weight: 700; }
.group-hero { display: flex; align-items: center; gap: 14px; }
.group-hero .g-badge { width: 56px; height: 56px; border-radius: 18px; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); font-weight: 800; font-size: 24px; flex: none; }
.group-hero h2 { margin: 0; font-size: 21px; letter-spacing: -.04em; line-height: 1.15; word-break: break-word; } .group-hero p { margin: 3px 0 0; color: var(--muted); font-size: 13px; font-weight: 600; }
.invite-row { display: flex; align-items: center; gap: 10px; padding: 10px 4px; } .invite-row + .invite-row { border-top: 1px solid var(--line); }
.invite-row .body { flex: 1; min-width: 0; font-weight: 700; } .invite-row small { display: block; color: var(--muted); font-weight: 600; }
.roles-help p { margin: 0; color: var(--muted); font-size: 13px; font-weight: 600; } .roles-help p + p { margin-top: 8px; } .roles-help b { color: var(--ink); }
.group-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px; border-radius: 16px; text-align: left; }
.group-item + .group-item { margin-top: 4px; } .group-item.on { background: var(--surface-2); }
.group-item .g-badge { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); font-weight: 800; flex: none; }
.group-item .body { flex: 1; min-width: 0; font-weight: 800; } .group-item small { display: block; font-weight: 600; color: var(--muted); }

/* ── нижняя навигация ── */
.nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; padding: 10px 14px calc(10px + var(--safe-bottom)); pointer-events: none; }
.nav-inner { max-width: 532px; margin: 0 auto; display: grid; grid-template-columns: 1fr 1fr 74px 1fr 1fr; align-items: center; padding: 6px; border-radius: 26px; background: color-mix(in srgb, var(--surface) 86%, transparent); backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4); box-shadow: 0 10px 40px -10px rgba(0,0,0,.28), 0 0 0 1px var(--line); pointer-events: auto; }
.nav button.tab { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 0 6px; border-radius: 18px; color: var(--muted); font-size: 11px; font-weight: 800; transition: color .15s; }
.nav button.tab .i { width: 23px; height: 23px; }
.nav button.tab.on { color: var(--ink); } .nav button.tab.on .i { stroke-width: 2.5; }
.nav .fab { justify-self: center; width: 58px; height: 58px; margin-top: -26px; border-radius: 22px; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); box-shadow: 0 10px 24px -6px rgba(140,190,0,.7), 0 0 0 5px var(--bg); transition: transform .15s var(--ease); }
.nav .fab:active { transform: scale(.92) rotate(90deg); } .nav .fab .i { width: 28px; height: 28px; stroke-width: 2.6; }

/* ── шторки и диалоги ── */
.overlay { position: fixed; inset: 0; z-index: 60; background: rgba(10,10,8,.5); opacity: 0; pointer-events: none; transition: opacity .22s; display: flex; align-items: flex-end; justify-content: center; }
.overlay.open { opacity: 1; pointer-events: auto; }
.sheet { width: 100%; max-width: 560px; max-height: 92vh; max-height: 92dvh; overflow-y: auto; overscroll-behavior: contain; background: var(--bg); border-radius: 28px 28px 0 0; padding: 10px 18px calc(24px + var(--safe-bottom)); transform: translateY(100%); transition: transform .3s var(--ease); }
.overlay.open .sheet { transform: none; }
.sheet .grab { width: 40px; height: 5px; border-radius: 999px; background: var(--line); margin: 0 auto 14px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.sheet-head h2 { margin: 0; font-size: 22px; letter-spacing: -.04em; }
.close-btn { width: 36px; height: 36px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; flex: none; }
.dialog-wrap { align-items: center; padding: 20px; }
.dialog { width: 100%; max-width: 380px; background: var(--surface); border-radius: 26px; padding: 22px; transform: scale(.94); transition: transform .25s var(--ease); box-shadow: var(--shadow); }
.overlay.open .dialog { transform: none; }
.dialog h3 { margin: 0 0 8px; font-size: 19px; letter-spacing: -.03em; } .dialog p { margin: 0 0 16px; color: var(--muted); font-weight: 600; }
.detail-amount { text-align: center; padding: 6px 0 18px; } .detail-amount .big { font-size: 40px; font-weight: 800; letter-spacing: -.05em; line-height: 1.1; } .detail-amount .big small { font-size: 16px; color: var(--muted); }
.detail-amount h3 { margin: 0 0 6px; font-size: 17px; }
.kv .line { display: flex; justify-content: space-between; gap: 14px; padding: 10px 0; } .kv .line + .line { border-top: 1px solid var(--line); }
.kv .line span { color: var(--muted); font-weight: 600; } .kv .line b { text-align: right; font-weight: 700; word-break: break-word; }
.copy-box { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-radius: 15px; background: var(--surface); border: 1.5px dashed var(--line); font-size: 13px; font-weight: 700; word-break: break-all; margin-bottom: 12px; }

/* ── прочее ── */
.empty { text-align: center; padding: 34px 20px; color: var(--muted); font-weight: 600; }
.empty .art { width: 64px; height: 64px; border-radius: 22px; margin: 0 auto 14px; display: grid; place-items: center; background: var(--surface-2); color: var(--ink); }
.empty .art .i { width: 30px; height: 30px; } .empty b { display: block; color: var(--ink); font-size: 17px; font-weight: 800; margin-bottom: 4px; }
.empty .btn { margin-top: 16px; width: auto; padding: 12px 22px; }
.skel { border-radius: 18px; background: linear-gradient(90deg, var(--surface-2), var(--line), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.3s infinite linear; }
@keyframes shimmer { to { background-position: -200% 0; } }
.toast { position: fixed; left: 50%; bottom: calc(96px + var(--safe-bottom)); z-index: 80; transform: translate(-50%, 20px); max-width: min(92vw, 500px); display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-radius: 16px; background: var(--ink); color: var(--bg); font-weight: 700; font-size: 14px; box-shadow: 0 12px 30px -8px rgba(0,0,0,.4); opacity: 0; pointer-events: none; transition: .25s var(--ease); }
.toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast.err { background: var(--neg); color: #fff; }
.toast button { color: var(--accent); font-weight: 800; white-space: nowrap; } .toast.err button { color: #fff; text-decoration: underline; }
.onboard { min-height: calc(100vh - 60px); display: flex; flex-direction: column; justify-content: center; gap: 14px; }
.onboard .logo { width: 64px; height: 64px; border-radius: 22px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-size: 30px; font-weight: 800; margin-bottom: 4px; box-shadow: 0 14px 30px -10px rgba(140,190,0,.6); }
.onboard h1 { margin: 0; font-size: 34px; line-height: 1.08; letter-spacing: -.05em; } .onboard > p { margin: 0 0 6px; color: var(--muted); font-weight: 600; font-size: 16px; }
.fullscreen-msg { min-height: 80vh; display: grid; place-items: center; text-align: center; padding: 20px; }
.fullscreen-msg .card { max-width: 380px; }
.divider { text-align: center; color: var(--muted); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.danger-zone { margin-top: 22px; display: grid; gap: 10px; }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 380px) { .hero .amount { font-size: 34px; } .stat .value { font-size: 19px; } .ledger b { font-size: 13px; } .row .ic { width: 38px; height: 38px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
