:root {
  color-scheme: light;
  --page: #f4f5f6;
  --surface: #ffffff;
  --soft: #f7f8f9;
  --text: #20262d;
  --muted: #68717d;
  --line: #dce1e6;
  --action: #303b48;
  --action-hover: #1c2631;
  --focus: #5b79a2;
  --error: #ad343c;
  --error-bg: #fff0f1;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  font-synthesis: none;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-width: 320px; overflow-x: hidden; overscroll-behavior-x: none; touch-action: pan-y; }
body { min-height: 100vh; min-height: 100svh; margin: 0; padding: max(40px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) max(40px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left)); display: flex; align-items: center; justify-content: center; background: var(--page); color: var(--text); overflow-x: hidden; touch-action: pan-y; }
button, input { font: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:disabled { cursor: not-allowed; opacity: .55; }
button, input, summary { outline-offset: 4px; }
:focus-visible { outline: 3px solid var(--focus); }
.entry-card { width: 100%; max-width: 370px; min-width: 0; padding: 29px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
h1 { font-size: 1.5rem; font-weight: 600; line-height: 1.25; letter-spacing: -.025em; margin: 0 0 25px; overflow-wrap: anywhere; }
p { margin: 0; }
.description { color: var(--muted); font-size: .9375rem; line-height: 1.65; margin: -11px 0 24px; }
label { display: block; margin: 19px 0 8px; font-size: .875rem; font-weight: 550; }
input { display: block; width: 100%; height: 48px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 8px; color: var(--text); background: var(--surface); font-size: 1rem; }
input:focus { border-color: var(--focus); }
input::placeholder { color: var(--muted); opacity: .65; }
.primary, .secondary { display: flex; width: 100%; min-height: 46px; align-items: center; justify-content: center; padding: 11px 15px; border: 1px solid transparent; border-radius: 8px; font-size: .9375rem; font-weight: 550; line-height: 1.5; text-align: center; overflow-wrap: anywhere; }
.primary { color: #ffffff; background: var(--action); margin-top: 25px; }
.primary:hover:not(:disabled) { background: var(--action-hover); }
.secondary { color: var(--text); background: var(--surface); border-color: var(--line); }
.secondary:hover:not(:disabled) { background: var(--soft); }
.text-button { display: block; width: 100%; min-height: 40px; margin: 13px 0 0; padding: 8px 0; border: 0; color: var(--text); background: transparent; font-size: .875rem; line-height: 1.5; text-align: center; }
.text-button:hover { text-decoration: underline; text-underline-offset: 4px; }
.secondary-link { color: var(--muted); margin-top: 2px; }
.code-input { font-variant-numeric: tabular-nums; letter-spacing: .18em; }
.code-input.is-recovery { letter-spacing: .035em; }
.error-message { margin-top: 22px; padding: 12px 14px; border-radius: 8px; color: var(--error); background: var(--error-bg); font-size: .875rem; line-height: 1.6; overflow-wrap: anywhere; }
.qr-frame { display: flex; justify-content: center; margin: 20px 0; }
.qr-frame img { display: block; width: 200px; height: auto; max-width: 100%; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: #ffffff; }
.manual-secret { padding: 11px 13px; border-radius: 8px; border: 1px solid var(--line); background: var(--soft); }
.manual-secret summary { font-size: .875rem; cursor: pointer; font-weight: 550; }
.manual-secret p { margin-top: 11px; font-size: .875rem; line-height: 1.6; color: var(--muted); }
.manual-secret code { display: block; padding-top: 13px; font: .875rem/1.75 ui-monospace, SFMono-Regular, Consolas, monospace; overflow-wrap: anywhere; user-select: all; }
.manual-secret .text-button { font-size: .875rem; margin-top: 5px; text-align: left; }
.code-notice { padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--soft); color: var(--muted); font-size: .875rem; line-height: 1.6; }
.recovery-codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; padding: 0; margin: 20px 0; list-style: none; }
.recovery-codes li { min-width: 0; padding: 10px 7px; border: 1px solid var(--line); border-radius: 7px; background: var(--soft); font: .875rem/1.6 ui-monospace, SFMono-Regular, Consolas, monospace; text-align: center; overflow-wrap: anywhere; user-select: all; }
.helper { margin-top: 12px; color: var(--muted); font-size: .875rem; line-height: 1.6; overflow-wrap: anywhere; }
.toast { position: fixed; left: 50%; bottom: max(20px, env(safe-area-inset-bottom)); transform: translateX(-50%); width: max-content; max-width: calc(100% - 32px); padding: 12px 16px; border-radius: 9px; background: var(--text); color: var(--surface); font-size: .875rem; line-height: 1.6; overflow-wrap: anywhere; }
@media (prefers-color-scheme: dark) {
  :root { color-scheme: dark; --page: #14191f; --surface: #1d242c; --soft: #242d36; --text: #e6ebf1; --muted: #a5aeb9; --line: #3a4653; --action: #d4dce7; --action-hover: #edf1f6; --focus: #9bb6da; --error: #f0a5aa; --error-bg: #40272d; }
  .primary { color: #18222d; }
}
@media (max-width: 380px) {
  body { padding: max(25px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) max(25px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left)); }
  .entry-card { padding: 24px 21px; }
  h1 { font-size: 1.375rem; }
}
@media (max-height: 650px) { body { align-items: flex-start; } }
