/* FinSight phone kit: the app's screens in HTML (assets/phone.js writes the markup; its header has the contract).
   Look C «Поле» from Design/PrototypeC (base.css look C block, plan.css, analytics.css, reports.css) with the app's
   own values where they differ (FieldPalette.swift: faint #6F7283). Text boxes are the fonts' natural heights, as
   SwiftUI draws them (Golos Text 1.2 em, Commissioner 1.223 em), so every line sits where the app puts it. Dark is «Нічне поле», following the system.
   Everything is scoped to .fs-phone and prefixed fs-; the fonts are the site's (assets/site.css @font-face). */

.fs-phone {
  --fs-field-top: #3238C4; --fs-field-bottom: #2B2FA8;
  --fs-amber: #FFC861; --fs-amber-ink: #8F5A00;
  --fs-ink: #111218; --fs-muted: #5D6070; --fs-faint: #6F7283; --fs-line: #E7E8EE;
  --fs-indigo: #3A3FCF; --fs-indigo-fill: #3A3FCF; --fs-bar: #D7D9F2; --fs-positive: #2E7244;
  --fs-edge-72: rgb(255 255 255 / 0.72); --fs-edge-55: rgb(255 255 255 / 0.55);   /* --fs-sheet at 72 % and 55 %, where color-mix is missing */
  --fs-sheet: #FFFFFF; --fs-pill: #F1F2F6; --fs-track: #ECEDF3; --fs-rest: #C9CBD6; --fs-raised: #FFFFFF;
  --fs-glass: rgb(255 255 255 / 0.16); --fs-on-field-2: rgb(255 255 255 / 0.86);
  --fs-switch: #FFFFFF; --fs-switch-edge: transparent; --fs-switch-shadow: 0 6px 18px rgb(20 22 80 / 0.18);
  --fs-tabbar: rgb(255 255 255 / 0.84); --fs-tabbar-edge: rgb(17 18 24 / 0.07); --fs-tabbar-shadow: 0 8px 24px rgb(17 18 24 / 0.10);
  --fs-tab-ink: #111218; --fs-tab-on: rgb(17 18 24 / 0.075); --fs-tab-on-ink: #3A3FCF;
  --fs-fab-glow: 0 10px 22px rgb(58 63 207 / 0.32); --fs-fly-shadow: 0 6px 16px rgb(43 47 168 / 0.18);
  --fs-bezel: #0B0C10; --fs-rim: #2C2E38; --fs-drop: 0 30px 60px -28px rgb(10 14 40 / 0.45);
  --fs-display: "Commissioner", "Golos Text", ui-sans-serif, system-ui, sans-serif;
  --fs-body: "Golos Text", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --fs-system: -apple-system, BlinkMacSystemFont, system-ui, "Golos Text", sans-serif;

  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 410 / 864;
  margin: 0;
  padding: 0;
  container-type: inline-size;
}
@media (prefers-color-scheme: dark) {
  .fs-phone {
    --fs-field-top: #252A9E; --fs-field-bottom: #1C1F7C;
    --fs-amber-ink: #FFC861;
    --fs-ink: #ECEDF5; --fs-muted: #A3A6B8; --fs-faint: #878A9C; --fs-line: #23253A;
    --fs-indigo: #A9ACFF; --fs-bar: #262839; --fs-positive: #6FD08F;
    --fs-edge-72: rgb(14 15 23 / 0.72); --fs-edge-55: rgb(14 15 23 / 0.55);
    --fs-sheet: #0E0F17; --fs-pill: #1D1F2E; --fs-track: #262839; --fs-rest: #6B6E82; --fs-raised: #181A27;
    --fs-glass: rgb(255 255 255 / 0.14);
    --fs-switch: #1A1C2A; --fs-switch-edge: rgb(255 255 255 / 0.08); --fs-switch-shadow: 0 6px 18px rgb(0 0 0 / 0.4);
    --fs-tabbar: rgb(28 30 43 / 0.84); --fs-tabbar-edge: rgb(255 255 255 / 0.09); --fs-tabbar-shadow: 0 8px 24px rgb(0 0 0 / 0.45);
    --fs-tab-ink: #ECEDF5; --fs-tab-on: rgb(255 255 255 / 0.13); --fs-tab-on-ink: #A9ACFF;
    --fs-fab-glow: 0 10px 24px rgb(0 0 0 / 0.45); --fs-fly-shadow: 0 6px 16px rgb(0 0 0 / 0.4);
    --fs-rim: #34364A; --fs-drop: 0 30px 60px -28px rgb(0 0 0 / 0.7);
  }
}
.fs-phone *, .fs-phone *::before, .fs-phone *::after { box-sizing: border-box; }
.fs-phone [hidden] { display: none !important; }
/* the text alternative: read, not shown */
.fs-alt {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

/* ───────── the device: a 10 pt bezel round the 390 × 844 screen, scaled by --s to the figure's width ───────── */
.fs-dev {
  --s: 0.75;
  position: absolute; left: 0; top: 0;
  width: 410px; height: 864px; padding: 10px;
  border-radius: 60px;
  background: var(--fs-bezel);
  box-shadow: inset 0 0 0 1.5px var(--fs-rim), var(--fs-drop);
  transform: scale(var(--s)); transform-origin: 0 0;
  -webkit-user-select: none; user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.fs-scr {
  position: relative; width: 390px; height: 844px;
  border-radius: 50px; overflow: hidden; isolation: isolate;
  background: var(--fs-sheet);
  font: 400 16px/1.3 var(--fs-body); letter-spacing: 0; text-align: left; color: var(--fs-ink);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
.fs-g { display: block; flex: none; }
.fs-scr b { font-weight: 600; }

/* the status bar: white over the field; the island */
.fs-status {
  position: absolute; left: 0; right: 0; top: 0; z-index: 30; height: 54px; padding-top: 6px;
  display: flex; align-items: center; justify-content: space-between;
  color: #FFFFFF; pointer-events: none;
}
.fs-time { width: 138px; padding-left: 14px; text-align: center; font: 600 17px/22px var(--fs-system); letter-spacing: -0.02em; }
.fs-island { position: absolute; left: 50%; top: 11px; width: 124px; height: 36px; margin-left: -62px; border-radius: 18px; background: #000; }
.fs-sys { width: 138px; padding-right: 14px; display: flex; align-items: center; justify-content: center; gap: 6px; }
.fs-sys svg { display: block; fill: currentColor; }

/* ───────── the field: wordmark row, the amber context, the sum, one supporting line ───────── */
.fs-view { position: absolute; inset: 0; z-index: 0; display: flex; flex-direction: column; overflow: hidden; }
.fs-ghost { z-index: 1; pointer-events: none; }
.fs-field {
  flex: none; position: relative; padding: 56px 20px 44px; color: #FFFFFF;
  background: linear-gradient(180deg, var(--fs-field-top) 0%, var(--fs-field-bottom) 100%);
}
.fs-field.edge { padding-bottom: 58px; }
.fs-top { height: 44px; display: flex; align-items: center; justify-content: space-between; }
.fs-wm { font: 700 20px/1.223 var(--fs-display); letter-spacing: -0.01em; }
.fs-btns { display: flex; gap: 8px; margin-left: auto; }
.fs-gb { width: 44px; height: 44px; border-radius: 22px; flex: none; display: flex; align-items: center; justify-content: center; background: var(--fs-glass); color: #FFFFFF; }
.fs-gb.sm { width: 36px; height: 36px; border-radius: 18px; }
.fs-gb.off { opacity: 0.45; }
/* a block of its own (no margin falls through); the План tab keeps one height in both views (plan-fbox) */
.fs-fbox { display: flow-root; }
.fs-fbox.tall { min-height: 160px; }
.fs-ctxrow { display: flex; align-items: center; justify-content: space-between; min-height: 36px; margin-top: 20px; }
/* the small glass buttons keep a 44 pt tap frame, so a row with the stepper is 44 tall */
.fs-ctxrow.st { min-height: 44px; }
.fs-ctx { font: 600 17px/1.2 var(--fs-body); color: var(--fs-amber); }
.fs-sum {
  margin-top: 2px; display: flex; align-items: flex-end; white-space: nowrap;
  font: 800 56px/1.223 var(--fs-display); letter-spacing: -0.027em; transform-origin: 0 50%;
}
.fs-sumlbl {
  display: inline-flex; flex-direction: column; justify-content: flex-end;
  margin-left: 12px; padding-bottom: 5.3px;
  font: 500 15px/1.2 var(--fs-body); letter-spacing: 0; color: var(--fs-on-field-2);
}
.fs-sumlbl b, .fs-sup b { font-weight: 600; color: #FFFFFF; }
.fs-sup { margin-top: 6px; font: 400 16px/1.2 var(--fs-body); color: var(--fs-on-field-2); white-space: nowrap; }

/* ───────── the sheet: radius 28 over the field by 24; the switcher on its edge ───────── */
.fs-sheet {
  flex: 1; position: relative; z-index: 1; margin-top: -24px; padding: 4px 20px 0;
  border-radius: 28px 28px 0 0; background: var(--fs-sheet);
}
.fs-sheet.edge { padding-top: 34px; }
.fs-switch {
  position: absolute; left: 75px; right: 75px; top: -18px; z-index: 2;
  display: flex; height: 36px; padding: 3px; border-radius: 18px;
  background: var(--fs-switch); box-shadow: inset 0 0 0 1px var(--fs-switch-edge), var(--fs-switch-shadow);
}
.fs-knob { position: absolute; left: 3px; top: 3px; bottom: 3px; width: calc(50% - 3px); border-radius: 15px; background: var(--fs-indigo-fill); }
.fs-switch[data-on="1"] .fs-knob { transform: translateX(100%); }
.fs-sw { position: relative; flex: 1; display: flex; align-items: center; justify-content: center; font: 600 15px/1.2 var(--fs-body); color: var(--fs-indigo); }
.fs-sw.on { color: #FFFFFF; }

/* a section header with the amber mark; a day's header is 14 pt with its total in indigo */
.fs-sec { position: relative; display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 22px 0 10px; }
.fs-sec::after { content: ""; position: absolute; left: 0; bottom: 0; width: 28px; height: 3px; border-radius: 2px; background: var(--fs-amber); }
.fs-st { display: flex; align-items: center; font: 700 17px/1.223 var(--fs-display); letter-spacing: -0.005em; color: var(--fs-ink); }
.fs-sv { font: 400 14px/1.2 var(--fs-body); color: var(--fs-muted); white-space: nowrap; }
.fs-sec.day { padding-top: 20px; }
.fs-sec.day .fs-st { font-size: 14px; }
.fs-sec.day .fs-sv { font: 700 14px/1.223 var(--fs-display); color: var(--fs-indigo); }

/* the hairline row: a category's glyph in its pale circle, name and detail, amount and time */
.fs-row { display: flex; align-items: center; gap: 14px; min-height: 56px; padding: 7px 0; border-bottom: 1px solid var(--fs-line); }
.fs-circ {
  width: 34px; height: 34px; border-radius: 17px; flex: none; margin-right: -2px;
  display: flex; align-items: center; justify-content: center;
  color: var(--c); background: var(--ct);
}
.fs-circ.sm { width: 28px; height: 28px; border-radius: 14px; margin-right: 0; }
.fs-mid { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.fs-m { font: 500 16px/1.2 var(--fs-body); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fs-s { margin-top: 2px; font: 400 13px/1.2 var(--fs-body); color: var(--fs-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fs-r { flex: none; display: flex; flex-direction: column; align-items: flex-end; text-align: right; }
.fs-a { font: 600 16px/1.2 var(--fs-body); white-space: nowrap; }
.fs-tm { margin-top: 2px; font: 400 12px/1.2 var(--fs-body); color: var(--fs-faint); white-space: nowrap; }
.fs-ic { width: 20px; flex: none; display: flex; align-items: center; color: var(--fs-muted); }

/* the floating «+» (Витрати), above the tab bar on the right */
.fs-fab {
  position: absolute; right: 20px; bottom: 92px; z-index: 22;
  width: 58px; height: 58px; border-radius: 29px;
  display: flex; align-items: center; justify-content: center;
  background: var(--fs-indigo-fill); color: #FFFFFF; box-shadow: var(--fs-fab-glow);
  cursor: pointer; touch-action: manipulation; transition: transform 0.15s ease-out;
}
.fs-fab:active { transform: scale(0.92); }
/* an amount on its way to the month's sum: a white slip */
.fs-fly {
  position: absolute; left: 0; top: 0; z-index: 25; padding: 2px 10px; border-radius: 999px;
  background: var(--fs-raised); box-shadow: inset 0 0 0 1px var(--fs-line), var(--fs-fly-shadow);
  font: 600 16px/1.2 var(--fs-body); color: var(--fs-ink); white-space: nowrap; pointer-events: none;
  transform-origin: 50% 50%; will-change: transform, opacity;
}

/* ───────── План: a category limit (plan.css .plan-lim) ───────── */
.fs-lim { padding: 10px 0 11px; border-bottom: 1px solid var(--fs-line); }
.fs-l1, .fs-l2 { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.fs-ln { display: flex; align-items: center; gap: 10px; font: 500 16px/1.2 var(--fs-body); }
.fs-dot { width: 12px; height: 12px; border-radius: 6px; flex: none; background: var(--c, var(--fs-rest)); }
.fs-la { font: 600 16px/1.2 var(--fs-body); white-space: nowrap; }
.fs-l2 { margin-top: 2px; padding-left: 22px; font: 400 13px/1.2 var(--fs-body); color: var(--fs-muted); white-space: nowrap; }
.fs-lw { font-size: 12px; line-height: 1.2; color: var(--fs-faint); }
.fs-trk { position: relative; height: 4px; margin: 7px 0 0 22px; border-radius: 2px; background: var(--fs-bar); overflow: hidden; }
.fs-trk i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 2px; background: var(--fs-indigo); }
.fs-trk i.amb { width: 100%; background: var(--fs-amber); opacity: 0; }
.fs-lim.over .fs-trk i.amb { opacity: 1; }
.fs-lim.over .fs-la, .fs-lim.over .fs-lw { color: var(--fs-amber-ink); }

/* ───────── Аналітика: «Куди пішли гроші» (analytics.css .an-*) ───────── */
/* the stack and its legend are the chart's hit area, edge to edge */
.fs-went { margin: 0 -20px; padding: 0 20px 2px; touch-action: pan-y; }
.fs-stack { position: relative; display: flex; gap: 2px; height: 14px; margin-top: 18px; border-radius: 7px; overflow: hidden; }
.fs-stack i { display: block; height: 100%; background: var(--c); transition: opacity 0.2s ease; }
.fs-stack i.rest { background: var(--fs-rest); }
.fs-stack.picking i:not(.on) { opacity: 0.35; }
.fs-cover { position: absolute; inset: 0; background: var(--fs-sheet); }
.fs-legend { display: flex; justify-content: space-between; margin-top: 8px; font: 400 13px/1.2 var(--fs-body); color: var(--fs-muted); }
.fs-gap { height: 6px; }
.fs-adot { width: 12px; height: 12px; margin: 0 4px; border-radius: 6px; flex: none; background: var(--c); }
.fs-chg { color: var(--fs-ink); }
.fs-chg.down { color: var(--fs-positive); }
.fs-row.an { gap: 12px; transition: background-color 0.2s ease; }
.fs-row.sel { background: linear-gradient(90deg, transparent, var(--fs-pill) 8%, var(--fs-pill) 92%, transparent); }

/* ───────── Звіти: the report, take B (reports.css .rep-ins) ───────── */
.fs-ins { padding: 18px 0; border-bottom: 1px solid var(--fs-line); }
.fs-lab { display: flex; align-items: center; gap: 10px; font: 500 15px/1.2 var(--fs-body); color: var(--fs-muted); }
.fs-fig { margin-top: 8px; font: 800 34px/1.223 var(--fs-display); letter-spacing: -0.02em; white-space: nowrap; color: var(--fs-ink); }
.fs-fig small { margin-left: 8px; font: 600 17px/1.2 var(--fs-body); letter-spacing: 0; }
.fs-cap { margin-top: 3px; font: 400 15px/1.2 var(--fs-body); color: var(--fs-muted); }
.fs-bar { position: relative; height: 10px; margin-top: 12px; border-radius: 5px; background: var(--fs-track); overflow: hidden; }
.fs-bar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 5px; background: var(--c); }
.fs-spark { display: inline-flex; margin-right: 8px; color: var(--fs-indigo); }

/* ───────── the tab bar of iOS 26: four tabs in a glass pill, the search circle beside it ───────── */
.fs-edge {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 19; height: 118px; pointer-events: none;
  background: linear-gradient(to top, var(--fs-edge-72) 0%, var(--fs-edge-55) 50%, transparent 100%);
  background: linear-gradient(to top,
    color-mix(in srgb, var(--fs-sheet) 72%, transparent) 0%,
    color-mix(in srgb, var(--fs-sheet) 55%, transparent) 50%,
    transparent 100%);
}
.fs-tabbar, .fs-searchtab {
  position: absolute; bottom: 22px; z-index: 20; height: 62px; border-radius: 31px;
  background: var(--fs-tabbar); box-shadow: inset 0 0 0 1px var(--fs-tabbar-edge), var(--fs-tabbar-shadow);
  -webkit-backdrop-filter: blur(18px) saturate(1.4); backdrop-filter: blur(18px) saturate(1.4);
}
.fs-tabbar { left: 20px; right: 92px; display: flex; padding: 4px; }
.fs-tab {
  flex: 1 1 auto; min-width: 0; padding: 0 6px; border-radius: 27px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--fs-tab-ink);
}
.fs-tab > span { font: 600 10px/1.2 var(--fs-body); white-space: nowrap; }
.fs-tab.on { background: var(--fs-tab-on); color: var(--fs-tab-on-ink); }
.fs-searchtab { right: 20px; width: 62px; display: flex; align-items: center; justify-content: center; color: var(--fs-tab-ink); }

/* dark: a category's circle and mark take CategoryShade's dark pair (phone.js catVars) */
@media (prefers-color-scheme: dark) {
  .fs-circ { color: var(--cg); background: var(--cb); }
  .fs-dot { background: var(--cg, var(--fs-rest)); }
  .fs-adot, .fs-stack i:not(.rest), .fs-bar i { background: var(--cg); }
}
@media (prefers-reduced-motion: reduce) {
  .fs-stack i, .fs-row.an, .fs-fab { transition: none; }
}

/* without JS the scale steps with the figure's width (JS sets the exact --s on .fs-dev) */
@container (min-width: 200px) { .fs-dev { --s: 0.4878; } }
@container (min-width: 210px) { .fs-dev { --s: 0.5122; } }
@container (min-width: 220px) { .fs-dev { --s: 0.5366; } }
@container (min-width: 230px) { .fs-dev { --s: 0.5610; } }
@container (min-width: 240px) { .fs-dev { --s: 0.5854; } }
@container (min-width: 250px) { .fs-dev { --s: 0.6098; } }
@container (min-width: 260px) { .fs-dev { --s: 0.6341; } }
@container (min-width: 270px) { .fs-dev { --s: 0.6585; } }
@container (min-width: 280px) { .fs-dev { --s: 0.6829; } }
@container (min-width: 290px) { .fs-dev { --s: 0.7073; } }
@container (min-width: 300px) { .fs-dev { --s: 0.7317; } }
@container (min-width: 310px) { .fs-dev { --s: 0.7561; } }
@container (min-width: 320px) { .fs-dev { --s: 0.7805; } }
@container (min-width: 330px) { .fs-dev { --s: 0.8049; } }
@container (min-width: 340px) { .fs-dev { --s: 0.8293; } }
@container (min-width: 350px) { .fs-dev { --s: 0.8537; } }
@container (min-width: 360px) { .fs-dev { --s: 0.8780; } }
@container (min-width: 370px) { .fs-dev { --s: 0.9024; } }
@container (min-width: 380px) { .fs-dev { --s: 0.9268; } }
@container (min-width: 390px) { .fs-dev { --s: 0.9512; } }
@container (min-width: 400px) { .fs-dev { --s: 0.9756; } }
@container (min-width: 410px) { .fs-dev { --s: 1; } }
@container (min-width: 430px) { .fs-dev { --s: 1.0488; } }
@container (min-width: 450px) { .fs-dev { --s: 1.0976; } }
@container (min-width: 470px) { .fs-dev { --s: 1.1463; } }
@container (min-width: 490px) { .fs-dev { --s: 1.1951; } }
@container (min-width: 520px) { .fs-dev { --s: 1.2683; } }
@container (min-width: 560px) { .fs-dev { --s: 1.3659; } }
@container (min-width: 600px) { .fs-dev { --s: 1.4634; } }
