:root {
  color-scheme: dark;
  --page: #090c10;
  --ink: #f2f5f9;
  --muted: #98a2b1;
  --line: #29313c;
  --panel: #11161d;
  --soft: #0d1218;
  --field: #0b1016;
  --button: #171e27;
  --qr-frame: #161c24;
  --lime: #c8ff43;
  --lime-dark: #a8e900;
  --danger: #ff8177;
  --eyebrow: #c8ff43;
  --status-ink: #dfff8f;
  --status-bg: #26350d;
  --shadow: 0 24px 90px rgb(0 0 0 / 35%);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

:root[data-theme="light"] {
  color-scheme: light;
  --page: #fafafa;
  --ink: #111827;
  --muted: #687083;
  --line: #e2e5eb;
  --panel: #ffffff;
  --soft: #f4f5f7;
  --field: #ffffff;
  --button: #ffffff;
  --qr-frame: #ffffff;
  --danger: #b42318;
  --eyebrow: #62700d;
  --status-ink: #4e6204;
  --status-bg: #eaffb6;
  --shadow: 0 24px 80px rgb(17 24 39 / 8%);
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--page); min-height: 100vh; }
button, input, textarea, select { font: inherit; }
.site-header { height: 74px; max-width: 1180px; margin: auto; padding: 0 28px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: -.03em; }
.brand-mark { display: grid; place-items: center; width: 34px; aspect-ratio: 1; border-radius: 9px; color: #0b1200; background: var(--lime); box-shadow: inset 0 0 0 1px #b3ee25; }
.header-actions { display: flex; align-items: center; gap: 8px; }
.privacy-badge { display: inline-flex; align-items: center; gap: 7px; margin-right: 4px; color: var(--muted); font-size: .8rem; font-weight: 650; }
.privacy-badge > span:first-child, .privacy-note > span:first-child { color: #9dcc27; }
.utility-button { min-height: 38px; padding: 7px 11px; display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: var(--button); cursor: pointer; font-size: .78rem; font-weight: 750; }
.utility-button:hover { border-color: #91b92d; }
.generator-shell { max-width: 1180px; margin: 0 auto; padding: 62px 28px 78px; }
.intro { max-width: 760px; margin-bottom: 36px; }
.eyebrow { margin: 0 0 10px; color: var(--eyebrow); font-size: .75rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.intro h1 { margin: 0; max-width: 700px; font-size: clamp(2.5rem, 6vw, 4.75rem); line-height: .98; letter-spacing: -.065em; }
.intro > p:last-child { color: var(--muted); font-size: 1.08rem; line-height: 1.7; }
.generator-card { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(360px, .95fr); overflow: hidden; border: 1px solid var(--line); border-radius: 24px; background: var(--panel); box-shadow: var(--shadow); }
.controls { padding: 38px; display: grid; gap: 24px; align-content: start; }
.control-group { display: grid; gap: 9px; }
.control-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
label, .label { font-size: .88rem; font-weight: 750; }
.label em { color: var(--muted); font-style: normal; font-weight: 500; }
textarea, select { width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 13px 14px; color: var(--ink); background: var(--field); outline: none; }
textarea { resize: vertical; line-height: 1.5; min-height: 112px; }
textarea:focus, select:focus, input:focus-visible, button:focus-visible { border-color: #8fbf16; box-shadow: 0 0 0 3px rgb(200 255 67 / 25%); outline: none; }
.field-help { color: var(--muted); font-size: .76rem; font-weight: 450; }
.color-control { display: grid; gap: 9px; }
.color-input { height: 50px; padding: 7px 11px 7px 7px; display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--field); }
input[type="color"] { width: 35px; height: 35px; padding: 0; border: 0; border-radius: 8px; background: none; overflow: hidden; }
.color-input output { color: var(--muted); font: .78rem ui-monospace, SFMono-Regular, Menlo, monospace; text-transform: uppercase; }
.file-row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.file-button { flex: none; padding: 9px 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--button); cursor: pointer; }
#logo-name { color: var(--muted); font-size: .78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.text-button { padding: 0; border: 0; color: var(--danger); background: none; cursor: pointer; font-size: .78rem; }
.preview-panel { padding: 38px; background: var(--soft); display: flex; flex-direction: column; min-width: 0; }
.preview-heading { display: flex; justify-content: space-between; align-items: start; gap: 12px; }
.preview-heading h2 { margin: 0; font-size: 1.35rem; letter-spacing: -.03em; }
#status { padding: 6px 9px; border-radius: 20px; color: var(--status-ink); background: var(--status-bg); font-size: .72rem; font-weight: 750; text-align: center; }
.qr-preview { display: grid; place-items: center; width: min(100%, 360px); aspect-ratio: 1; margin: 28px auto; padding: 20px; border: 1px solid var(--line); border-radius: 18px; background: var(--qr-frame); box-shadow: 0 10px 35px rgb(0 0 0 / 18%); }
.qr-preview canvas, .qr-preview svg { display: block; width: 100% !important; height: 100% !important; }
.download-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.button { min-height: 44px; display: inline-flex; justify-content: center; align-items: center; padding: 10px 15px; border: 1px solid transparent; border-radius: 11px; font-weight: 750; cursor: pointer; }
.button.primary { color: #101700; background: var(--lime); border-color: var(--lime-dark); }
.button.primary:hover { background: #d2ff65; }
.button.secondary { color: var(--ink); background: var(--button); border-color: var(--line); }
.button:disabled { opacity: .45; cursor: not-allowed; }
.privacy-note { margin: 16px 0 0; color: var(--muted); font-size: .76rem; text-align: center; }
footer { max-width: 1180px; margin: auto; padding: 25px 28px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; color: var(--muted); font-size: .8rem; }
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

@media (max-width: 800px) {
  .site-header { height: 64px; padding: 0 18px; }
  .generator-shell { padding: 38px 16px 55px; }
  .generator-card { grid-template-columns: 1fr; border-radius: 18px; }
  .controls, .preview-panel { padding: 24px; }
  .preview-panel { border-top: 1px solid var(--line); }
  .intro h1 { font-size: clamp(2.45rem, 13vw, 4rem); }
  footer { padding: 20px 18px; }
}

@media (max-width: 620px) {
  .privacy-badge { display: none; }
}

@media (max-width: 520px) {
  .generator-shell { padding-top: 25px; }
  .intro { margin-bottom: 24px; }
  .intro > p:last-child { font-size: .96rem; }
  .control-row, .download-row { grid-template-columns: 1fr; }
  .qr-preview { padding: 14px; }
  .utility-button { padding: 7px 9px; }
}

@media (prefers-reduced-motion: no-preference) {
  body, .generator-card, .preview-panel, textarea, select, .utility-button, .button { transition: color .15s, background-color .15s, border-color .15s; }
  .button:active { transform: translateY(1px); }
}
