:root {
  color-scheme: light;
  --paper: #fff;
  --ink: #191919;
  --muted: #62666d;
  --line: #dcdfe2;
  --accent: #191919;
  --accent-hover: #393939;
  --tint: #f3f4f4;
  --focus: #2054bc;
  --text: 1rem;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--paper); color: var(--ink); font: var(--text)/1.5 Arial, Helvetica, sans-serif; -webkit-font-smoothing: antialiased; }
button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .55; }
a { color: inherit; text-decoration: none; }
button:focus-visible, a:focus-visible, summary:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; }
input, textarea { width: 100%; min-width: 0; border: 1px solid #92979e; border-radius: 4px; padding: 15px 16px; background: var(--paper); color: var(--ink); font-size: var(--text); transition: border-color .15s; }
input::placeholder, textarea::placeholder { color: var(--muted); }
input:focus, textarea:focus { outline: 2px solid var(--focus); outline-offset: 2px; border-color: var(--focus); }
textarea { resize: vertical; line-height: 1.6; }
.sr-only, .skip-link:not(:focus) { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link:focus { position: fixed; top: 12px; left: 12px; z-index: 3; background: #fff; padding: 12px; }
.site-header { max-width: 1160px; margin: auto; padding: 32px 40px; display: flex; align-items: center; justify-content: space-between; }
.wordmark { display: inline-flex; align-items: center; gap: 12px; font-size: 28px; font-weight: 700; letter-spacing: -1.1px; }
.wordmark img { width: 26px; height: 26px; }
.text-button { border: 0; background: transparent; min-height: 44px; padding: 10px 0; color: var(--ink); font-size: var(--text); text-decoration: underline; text-decoration-color: #aaaeb4; text-underline-offset: 5px; }
.text-button:hover { text-decoration-color: var(--ink); }
.button { min-height: 54px; border: 1px solid transparent; border-radius: 4px; padding: 14px 23px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-size: var(--text); font-weight: 500; transition: background .15s; }
.button:active { transform: translateY(1px); }
.button-primary { background: var(--accent); color: #fff; }
.button-primary:hover { background: var(--accent-hover); }
.button-secondary { background: var(--paper); color: var(--ink); border-color: #92979e; }
.button-secondary:hover { background: var(--tint); }
main { max-width: 1160px; margin: auto; padding: 80px 40px; }
.workspace { width: 100%; }
h1 { font-size: 28px; font-weight: 500; letter-spacing: -.7px; line-height: 1.2; margin: 0 0 36px; }
.tool { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 110px; align-items: start; }
.editor { padding-top: 4px; }
.mode-switch { display: flex; gap: 28px; margin-bottom: 34px; }
.mode { position: relative; min-height: 44px; border: 0; background: transparent; color: var(--muted); padding: 0 0 14px; font-size: var(--text); }
.mode.active { color: var(--ink); }
.mode.active::after { position: absolute; content: ''; left: 0; right: 0; bottom: 2px; height: 2px; background: var(--ink); }
#generate-form, #discover-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
form > .button { width: 100%; }
.secondary-link { display: block; margin: 16px 0 0; color: var(--muted); }
#paste-form { margin-top: 18px; }
#paste-form > .button { margin-top: 12px; }
.preview { min-height: 360px; display: flex; flex-direction: column; align-items: center; padding-top: 2px; }
.preview-empty { width: 300px; height: 300px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; border: 1px dashed #b2b6bb; color: var(--muted); background: #fafafa; }
.preview-empty svg { width: 72px; height: 72px; color: #878b92; }
.qr-preview { width: 300px; aspect-ratio: 1; background: #fff; }
.qr-preview svg { display: block; width: 100%; height: auto; }
.preview-host { width: 300px; text-align: center; font-size: var(--text); color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin: 12px 0 22px; }
.preview-actions { width: 300px; }
.preview-actions .button { width: 100%; }
.library { margin: 90px 0 0; padding-top: 28px; border-top: 1px solid var(--line); }
.library-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 22px; }
h2 { font-size: 24px; font-weight: 500; line-height: 1.3; letter-spacing: -.5px; margin: 0 0 24px; }
.library-header h2 { font-size: 22px; margin: 0; }
.backup-note { color: var(--muted); margin: 0 0 24px; font-size: var(--text); }
.backup-note .text-button { margin-left: 6px; }
#library-count { font-size: var(--text); color: var(--muted); font-weight: 400; padding-left: 10px; }
#search-codes { max-width: 360px; margin-bottom: 24px; }
.code-list { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px; }
.code-tile { border: 1px solid var(--line); border-radius: 2px; background: #fff; padding: 20px; text-align: left; min-width: 0; }
.code-tile:hover { border-color: var(--ink); }
.code-tile svg { display: block; width: 100%; height: auto; }
.code-tile strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--text); font-weight: 400; margin-top: 14px; }
.code-tile small { font-size: var(--text); color: var(--muted); }
.status-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #3d7157; margin-right: 7px; }
.demo-banner { text-align: center; background: #f0f1f2; color: var(--muted); padding: 9px 20px; }
.demo-banner button { background: transparent; border: 0; color: var(--ink); font: inherit; text-decoration: underline; margin-left: 16px; min-height: 36px; }
.error-message { color: #a32e31; font-size: var(--text); margin: 16px 0 0; }
.muted { color: var(--muted); font-size: var(--text); }
.break-word { overflow-wrap: anywhere; }
.warning { background: #faf2e7; color: #76501f; padding: 14px 16px; }
dialog { position: fixed; border: 1px solid var(--line); border-radius: 6px; padding: 40px; width: 480px; max-width: calc(100vw - 32px); max-height: calc(100dvh - 40px); overflow: auto; color: var(--ink); background: #fff; }
dialog::backdrop { background: #0005; }
.dialog-close { position: absolute; top: 8px; right: 8px; width: 44px; height: 44px; border: 0; background: transparent; color: var(--muted); font-size: 27px; line-height: 1; }
dialog h2 { padding-right: 16px; }
dialog > .button, #signed-in-actions > .button { width: 100%; margin-top: 12px; }
.dialog-note { margin: 26px 0 0; color: var(--muted); font-size: var(--text); line-height: 1.6; }
#account-email { margin: 0 0 12px; }
#account-plan { color: var(--muted); }
.url-review { margin: 10px 0 24px; }
summary { color: var(--ink); font-size: var(--text); cursor: pointer; padding: 12px 0; }
.url-review textarea { margin-top: 10px; }
#bulk-generate { width: 100%; }
#bulk-progress { color: var(--muted); }
.saved-qr { max-width: 280px; margin: 0 auto 20px; }
.saved-qr svg { display: block; width: 100%; height: auto; }
.download-row { display: flex; gap: 12px; margin: 26px 0; }
.download-row .button:first-child { flex: 1; }
#edit-form-details { border-top: 1px solid var(--line); padding-top: 8px; }
#edit-form .button { margin-top: 12px; }
.toast { position: fixed; z-index: 2; bottom: 24px; left: 50%; transform: translateX(-50%); width: max-content; max-width: calc(100vw - 32px); border-radius: 4px; padding: 16px 22px; background: var(--ink); color: #fff; }
.toast.error { background: #953b50; }
@media (max-width: 960px) {
  .tool { gap: 40px; grid-template-columns: minmax(0, 1fr) 280px; }
  .preview-empty, .qr-preview, .preview-host, .preview-actions { width: 260px; }
  .preview-empty { height: 260px; }
  #discover-form { grid-template-columns: 1fr; }
  .code-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .site-header { padding: 24px; }
  .wordmark { font-size: 26px; }
  main { padding: 38px 24px 50px; }
  h1 { font-size: 26px; margin-bottom: 28px; }
  .tool { grid-template-columns: 1fr; gap: 38px; }
  .editor { padding: 0; }
  .mode-switch { margin-bottom: 24px; }
  #discover-form { grid-template-columns: minmax(0, 1fr) auto; }
  .button { padding-left: 18px; padding-right: 18px; }
  .preview { min-height: 0; }
  .preview-empty { height: 180px; width: 100%; flex-direction: row; gap: 16px; }
  .preview-empty svg { width: 48px; height: 48px; }
  .qr-preview { width: 240px; }
  .preview-host, .preview-actions { width: 100%; max-width: 320px; }
  .library { margin-top: 54px; }
  .code-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
  .code-tile { padding: 12px; }
  dialog { padding: 34px 24px; }
}
@media (max-width: 360px) { #generate-form, #discover-form { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; } }

#email-form .button, #verify-form .button { margin-top: 12px; }
#code-sent { overflow-wrap: anywhere; }
#login-code { font-size: 24px; letter-spacing: 6px; }
#login-code::placeholder { font-size: 16px; letter-spacing: 0; }
.site-footer { max-width: 1160px; margin: 40px auto 0; padding: 28px 40px; display: flex; gap: 24px; color: var(--muted); }
.site-footer a { min-height: 44px; display: flex; align-items: center; }
.site-footer a:hover { text-decoration: underline; }
.legal { max-width: 720px; padding-top: 45px; }
.legal p, .legal h2 { margin-top: 30px; }
.legal a { text-decoration: underline; }
@media(max-width:640px) { .site-footer { padding: 24px; margin-top: 0; } }
.reading { max-width: 800px; padding-top: 50px; }
.reading h1 { font-size: clamp(30px, 4vw, 42px); line-height: 1.18; letter-spacing: -1px; margin: 22px 0; }
.reading article > p { font-size: 18px; line-height: 1.75; margin: 0 0 22px; }
.reading article > h2 { margin: 42px 0 16px; font-size: 26px; }
.reading a:not(.button), .legal a { text-decoration: underline; text-underline-offset: 4px; }
.reading .article-deck { color: var(--muted); font-size: 21px; line-height: 1.5; }
.reading .article-byline, .reading .article-source { font-size: 16px; color: var(--muted); }
.back-link { display: inline-flex; min-height: 44px; align-items: center; color: var(--muted); }
.guide-list { margin-top: 42px; }
.guide-list article { padding: 26px 0; border-top: 1px solid var(--line); }
.guide-list h2 { margin: 0 0 12px; }
.guide-list p { color: var(--muted); }
.related { margin-top: 60px; padding-top: 25px; border-top: 1px solid var(--line); }
.related a { display: block; padding: 12px 0; }
.site-footer { flex-wrap: wrap; }
.site-footer .text-button { color: var(--muted); text-decoration: none; }
.consent { display: flex; align-items: flex-start; gap: 12px; margin: 20px 0; cursor: pointer; }
.consent input { width: 22px; height: 22px; flex: 0 0 22px; margin: 2px 0; accent-color: var(--ink); }
#updates-form .button { width: 100%; }
#updates-form a { text-decoration: underline; }
.reading .automation-note { font-size: 16px; color: var(--muted); border-left: 2px solid var(--line); padding-left: 16px; }
.article-sources { margin: 36px 0; padding-top: 20px; border-top: 1px solid var(--line); font-size: 16px; }
.article-sources li { margin: 12px 0; }
