/* Golos Text, SIL Open Font License 1.1. cyrillic-ext carries the Mongolian and Kazakh letters. */
@font-face {
  font-family: 'Golos Text';
  font-weight: 400 800;
  font-display: swap;
  src: url('/static/fonts/golos-text-cyrillic-ext.woff2') format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
@font-face {
  font-family: 'Golos Text';
  font-weight: 400 800;
  font-display: swap;
  src: url('/static/fonts/golos-text-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Golos Text';
  font-weight: 400 800;
  font-display: swap;
  src: url('/static/fonts/golos-text-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Golos Text';
  font-weight: 400 800;
  font-display: swap;
  src: url('/static/fonts/golos-text-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 {
  --page: #eff0f2;
  --side: #f6f7f8;
  --card: #ffffff;
  --sunken: #f3f4f6;
  --line: #e2e4e9;
  --line-soft: #eceef1;
  --text: #14171c;
  --text-2: #3b4250;
  --muted: #667085;
  --accent: #2f5be7;
  --accent-hover: #2449c9;
  --accent-ink: #1f4bd8;
  --accent-soft: #e3e9f8;
  --pos: #0f7a56;
  --neg: #c2321f;
  --k-cash: #1f9d6b;
  --k-salary: #7a5af8;
  --k-rent: #2f6fed;
  --k-utility: #c98a00;
  --k-expense: #e8590c;
  --k-debt: #5b6b82;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 1px 3px rgba(16, 24, 40, 0.05);
  --font: 'Golos Text', system-ui, -apple-system, 'Segoe UI', Roboto, 'Noto Sans', sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font: 400 15px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
}
h1, h2, p { margin: 0; }
h1 { font-size: 24px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.2; }
h2 { font-size: 18px; font-weight: 700; letter-spacing: -0.01em; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ic { display: inline-flex; flex: none; }
.muted { color: var(--muted); font-size: 13px; }
.center { text-align: center; }
.pad { padding: 16px 20px; }
.pos { color: var(--pos); }
.neg { color: var(--neg); }
.link { color: var(--accent-ink); font-weight: 600; font-size: 14px; }
.link:hover { text-decoration: underline; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 216px minmax(0, 1fr); min-height: 100dvh; }
.side {
  position: sticky; top: 0; height: 100dvh; overflow-y: auto;
  display: flex; flex-direction: column;
  padding: 18px 12px 12px; background: var(--side); border-right: 1px solid var(--line);
}
.brand { font-weight: 800; font-size: 28px; letter-spacing: -0.05em; line-height: 1; padding: 0 10px; }
.brand-sub { color: var(--muted); font-size: 12px; padding: 4px 10px 0; overflow-wrap: anywhere; }
.nav-list { display: flex; flex-direction: column; gap: 2px; margin-top: 8px; }
.nav-sec {
  margin: 16px 10px 6px; color: var(--muted);
  font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
}
.nav {
  display: flex; align-items: center; gap: 10px; min-height: 38px; padding: 7px 10px;
  border-radius: 10px; color: var(--text-2); font-weight: 500; font-size: 14.5px;
}
.nav:hover { background: #eceef2; }
.nav.on { background: var(--accent-soft); color: #1b3a9c; font-weight: 600; }
.side-foot { margin-top: auto; padding-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.lang-seg { align-self: flex-start; flex: none; }
.lang-seg button { padding: 5px 12px; min-height: 32px; font-size: 12.5px; font-weight: 600; letter-spacing: 0.03em; }
.user-card {
  padding: 10px; background: var(--card);
  border: 1px solid var(--line); border-radius: 12px;
}
.user-top { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.user-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.user-text b { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-text small { color: var(--muted); font-size: 12px; }
.avatar {
  flex: none; width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent-soft); color: #1b3a9c; font-weight: 700; font-size: 12.5px;
}
.content { min-width: 0; }
.main { max-width: 1140px; padding: 22px 28px 64px; display: flex; flex-direction: column; gap: 16px; }
.topbar, .tabbar { display: none; }

/* ---------- page parts ---------- */
.head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.head .sub { color: var(--muted); font-size: 14px; margin-top: 2px; }
.head-actions { display: flex; gap: 8px; flex: none; }
.stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 16px; align-items: start; }
.grid-even { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.grid-journal { display: grid; grid-template-columns: minmax(0, 1fr) 348px; gap: 16px; align-items: start; }

.period { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; }
.seg { display: inline-flex; padding: 3px; gap: 2px; background: #e6e8ec; border-radius: 12px; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button {
  border: 0; background: none; padding: 7px 14px; border-radius: 10px; min-height: 36px;
  font-weight: 500; font-size: 14px; color: var(--text-2); white-space: nowrap;
}
.seg button.on { background: var(--card); color: var(--accent-ink); font-weight: 600; box-shadow: var(--shadow); }
.period-note { color: var(--muted); font-size: 13px; }
.range { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.range .input { width: auto; min-height: 38px; }

.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; min-width: 0; }
.card.flush { padding: 0; overflow: hidden; }
.card-label { font-weight: 600; font-size: 14.5px; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.big { font-size: 40px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; margin-top: 6px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.mid { font-size: 26px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.2; margin-top: 6px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.side-card { display: block; }
.side-card .link { display: inline-block; margin-top: 14px; }
.side-card:hover .link { text-decoration: underline; }

.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 16px; }
.tile { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; background: var(--sunken); border-radius: 10px; }
.tile:hover { background: #eceef2; }
.tile-top { font-size: 15px; font-weight: 500; }
.tile-top b { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tile-sub { color: var(--muted); font-size: 12.5px; }
.hero-actions { display: flex; align-items: center; gap: 18px; margin-top: 18px; }

.bars { display: flex; align-items: flex-end; gap: 6px; height: 92px; margin-top: 18px; overflow-x: auto; }
.bar { flex: 1 0 14px; max-width: 44px; height: 100%; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.bar-cols { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 2px; }
.bar-cols i { display: block; width: 45%; max-width: 12px; min-height: 2px; border-radius: 3px 3px 0 0; }
.bar-cols .in { background: var(--k-cash); }
.bar-cols .out { background: #f0a37a; }
.bar small { color: var(--muted); font-size: 10.5px; line-height: 1; }

/* ---------- rows, entries ---------- */
.rows { display: flex; flex-direction: column; margin-top: 8px; }
.row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line-soft); }
.rows .row:first-child { border-top: 0; }
a.row:hover .row-title { color: var(--accent-ink); }
.row-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.row-title { font-weight: 600; overflow-wrap: anywhere; }
.row-sub { color: var(--muted); font-size: 12.5px; }
.row-go { color: var(--muted); }
.share { display: block; height: 4px; margin-top: 6px; background: var(--sunken); border-radius: 2px; overflow: hidden; max-width: 280px; }
.share i { display: block; height: 100%; background: currentColor; border-radius: 2px; }
.amount { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.amount.neutral { color: var(--text-2); }

.badge { flex: none; width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; }
.dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.kind-cash .badge, .kind-cash .dot, .kind-cash .share { color: var(--k-cash); }
.kind-salary .badge, .kind-salary .dot, .kind-salary .share { color: var(--k-salary); }
.kind-rent .badge, .kind-rent .dot, .kind-rent .share { color: var(--k-rent); }
.kind-utility .badge, .kind-utility .dot, .kind-utility .share { color: var(--k-utility); }
.kind-expense .badge, .kind-expense .dot, .kind-expense .share { color: var(--k-expense); }
.kind-debt .badge, .kind-debt .dot, .kind-debt .share { color: var(--k-debt); }
.badge { background: color-mix(in srgb, currentColor 12%, white); }

.totals { display: flex; flex-wrap: wrap; gap: 8px 28px; padding: 16px 20px; border-bottom: 1px solid var(--line-soft); }
.stat { display: flex; flex-direction: column; }
.stat span { color: var(--muted); font-size: 12.5px; }
.stat b { font-size: 19px; font-weight: 700; font-variant-numeric: tabular-nums; }
.entries { display: flex; flex-direction: column; }
.day {
  display: flex; justify-content: space-between; gap: 12px; padding: 9px 20px;
  background: #f7f8f9; border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft);
  color: var(--text-2); font-size: 13px; font-weight: 600;
}
.entries .day:first-child { border-top: 0; }
.day-sum { display: flex; gap: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.entry {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 10px 20px;
  background: none; border: 0; border-top: 1px solid var(--line-soft); text-align: left;
}
.entries .entry:first-child, .day + .entry { border-top: 0; }
.entry:hover { background: #fafbfc; }
.entry-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.entry-title { font-weight: 600; }
.entry-sub { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.card:not(.flush) .entry { padding-left: 0; padding-right: 0; }
.empty { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 36px 20px; color: var(--muted); text-align: center; }
.empty b { color: var(--text); font-weight: 600; }
.empty.small { padding: 18px 0 4px; align-items: flex-start; }
.empty.err { color: var(--neg); }

/* ---------- controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 9px 16px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--card);
  font-weight: 600; font-size: 14.5px; white-space: nowrap;
}
.btn:hover { background: #f5f6f8; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-hover); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--neg); }
.btn.danger.armed { background: var(--neg); border-color: var(--neg); color: #fff; }
.btn.small { min-height: 34px; padding: 5px 12px; font-size: 13px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: 0.55; cursor: default; }
.btn.logout { min-height: 36px; background: var(--sunken); border-color: transparent; justify-content: flex-start; font-weight: 500; }
.icon-btn { display: grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 10px; background: none; color: var(--muted); }
.icon-btn:hover { background: var(--sunken); }

.chips { display: flex; gap: 6px; }
.chips.wrap { flex-wrap: wrap; }
.chips.scroll { overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chips.scroll::-webkit-scrollbar { display: none; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; min-height: 36px; padding: 6px 12px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--card);
  font-weight: 500; font-size: 13.5px; white-space: nowrap; color: var(--text-2);
}
.chip:hover { border-color: #c9ced8; }
.chip.on { background: var(--accent-soft); border-color: #b9c8f3; color: #1b3a9c; font-weight: 600; }

.form { display: flex; flex-direction: column; gap: 14px; }
.form h2:not(:first-child) { margin-top: 8px; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field.grow { flex: 1; }
.field-row { display: flex; gap: 10px; }
.label { font-size: 13px; font-weight: 500; color: var(--text-2); }
.hint { font-size: 12.5px; color: var(--muted); }
.input {
  width: 100%; min-height: 42px; padding: 8px 12px;
  border: 1px solid #d3d7de; border-radius: 10px; background: var(--card);
}
.input:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
.input:disabled { background: var(--sunken); color: var(--muted); }
.input::placeholder { color: #98a0ad; }
.form-msg { color: var(--neg); font-size: 13.5px; font-weight: 500; }
.form-msg:empty { display: none; }
.form-actions { display: flex; gap: 10px; }
.form-actions .btn.primary { flex: 1; }

/* ---------- calculator ---------- */
.calc { display: flex; flex-direction: column; gap: 12px; }
.calc-card h2 { margin-bottom: 14px; }
.calc-card { position: sticky; top: 16px; max-height: calc(100dvh - 32px); overflow-y: auto; }
.calc-display { background: var(--sunken); border-radius: 12px; padding: 10px 14px 12px; }
.calc-input {
  width: 100%; border: 0; background: none; padding: 0; text-align: right;
  font-size: 28px; font-weight: 700; letter-spacing: -0.01em; font-variant-numeric: tabular-nums;
}
.calc-input:focus { outline: none; }
.calc-display:focus-within { box-shadow: inset 0 0 0 2px var(--accent); }
.calc-input::placeholder { color: #a9b0bc; }
.calc-result { text-align: right; color: var(--pos); font-weight: 600; font-size: 15px; font-variant-numeric: tabular-nums; min-height: 22px; }
.calc-result.hint { color: var(--muted); font-weight: 400; font-size: 12.5px; }
.calc-result.bad { color: var(--muted); }
.keypad { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.key {
  min-height: 46px; border: 1px solid var(--line); border-radius: 10px; background: var(--card);
  font-size: 18px; font-weight: 600; display: grid; place-items: center;
  touch-action: manipulation; user-select: none; -webkit-user-select: none;
}
.key:hover { background: #f5f6f8; }
.key:active { background: #e9ecf1; }
.key.op { background: var(--accent-soft); border-color: transparent; color: #1b3a9c; font-size: 20px; }
.key.fn { background: var(--sunken); border-color: transparent; color: var(--text-2); }
.key.eq { grid-row: span 2; background: var(--accent); border-color: var(--accent); color: #fff; font-size: 22px; }

/* ---------- entry form: what happened, then how much ---------- */
.pick { display: flex; flex-direction: column; gap: 6px; }
.pick-q { font-size: 17px; font-weight: 700; margin-bottom: 2px; }
.pick-group {
  margin: 10px 2px 2px; color: var(--muted);
  font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
}
.pick-item {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 8px 10px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--card); text-align: left;
}
.pick-item:hover { border-color: #c3c9d4; background: #fafbfc; }
.pick-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.pick-text b { font-weight: 600; font-size: 15px; }
.pick-text small { color: var(--muted); font-size: 12.5px; }
.calc-detail { display: flex; flex-direction: column; gap: 12px; }
.chosen { display: flex; align-items: center; gap: 12px; padding: 8px 10px; background: var(--sunken); border-radius: 12px; }
.date-note {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%;
  padding: 8px 12px; border: 1px solid #ecd58a; border-radius: 10px; background: #fdf5d7;
  color: #6b4e00; font-size: 13.5px; font-weight: 500; text-align: left;
}
.date-note b { font-weight: 600; white-space: nowrap; }
.form-foot { display: flex; flex-direction: column; gap: 8px; }
.sheet .form-foot {
  position: sticky; bottom: 0; z-index: 1; margin: 0 -18px; padding: 10px 18px 4px;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0), var(--card) 10px);
}
.quick { display: flex; flex-wrap: wrap; gap: 6px; }
.quick:empty { display: none; }
.chip.small { min-height: 32px; padding: 4px 11px; font-size: 13px; }
.check { display: flex; align-items: center; gap: 10px; min-height: 36px; font-size: 14px; font-weight: 500; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); flex: none; }
.steps, .rules { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 8px; }
.steps li::marker { font-weight: 700; color: var(--accent-ink); }
.start { border: 1px solid #c9d5f5; background: #f5f8ff; }
.start h2 { margin-bottom: 12px; }
.row.static .row-sub { font-size: 13px; }

.staff { border-top: 1px solid var(--line-soft); }
.rows .staff:first-child { border-top: 0; }
.staff .row { border-top: 0; flex-wrap: wrap; }
.staff-reset { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 0 0 12px 46px; }
.staff-reset .input { flex: 1; min-width: 150px; min-height: 36px; }
.staff-reset .form-msg { flex-basis: 100%; }
.staff-add { margin-top: 6px; padding-top: 14px; border-top: 1px solid var(--line-soft); }
.btn.small.danger.armed { background: var(--neg); border-color: var(--neg); color: #fff; }

/* ---------- overlay, toast ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 50; background: rgba(16, 24, 40, 0.42);
  display: grid; place-items: center; padding: 20px; overflow-y: auto;
}
.sheet { width: 100%; max-width: 420px; background: var(--card); border-radius: 18px; padding: 16px 18px 18px; box-shadow: 0 20px 50px rgba(16, 24, 40, 0.25); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 60; transform: translateX(-50%);
  padding: 11px 18px; border-radius: 12px; background: #14171c; color: #fff;
  font-weight: 600; font-size: 14px; box-shadow: 0 8px 24px rgba(16, 24, 40, 0.25);
  max-width: calc(100vw - 32px);
}

/* ---------- auth ---------- */
.auth { min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 24px 16px; }
.auth-card { width: 100%; max-width: 400px; padding: 28px 24px; display: flex; flex-direction: column; gap: 14px; }
.auth-card h1 { font-size: 20px; margin-top: 6px; }
.big-brand { font-size: 44px; text-align: center; padding: 0; }
.switch { text-align: center; color: var(--muted); font-size: 14px; }
.narrow-only { display: none; }

/* ---------- phones and small tablets ---------- */
@media (max-width: 1020px) {
  .grid-journal { grid-template-columns: minmax(0, 1fr); }
  .wide-only { display: none !important; }
  .narrow-only { display: inline-flex; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { display: none; }
  .topbar {
    display: flex; align-items: baseline; gap: 10px; padding: 14px 16px 0;
  }
  .topbar .brand { padding: 0; font-size: 24px; }
  .topbar .brand-sub { padding: 0; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topbar { align-items: center; }
  .topbar .lang-seg { align-self: center; }
  .topbar .lang-seg button { min-height: 36px; }
  .main { padding: 14px 16px calc(96px + env(safe-area-inset-bottom)); gap: 14px; }
  h1 { font-size: 22px; }
  .grid-2, .grid-even { grid-template-columns: minmax(0, 1fr); }
  .big { font-size: 34px; }
  .card { padding: 16px; }
  .totals, .pad { padding: 14px 16px; }
  .day, .entry { padding-left: 16px; padding-right: 16px; }
  .head-actions .btn.narrow-only { display: none; }
  .tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    display: grid; grid-template-columns: repeat(5, 1fr); align-items: center;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, 0.96); border-top: 1px solid var(--line);
  }
  .tab { display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 48px; justify-content: center; color: var(--muted); font-size: 11px; font-weight: 500; }
  .tab span:last-child { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tab.on { color: var(--accent-ink); font-weight: 600; }
  .tab-add {
    justify-self: center; width: 54px; height: 54px; border-radius: 50%; border: 0;
    display: grid; place-items: center; background: var(--accent); color: #fff;
    box-shadow: 0 6px 16px rgba(47, 91, 231, 0.35);
  }
  .overlay { padding: 0; place-items: end center; }
  .sheet { max-width: none; border-radius: 18px 18px 0 0; padding-bottom: calc(18px + env(safe-area-inset-bottom)); max-height: 100dvh; overflow-y: auto; }
  .key { min-height: 52px; }
  .toast { bottom: calc(92px + env(safe-area-inset-bottom)); }
  .row.static { flex-wrap: wrap; }
  .row.static .btn { margin-left: 46px; }
  .topbar .icon-btn { width: 36px; height: 36px; }
}
@media (max-width: 420px) {
  .tiles { grid-template-columns: minmax(0, 1fr); }
  .field-row { flex-direction: column; }
}
@media (prefers-reduced-motion: no-preference) {
  .btn, .chip, .nav, .key, .seg button { transition: background-color 0.12s ease, border-color 0.12s ease; }
}
