:root {
  color-scheme: dark;
  --bg: #000;
  --panel: #070707;
  --field: #f6f3ee;
  --field-text: #14110e;
  --field-muted: rgba(20, 17, 14, 0.55);
  --accent: #f2a336;
  --accent-soft: rgba(242, 163, 54, 0.22);
  --ink: #f6f6f3;
  --muted: rgba(246, 246, 243, 0.72);
  --shadow: 0 18px 42px rgba(0, 0, 0, 0.55);
  --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  min-height: 100vh;
  font-family: var(--sans);
  touch-action: manipulation;
  -ms-touch-action: manipulation;
  background:
    radial-gradient(circle at 50% 8%, rgba(255, 255, 255, 0.07), transparent 24%),
    linear-gradient(180deg, #060606 0%, #000 100%);
  color: var(--ink);
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,0.015) 1px, transparent 1px);
  background-size: 100% 3px;
  opacity: 0.28;
}

.screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 22px 16px 26px;
}

.app {
  width: min(100%, 420px);
  text-align: center;
}

.header {
  display: grid;
  gap: 12px;
  justify-items: center;
  margin-bottom: 18px;
}

.brand {
  font-family: var(--mono);
  font-weight: 600;
  font-size: clamp(2rem, 6vw, 2.7rem);
  letter-spacing: 0.16em;
  line-height: 0.95;
  text-transform: none;
}

.rate {
  font-family: var(--mono);
  color: var(--muted);
  font-size: 0.95rem;
  letter-spacing: 0.04em;
}

.fields {
  display: grid;
  gap: 14px;
  margin: 0 auto 14px;
}

.field {
  position: relative;
  width: 100%;
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 3px;
  padding: 14px 16px;
  background: var(--field);
  color: var(--field-text);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08), var(--shadow);
  display: grid;
  grid-template-columns: 56px 1fr 22px;
  align-items: center;
  gap: 10px;
  text-align: left;
  min-height: 62px;
}

.field.active {
  border-color: var(--accent);
  box-shadow:
    0 0 0 4px rgba(242, 163, 54, 0.22),
    0 0 28px rgba(242, 163, 54, 0.18),
    inset 0 0 0 1px rgba(242,163,54,0.3),
    var(--shadow);
  transform: translateY(-1px);
}

.mode-switch {
  display: grid;
  grid-template-columns: 1fr 66px 1fr;
  align-items: center;
  gap: 10px;
  width: min(100%, 230px);
  margin: 0 auto 18px;
  cursor: pointer;
}

.mode-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: rgba(246, 246, 243, 0.58);
  font-family: var(--mono);
  font-size: 0.92rem;
  letter-spacing: 0.18em;
  padding: 8px 0;
  cursor: pointer;
}

.mode-btn.active {
  color: var(--ink);
  text-shadow: 0 0 10px rgba(255,255,255,0.12);
}

.mode-switch[data-mode='btc'] .mode-btn:first-child,
.mode-switch[data-mode='sats'] .mode-btn:last-child {
  color: var(--ink);
  font-weight: 600;
}

.mode-track {
  position: relative;
  height: 24px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255,255,255,0.15), rgba(255,255,255,0.09));
  border: 1px solid rgba(255,255,255,0.18);
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.45);
}

.mode-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--field);
  box-shadow: 0 1px 2px rgba(0,0,0,0.45);
  transition: transform 180ms ease;
}

.mode-switch[data-mode='btc'] .mode-track {
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.45), 0 0 0 1px rgba(242,163,54,0.25);
}

.mode-switch[data-mode='sats'] .mode-track {
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.45), 0 0 0 1px rgba(242,163,54,0.25);
}

.mode-switch[data-mode='sats'] .mode-knob {
  transform: translateX(42px);
}

.label {
  font-family: var(--mono);
  font-size: 0.95rem;
  line-height: 1;
  letter-spacing: 0.12em;
  color: var(--field-text);
  user-select: none;
}

.value {
  min-width: 0;
  font-family: var(--mono);
  font-size: clamp(1.15rem, 4.2vw, 1.55rem);
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.copy {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  width: auto;
  height: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--field-text);
  opacity: 0.72;
  justify-self: end;
  line-height: 0;
  cursor: pointer;
}

.copy:focus-visible {
  outline: none;
}

.copy svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

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

.key {
  appearance: none;
  border: 0;
  border-radius: 3px;
  background: var(--field);
  color: var(--field-text);
  height: 68px;
  box-shadow: var(--shadow), inset 0 -1px 0 rgba(0,0,0,0.12);
  font-family: 'Georgia', 'Times New Roman', serif;
  font-size: 1.35rem;
  font-weight: 400;
  cursor: pointer;
  transition: transform 120ms ease, filter 120ms ease, background 120ms ease;
}

.key:active {
  transform: translateY(1px) scale(0.99);
  filter: brightness(0.98);
}

.key.clear {
  background: var(--accent);
  color: #1d1207;
}

.footer {
  margin: 18px 0 0;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: rgba(246, 246, 243, 0.65);
  letter-spacing: 0.02em;
}

.sr-only {
  position: fixed;
  left: -9999px;
  top: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

@media (max-width: 430px) {
  .screen { padding: 18px 12px 22px; }
  .header { margin-bottom: 16px; }
  .field { min-height: 60px; padding: 13px 14px; }
  .key { height: 64px; }
}
