:root {
  color-scheme: dark;
  --bg: #131313;
  --surface: #1c1b1b;
  --surface-2: #201f1f;
  --surface-3: #2a2a2a;
  --surface-4: #353534;
  --text: #e5e2e1;
  --muted: #c2c6d8;
  --outline: #424656;
  --primary: #b3c5ff;
  --primary-strong: #0066ff;
  --secondary: #4ae183;
  --danger: #ffb4ab;
  --ink-on-primary: #001849;
  --radius: 8px;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
}

html {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background:
    radial-gradient(circle at 20% 10%, rgba(0, 102, 255, 0.16), transparent 28rem),
    radial-gradient(circle at 80% 80%, rgba(74, 225, 131, 0.1), transparent 26rem),
    var(--bg);
  color: var(--text);
  font-family: "Roboto Flex", system-ui, sans-serif;
  letter-spacing: 0;
  user-select: none;
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.material-symbols-outlined {
  font-variation-settings: "FILL" 0, "wght" 420, "GRAD" 0, "opsz" 24;
  line-height: 1;
}

.app-shell {
  width: 100vw;
  height: 100vh;
  display: grid;
  grid-template-rows: 64px minmax(0, 1fr) 72px;
  overflow: hidden;
  position: relative;
}

body[data-route="welcome"] .app-shell {
  grid-template-rows: 64px minmax(0, 1fr);
}

body[data-route="welcome"] .bottom-nav {
  display: none;
}

.topbar,
.bottom-nav {
  position: sticky;
  z-index: 10;
  background: rgba(28, 27, 27, 0.92);
  backdrop-filter: blur(16px);
  border-color: rgba(66, 70, 86, 0.7);
}

.topbar {
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 0;
  padding: 0 28px;
  border-bottom: 1px solid var(--outline);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.brand-icon {
  color: var(--primary);
  font-size: 30px;
}

.eyebrow {
  margin: 0 0 2px;
  color: var(--secondary);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.topbar h1 {
  margin: 0;
  color: var(--primary);
  font-size: 19px;
  line-height: 23px;
}

.status-cluster {
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--muted);
  white-space: nowrap;
}

.screen {
  width: min(1120px, calc(100vw - 64px));
  height: 100%;
  margin: 0 auto;
  padding: 14px 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  justify-content: center;
  overflow: hidden;
}

body.keyboard-open .screen {
  justify-content: flex-start;
  padding-bottom: 190px;
}

.bottom-nav {
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: space-around;
  border-top: 1px solid var(--outline);
  min-height: 0;
}

.bottom-nav button,
.icon-button {
  min-width: 142px;
  min-height: 60px;
  padding: 8px 18px;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text);
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.bottom-nav button:hover,
.icon-button:hover {
  background: var(--surface-4);
}

.bottom-nav button:first-child .material-symbols-outlined {
  color: var(--danger);
}

.hero {
  height: 100%;
  min-height: 0;
  display: grid;
  place-items: center;
  text-align: center;
  overflow: hidden;
}

.welcome-stack,
.pin-layout,
.center-stack {
  width: min(760px, 100%);
  margin: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.qr {
  position: relative;
  width: min(190px, 27vh);
  aspect-ratio: 1;
  border-radius: 16px;
  padding: 12px;
  background: var(--text);
  border: 1px solid var(--outline);
}

.qr img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 8px;
}

.display-title {
  font-size: clamp(26px, 3.5vw, 40px);
  line-height: 1.08;
  max-width: 840px;
  margin-bottom: 0;
}

.subtitle {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.36;
  max-width: 700px;
  margin-bottom: 0;
}

.banner {
  width: min(620px, 100%);
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 11px 14px;
  border: 1px solid rgba(66, 70, 86, 0.75);
  border-radius: var(--radius);
  background: rgba(32, 31, 31, 0.82);
  color: var(--muted);
}

.primary-button,
.secondary-button,
.ghost-button {
  min-height: 64px;
  border-radius: var(--radius);
  padding: 0 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-weight: 700;
  transition: transform 120ms ease, background 120ms ease, border 120ms ease;
}

.primary-button {
  background: var(--primary-strong);
  color: #fff;
  box-shadow: 0 16px 44px rgba(0, 102, 255, 0.28);
}

.secondary-button {
  background: var(--surface-3);
  color: var(--text);
  border: 1px solid var(--outline);
}

.ghost-button {
  background: transparent;
  color: var(--primary);
}

.primary-button:active,
.secondary-button:active,
.ghost-button:active,
.card-button:active,
.amount-button:active,
.key:active {
  transform: scale(0.98);
}

.actions-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.panel {
  background: linear-gradient(135deg, rgba(42, 42, 42, 0.96), rgba(28, 27, 27, 0.98));
  border: 1px solid rgba(66, 70, 86, 0.8);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.balance-panel {
  padding: 16px;
  text-align: center;
}

.balance-label {
  color: var(--muted);
  text-transform: uppercase;
  font-weight: 700;
  font-size: 14px;
}

.balance {
  margin: 6px 0 0;
  font-size: clamp(32px, 4.4vw, 46px);
  line-height: 1;
  font-weight: 800;
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.card-button {
  min-height: 158px;
  padding: 18px;
  border-radius: var(--radius);
  border: 1px solid rgba(66, 70, 86, 0.78);
  background: linear-gradient(135deg, #242424, #1a1a1a);
  color: var(--text);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  text-align: left;
  gap: 14px;
}

.card-button:hover,
.amount-button:hover,
.account-row:hover,
.recipient-row:hover {
  border-color: var(--primary);
  background: linear-gradient(135deg, #2b2d35, #1d1d1d);
}

.card-button.featured {
  background: linear-gradient(135deg, var(--primary-strong), #0047bd);
  border-color: var(--primary-strong);
  color: white;
}

.card-button .material-symbols-outlined {
  font-size: 40px;
  color: var(--primary);
}

.card-button.featured .material-symbols-outlined {
  color: white;
}

.card-button h3 {
  margin: 0 0 5px;
  font-size: 21px;
  line-height: 1.16;
}

.card-button p {
  margin: 0;
  color: var(--muted);
  line-height: 1.28;
  font-size: 14px;
}

.card-button.featured p {
  color: rgba(255, 255, 255, 0.8);
}

.section-title {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 20px;
}

.section-title h2 {
  margin: 0;
  font-size: clamp(24px, 3vw, 36px);
  line-height: 1.1;
}

.section-title p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.steps {
  width: min(720px, 100%);
  display: grid;
  grid-template-columns: repeat(var(--steps, 4), 1fr);
  gap: 8px;
  flex: 0 0 auto;
}

.step {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.step span {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--surface-4);
  color: var(--muted);
}

.step.done,
.step.active {
  color: var(--secondary);
}

.step.done span {
  background: var(--secondary);
  color: #00210c;
}

.step.active span {
  background: var(--primary);
  color: var(--ink-on-primary);
}

.amount-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.amount-button,
.account-row,
.recipient-row {
  border: 1px solid var(--outline);
  background: var(--surface-2);
  color: var(--text);
  border-radius: var(--radius);
}

.amount-button {
  min-height: 82px;
  font-size: 24px;
  font-weight: 800;
}

.form-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 12px;
  align-items: start;
}

.form-panel,
.summary-panel,
.list-panel {
  padding: 14px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}

.field label {
  color: var(--muted);
  font-weight: 700;
}

.field input {
  min-height: 58px;
  border-radius: var(--radius);
  border: 1px solid var(--outline);
  background: #0f0f0f;
  color: var(--text);
  padding: 0 16px;
  font-size: 20px;
}

.field input:focus {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.keypad {
  display: grid;
  grid-template-columns: repeat(3, 88px);
  gap: 12px;
  justify-content: center;
}

.key {
  width: 84px;
  height: 64px;
  border-radius: var(--radius);
  background: var(--surface-3);
  color: var(--text);
  font-size: 26px;
  font-weight: 800;
  border: 1px solid var(--outline);
}

.pin-dots {
  display: flex;
  gap: 12px;
}

.pin-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--outline);
}

.pin-dot.filled {
  background: var(--primary);
  border-color: var(--primary);
}

.account-row,
.recipient-row,
.summary-row {
  width: 100%;
  min-height: 76px;
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  text-align: left;
  margin-bottom: 10px;
}

.summary-row {
  border-bottom: 1px solid var(--outline);
  margin: 0;
}

.summary-row:last-child {
  border-bottom: 0;
}

.row-title {
  display: block;
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 4px;
}

.row-subtitle {
  color: var(--muted);
}

.money {
  font-size: 21px;
  font-weight: 800;
  color: var(--secondary);
  white-space: nowrap;
}

.processing {
  height: 100%;
  min-height: 0;
  display: grid;
  place-items: center;
  text-align: center;
}

.spinner {
  width: 82px;
  height: 82px;
  border-radius: 50%;
  border: 7px solid var(--surface-4);
  border-top-color: var(--primary);
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.success-icon {
  width: 92px;
  height: 92px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(74, 225, 131, 0.14);
  color: var(--secondary);
  border: 1px solid rgba(74, 225, 131, 0.35);
}

.success-icon .material-symbols-outlined {
  font-size: 58px;
  font-variation-settings: "FILL" 1, "wght" 500, "GRAD" 0, "opsz" 48;
}

.receipt {
  width: min(520px, 100%);
  padding: 18px;
}

.route-dashboard {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  justify-content: stretch;
}

.route-dashboard .list-panel {
  min-height: 0;
  overflow: hidden;
}

.route-dashboard .section-title h2 {
  font-size: 25px;
}

.route-dashboard .section-title p {
  display: none;
}

.route-dashboard .summary-row {
  min-height: 55px;
  padding: 10px 12px;
}

.route-dashboard .row-title {
  font-size: 16px;
}

.route-dashboard .row-subtitle {
  font-size: 13px;
}

.route-dashboard .money {
  font-size: 18px;
}

.route-account,
.route-deposit-account,
.route-transfer-source,
.route-transfer-destination {
  justify-content: start;
}

.route-account .list-panel,
.route-deposit-account .list-panel,
.route-transfer-source .list-panel,
.route-transfer-destination .list-panel {
  display: grid;
  gap: 10px;
}

.route-account .account-row,
.route-deposit-account .account-row,
.route-transfer-source .account-row,
.route-transfer-destination .account-row,
.route-transfer-destination .recipient-row {
  margin-bottom: 0;
}

.modal {
  border: 0;
  padding: 0;
  background: transparent;
}

.modal::backdrop {
  background: rgba(0, 0, 0, 0.64);
}

.modal-body {
  width: min(460px, calc(100vw - 32px));
  position: relative;
  border-radius: var(--radius);
  background: var(--surface-2);
  border: 1px solid var(--outline);
  padding: 26px;
  color: var(--text);
  box-shadow: var(--shadow);
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
}

.touch-keyboard {
  position: absolute;
  left: 50%;
  bottom: 78px;
  z-index: 25;
  width: min(900px, calc(100vw - 32px));
  transform: translateX(-50%);
  padding: 12px;
  border: 1px solid rgba(66, 70, 86, 0.86);
  border-radius: var(--radius);
  background: rgba(28, 27, 27, 0.98);
  box-shadow: var(--shadow);
}

.keyboard-row {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 8px;
}

.keyboard-row:last-child {
  margin-bottom: 0;
}

.keyboard-key {
  min-width: 58px;
  min-height: 54px;
  padding: 0 14px;
  border-radius: var(--radius);
  border: 1px solid var(--outline);
  background: var(--surface-3);
  color: var(--text);
  font-size: 20px;
  font-weight: 800;
}

.keyboard-key.wide {
  min-width: 112px;
}

.keyboard-key.space {
  min-width: 260px;
}

.keyboard-key.primary {
  background: var(--primary-strong);
  border-color: var(--primary-strong);
  color: #fff;
}

.keyboard-key:active {
  transform: scale(0.98);
}

@media (max-width: 860px) {
  .app-shell {
    grid-template-rows: 60px minmax(0, 1fr) 70px;
  }

  .topbar {
    padding: 0 18px;
    align-items: center;
  }

  .topbar h1 {
    font-size: 18px;
    line-height: 24px;
  }

  .status-cluster {
    gap: 8px;
  }

  .status-cluster > .material-symbols-outlined {
    display: none;
  }

  .screen {
    width: calc(100vw - 28px);
    padding: 10px 0;
    gap: 10px;
  }

  body.keyboard-open .screen {
    padding-bottom: 176px;
  }

  .grid,
  .grid.two,
  .form-layout {
    grid-template-columns: 1fr;
  }

  .amount-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .section-title {
    flex-direction: column;
    align-items: flex-start;
  }

  .steps {
    padding-bottom: 4px;
    gap: 4px;
  }

  .step {
    gap: 5px;
    font-size: 11px;
  }

  .step span {
    width: 23px;
    height: 23px;
  }

  .bottom-nav button {
    min-width: auto;
    width: 33.333%;
    min-height: 58px;
    font-size: 13px;
  }

  .card-button {
    min-height: 118px;
  }

  .touch-keyboard {
    bottom: 74px;
    width: calc(100vw - 16px);
    padding: 8px;
  }

  .keyboard-row {
    gap: 3px;
    margin-bottom: 6px;
  }

  .keyboard-key {
    min-width: 29px;
    min-height: 46px;
    padding: 0 6px;
    font-size: 15px;
  }

  .keyboard-key.wide {
    min-width: 62px;
  }

  .keyboard-key.space {
    min-width: 128px;
  }
}
