:root {
  --bg: #faf6f1;
  --surface: #ffffff;
  --surface-soft: #f4ece3;
  --text: #1c1714;
  --muted: #6b5f58;
  --border: rgba(28, 23, 20, 0.1);
  --brand: #cf3d18;
  --brand-hover: #b83312;
  --brand-soft: rgba(207, 61, 24, 0.12);
  --success: #16803c;
  --success-soft: rgba(22, 128, 60, 0.12);
  --warn: #b45309;
  --warn-soft: rgba(180, 83, 9, 0.12);
  --danger: #b91c1c;
  --danger-soft: rgba(185, 28, 28, 0.11);
  --shadow: 0 12px 32px rgba(28, 23, 20, 0.06);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141210;
    --surface: #1e1a17;
    --surface-soft: #29231f;
    --text: #f7f3ee;
    --muted: #b1a59d;
    --border: rgba(255, 245, 235, 0.12);
    --brand: #e8552e;
    --brand-hover: #f26844;
    --brand-soft: rgba(232, 85, 46, 0.18);
    --success: #4ade80;
    --success-soft: rgba(74, 222, 128, 0.16);
    --warn: #fbbf24;
    --warn-soft: rgba(251, 191, 36, 0.16);
    --danger: #f87171;
    --danger-soft: rgba(248, 113, 113, 0.16);
    --shadow: 0 14px 36px rgba(0, 0, 0, 0.35);
  }
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.shell {
  width: 100%;
  max-width: 460px;
  min-height: 100dvh;
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top, 16px) + 20px) 18px calc(env(safe-area-inset-bottom, 20px) + 24px);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.shell-center {
  justify-content: center;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 4px 2px;
}

.brand-icon {
  border-radius: 15px;
  box-shadow: 0 6px 18px rgba(207, 61, 24, 0.25);
  flex-shrink: 0;
}

.brand h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.subtitle {
  margin: 2px 0 0;
  font-size: 13.5px;
  color: var(--muted);
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 20px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.launch-card {
  text-align: center;
  align-items: center;
  padding: 28px 22px;
}

.launch-icon {
  border-radius: 18px;
}

.card h1, .card h2 {
  margin: 0;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.015em;
}

.lead {
  margin: 0;
  font-size: 14.5px;
  color: var(--muted);
}

.badge {
  align-self: flex-start;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 999px;
}

.badge-brand {
  background: var(--brand-soft);
  color: var(--brand);
}

.badge-success {
  background: var(--success-soft);
  color: var(--success);
}

.badge-warn {
  background: var(--warn-soft);
  color: var(--warn);
}

.banner {
  border-radius: 15px;
  padding: 12px 14px;
  font-size: 13.5px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.banner-success {
  background: var(--success-soft);
  color: var(--success);
}

.banner-warn {
  background: var(--warn-soft);
  color: var(--warn);
}

.banner-danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.code-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
}

.code-label {
  display: block;
  font-size: 11.5px;
  color: var(--muted);
}

.code-text {
  font-size: 20px;
  letter-spacing: 0.1em;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.steps {
  list-style: none;
  margin: 2px 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.steps li {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  font-size: 14.5px;
}

.step-num {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}

.ios-chip {
  display: inline-block;
  padding: 0 5px;
  border-radius: 6px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  font-size: 12px;
}

.hint {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  padding-top: 4px;
  border-top: 1px solid var(--border);
}

.form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.input-row {
  display: flex;
  gap: 8px;
}

.field input {
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface-soft);
  color: var(--text);
  font-size: 16px;
  outline: none;
}

.field input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

#pairing-code {
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
}

.actions {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 14px;
  border: none;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: opacity 0.15s ease, transform 0.12s ease;
}

.btn:active {
  transform: scale(0.98);
}

.btn:disabled {
  opacity: 0.55;
  cursor: default;
}

.btn-primary {
  background: var(--brand);
  color: #ffffff;
}

.btn-primary:hover:not(:disabled) {
  background: var(--brand-hover);
}

.btn-secondary {
  background: var(--surface-soft);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-tonal {
  background: var(--brand-soft);
  color: var(--brand);
}

.btn-sm {
  min-height: 40px;
  padding: 0 13px;
  font-size: 13.5px;
  white-space: nowrap;
}

.footer {
  margin-top: auto;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  padding: 8px 6px 0;
}

.footer p {
  margin: 0;
}

[hidden] {
  display: none !important;
}
