:root {
  color-scheme: dark;
  --page: #101117;
  --panel: #181a23;
  --subpanel: #12141c;
  --border: #303341;
  --text: #f9f8ff;
  --muted: #afb4c5;
  --accent: #c1b7ff;
  --positive: #91e2be;
  --attention: #ffd99b;
  font-family: "Inter", "Segoe UI", system-ui, sans-serif;
  background: var(--page);
  color: var(--text);
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea, summary { -webkit-tap-highlight-color: transparent; }
button, summary { cursor: pointer; }
a { color: inherit; text-underline-offset: .24em; }
:focus-visible { outline: 2px solid #c5bcff; outline-offset: 4px; }
[hidden] { display: none !important; }
.shell { width: min(1120px, calc(100% - 48px)); margin-inline: auto; }
.sr-only, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip:focus { position: absolute; z-index: 10; top: 8px; left: 8px; padding: 12px; color: #151421; background: var(--accent); }
.masthead { background: #12131b; border-bottom: 1px solid var(--border); }
.masthead-inner, .footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.masthead-inner { min-height: 76px; }
.brand { flex: 0 0 auto; }
.brand img { display: block; width: 124px; height: auto; }
.masthead nav { display: flex; gap: clamp(12px, 3vw, 28px); }
.masthead nav a, .footer a { font-size: .875rem; color: var(--muted); font-weight: 650; text-decoration: none; }
.masthead nav a:hover, .footer a:hover { color: var(--text); text-decoration: underline; }
.intro { padding-block: 45px 30px; }
.intro h1 { margin: 0; font-size: clamp(2.45rem, 6.2vw, 4.6rem); line-height: 1.01; letter-spacing: -.072em; }
.intro h1 span { color: var(--accent); }
.intro p { max-width: 38rem; margin: 15px 0 0; color: var(--muted); line-height: 1.6; }
.workspace { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.builder { display: grid; min-width: 0; gap: 14px; }
.panel { min-width: 0; border: 1px solid var(--border); border-radius: 16px; background: var(--panel); padding: 23px; }
.panel h2 { margin: 0; font-size: 1.2rem; letter-spacing: -.025em; }
.types, .fields { min-width: 0; padding: 0; margin: 0; border: 0; }
.types { display: flex; flex-wrap: wrap; gap: 7px; margin: 17px 0 19px; }
.types label { position: relative; cursor: pointer; }
.types input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.types span, .preset-row button {
  display: flex; align-items: center; gap: 7px; min-height: 40px; padding: 7px 12px;
  border: 1px solid var(--border); border-radius: 8px; color: var(--muted);
  background: var(--subpanel); font-size: .84rem; font-weight: 690;
}
.types input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 3px; }
.types input:checked + span { border-color: #9c8faa; background: #302b49; color: #f3edff; }
.types label:hover span, .preset-row button:hover { border-color: #9395b3; color: var(--text); }
.fields { display: grid; gap: 13px; }
.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.full { grid-column: 1 / -1; }
.fields label, .color-label { display: grid; align-content: start; gap: 6px; font-size: .86rem; font-weight: 650; }
.fields input:not([type="checkbox"]), .fields select, .fields textarea {
  width: 100%; min-width: 0; min-height: 43px; padding: 9px 11px; color: var(--text);
  border: 1px solid #3a3e50; border-radius: 8px; background: var(--subpanel);
  font-size: max(1rem, 16px); font-weight: 450; line-height: 1.35;
}
.fields textarea { resize: vertical; }
.fields input::placeholder, .fields textarea::placeholder { color: #8c91a6; opacity: 1; }
.fields input[aria-invalid="true"] { border-color: var(--attention); }
.fields .check { display: flex; align-items: center; gap: 8px; min-height: 33px; cursor: pointer; }
.check input { margin: 0; width: 18px; height: 18px; accent-color: var(--accent); }
.field-help, .formats { margin: 0; color: var(--muted); font-size: .84rem; line-height: 1.5; }
.preset-row { display: flex; flex-wrap: wrap; gap: 7px; margin-block: 17px 15px; }
.preset-row button[aria-pressed="true"] { border-color: #9c8faa; color: var(--text); }
.preset-row i { width: 12px; height: 12px; border-radius: 50%; background: var(--swatch); border: 1px solid #a7a5b3; }
.color-label { margin-bottom: 6px; }
.color-control { display: flex; align-items: center; position: relative; }
.color-control input[type="color"] { cursor: pointer; position: absolute; width: 32px; min-height: 0; height: 31px; padding: 3px; inset-inline-start: 6px; border: 0; background: transparent; }
.color-control input[type="text"] { padding-inline-start: 45px; font-family: ui-monospace, monospace; }
.advanced { margin-top: 17px; border-top: 1px solid var(--border); }
.advanced summary { padding-block: 14px 5px; font-size: .88rem; font-weight: 670; }
.advanced[open] .fields { margin-top: 11px; }
.reset { margin-top: 15px; padding: 4px 0; border: 0; background: transparent; color: var(--muted); font-size: .82rem; text-decoration: underline; text-underline-offset: .22em; }
.reset:hover { color: var(--text); }
.preview-panel { position: sticky; top: 15px; }
.preview-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.preview-type { color: var(--accent); font-size: .8rem; font-weight: 710; }
.qr-stage {
  display: grid; place-items: center; min-height: 304px; margin-block: 17px 12px; padding: 18px;
  border: 1px solid #37374a; border-radius: 12px;
  background: radial-gradient(circle at 50% 32%, #343151, #1b1e2e 66%, #171a26);
}
.qr-paper { width: min(100%, 248px); aspect-ratio: 1; border-radius: 6px; overflow: hidden; background: #fff; box-shadow: 0 16px 30px #09091260; }
.qr-paper[data-transparent="true"] {
  background-color: #fff;
  background-image: conic-gradient(#e9e9ef 25%, #fff 0 50%, #e9e9ef 0 75%, #fff 0);
  background-size: 24px 24px;
}
.qr-art, .qr-art svg { display: block; width: 100%; height: 100%; }
.empty { max-width: 14rem; margin: 0; text-align: center; color: var(--muted); line-height: 1.5; }
.status { min-height: 2.7em; margin: 0 0 9px; color: var(--positive); line-height: 1.45; font-size: .82rem; }
.status[data-state="notice"], .status[data-state="error"] { color: var(--attention); }
.status:empty { min-height: 0; }
.download-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.download { min-height: 45px; padding: 9px 7px; border: 1px solid transparent; border-radius: 8px; font-size: .88rem; font-weight: 760; }
.download.primary { background: var(--accent); color: #17142c; }
.download.primary:hover:not(:disabled) { background: #ddd5ff; }
.download.secondary { border-color: #5a5873; background: #27283a; color: var(--text); }
.download.secondary:hover:not(:disabled) { border-color: var(--accent); }
.download:disabled { opacity: .46; cursor: not-allowed; }
.formats { margin-top: 10px; }
.notes { display: flex; gap: 12px 22px; flex-wrap: wrap; margin-block: 18px 29px; color: var(--muted); font-size: .83rem; line-height: 1.5; }
.notes p { margin: 0; }
.footer { min-height: 70px; border-top: 1px solid var(--border); }
.no-script { padding: 13px; color: var(--attention); border: 1px solid var(--border); }
@media (max-width: 850px) {
  .panel { padding: 17px; }
  .qr-stage { min-height: 252px; }
}
@media (max-width: 720px) {
  .workspace { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .preview-panel { position: static; }
}
@media (max-width: 480px) {
  .shell { width: calc(100% - 28px); }
  .masthead-inner { min-height: 63px; gap: 9px; }
  .brand img { width: 90px; }
  .masthead nav a { font-size: .76rem; }
  .intro { padding-block: 31px 23px; }
  .intro h1 { letter-spacing: -.059em; }
  .panel { padding: 15px; }
  .types span, .preset-row button { padding-inline: 10px; }
  [data-fields="contact"].two { grid-template-columns: minmax(0, 1fr); }
}

.logo-controls { margin-top: 16px; }
.logo-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.logo-actions button, .logo-upload {
  position: relative; display: inline-flex; align-items: center; min-height: 39px;
  padding: 5px 11px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--subpanel); color: var(--text); font-size: .84rem; font-weight: 650;
}
.logo-actions button:hover, .logo-upload:hover { border-color: var(--accent); }
.logo-upload { cursor: pointer; }
.logo-upload:focus-within { outline: 2px solid var(--accent); outline-offset: 4px; }
.logo-upload input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.logo-status { margin-top: 7px; }
.logo-status:empty { display: none; }

.scan-test { margin-block: 12px; }
.scan-test button { padding-inline: 13px; min-height: 40px; }
.scan-result { margin: 7px 0 0; color: var(--muted); font-size: .84rem; line-height: 1.42; }
.scan-result:empty { display: none; }
.scan-result[data-result="pass"] { color: var(--positive); }
.scan-result[data-result="warning"] { color: var(--attention); }
