: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: border-color 0.15s ease, box-shadow 0.15s ease, background 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; }

/* Header */
.hdr {
  padding: 22px 28px 16px;
  border-bottom: 1px solid var(--bg-tertiary);
  background: var(--bg-primary);
  flex-shrink: 0;
}
.hdr h1 { font-size: 30px; font-weight: 700; letter-spacing: 0.5px; }
.hdr-sub {
  display: block; margin-top: 4px;
  font-size: 16px; color: var(--text-secondary);
}

/* Home body */
.body {
  flex: 1; display: flex; flex-direction: column; justify-content: center;
  gap: 18px; padding: 24px 28px;
}

.field {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: 14px 20px;
  min-height: 76px;
}
.field-label { font-size: 19px; color: var(--text-primary); font-weight: 500; }

/* Stepper */
.stepper { display: flex; align-items: center; gap: 14px; }
.step-btn {
  width: 60px; height: 60px;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border-radius: 50%;
  font-size: 32px; font-weight: 600; line-height: 1;
  display: flex; align-items: center; justify-content: center;
}
.step-val {
  min-width: 48px; text-align: center;
  font-size: 28px; font-weight: 700; color: var(--accent);
  font-variant-numeric: tabular-nums;
}

/* Toggle */
.toggle {
  display: flex; align-items: center; gap: 12px;
  background: var(--bg-tertiary);
  border-radius: 999px;
  padding: 10px 18px 10px 12px;
  min-height: 56px;
}
.toggle-knob {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--text-muted);
  transition: background 0.15s ease, box-shadow 0.15s ease;
}
.toggle.on .toggle-knob {
  background: var(--accent-secondary);
  box-shadow: 0 0 12px rgba(0, 255, 136, 0.6);
}
.toggle-txt { font-size: 18px; font-weight: 600; color: var(--text-secondary); min-width: 34px; }
.toggle.on .toggle-txt { color: var(--accent-secondary); }

/* Primary button */
.primary {
  margin-top: 6px;
  height: 88px;
  background: linear-gradient(135deg, #007a99, #00d4ff);
  color: #00131a;
  border-radius: var(--radius-md);
  font-size: 24px; font-weight: 700; letter-spacing: 0.5px;
}
.primary:focus { color: #001016; }

/* Output scroll */
.out-scroll {
  flex: 1;
  margin: 16px 22px 0;
  padding: 18px 20px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  overflow-y: auto;
  overflow-x: hidden;
}
.out-scroll p {
  font-size: 18px; line-height: 1.55; color: var(--text-secondary);
  margin-bottom: 14px;
}
.out-scroll p:last-child { margin-bottom: 0; }
.out-scroll p .lead { color: var(--text-primary); font-weight: 600; }
.out-scroll::-webkit-scrollbar { width: 8px; }
.out-scroll::-webkit-scrollbar-thumb { background: var(--bg-tertiary); border-radius: 4px; }

/* Actions row */
.actions {
  display: flex; gap: 12px;
  padding: 16px 22px;
  flex-shrink: 0;
}
.act {
  flex: 1; min-height: 72px;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border-radius: var(--radius-md);
  font-size: 19px; font-weight: 600;
}

/* Footer hint */
.ftr {
  padding: 12px 28px 16px;
  font-size: 14px; color: var(--text-muted);
  text-align: center;
  flex-shrink: 0;
}

/* Toast */
.toast {
  position: absolute; bottom: 96px; left: 50%; transform: translateX(-50%);
  background: var(--bg-tertiary);
  border: 2px solid var(--accent-secondary);
  color: var(--text-primary);
  padding: 14px 26px; border-radius: 999px;
  font-size: 18px; font-weight: 600;
  box-shadow: 0 0 24px rgba(0, 255, 136, 0.4);
  z-index: 10;
}
.toast.danger { border-color: var(--danger); box-shadow: 0 0 24px rgba(255, 68, 102, 0.4); }
