/* Planner — dark only, iOS 26–inspired: true black, grouped cards, glass bars, green accent. */
:root {
  color-scheme: dark;
  --bg: #000;
  --card: #1c1c1e;
  --card-2: #2c2c2e;
  --fill: rgba(118, 118, 128, 0.24);
  --fill-2: rgba(118, 118, 128, 0.16);
  --sep: rgba(84, 84, 88, 0.5);
  --text: #fff;
  --text-2: rgba(235, 235, 245, 0.6);
  --text-3: rgba(235, 235, 245, 0.32);
  --accent: #30d158;
  --accent-ink: #00230b;
  --accent-soft: rgba(48, 209, 88, 0.15);
  --danger: #ff453a;
  --danger-soft: rgba(255, 69, 58, 0.14);
  --glass: rgba(37, 37, 41, 0.58);
  --glass-strong: rgba(30, 30, 33, 0.82);
  --glass-edge: rgba(255, 255, 255, 0.1);
  --glass-shine: inset 0 0.5px 0 rgba(255, 255, 255, 0.18), 0 8px 32px rgba(0, 0, 0, 0.45);
  --r-card: 26px;
  --r-ctl: 14px;
  --top: env(safe-area-inset-top, 0px);
  --bottom: env(safe-area-inset-bottom, 0px);
  --dock-gap: max(12px, calc(var(--bottom) - 12px));
  --ease: cubic-bezier(0.32, 0.72, 0, 1);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh;
  background: var(--bg); color: var(--text);
  font: 17px/1.35 var(--font); letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}
body.sheet-open { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; -webkit-user-select: none; user-select: none; }
h1, h2, h3, p { margin: 0; }
b { font-weight: 600; }
.boot { padding: 40vh 24px 0; text-align: center; color: var(--text-2); }

.ic { width: 22px; height: 22px; flex: none; }
.ic-xs { width: 14px; height: 14px; vertical-align: -2px; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.accent { color: var(--accent); }
.warn { color: var(--danger); }
.small { font-size: 15px; }
.hint { color: var(--text-2); font-size: 13px; line-height: 1.4; }
.center { text-align: center; }
.optional { color: var(--text-3); font-weight: 400; font-size: 12px; margin-left: 4px; }
.eyebrow { color: var(--text-2); font-size: 13px; font-weight: 500; }

/* ---------- glass buttons ---------- */
.glass-btn {
  width: 44px; height: 44px; border-radius: 50%; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--glass); border: 0.5px solid var(--glass-edge); box-shadow: var(--glass-shine);
  -webkit-backdrop-filter: blur(20px) saturate(180%); backdrop-filter: blur(20px) saturate(180%);
  color: var(--text); transition: transform 0.25s var(--ease), background 0.2s;
}
.glass-btn.sm { width: 34px; height: 34px; }
.glass-btn.sm .ic { width: 18px; height: 18px; }
.glass-btn:active { transform: scale(0.9); background: rgba(70, 70, 76, 0.6); }
.plain-btn {
  width: 32px; height: 32px; border-radius: 50%; border: 0; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--fill-2); color: var(--text); transition: transform 0.2s var(--ease);
}
.plain-btn .ic { width: 18px; height: 18px; }
.plain-btn:active { transform: scale(0.88); }
.plain-btn.accent { color: var(--accent); background: var(--accent-soft); }

/* ---------- top bar (scroll-edge blur) ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: calc(var(--top) + 8px) 16px 14px;
}
.topbar::before {
  content: ""; position: absolute; inset: 0 0 -18px; z-index: -1; pointer-events: none;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.92) 40%, rgba(0, 0, 0, 0));
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  -webkit-mask-image: linear-gradient(to bottom, #000 55%, transparent);
  mask-image: linear-gradient(to bottom, #000 55%, transparent);
}
.topbar-spacer { width: 44px; flex: none; }
.pill-switch {
  display: flex; align-items: center; height: 44px; border-radius: 22px; padding: 0 4px;
  background: var(--glass); border: 0.5px solid var(--glass-edge); box-shadow: var(--glass-shine);
  -webkit-backdrop-filter: blur(20px) saturate(180%); backdrop-filter: blur(20px) saturate(180%);
  min-width: 0;
}
.pill-switch a { width: 36px; height: 36px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: var(--text-2); flex: none; }
.pill-switch a:active { background: var(--fill); }
.pill-switch a .ic { width: 18px; height: 18px; }
.pill-switch .title { font-size: 16px; font-weight: 600; padding: 0 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 5px; }
.pill-switch .title .ic { width: 14px; height: 14px; color: var(--accent); }
.topbar .title-plain { font-size: 17px; font-weight: 600; }

/* ---------- content ---------- */
.content {
  max-width: 600px; margin: 0 auto;
  padding: 0 16px calc(var(--dock-gap) + 62px + 40px);
  display: flex; flex-direction: column; gap: 14px;
}
.large-title { font-size: 34px; font-weight: 700; letter-spacing: -0.025em; line-height: 1.12; padding: 2px 4px 2px; }
.title-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.back-link { display: inline-flex; align-items: center; gap: 2px; color: var(--accent); font-size: 17px; margin: 0 0 -6px -6px; padding: 4px 6px; border-radius: 10px; width: max-content; }
.back-link .ic { width: 20px; height: 20px; }
.section-label { font-size: 13px; color: var(--text-2); padding: 6px 16px 0; text-transform: uppercase; letter-spacing: 0.02em; display: flex; justify-content: space-between; gap: 8px; }
.section-label span:last-child { text-transform: none; letter-spacing: 0; }

/* ---------- cards ---------- */
.card { background: var(--card); border-radius: var(--r-card); padding: 18px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.card.flush { padding: 0; gap: 0; overflow: hidden; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 32px; }
.card-head h2 { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; }
.card-head h3 { font-size: 16px; font-weight: 600; }

.hero { background: linear-gradient(160deg, #1f2a22 0%, #1c1c1e 55%); }
.totals-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.totals-2 > div { min-width: 0; }
.big { font-size: clamp(22px, 7vw, 30px); font-weight: 700; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.big.sm { font-size: clamp(19px, 5.6vw, 24px); }
.big .unit { font-size: 0.55em; font-weight: 600; color: var(--text-2); margin-left: 3px; letter-spacing: 0; }
.big.neg { color: var(--danger); }
.sub-amt { font-size: 15px; color: var(--text-2); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.divider { height: 0.5px; background: var(--sep); margin: 2px 0; }

/* two equal columns of cards */
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; align-items: stretch; }
.split > .card { padding: 14px; gap: 10px; }
.mini-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.mini-head h3 { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-total { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-total .eur { display: block; font-size: 15px; font-weight: 600; color: var(--text-2); }
.mini-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.mini-item { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-top: 0.5px solid var(--sep); min-width: 0; }
.mini-item .mi-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.mini-item .mi-name { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-item .mi-amt { font-size: 13px; color: var(--text-2); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-item.done .mi-name { color: var(--text-3); text-decoration: line-through; }
.mini-empty { font-size: 13px; color: var(--text-3); }
.mini-add {
  margin-top: auto; align-self: flex-start; display: inline-flex; align-items: center; gap: 4px;
  min-height: 32px; padding: 0 12px 0 8px; border-radius: 999px; border: 0;
  background: var(--accent-soft); color: var(--accent); font-size: 14px; font-weight: 600;
  transition: transform 0.2s var(--ease);
}
.mini-add .ic { width: 16px; height: 16px; stroke-width: 2.2; }
.mini-add:active { transform: scale(0.94); }
.mini-foot { margin-top: auto; font-size: 12.5px; color: var(--text-2); }

/* ---------- grouped list rows ---------- */
.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.row {
  position: relative; display: flex; align-items: center; gap: 12px;
  min-height: 52px; padding: 10px 16px; transition: background 0.2s;
}
.row + .row::before { content: ""; position: absolute; top: 0; right: 0; left: 16px; height: 0.5px; background: var(--sep); }
.row.has-icon + .row.has-icon::before, .row.has-check + .row::before, .row + .row.has-check::before { left: 54px; }
.list > li + li > .row::before { content: ""; position: absolute; top: 0; right: 0; left: 16px; height: 0.5px; background: var(--sep); }
.list > li + li > .row.has-icon::before { left: 60px; }
.card:not(.flush) .row { padding-left: 0; padding-right: 0; }
.card:not(.flush) .row + .row::before { left: 0; }
.row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; align-self: stretch; justify-content: center; }
.row-title { font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-title.done { color: var(--text-3); text-decoration: line-through; }
.row-sub { font-size: 13px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 4px; }
.row-end { display: flex; align-items: center; gap: 6px; color: var(--text-2); flex: none; font-variant-numeric: tabular-nums; font-size: 16px; }
.row-end .ic { width: 16px; height: 16px; color: var(--text-3); }
.amount { font-variant-numeric: tabular-nums; font-weight: 500; white-space: nowrap; text-align: right; color: var(--text); }
.amount.neg { color: var(--danger); }
.amount.pos { color: var(--accent); }
.amount.dim { color: var(--text-2); font-weight: 400; }
.tappable { cursor: pointer; }
a.row:active, .row.tappable:active { background: rgba(255, 255, 255, 0.06); }
.faded { opacity: 0.5; }

.icon-tile {
  width: 32px; height: 32px; border-radius: 9px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent);
}
.icon-tile .ic { width: 19px; height: 19px; }
.icon-tile.neutral { background: var(--fill-2); color: var(--text-2); }

/* transaction rows */
.tx-ic { width: 34px; height: 34px; border-radius: 50%; flex: none; display: inline-flex; align-items: center; justify-content: center; background: var(--fill-2); color: var(--text-2); }
.tx-ic .ic { width: 17px; height: 17px; }
.tx-income .tx-ic { background: var(--accent-soft); color: var(--accent); }
.tx-income .amount { color: var(--accent); }
.tx-transfer .amount, .tx-adjust .amount { color: var(--text-2); }
.row.tx + .row.tx::before { left: 62px; }

/* ---------- checkbox (circle) ---------- */
.check {
  position: relative; width: 26px; height: 26px; flex: none; border-radius: 50%; padding: 0;
  border: 1.6px solid var(--text-3); background: transparent; color: transparent;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background 0.25s var(--ease), border-color 0.25s var(--ease), transform 0.25s var(--ease);
}
.check::after { content: ""; position: absolute; inset: -10px; }
.check .ic { width: 15px; height: 15px; stroke-width: 2.8; }
.check.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.check.pop { animation: pop 0.42s var(--ease); }
.check:active { transform: scale(0.85); }
.check:disabled { opacity: 0.4; }
.check.sm { width: 22px; height: 22px; }
.check.sm .ic { width: 13px; height: 13px; }

.tag { font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--fill-2); color: var(--text-2); white-space: nowrap; }
.tag.accent { background: var(--accent-soft); color: var(--accent); }

/* ---------- bars ---------- */
.bar { height: 6px; border-radius: 99px; background: var(--fill-2); overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: 99px; background: var(--accent); transform-origin: left; }
.enter .bar > span, .push .bar > span { animation: grow 0.8s var(--ease) 0.15s both; }
.bar.over > span { background: var(--danger); }
.bars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.bar-label { display: flex; justify-content: space-between; gap: 8px; font-size: 15px; margin-bottom: 6px; }
.bar-label span:last-child { color: var(--text-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.months-bars { gap: 10px; }
.months-bars li.current .bar-label span:first-child { color: var(--accent); font-weight: 600; }
.months-bars li.faded .bar-label { margin: 0; }

/* compare table (planned vs actual, money flow) */
.table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: 15px; }
.table th, .table td { padding: 9px 0; text-align: right; border-top: 0.5px solid var(--sep); white-space: nowrap; }
.table thead th { border-top: 0; color: var(--text-2); font-size: 13px; font-weight: 500; padding-top: 0; }
.table th[scope="row"] { text-align: left; font-weight: 400; color: var(--text-2); padding-right: 8px; white-space: normal; }
.table td { padding-left: 10px; }
.table tr.strong th, .table tr.strong td { color: var(--text); font-weight: 600; }
.table tr.accent th, .table tr.accent td { color: var(--accent); }

/* ---------- buttons ---------- */
.btn {
  min-height: 50px; padding: 0 20px; border-radius: 999px; border: 0;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 17px; font-weight: 600; background: var(--fill); color: var(--text); white-space: nowrap;
  transition: transform 0.25s var(--ease), opacity 0.2s;
}
.btn:active { transform: scale(0.97); opacity: 0.85; }
.btn .ic { width: 20px; height: 20px; }
.btn-sm { min-height: 36px; padding: 0 14px; font-size: 15px; }
.btn-block { width: 100%; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-ghost { background: var(--fill-2); }
.btn-tinted { background: var(--accent-soft); color: var(--accent); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger-ghost { background: transparent; color: var(--danger); min-height: 44px; }
.btn-row { display: flex; gap: 10px; }
.btn-row .btn { flex: 1; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.file-btn { cursor: pointer; }
.link-btn { background: none; border: 0; color: var(--accent); padding: 4px 0; font-size: 15px; text-align: left; }
.text-btn { background: none; border: 0; color: var(--accent); font-size: 17px; padding: 12px 4px; display: inline-flex; align-items: center; gap: 6px; }
.text-btn .ic { width: 20px; height: 20px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  min-height: 34px; padding: 0 14px; border-radius: 999px; border: 0;
  background: var(--fill-2); font-size: 15px; display: inline-flex; align-items: center; gap: 4px;
  transition: transform 0.2s var(--ease);
}
.chip:active { transform: scale(0.95); }
.chip-add { color: var(--accent); background: var(--accent-soft); }
.chip-add .ic { width: 16px; height: 16px; }
.ideas { display: flex; flex-direction: column; gap: 8px; padding: 2px 0 6px; }

/* ---------- floating dock: tab bar + add ---------- */
.dock {
  position: fixed; z-index: 30; left: 0; right: 0; bottom: var(--dock-gap);
  display: flex; gap: 10px; align-items: center; padding: 0 14px; max-width: 560px; margin: 0 auto;
  pointer-events: none;
}
.dock > * { pointer-events: auto; }
.tabbar {
  position: relative; flex: 1; height: 62px; padding: 4px; border-radius: 31px;
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--glass); border: 0.5px solid var(--glass-edge); box-shadow: var(--glass-shine);
  -webkit-backdrop-filter: blur(24px) saturate(180%); backdrop-filter: blur(24px) saturate(180%);
}
.tab-indicator {
  position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc((100% - 8px) / 5); border-radius: 27px;
  background: rgba(255, 255, 255, 0.1);
  transform: translateX(calc(var(--i, 0) * 100%));
  transition: transform 0.5s var(--ease);
}
.tab {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font-size: 10px; font-weight: 600; color: var(--text-2); border-radius: 27px;
  transition: color 0.3s, transform 0.25s var(--ease);
}
.tab .ic { width: 25px; height: 25px; stroke-width: 1.6; }
.tab.active { color: var(--accent); }
.tab.active .ic { fill: currentColor; fill-opacity: 0.16; }
.tab:active { transform: scale(0.92); }
.add-btn {
  width: 62px; height: 62px; border-radius: 50%; border: 0; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent); color: var(--accent-ink);
  box-shadow: 0 8px 28px rgba(48, 209, 88, 0.28), inset 0 0.5px 0 rgba(255, 255, 255, 0.5);
  transition: transform 0.3s var(--ease);
}
.add-btn .ic { width: 28px; height: 28px; stroke-width: 2.3; }
.add-btn:active { transform: scale(0.9); }
.dock.solo { justify-content: flex-end; }

/* ---------- home ---------- */
.year-total { color: var(--text-2); font-size: 15px; padding: 0 4px; }
.year-total b { color: var(--text); }
.month-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 520px) { .month-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.month-card {
  background: var(--card); border-radius: 24px; padding: 16px; min-height: 108px;
  display: flex; flex-direction: column; gap: 2px; transition: transform 0.3s var(--ease);
  position: relative;
}
.month-card:active { transform: scale(0.96); }
.month-card.now { box-shadow: inset 0 0 0 1.5px var(--accent); }
.month-card.now .m-name { color: var(--accent); }
.m-name { font-size: 17px; font-weight: 600; margin-bottom: 6px; }
.m-amount { font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; }
.m-amount.dim { color: var(--text-3); font-weight: 400; }
.m-label { font-size: 12px; color: var(--text-2); }
.m-status { margin-top: auto; padding-top: 8px; font-size: 12px; color: var(--text-3); display: flex; align-items: center; gap: 4px; }
.m-status.ok { color: var(--accent); }
.month-card.not-started { background: #121214; }

.banner {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 20px;
  background: var(--accent-soft); color: var(--text); font-size: 15px;
}
.banner .ic { color: var(--accent); }
.banner.danger { background: var(--danger-soft); }

.empty { text-align: center; padding: 36px 24px; display: flex; flex-direction: column; gap: 6px; align-items: center; }
.empty-title { font-size: 17px; font-weight: 600; }
.empty-text { color: var(--text-2); font-size: 15px; max-width: 300px; }

.steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; color: var(--text-2); font-size: 15px; }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field.grow { flex: 1; }
.label { font-size: 13px; color: var(--text-2); font-weight: 500; display: flex; align-items: center; gap: 6px; padding-left: 4px; }
.input, .select {
  width: 100%; min-height: 50px; padding: 12px 16px; border-radius: var(--r-ctl);
  background: var(--fill-2); border: 0; color: var(--text); font-size: 17px; outline: none;
  -webkit-appearance: none; appearance: none; transition: box-shadow 0.2s;
}
.input::placeholder { color: var(--text-3); }
.input:focus, .select:focus { box-shadow: 0 0 0 2px var(--accent); }
.input[type="date"], .input[type="time"] { color-scheme: dark; }
.input-amount { font-size: 30px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; padding: 10px 16px; min-height: 60px; }
.input-right { text-align: right; font-variant-numeric: tabular-nums; }
.select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M7 10l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; background-size: 16px; padding-right: 40px;
}
.field-inline { flex-direction: row; align-items: center; justify-content: space-between; gap: 12px; }
.field-inline .label { flex: 1; font-size: 16px; color: var(--text); font-weight: 400; padding: 0; }
.field-inline .input, .field-inline .select { width: 50%; flex: none; }
.has-error .input, .has-error .select { box-shadow: 0 0 0 2px var(--danger); }
.field-error { color: var(--danger); font-size: 13px; width: 100%; padding-left: 4px; }
.field-inline.has-error { flex-wrap: wrap; }
.amount-row { display: flex; gap: 10px; align-items: flex-end; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cur-tag { font-size: 11px; font-weight: 600; color: var(--text-2); background: var(--fill); border-radius: 6px; padding: 1px 6px; }
.check-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 16px; min-height: 44px; }
.edit-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }

/* iOS switch */
.switch { position: relative; width: 51px; height: 31px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: var(--fill); transition: background 0.25s var(--ease); }
.switch span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3); transition: transform 0.3s var(--ease); }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(20px); }

/* segmented control */
.seg { position: relative; display: flex; background: var(--fill-2); border-radius: 12px; padding: 2px; gap: 2px; min-height: 40px; }
.seg-opt { flex: 1; position: relative; display: flex; }
.seg-opt input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; z-index: 1; }
.seg-opt span {
  flex: 1; display: flex; align-items: center; justify-content: center; padding: 0 10px; border-radius: 10px;
  font-size: 15px; font-weight: 500; color: var(--text-2); white-space: nowrap;
  transition: background 0.25s var(--ease), color 0.25s;
}
.seg-opt input:checked + span { background: #636366; color: var(--text); font-weight: 600; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25); }
.seg-opt input:focus-visible + span { outline: 2px solid var(--accent); }
.amount-row .seg { min-height: 60px; }
.seg-sm .seg-opt span { font-size: 13.5px; padding: 0 6px; }

/* ---------- sheet (floating glass) ---------- */
#sheet-root { position: fixed; inset: 0; z-index: 50; display: none; }
#sheet-root.open { display: block; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.5); animation: fade 0.3s ease both; }
.sheet {
  position: absolute; left: 8px; right: 8px; bottom: 8px; margin: 0 auto; max-width: 560px;
  max-height: calc(100dvh - var(--top) - 24px);
  background: var(--glass-strong); border: 0.5px solid var(--glass-edge); box-shadow: var(--glass-shine);
  -webkit-backdrop-filter: blur(40px) saturate(180%); backdrop-filter: blur(40px) saturate(180%);
  border-radius: 34px; display: flex; flex-direction: column;
  animation: sheet-in 0.5s var(--ease) both;
}
#sheet-root.swap .sheet, #sheet-root.swap .sheet-backdrop { animation: none; }
#sheet-root.closing .sheet { animation: sheet-out 0.26s cubic-bezier(0.4, 0, 1, 1) both; }
#sheet-root.closing .sheet-backdrop { animation: fade-out 0.26s ease both; }
.sheet-grip { width: 36px; height: 5px; border-radius: 9px; background: var(--text-3); margin: 7px auto 0; flex: none; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 6px 14px 4px 22px; flex: none; }
.sheet-head h2 { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; }
.sheet-body { padding: 10px 18px 14px; overflow-y: auto; display: flex; flex-direction: column; gap: 16px; -webkit-overflow-scrolling: touch; }
.sheet-foot { padding: 6px 18px calc(max(var(--bottom), 8px) + 8px); display: flex; flex-direction: column; gap: 8px; flex: none; }
.sheet-text { color: var(--text-2); font-size: 16px; }
.choice-list { display: flex; flex-direction: column; gap: 8px; padding-bottom: calc(max(var(--bottom), 8px) + 4px); }
.choice {
  text-align: left; padding: 14px 18px; border-radius: 20px; border: 0; background: var(--fill-2);
  display: flex; flex-direction: column; gap: 3px; min-height: 58px; justify-content: center;
  transition: transform 0.2s var(--ease);
}
.choice:active { transform: scale(0.98); }
.choice.primary { background: var(--accent-soft); }
.choice.primary .choice-title { color: var(--accent); }
.choice-title { font-weight: 600; font-size: 17px; }
.choice-hint { color: var(--text-2); font-size: 13px; }

/* ---------- toast ---------- */
#toast-root { position: fixed; left: 0; right: 0; top: calc(var(--top) + 10px); z-index: 60; display: flex; justify-content: center; pointer-events: none; padding: 0 16px; }
.toast {
  pointer-events: auto; max-width: 520px; display: flex; align-items: center; gap: 14px;
  background: var(--glass-strong); border: 0.5px solid var(--glass-edge); box-shadow: var(--glass-shine);
  -webkit-backdrop-filter: blur(30px) saturate(180%); backdrop-filter: blur(30px) saturate(180%);
  color: var(--text); border-radius: 999px; padding: 12px 12px 12px 20px; min-height: 48px;
  font-size: 15px; font-weight: 500; animation: toast-in 0.45s var(--ease) both;
}
.toast.out { animation: toast-out 0.22s ease both; }
.toast-btn { background: var(--accent-soft); color: var(--accent); border: 0; border-radius: 999px; font-weight: 600; padding: 6px 12px; white-space: nowrap; font-size: 15px; }

/* ---------- lock screen ---------- */
#lock-root { position: fixed; inset: 0; z-index: 45; background: var(--bg); overflow-y: auto; }
body.locked { overflow: hidden; }
.lock {
  min-height: 100%; max-width: 360px; margin: 0 auto; padding: calc(var(--top) + 12vh) 24px calc(var(--bottom) + 24px);
  display: flex; flex-direction: column; align-items: center; gap: 14px; animation: rise 0.5s var(--ease) both;
}
.lock-icon { width: 72px; height: 72px; border-radius: 18px; margin-bottom: 8px; }
.lock h1 { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; }
.lock-form { width: 100%; display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.lock-form .input { text-align: center; font-size: 19px; }
.lock-form .field-error { text-align: center; padding: 0; }
.shake { animation: shake 0.4s var(--ease); }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }

/* ---------- motion ---------- */
.enter > * { animation: rise 0.5s var(--ease) both; }
.enter > *:nth-child(2) { animation-delay: 0.03s; }
.enter > *:nth-child(3) { animation-delay: 0.06s; }
.enter > *:nth-child(4) { animation-delay: 0.09s; }
.enter > *:nth-child(5) { animation-delay: 0.12s; }
.enter > *:nth-child(n + 6) { animation-delay: 0.15s; }
.push > * { animation: push-in 0.45s var(--ease) both; }
.pop > * { animation: pop-in 0.45s var(--ease) both; }

@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
@keyframes push-in { from { opacity: 0; transform: translateX(40px); } }
@keyframes pop-in { from { opacity: 0; transform: translateX(-40px); } }
@keyframes fade { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }
@keyframes sheet-in { from { transform: translateY(105%); } }
@keyframes sheet-out { to { transform: translateY(105%); } }
@keyframes toast-in { from { opacity: 0; transform: translateY(-24px) scale(0.92); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(-12px) scale(0.96); } }
@keyframes pop { 0% { transform: scale(0.6); } 60% { transform: scale(1.15); } 100% { transform: scale(1); } }
@keyframes grow { from { transform: scaleX(0); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
