:root {
  --bg: #f7f5ef;
  --surface: #ffffff;
  --ink: #1f1d2b;
  --muted: #5b5870;
  --line: rgba(31, 29, 43, 0.16);
  --accent: #7a3fd1;
  --accent-ink: #ffffff;
  --danger: #b3261e;
  --ok: #1d6b3a;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15151b;
    --surface: #1f1f28;
    --ink: #eeedf3;
    --muted: #b1aec2;
    --line: rgba(238, 237, 243, 0.16);
    --accent: #a77bf0;
    --accent-ink: #15151b;
    --danger: #ff8a80;
    --ok: #7fd9a0;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--accent); }

.bar, .foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 16px max(16px, calc((100% - 960px) / 2));
}

.bar nav { display: flex; gap: 16px; align-items: center; }
.brand { font-weight: 700; letter-spacing: 0.04em; color: var(--ink); text-decoration: none; }
.quiet { color: var(--muted); }
.foot { margin-top: auto; justify-content: flex-start; color: var(--muted); font-size: 14px; }

main { width: 100%; padding: 0 16px 32px; margin: 0 auto; }
.panel { max-width: 460px; }
.wide { max-width: 760px; display: grid; gap: 16px; }

h1 { font-size: 28px; line-height: 1.2; margin: 24px 0 8px; }
h2 { font-size: 20px; margin: 0 0 8px; }
h3 { font-size: 16px; margin: 16px 0 4px; }
.lede, .hint { color: var(--muted); }

.step { display: grid; gap: 10px; margin-top: 16px; }
label { font-weight: 600; }
label.check { font-weight: 400; display: flex; gap: 8px; align-items: flex-start; }

input[type="email"], input[inputmode="numeric"], select {
  font: inherit;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
}

input:focus-visible, select:focus-visible, button:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

button, .button {
  font: inherit;
  padding: 9px 16px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}

button.primary, .button.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
button.link { border: 0; background: none; color: var(--accent); padding: 4px 0; justify-self: start; }
button:disabled { opacity: 0.6; cursor: progress; }

.bot-check { min-height: 65px; }
.status { min-height: 1.5em; }
.status[data-tone="error"] { color: var(--danger); }
.notice { padding: 10px 12px; border-left: 3px solid var(--accent); background: var(--surface); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 20px; }
.card h1 { margin-top: 0; font-size: 22px; }
.plan-line { font-size: 18px; margin: 0 0 12px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }

.meter { height: 10px; border-radius: 5px; background: var(--line); overflow: hidden; }
.meter span { display: block; height: 100%; width: 0; background: var(--accent); }

.plain { list-style: none; padding: 0; margin: 0; }
.devices li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 0;
  border-bottom: 1px solid var(--line); }
.devices li:last-child { border-bottom: 0; }

@media (max-width: 520px) {
  .devices li { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
}
