:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #14141f;
  --bg-tertiary: #1e1e2e;
  --text-primary: #ffffff;
  --text-secondary: #a0a0b0;
  --text-muted: #606070;
  --accent: #00d4ff;
  --accent-secondary: #00ff88;
  --danger: #ff4466;
  --focus-ring: #00d4ff;
  --focus-glow: rgba(0, 212, 255, 0.4);
  --radius-md: 12px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body {
  width: 600px; height: 600px; overflow: hidden;
  background: #000;
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
#app { width: 100%; height: 100%; position: relative; }
.screen { width: 100%; height: 100%; position: absolute; top: 0; left: 0; display: flex; flex-direction: column; }
.screen.hidden { display: none; }
.focusable { transition: all 0.15s ease; border: 2px solid transparent; cursor: pointer; outline: none; }
.focusable:focus { border-color: var(--focus-ring); box-shadow: 0 0 20px var(--focus-glow); }
.hidden { display: none !important; }

/* ===== Top bar ===== */
.topbar {
  display: flex; align-items: center; gap: 12px;
  height: 64px; flex: 0 0 64px;
  padding: 0 18px;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--bg-tertiary);
}
.logo { font-size: 24px; font-weight: 700; letter-spacing: 0.3px; }
.badge {
  margin-left: auto;
  font-size: 13px; color: var(--text-muted);
  background: var(--bg-tertiary);
  padding: 5px 10px; border-radius: 999px;
}
.screen-title { font-size: 22px; font-weight: 600; }
.back-btn {
  background: var(--bg-tertiary); color: var(--text-primary);
  font-size: 18px; font-weight: 600;
  padding: 10px 16px; border-radius: var(--radius-md);
  min-height: 44px;
}

/* ===== Home ===== */
.home-body {
  flex: 1; display: flex; flex-direction: column;
  gap: 16px; padding: 18px;
}
.conv-card {
  background: var(--bg-secondary);
  border-radius: 18px;
  padding: 22px 20px;
  display: flex; flex-direction: column; gap: 10px;
}
.conv-row {
  display: flex; align-items: baseline; justify-content: space-between;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  min-height: 80px;
}
.conv-row.result { background: var(--bg-primary); }
.conv-amount {
  font-size: 46px; font-weight: 700; line-height: 1;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.conv-amount.accent { color: var(--accent); }
.conv-code { font-size: 22px; font-weight: 600; color: var(--text-secondary); margin-left: 12px; }
.conv-mid { display: flex; align-items: center; gap: 14px; padding: 2px 4px; }
.swap-btn {
  background: var(--bg-tertiary); color: var(--accent);
  font-size: 24px; font-weight: 700;
  width: 56px; height: 48px; border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
}
.rate-line { font-size: 15px; color: var(--text-secondary); }

.cur-pickers { display: flex; gap: 14px; }
.pick-btn {
  flex: 1; display: flex; flex-direction: column; gap: 4px;
  align-items: flex-start;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: 14px 18px; min-height: 72px;
}
.pick-label { font-size: 14px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.6px; }
.pick-val { font-size: 22px; font-weight: 600; }

.home-actions { display: flex; gap: 14px; margin-top: auto; }
.action-btn {
  flex: 1;
  background: var(--bg-secondary); color: var(--text-primary);
  font-size: 18px; font-weight: 600;
  padding: 16px; border-radius: var(--radius-md);
  min-height: 56px;
  display: flex; align-items: center; justify-content: center;
}
.action-btn.primary { background: var(--accent); color: #001018; }
.action-btn.ghost { background: var(--bg-tertiary); }

/* ===== Keypad ===== */
.keypad-body { flex: 1; display: flex; flex-direction: column; gap: 16px; padding: 18px; }
.keypad-display {
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: 18px 22px; min-height: 84px;
  display: flex; align-items: baseline; justify-content: flex-end; gap: 12px;
}
.kp-value {
  font-size: 52px; font-weight: 700; line-height: 1;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.kp-unit { font-size: 24px; font-weight: 600; color: var(--text-secondary); }
.keypad-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: 1fr;
  gap: 12px;
}
.key {
  background: var(--bg-secondary); color: var(--text-primary);
  font-size: 30px; font-weight: 600;
  border-radius: var(--radius-md);
  min-height: 64px;
  display: flex; align-items: center; justify-content: center;
}
.key-alt { background: var(--bg-tertiary); color: var(--accent); }
.keypad-actions { display: flex; gap: 14px; }

/* ===== Currency picker ===== */
.picker-body { flex: 1; overflow: hidden; padding: 12px 18px 18px; }
.cur-list {
  height: 100%; overflow-y: auto;
  display: flex; flex-direction: column; gap: 10px;
  padding-right: 4px;
}
.cur-list::-webkit-scrollbar { width: 6px; }
.cur-list::-webkit-scrollbar-thumb { background: var(--bg-tertiary); border-radius: 6px; }
.cur-row {
  display: flex; align-items: center; gap: 14px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: 14px 18px; min-height: 60px;
}
.cur-flag { font-size: 26px; }
.cur-code { font-size: 20px; font-weight: 700; width: 56px; }
.cur-name { font-size: 17px; color: var(--text-secondary); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cur-check { font-size: 20px; color: var(--accent-secondary); }
.cur-row.selected { background: var(--bg-tertiary); }

/* ===== Quick amounts ===== */
.quick-body { flex: 1; display: flex; flex-direction: column; gap: 14px; padding: 18px; overflow: hidden; }
.quick-sub { font-size: 18px; font-weight: 600; color: var(--accent); }
.quick-list { flex: 1; display: flex; flex-direction: column; gap: 10px; overflow-y: auto; }
.quick-item {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: 14px 20px; min-height: 56px;
}
.qi-from { font-size: 22px; font-weight: 600; }
.qi-to { font-size: 24px; font-weight: 700; color: var(--accent); }
.qi-unit { font-size: 16px; color: var(--text-muted); font-weight: 500; margin-left: 6px; }

/* ===== Budget ===== */
.budget-body { flex: 1; display: flex; flex-direction: column; gap: 16px; padding: 18px; }
.budget-card {
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: 18px 20px; min-height: 80px;
  display: flex; flex-direction: column; gap: 6px;
  align-items: flex-start;
}
.bc-label { font-size: 15px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.6px; }
.bc-value { font-size: 32px; font-weight: 700; }
.days-card { width: 100%; }
.days-stepper { display: flex; align-items: center; gap: 18px; width: 100%; }
.step-btn {
  background: var(--bg-tertiary); color: var(--accent);
  font-size: 30px; font-weight: 700;
  width: 64px; height: 56px; border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
}
.days-val { font-size: 34px; font-weight: 700; min-width: 60px; text-align: center; }
.budget-result {
  background: var(--bg-primary);
  border-radius: var(--radius-md);
  padding: 20px; margin-top: auto;
  display: flex; flex-direction: column; gap: 8px;
}
.br-label { font-size: 15px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.6px; }
.br-line { font-size: 32px; font-weight: 700; }
.br-line.accent { color: var(--accent); }
.muted { color: var(--text-secondary); font-size: 20px; font-weight: 600; }
