:root {
  --background: #F5F6F2; --ink: #1A2B25; --accent: #215C4D; --on-accent: #FFFFFF;
  --muted: #5E6E65; --outline: #C1CFC6; --field: #FFFFFF; --error: #B3261E;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --background: #000000; --ink: #F5F5F5; --accent: #E0E0E0; --on-accent: #000000;
    --muted: #AAAAAA; --outline: #444444; --field: #0D0D0D; --error: #FFB4AB;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
    --background: #000000; --ink: #F5F5F5; --accent: #E0E0E0; --on-accent: #000000;
    --muted: #AAAAAA; --outline: #444444; --field: #0D0D0D; --error: #FFB4AB;
    color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh;
  background: var(--background); color: var(--ink);
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI", Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
}
main {
  max-width: 480px; margin: 0 auto; outline: none;
  padding: calc(36px + env(safe-area-inset-top)) calc(24px + env(safe-area-inset-right))
           calc(28px + env(safe-area-inset-bottom)) calc(24px + env(safe-area-inset-left));
  display: flex; flex-direction: column; text-align: center;
}
.brand { font-size: 18px; font-weight: 700; color: var(--accent); margin: 0; }
h1 { font-size: 32px; line-height: 1.15; margin: 36px 0 0; font-weight: 700; white-space: pre-line; }
h1.small { font-size: 28px; margin-top: 28px; }
.lead { margin: 14px 0 0; }
.muted { color: var(--muted); font-size: 13px; margin: 26px 0 0; white-space: pre-line; }
.caption { color: var(--muted); font-size: 12px; letter-spacing: .08em; margin: 18px 0 0; }
.note { font-size: 14px; margin: 28px 0 0; }
label.field { display: block; text-align: left; font-size: 14px; font-weight: 700; margin: 30px 0 6px; }
label.field + label.field, .field.second { margin-top: 18px; }
input[type=text] {
  width: 100%; min-height: 56px; padding: 12px 16px; font: inherit; font-size: 17px;
  color: var(--ink); background: var(--field); border: 1px solid var(--outline); border-radius: 14px;
  -webkit-appearance: none; appearance: none;
}
input[type=text]::placeholder { color: var(--muted); opacity: 1; }
input[type=text]:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
input.number { min-height: 76px; font: 22px ui-monospace, "SF Mono", Menlo, monospace; text-align: center; letter-spacing: .06em; }
input[aria-invalid=true] { border-color: var(--error); }
.error { color: var(--error); font-size: 14px; text-align: left; margin: 6px 0 0; min-height: 0; }
.check { display: flex; align-items: center; gap: 12px; text-align: left; min-height: 48px; margin: 18px 0 0; cursor: pointer; }
.check input { width: 22px; height: 22px; margin: 0; accent-color: var(--accent); flex: none; }
button, a.button {
  display: block; width: 100%; min-height: 56px; margin: 12px 0 0; padding: 14px 16px;
  font: inherit; font-size: 16px; line-height: 1.3; color: var(--accent); background: transparent;
  border: 1px solid var(--outline); border-radius: 14px; cursor: pointer; text-decoration: none;
  white-space: pre-line; touch-action: manipulation;
}
button.primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); margin-top: 24px; font-weight: 600; }
button.entry { min-height: 76px; margin-top: 16px; }
button.entry .num { font-family: ui-monospace, "SF Mono", Menlo, monospace; display: block; }
button.entry .title { display: block; font-weight: 600; }
button:active { opacity: .7; }
button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.spaced { margin-top: 28px; }
.card { background: #fff; border-radius: 20px; padding: 28px 12px; margin-top: 36px; color: #000; }
.card canvas { display: block; width: 100%; height: 148px; }
.digits { font: 30px ui-monospace, "SF Mono", Menlo, monospace; color: #000; margin-top: 18px; white-space: nowrap; letter-spacing: .02em; }
.digits.long { font-size: clamp(14px, 6vw, 26px); }
button.install {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; align-self: center;
  width: auto; min-height: 40px; margin: 14px 0 0; padding: 8px 18px; border-radius: 999px;
  font-size: 15px; font-weight: 600; border-width: 1.5px; border-color: var(--accent);
}
button.install + h1 { margin-top: 26px; }
.sheet {
  width: min(100% - 24px, 440px); max-height: calc(100% - 24px); margin: auto auto 12px; padding: 24px 20px 20px;
  border: 1px solid var(--outline); border-radius: 22px; background: var(--background); color: var(--ink);
  text-align: left;
}
.sheet::backdrop { background: rgb(0 0 0 / .5); }
.sheet h2 { margin: 0; font-size: 22px; }
.sheet-lead { margin: 8px 0 0; color: var(--muted); font-size: 15px; }
.steps { list-style: none; margin: 20px 0 0; padding: 0; display: grid; gap: 16px; }
.step { display: flex; gap: 14px; align-items: flex-start; }
.step-num {
  flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent); color: var(--on-accent); font-weight: 700; font-size: 15px;
}
.step-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding-top: 3px; }
.step-text { font-weight: 600; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.step-icon { display: inline-grid; place-items: center; width: 32px; height: 28px; border-radius: 8px; border: 1px solid var(--outline); color: #0A84FF; }
.step-detail { color: var(--muted); font-size: 14px; }
.sheet button.primary { margin-top: 22px; }
.prose { text-align: left; font-size: 15px; margin-top: 18px; }
.prose h2 { font-size: 17px; margin: 24px 0 0; }
.prose p { margin: 8px 0 0; }
.prose a { color: var(--accent); }
.noscript { padding: 24px; text-align: center; }
