:root,
[data-theme="dark"] {
  --bg: #08090a;
  --surface: #0e0f11;
  --elevated: #131517;
  --ink: #f7f8f8;
  --muted: #8a8f98;
  --faint: #62666d;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.12);
  --accent: #5e6ad2;
  --accent-hover: #828fff;
  --accent-soft: rgba(94, 106, 210, 0.16);
  --green: #4cb782;
  --green-soft: rgba(76, 183, 130, 0.14);
  --amber: #f2c94c;
  --amber-soft: rgba(242, 201, 76, 0.14);
  --red: #eb5757;
  --red-soft: rgba(235, 87, 87, 0.14);
  --white: #f7f8f8;
  --black: #08090a;
  --radius: 10px;
  --font: Inter, "Segoe UI", sans-serif;
  --tabbar-h: 64px;
  --safe-b: max(12px, env(safe-area-inset-bottom));
  color-scheme: dark;
}

[data-theme="light"] {
  --bg: #f6f7f8;
  --surface: #ffffff;
  --elevated: #eef0f2;
  --ink: #111214;
  --muted: #5e636b;
  --faint: #8a8f98;
  --line: rgba(17, 18, 20, 0.08);
  --line-strong: rgba(17, 18, 20, 0.14);
  --accent-soft: rgba(94, 106, 210, 0.12);
  --white: #111214;
  --black: #ffffff;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: #050506;
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  letter-spacing: -0.011em;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.stage {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(240px, 320px) minmax(0, 1fr);
  gap: 32px;
  padding: 32px 40px;
  align-items: center;
}

.stage-meta {
  max-width: 320px;
}

.stage-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.brand-mark {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  display: grid;
  place-items: center;
}

.stage-name {
  font-weight: 600;
  letter-spacing: -0.02em;
}

.stage-sub,
.stage-copy,
.stage-notes {
  color: #8a8f98;
  font-size: 13px;
  line-height: 1.5;
}

.stage-copy {
  margin: 0 0 16px;
}

.stage-notes {
  margin: 0 0 20px;
  padding-left: 18px;
}

.stage-notes li + li {
  margin-top: 6px;
}

.stage-link {
  color: #f7f8f8;
  font-size: 13px;
  font-weight: 550;
}

.phone {
  display: flex;
  justify-content: center;
}

.phone-bezel {
  width: min(402px, 100%);
  height: min(844px, calc(100dvh - 48px));
  background: #000;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 36px;
  padding: 10px;
  box-shadow: 0 40px 80px rgba(0, 0, 0, 0.45);
}

.device {
  position: relative;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  border-radius: 28px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 22px 4px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.02em;
  flex: 0 0 auto;
}

.status-icons {
  display: flex;
  color: var(--ink);
}

.screen {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 12px 16px 16px;
  -webkit-overflow-scrolling: touch;
}

.tabbar {
  position: relative;
  z-index: 6;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: end;
  padding: 6px 4px var(--safe-b);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(18px);
  border-top: 1px solid var(--line);
  flex: 0 0 auto;
}

.tab {
  border: 0;
  background: transparent;
  color: var(--faint);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 550;
  padding: 4px 0 2px;
  min-height: 44px;
}

.tab svg {
  width: 22px;
  height: 22px;
}

.tab.is-active {
  color: var(--ink);
}

.composer {
  flex: 0 0 auto;
  z-index: 7;
  padding: 8px 12px 10px;
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  backdrop-filter: blur(18px);
  border-top: 1px solid var(--line);
}

.composer-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.composer-amount,
.composer-category {
  display: grid;
  align-items: center;
  min-height: 56px;
  background: var(--elevated);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.composer-amount {
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  padding: 6px 12px 6px 14px;
}

.composer-amount:focus-within,
.composer-category:focus-within {
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.composer-currency {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.04em;
  color: var(--muted);
}

.composer-amount input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.05em;
  font-variant-numeric: tabular-nums;
  height: 44px;
}

.composer-amount input::placeholder {
  color: var(--faint);
}

.composer-amount input:focus-visible {
  outline: none;
}

.composer-category {
  position: relative;
}

.composer-category-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  height: 56px;
  padding: 0 12px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 24px;
  font-weight: 550;
  text-align: left;
}

.composer-category-btn .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: 0 0 auto;
}

.composer-category-btn span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.composer-category-btn:not(.has-value) span {
  color: var(--faint);
}

.composer-category-menu {
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  width: min(280px, 78vw);
  max-height: 320px;
  overflow: auto;
  padding: 6px;
  background: var(--elevated);
  border: 0;
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  z-index: 8;
}

.composer-category-menu[hidden] {
  display: none;
}

.composer-cat {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  font-size: 14px;
  font-weight: 550;
  text-align: left;
}

.composer-cat.is-active {
  background: var(--surface);
}

.composer-cat .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: 0 0 auto;
}

.composer-cat-rule {
  height: 1px;
  margin: 6px 10px;
  background: var(--line);
  border: 0;
}

.composer-cat-heading {
  margin: 0;
  padding: 6px 10px 4px;
  color: var(--faint);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.composer-submit {
  width: 100%;
  margin-top: 8px;
  height: 48px;
  border: 1px solid var(--green);
  border-radius: 12px;
  background: transparent;
  color: var(--green);
  font-size: 15px;
  font-weight: 600;
}

.composer-submit:disabled {
  opacity: 0.38;
}

.home-indicator {
  display: none;
}

.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.month-header {
  margin-bottom: 16px;
}

.month-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.month-intro {
  flex: 1;
  min-width: 0;
}

.month-intro .hero-meta {
  margin: 4px 0 0;
}

.month-head-end {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  flex: 0 0 auto;
}

.month-context {
  margin: 0;
  font-size: 17px;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--muted);
  min-width: 0;
}

.month-total {
  flex: 0 0 auto;
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  text-align: right;
  color: var(--ink);
}

.hero-meta {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
  line-height: 18px;
}

.kicker {
  margin: 0;
  color: var(--faint);
  font-size: 12px;
  font-weight: 500;
  line-height: 16px;
  letter-spacing: 0.04em;
}

h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.04em;
}

h2 {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.hero {
  margin: 4px 0 16px;
}

.hero .hero-meta {
  margin-top: 6px;
}

.hero-amount {
  font-size: 44px;
  font-weight: 600;
  letter-spacing: -0.05em;
  font-variant-numeric: tabular-nums;
  line-height: 1.05;
}

.icon-btn,
.ghost-btn,
.chip,
.btn {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  border-radius: 8px;
}

.icon-btn {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  padding: 0;
}

.icon-btn svg {
  width: 16px;
  height: 16px;
}

.ghost-btn,
.btn {
  height: 36px;
  padding: 0 12px;
  font-weight: 550;
  font-size: 13px;
}

.btn-primary {
  background: var(--white);
  color: var(--black);
  border-color: transparent;
}

.btn-danger {
  background: var(--red-soft);
  color: var(--red);
  border-color: transparent;
}

.btn-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.nav-arrows {
  display: flex;
  gap: 6px;
  align-items: center;
}

button.glyph {
  padding: 0;
  flex: 0 0 auto;
}

button.glyph.is-active {
  color: var(--ink);
  border-color: var(--line-strong);
  background: var(--surface);
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
}

.card + .card,
.section + .section {
  margin-top: 10px;
}

.week-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.week-stack .card + .card {
  margin-top: 0;
}

.week-card {
  padding: 14px 10px 8px;
}

.week-card.is-current {
  border-color: var(--line-strong);
}

.week-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 0 4px;
}

.week-title {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1.1;
  color: var(--ink);
}

.week-remaining {
  flex: 0 0 auto;
  font-size: 36px;
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
  text-align: right;
  color: var(--ink);
}

.week-remaining.is-left {
  color: var(--green);
}

.week-remaining.is-over {
  color: var(--red);
}

.week-meta {
  margin: 6px 4px 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
  line-height: 18px;
}

.week-card .week-meter {
  height: 7px;
  margin: 12px 4px 16px;
}

.week-ledger {
  margin: 0 4px 8px;
  padding: 8px 10px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.likely-due {
  margin: 0 4px 12px;
  padding: 0;
}

.likely-due-label {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.likely-due-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  min-height: 24px;
  padding: 0;
}

.likely-due-row span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.2;
}

.likely-due-row strong {
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

.week-empty {
  padding: 8px 4px 12px;
}

.day-in-week {
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.day-in-week:last-child {
  padding-bottom: 4px;
  border-bottom: 0;
}

.day-in-week + .day-in-week {
  margin-top: 0;
}

.day-in-week:first-child .day-head {
  padding-top: 8px;
}

.week-card .day-head {
  margin: 0 6px;
  padding-top: 20px;
  padding-bottom: 8px;
}

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 10px;
}

.card-sub {
  margin: 3px 0 0;
  color: var(--faint);
  font-size: 12px;
  line-height: 1.4;
}

.class-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin: 0 0 16px;
}

.class-pair {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  border: 0;
  background: transparent;
  padding: 0;
  color: inherit;
}

.class-pair-label {
  font-size: 13px;
  font-weight: 400;
  color: var(--faint);
}

.class-pair-amount {
  font-size: 16px;
  font-weight: 500;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.class-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.week-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin: 0 0 10px;
  padding: 2px 0 4px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.week-tabs::-webkit-scrollbar {
  display: none;
}

.week-tab {
  flex: 0 0 auto;
  height: 36px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--faint);
  font-size: 13px;
  font-weight: 500;
}

.week-tab.is-active {
  background: var(--elevated);
  color: var(--ink);
  font-weight: 600;
}

.week-panel .week-card {
  margin-top: 0;
}

.cap-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}

.cap-value {
  font-size: 20px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
}

.meter {
  height: 5px;
  background: var(--elevated);
  border-radius: 999px;
  overflow: hidden;
  margin: 10px 0 8px;
}

.meter > span {
  display: block;
  height: 100%;
  background: var(--accent);
}

.meter.warn > span {
  background: var(--amber);
}

.meter.hot > span {
  background: var(--red);
}

.cap-meta {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
}

.chip-scroller {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 0 12px;
  margin: 0 -16px;
  padding-left: 16px;
  padding-right: 16px;
  scrollbar-width: none;
}

.chip-scroller::-webkit-scrollbar {
  display: none;
}

.chip {
  flex: 0 0 auto;
  height: 34px;
  border-radius: 999px;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
}

.chip.is-active {
  background: var(--elevated);
  border-color: var(--line-strong);
  color: var(--ink);
}

.chip .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 6px;
}

.pay-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pay-row,
.sub-row,
.setting-row,
.day-row {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 10px 8px;
  border-radius: 10px;
  min-height: 56px;
}

.pay-row:hover,
.sub-row:hover,
.setting-row:hover,
.day-row:hover {
  background: var(--elevated);
}

.glyph {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 650;
  background: var(--elevated);
  border: 1px solid var(--line);
  color: var(--muted);
}

.pay-copy strong,
.sub-copy strong,
.setting-copy strong {
  display: block;
  font-weight: 500;
  font-size: 16px;
  color: var(--ink);
}

.pay-copy span,
.sub-copy span,
.setting-copy span,
.money-sub {
  display: block;
  color: var(--faint);
  font-size: 13px;
  font-weight: 400;
  margin-top: 2px;
}

.money {
  font-size: 16px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  letter-spacing: -0.03em;
  text-align: right;
}

.pill {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  background: var(--elevated);
  color: var(--muted);
}

.pill.regular {
  background: var(--accent-soft);
  color: #a8b0f0;
}

.pill.subscription {
  background: rgba(139, 140, 248, 0.16);
  color: #b4b6ff;
}

.pill.monthly {
  background: rgba(107, 158, 255, 0.14);
  color: #8fb4ff;
}

.pill.one_off {
  background: var(--amber-soft);
  color: var(--amber);
}

.pill.debt {
  background: var(--red-soft);
  color: var(--red);
}

.pill.forecast {
  background: var(--amber-soft);
  color: var(--amber);
}

.pill.actual,
.pill.paid {
  background: var(--green-soft);
  color: var(--green);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

.empty {
  padding: 28px 12px;
  text-align: center;
  color: var(--muted);
}

.empty h2 {
  font-size: 16px;
  margin-bottom: 6px;
}

.empty p {
  margin: 0 0 14px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--faint);
}

.search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 12px;
  height: 42px;
  margin-bottom: 10px;
}

.search svg {
  width: 16px;
  height: 16px;
  color: var(--faint);
}

.search input {
  border: 0;
  outline: 0;
  width: 100%;
  background: transparent;
}

.search input::placeholder {
  color: var(--faint);
}

.day-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin: 16px 4px 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
  margin-bottom: 12px;
}

.cal-grid span,
.cal-day {
  text-align: center;
  font-size: 11px;
  color: var(--faint);
  padding: 4px 0;
}

.cal-day {
  border: 0;
  background: transparent;
  border-radius: 8px;
  color: var(--ink);
  min-height: 44px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
}

.cal-day em {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
  font-style: normal;
}

.cal-day.is-muted {
  color: var(--faint);
}

.cal-day.is-selected {
  background: var(--elevated);
}

.cal-day.is-today {
  box-shadow: inset 0 0 0 1px var(--line-strong);
}

.segmented {
  display: flex;
  gap: 2px;
  padding: 3px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-bottom: 12px;
}

.segmented button {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--muted);
  height: 32px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 550;
}

.segmented button.is-active {
  background: var(--elevated);
  color: var(--ink);
}

.stat-row,
.bucket-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  width: 100%;
  background: transparent;
  border-left: 0;
  border-right: 0;
  border-bottom: 0;
}

.stat-row:first-of-type,
.bucket-row:first-of-type {
  border-top: 0;
}

.bars {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  height: 92px;
  align-items: end;
  margin: 8px 0 4px;
}

.bars button {
  height: 100%;
  border: 0;
  background: transparent;
  padding: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
  color: var(--faint);
  font-size: 10px;
}

.bars i {
  display: block;
  width: 100%;
  max-width: 18px;
  border-radius: 4px 4px 1px 1px;
  background: #3a3d44;
  min-height: 3px;
}

.bars button.is-today i,
.bars button.is-active i {
  background: var(--accent);
}

.mix {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bucket-row span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.mix-row {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  font-size: 13px;
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  padding: 4px 0;
}

.swatch {
  width: 8px;
  height: 8px;
  border-radius: 2px;
}

.mix-track {
  height: 4px;
  background: var(--elevated);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 4px;
}

.mix-track span {
  display: block;
  height: 100%;
}

.note {
  background: var(--elevated);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  margin-bottom: 8px;
}

.note-input {
  width: 100%;
  min-height: 88px;
  border: 1px solid var(--line);
  background: var(--bg);
  border-radius: 8px;
  padding: 10px;
  resize: vertical;
}

.setting-row {
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 12px 4px;
  border-top: 1px solid var(--line);
  border-radius: 0;
  min-height: 52px;
}

.setting-row:first-child {
  border-top: 0;
}

.toggle {
  width: 44px;
  height: 26px;
  border: 0;
  border-radius: 999px;
  background: var(--elevated);
  position: relative;
}

.toggle.is-on {
  background: var(--accent);
}

.toggle i {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  transition: left 120ms ease;
}

.toggle.is-on i {
  left: 21px;
}

.sheet {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: grid;
  align-items: end;
}

.sheet[hidden] {
  display: none;
}

.sheet-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(0, 0, 0, 0.56);
}

.sheet-panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-height: 92%;
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 20px 20px 0 0;
  padding: 8px 16px calc(20px + env(safe-area-inset-bottom));
}

.sheet-handle {
  width: 36px;
  height: 4px;
  border-radius: 999px;
  background: var(--line-strong);
  margin: 4px auto 12px;
}

.sheet-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}

.amount-field {
  text-align: center;
  padding: 8px 0 18px;
}

.amount-field label {
  display: block;
  color: var(--faint);
  font-size: 12px;
  margin-bottom: 6px;
}

.amount-field input {
  width: 100%;
  border: 0;
  background: transparent;
  text-align: center;
  font-size: 48px;
  font-weight: 600;
  letter-spacing: -0.05em;
  font-variant-numeric: tabular-nums;
  outline: none;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 12px;
}

.field input,
.field select,
.field textarea {
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: var(--bg);
}

.field textarea {
  height: 84px;
  padding: 10px 12px;
  resize: vertical;
}

.more-toggle {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--muted);
  text-align: left;
  padding: 8px 0 12px;
  font-weight: 550;
}

.sheet-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.sheet-actions .btn {
  flex: 1;
  height: 44px;
}

.detail-amount {
  font-size: 36px;
  font-weight: 600;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  margin: 0 0 12px;
}

.toast {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: auto;
  top: 56px;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 12px;
  background: #15171a;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  padding: 10px 12px 10px 14px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

.toast[hidden] {
  display: none;
}

.toast span {
  flex: 1;
  font-size: 13px;
}

.toast button {
  border: 0;
  background: transparent;
  color: var(--accent-hover);
  font-weight: 650;
}

.wizard {
  padding: 12px 4px 8px;
}

.wizard p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.choice-grid {
  display: grid;
  gap: 8px;
  margin: 16px 0;
}

.choice {
  border: 1px solid var(--line);
  background: var(--bg);
  border-radius: 10px;
  padding: 12px;
  text-align: left;
}

.choice.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.recon {
  font-size: 12px;
  color: var(--faint);
  line-height: 1.45;
}

.forecast-note {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--bg);
  border: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
  margin-top: 8px;
}

@media (max-width: 860px) {
  .stage {
    display: block;
    padding: 0;
    background: var(--bg);
  }

  .stage-meta {
    display: none;
  }

  .phone-bezel {
    width: 100%;
    height: 100dvh;
    height: 100svh;
    border: 0;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
  }

  .device {
    border-radius: 0;
    padding-top: env(safe-area-inset-top);
  }

  .status-bar {
    display: none;
  }
}
