:root {
  color-scheme: dark;
  --bg: #060808;
  --panel: #101615;
  --panel-soft: #151f1d;
  --text: #f3f7f5;
  --muted: #91a19d;
  --line: #263633;
  --accent: #2dd4bf;
  --accent-strong: #7ddfd3;
  --danger: #ff8a80;
  --shadow: none;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  width: 100%;
  min-height: 100%;
  overflow-x: hidden;
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}

body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  background: var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  touch-action: manipulation;
}

button,
input,
textarea {
  font: inherit;
  font-size: 16px;
}

button {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.auth-shell {
  display: grid;
  min-height: 100vh;
  padding: max(18px, env(safe-area-inset-top)) 14px max(22px, env(safe-area-inset-bottom));
  place-items: center;
}

.auth-card {
  width: min(100%, 430px);
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.auth-card h1 {
  margin-bottom: 8px;
}

.auth-copy,
.auth-message {
  color: var(--muted);
  font-size: 0.92rem;
}

.auth-message {
  min-height: 1.4em;
  margin-top: 10px;
}

.auth-form {
  display: grid;
  gap: 9px;
  margin-top: 14px;
}

.auth-form label {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.auth-form input,
.auth-form textarea,
.recovery-details textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: #0b1110;
  outline: none;
}

.auth-form input {
  height: 48px;
  padding: 0 12px;
  font-weight: 800;
}

.auth-form input.pin-input {
  text-align: center;
  letter-spacing: 0.18em;
}

.auth-form input.pin-input.active {
  border-color: var(--accent);
}

.auth-form textarea,
.recovery-details textarea {
  min-height: 92px;
  padding: 10px 12px;
  resize: vertical;
  word-break: break-all;
}

.auth-details,
.recovery-details {
  margin-top: 14px;
  color: var(--muted);
}

.auth-details summary,
.recovery-details summary {
  cursor: pointer;
  color: var(--accent-strong);
  font-weight: 800;
}

.pin-pad {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.pin-pad button,
.amount-pad button {
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: var(--panel-soft);
  font-size: 1.1rem;
  font-weight: 850;
}

.pin-pad button:active,
.amount-pad button:active {
  transform: translateY(1px);
}

.app-shell {
  width: min(100%, 680px);
  max-width: 100%;
  min-height: 100vh;
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) 14px max(22px, env(safe-area-inset-bottom));
  overflow-x: hidden;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  min-width: 0;
}

.top-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.eyebrow {
  margin: 0 0 3px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 2rem;
  line-height: 1.05;
}

h2 {
  font-size: 1rem;
  line-height: 1.2;
}

.summary {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.summary-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
}

.summary-item {
  min-width: 0;
  display: grid;
  gap: 5px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.summary-item span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 650;
}

.summary-item strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 1.32rem;
  line-height: 1.1;
}

.summary-item.primary {
  border-color: rgba(45, 212, 191, 0.42);
}

.summary-item.primary strong {
  color: var(--accent-strong);
  font-size: clamp(2rem, 8vw, 3rem);
}

.panel {
  margin-top: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.section-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
  min-width: 0;
}

.section-heading p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.86rem;
}

.bill-list {
  display: grid;
  gap: 10px;
}

.bill-row {
  display: grid;
  grid-template-columns: minmax(110px, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  min-width: 0;
}

.bill-label {
  display: grid;
  gap: 3px;
}

.bill-label span {
  font-size: 1.04rem;
  font-weight: 750;
}

.bill-label small {
  color: var(--muted);
  font-size: 0.86rem;
  overflow-wrap: anywhere;
}

.counter {
  display: grid;
  grid-template-columns: 44px minmax(64px, 68px) 44px;
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.step-button,
.ghost-button,
.text-button,
.pin-pad button,
.amount-pad button,
.submit-button,
.wide-action {
  border: 0;
  border-radius: 8px;
}

.step-button {
  width: 44px;
  height: 44px;
  color: #04100e;
  background: var(--accent);
  font-size: 1.45rem;
  font-weight: 750;
  line-height: 1;
}

.step-button:active,
.ghost-button:active,
.amount-pad button:active,
.submit-button:active,
.wide-action:active {
  transform: translateY(1px);
}

.counter input,
.bank-input-wrap input,
.adjust-input-wrap input {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: #0b1110;
  text-align: center;
}

.counter input {
  width: 100%;
  height: 44px;
  font-weight: 750;
}

.bank-input-label {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.deposit-form {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.deposit-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.deposit-heading h3 {
  margin: 0;
  font-size: 0.95rem;
}

.deposit-heading p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.82rem;
}

.deposit-heading strong {
  color: var(--accent-strong);
  white-space: nowrap;
}

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

.deposit-item {
  display: grid;
  gap: 6px;
}

.deposit-grid span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
}

.deposit-counter {
  grid-template-columns: 40px minmax(54px, 1fr) 40px;
  gap: 6px;
}

.deposit-counter .step-button {
  width: 40px;
  height: 42px;
}

.bank-input-wrap {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0b1110;
}

.bank-input-wrap span {
  color: var(--muted);
  font-size: 1.25rem;
  font-weight: 800;
}

.bank-input-wrap input {
  width: 100%;
  height: 48px;
  border: 0;
  text-align: left;
  font-size: 1.5rem;
  font-weight: 800;
  outline: none;
}

.adjust-form {
  margin-top: 12px;
}

.amount-pad {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.submit-button,
.wide-action {
  min-height: 46px;
  color: var(--accent-strong);
  background: #122622;
  font-weight: 800;
}

.adjust-input-wrap {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0b1110;
}

.adjust-input-wrap span {
  color: var(--muted);
  font-weight: 800;
}

.adjust-input-wrap input {
  width: 100%;
  height: 44px;
  border: 0;
  text-align: left;
  font-weight: 800;
  outline: none;
}

.submit-button {
  padding: 0 14px;
}

.bank-action-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
}

.danger-action {
  color: var(--danger);
  background: #2a1918;
}

.wide-action {
  width: 100%;
  margin-top: 12px;
  color: #04100e;
  background: var(--accent);
}

.wide-action:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.ghost-button {
  min-width: 70px;
  min-height: 40px;
  padding: 0 14px;
  color: var(--accent-strong);
  background: #122622;
  font-weight: 750;
}

.text-button {
  padding: 4px 0;
  color: var(--accent-strong);
  background: transparent;
  font-size: 0.9rem;
  font-weight: 750;
}

.text-button.danger {
  color: var(--danger);
}

.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 2px 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.sync-panel {
  color: var(--muted);
}

.sync-status {
  color: var(--muted);
  font-size: 0.88rem;
}

.recovery-details p {
  margin: 8px 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.recovery-details textarea {
  min-height: 78px;
  margin-top: 8px;
}

.hidden-value {
  filter: blur(9px);
  user-select: none;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(15, 118, 110, 0.22);
  outline-offset: 2px;
}

@media (max-width: 410px) {
  .app-shell {
    padding-left: 10px;
    padding-right: 10px;
  }

  .panel,
  .summary-item {
    padding: 12px;
  }

  .bill-row {
    grid-template-columns: 1fr;
  }

  .counter {
    grid-template-columns: 1fr 86px 1fr;
  }

  .step-button {
    width: 100%;
  }

  .deposit-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .deposit-grid {
    grid-template-columns: 1fr;
  }

  .deposit-counter {
    grid-template-columns: 1fr 86px 1fr;
  }

  .deposit-counter .step-button {
    width: 100%;
  }
}

@media (max-width: 360px) {
  .summary-grid {
    grid-template-columns: 1fr;
  }

  .section-heading {
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
  }

  .text-button {
    align-self: flex-start;
  }
}
