:root { font: 14px/1.6 var(--font-sans); color: var(--ink); background: var(--paper); }
* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
header { min-height: 60px; padding: 18px 40px; display: flex; align-items: center; }
header img { display: block; width: auto; height: 24px; }
main { width: min(420px, calc(100% - 32px)); margin: 64px auto; padding: 32px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); }
h1 { font-size: 28px; line-height: 34px; letter-spacing: -.015em; margin: 0 0 6px; font-weight: 500; }
.sub { color: var(--ink-muted); margin: 0 0 24px; }
strong { color: var(--ink); overflow-wrap: anywhere; }
button, input { font: inherit; border-radius: var(--radius-md); }
button { cursor: pointer; min-height: 44px; background: var(--surface); border: 1px solid var(--ink); padding: 10px 16px; font-size: 13px; line-height: 20px; font-weight: 600; color: var(--ink); }
button:hover:not(:disabled) { background: var(--paper); }
button:disabled { opacity: .5; cursor: default; }
button:focus-visible, input:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
input { width: 100%; min-width: 0; border: 1px solid var(--line-strong); min-height: 44px; padding: 10px 12px; margin-bottom: 14px; background: var(--surface); color: inherit; }
input::placeholder { color: var(--ink-muted); opacity: 1; }
input:disabled { background: var(--surface-sunken); color: var(--ink-muted); }
.google { width: 100%; display: flex; align-items: center; justify-content: center; gap: 12px; font-weight: 550; }
.google svg { flex-shrink: 0; }
.primary { background: var(--ink); color: var(--on-ink); border-color: var(--ink); width: 100%; }
.primary:hover:not(:disabled) { background: var(--gray-800); }
.divider { display: flex; align-items: center; gap: 12px; color: var(--ink-muted); font-size: 12px; margin: 20px 0; }
.divider::before,.divider::after { content: ''; flex: 1; border-top: 1px solid var(--line); }
.note,.notice { font-size: 12px; line-height: 18px; color: var(--ink-muted); }
.note { margin: 8px 0 0; }
#entry > .note { text-align: center; }
.notice { margin: 6px 0 0; text-align: center; }
.code-input {
  --code-step: min(56px, calc((100vw - 82px) / 6));
  position: relative;
  width: calc(var(--code-step) * 6 - 8px);
  margin: 0 auto 8px;
  border-radius: var(--radius-md);
}
.code-slots { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; pointer-events: none; }
.code-slots span { border: 1px solid var(--line-strong); border-radius: var(--radius-md); background: var(--surface); }
.code-input:focus-within { outline: 2px solid var(--ink); outline-offset: 3px; }
#code {
  position: relative;
  width: calc(100% + 8px);
  min-height: 52px;
  margin: 0;
  padding: 0 0 0 calc((var(--code-step) - 8px - 1ch) / 2);
  border: 0;
  background: transparent;
  font: 20px/52px var(--font-mono);
  letter-spacing: calc(var(--code-step) - 1ch);
  text-align: left;
}
#code:focus-visible { outline: none; }
#code-help { margin-bottom: 14px; }
.actions { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.link { padding: 8px 0; border: 0; background: transparent; text-decoration: underline; text-underline-offset: 4px; color: var(--ink); }
.back { display: block; width: 100%; margin: 18px auto 0; padding-top: 18px; border-top: 1px solid var(--line); border-radius: 0; }
.error, #notice { font-size: 13px; line-height: 20px; margin: 18px 0 0; padding: 12px 14px; border-radius: var(--radius-md); overflow-wrap: anywhere; }
.error { color: var(--danger); background: var(--danger-soft); }
#notice { color: var(--ink); background: var(--paper); }
.error:empty, #notice:empty { display: none; }
@media (max-width: 500px) {
  header { padding: 18px 24px; }
  main { margin: 24px auto 40px; padding: 24px; }
  input { font-size: 16px; }
}
