:root {
  --bg: #0a0e14;
  --panel: #111723;
  --panel-strong: #152033;
  --line: #243042;
  --text: #e8edf3;
  --muted: #8a96a6;
  --accent-a: #00d4ff;
  --accent-b: #1a5cff;
  --ok: #3ddc97;
  --error: #ff6b6b;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  padding: max(20px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(28px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}

.brand {
  max-width: 560px;
  margin: 8px auto 20px;
  text-align: center;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.logo {
  display: block;
  width: min(280px, 78vw);
  height: auto;
  margin: 0 auto;
}

.brand-sub {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

main {
  max-width: 560px;
  margin: 0 auto;
  display: grid;
  gap: 14px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
}

.panel.highlight {
  background: var(--panel-strong);
  border-color: #2e4466;
}

h1 {
  font-size: 22px;
  line-height: 1.25;
  margin: 0 0 8px;
}

h2 {
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 10px;
}

p {
  margin: 0 0 12px;
}

p:last-child {
  margin-bottom: 0;
}

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

.small {
  font-size: 13px;
}

.ok {
  color: var(--ok);
  font-weight: 600;
}

.error {
  color: var(--error);
  font-size: 14px;
  margin-top: 10px;
}

strong {
  color: var(--text);
}

.btn {
  display: block;
  width: 100%;
  min-height: 50px;
  margin: 14px 0 0;
  padding: 13px 16px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent-a), var(--accent-b));
  color: #fff;
  font: inherit;
  font-weight: 650;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

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

.btn:disabled {
  opacity: 0.6;
}

.link-btn {
  background: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  padding: 6px 12px;
  cursor: pointer;
  flex-shrink: 0;
}

.code {
  margin: 14px 0 0;
  padding: 18px 10px;
  border: 1px dashed #3a5478;
  border-radius: 12px;
  background: #0d1420;
  text-align: center;
  font: 700 34px/1 ui-monospace, 'SF Mono', Menlo, monospace;
  letter-spacing: 0.12em;
  user-select: all;
  -webkit-user-select: all;
}

.steps {
  margin: 16px 0 14px;
  padding: 0;
  list-style: none;
  counter-reset: step;
  border-top: 1px solid var(--line);
}

.steps li {
  counter-increment: step;
  position: relative;
  padding: 11px 0 11px 40px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 9px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid #3a5478;
  color: var(--accent-a);
  font-size: 14px;
  font-weight: 700;
  line-height: 24px;
  text-align: center;
}

.rows {
  border-top: 1px solid var(--line);
}

.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.row-text {
  display: grid;
  min-width: 0;
}

.row-title {
  overflow-wrap: anywhere;
}

.row-detail {
  color: var(--muted);
  font-size: 13px;
}

.switch {
  position: relative;
  flex-shrink: 0;
  width: 51px;
  height: 31px;
  border: 0;
  border-radius: 16px;
  background: #2b3647;
  cursor: pointer;
  transition: background 0.2s;
}

.switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s;
}

.switch[aria-checked='true'] {
  background: linear-gradient(135deg, var(--accent-a), var(--accent-b));
}

.switch[aria-checked='true']::after {
  transform: translateX(20px);
}

.switch:disabled {
  opacity: 0.6;
}

.switch:focus-visible,
.btn:focus-visible,
.link-btn:focus-visible {
  outline: 2px solid var(--accent-a);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .switch,
  .switch::after {
    transition: none;
  }
}
