.qr-workshop, .site-footer {
  --paper: var(--surface);
  --ink: var(--text);
  --muted: var(--muted-text);
  --line: var(--blue-soft);
  --control-line: var(--control-border);
  --selected: var(--muted-text);
  --hover: var(--surface-subtle);
  --error: var(--error-text);
  --mono: ui-monospace, "SFMono-Regular", Consolas, monospace;
  --edge: clamp(18px, 2vw, 30px);
  font-family: "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
}

.site-header { position: sticky; }
.qr-workshop {
  --header-clearance: 100px;
  scroll-margin-top: var(--header-clearance);
}
.qr-workshop :where(button, input, select) { font: inherit; color: inherit; }
.qr-workshop button { cursor: pointer; }
.qr-workshop button:disabled { cursor: default; opacity: .46; }
.qr-workshop :focus-visible { outline: 2px solid var(--link); outline-offset: 3px; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.frame { width: min(1600px, calc(100% - clamp(40px, 4.33vw, 82px))); margin-inline: auto; }
.intro { padding-block: clamp(32px, 3.4vw, 58px); }
.prototype-back {
  display: inline-block;
  margin-block-end: 1rem;
  color: var(--muted);
  font-size: .875rem;
  text-decoration: none;
}
.prototype-back:hover { color: var(--ink); text-decoration: underline; }
.intro h1 {
  margin: 0;
  font-size: clamp(57px, 7.15vw, 116px);
  font-weight: 700;
  line-height: .96;
  letter-spacing: -.09em;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.31fr) minmax(0, 1fr);
  gap: clamp(16px, 1.65vw, 26px);
  align-items: start;
  padding-bottom: 48px;
}
.preview, .controls {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: clamp(17px, 1.65vw, 26px);
  overflow: clip;
}
.preview-head, .controls-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: clamp(76px, 6.76vw, 104px);
  padding: 15px var(--edge);
  gap: 12px;
  border-bottom: 1px solid var(--line);
}
.preview-head { justify-content: center; }
.controls-head #reset { flex: none; }
.view-switch, .shape-switch { display: flex; gap: 8px; }
.view-switch button, .shape-switch button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: clamp(38px, 3.1vw, 48px);
  padding: 6px clamp(11px, 1.1vw, 17px);
  color: var(--muted);
  border: 1px solid var(--control-line);
  border-radius: 999px;
  background: var(--paper);
  font-size: clamp(13px, 1.02vw, 16px);
  letter-spacing: -.024em;
  white-space: nowrap;
}
.view-switch { gap: clamp(8px, .7vw, 11px); }
.view-switch button {
  min-width: clamp(98px, 8.5vw, 130px);
  min-height: clamp(44px, 3.67vw, 56px);
  font-size: clamp(15px, 1.19vw, 18px);
}
.view-switch button:hover, .shape-switch button:hover { background: var(--hover); }
.view-switch button[aria-pressed="true"], .shape-switch button[aria-pressed="true"] {
  color: var(--ink);
  border-color: var(--selected);
}
.shape-switch { flex-wrap: wrap; }
.qr-style .shape-switch button { gap: 7px; padding-inline: clamp(8px, .94vw, 16px); }
.shape-switch[aria-label="Subject area shape"] button { flex: 1; }
.style-icon { display: inline-block; flex: none; width: .75em; height: .75em; background: currentColor; }
[data-outline="rounded"] .style-icon, [data-pattern="rounded"] .style-icon { border-radius: .18em; }
[data-outline="circle"] .style-icon, [data-pattern="circles"] .style-icon { border-radius: 50%; }
[data-pattern="diamonds"] .style-icon { transform: rotate(45deg) scale(.78); }
.heart-icon { background: none; font-size: 1.02em; line-height: .75; width: auto; }
.bubble-icon { border-radius: 50% 50% 50% .05em; }
.qr-style #pattern-label { margin-top: clamp(15px, 1.45vw, 23px); }

.artboard {
  display: grid;
  place-items: center;
  padding: clamp(4px, .4vw, 6px) clamp(7px, 1vw, 16px) clamp(15px, 1.65vw, 25px);
}
.art-stack { width: min(100%, 45.2vw, 688px); aspect-ratio: 1; position: relative; }
#preview { display: block; width: 100%; height: 100%; }
.mask-guide {
  position: absolute;
  z-index: 1;
  cursor: grab;
  touch-action: none;
  border: 1.5px dashed #fff;
  box-shadow: 0 0 0 1px #141414a3, inset 0 0 0 1px #141414a3;
}
.mask-guide:active { cursor: grabbing; }
.mask-guide[data-shape="ellipse"] { border-radius: 50%; }

.export-row {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  align-items: center;
  padding: clamp(15px, 1.4vw, 22px) var(--edge);
  min-height: clamp(76px, 6.25vw, 98px);
  border-top: 1px solid var(--line);
}
.scan-status {
  display: flex;
  align-items: baseline;
  font-size: clamp(18px, 1.67vw, 26px);
  letter-spacing: -.055em;
  font-weight: 600;
}
.scan-status::before {
  display: inline-block;
  content: "";
  flex: none;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #808080;
  margin-right: 10px;
  transform: translateY(-.16em);
}
.scan-status[data-state="pass"]::before { background: #2d8350; }
.scan-status[data-state="warn"]::before { background: #a26712; }
.scan-status[data-state="fail"]::before { background: var(--error); }
.scan-text p, .hint {
  margin: 5px 0 0;
  font-size: clamp(13px, 1.03vw, 16px);
  line-height: 1.42;
  color: var(--muted);
  letter-spacing: -.02em;
}
.density {
  position: relative;
  margin-top: clamp(-12px, -.8vw, -6px);
  font: clamp(12px, 1.02vw, 16px) var(--mono);
  color: var(--muted);
  white-space: nowrap;
}
.density:empty { display: none; }
.export-row label { display: flex; align-items: center; gap: clamp(7px, 1vw, 16px); font-size: clamp(13px, 1.03vw, 16px); color: var(--muted); }
select {
  min-height: clamp(39px, 3.23vw, 50px);
  border: 1px solid var(--control-line);
  border-radius: 999px;
  padding: 4px 13px;
  background: var(--paper);
  color: var(--ink);
}
.primary {
  min-height: clamp(42px, 3.6vw, 56px);
  padding: 6px clamp(12px, 1.8vw, 28px);
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: var(--paper);
  font-size: clamp(13px, 1.1vw, 17px);
  font-weight: 500;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.primary:not(:disabled):hover { background: var(--hover); }
.download-icon {
  display: inline-block;
  width: 13px;
  height: 15px;
  position: relative;
  border-bottom: 1.5px solid currentColor;
  background: linear-gradient(currentColor, currentColor) center top / 1.5px 10px no-repeat;
}
.download-icon::after {
  content: "";
  position: absolute;
  width: 8px;
  height: 8px;
  bottom: 4px;
  left: 2.5px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
}
.export-status:empty { display: none; }
.export-status { margin: 0; padding: 0 var(--edge) 15px; font-size: 13px; color: var(--muted); }

.text-button, .file-action {
  font-size: clamp(13px, 1.03vw, 16px);
  text-decoration: underline;
  text-decoration-color: var(--field-border);
  text-underline-offset: 5px;
}
.text-button { background: transparent; padding: 4px 0; border: 0; }
.text-button:hover { text-decoration-color: currentColor; }
.settings { margin-inline: var(--edge); padding-block: clamp(17px, 1.78vw, 28px); border-bottom: 1px solid var(--line); }
.settings:last-child { border: 0; }
.field-label {
  display: block;
  margin: 0 0 clamp(8px, .9vw, 14px);
  font-weight: 600;
  font-size: clamp(15px, 1.13vw, 18px);
  letter-spacing: -.035em;
}
#destination {
  width: 100%;
  height: clamp(43px, 3.23vw, 50px);
  border: 1px solid var(--control-line);
  border-radius: 15px;
  background: var(--paper);
  padding: 0 16px;
  font: clamp(13px, 1.03vw, 16px) var(--mono);
}
#destination[aria-invalid="true"] { border-color: var(--error); }
.field-error { margin: 7px 0 0; color: var(--error); font-size: 13px; }
.file-picker {
  --thumb-size: clamp(42px, 4vw, 62px);
  display: grid;
  grid-template-columns: var(--thumb-size) minmax(0, 1fr) auto;
  align-items: center;
  text-align: left;
  padding: clamp(9px, .85vw, 13px);
  gap: clamp(9px, 1.1vw, 17px);
  width: 100%;
  background: var(--paper);
  border: 1px dashed var(--control-line);
  border-radius: 19px;
}
.file-picker:hover, .file-picker[data-dragging="true"] { background: var(--hover); border-color: var(--selected); }
.thumbnail {
  overflow: hidden;
  width: var(--thumb-size);
  height: var(--thumb-size);
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--paper);
}
.thumbnail canvas { display: block; width: 100%; height: 100%; }
.file-picker strong, .file-picker small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-picker strong { font-size: clamp(14px, 1.1vw, 17px); font-weight: 600; letter-spacing: -.025em; }
.file-picker small { font-size: clamp(12px, .96vw, 15px); color: var(--muted); margin-top: 4px; }
.file-action { padding-right: 5px; white-space: nowrap; }

.advanced { margin-top: clamp(10px, 1.25vw, 19px); }
.advanced summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
  padding-block: 3px;
  font-size: clamp(14px, 1.1vw, 17px);
  letter-spacing: -.025em;
}
.advanced summary::-webkit-details-marker { display: none; }
.advanced summary::after {
  content: "";
  width: 6px;
  height: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  margin: -3px 5px 0 0;
}
.advanced[open] summary::after { transform: rotate(225deg); margin-top: 4px; }
.advanced > .text-button { margin-top: 8px; }
#mask-details { border-top: 1px solid var(--line); padding-top: clamp(12px, 1.15vw, 18px); margin-top: clamp(15px, 1.45vw, 23px); }
.section-heading { display: flex; justify-content: space-between; gap: 8px; align-items: start; margin-bottom: 9px; }
.check-label { color: var(--muted); font-size: clamp(13px, 1.03vw, 16px); display: flex; gap: 8px; align-items: center; }
.check-label input { width: 17px; height: 17px; margin: 0; accent-color: var(--ink); }
.hint { margin-top: 13px; }

.slider {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 48px;
  gap: 5px 10px;
  align-items: center;
  margin-top: clamp(13px, 1.5vw, 23px);
  font-size: clamp(13px, 1vw, 16px);
  letter-spacing: -.02em;
}
.slider output { font: inherit; text-align: right; }
.slider input {
  grid-column: 1 / -1;
  width: 100%;
  margin: 0;
  height: 24px;
  background: transparent;
  cursor: pointer;
  appearance: none;
}
.slider input:disabled { cursor: default; opacity: .45; }
.slider input::-webkit-slider-runnable-track { height: 2px; background: var(--line); }
.slider input::-moz-range-track { height: 2px; background: var(--line); }
.slider input::-webkit-slider-thumb {
  appearance: none;
  height: 19px;
  width: 19px;
  border: 1px solid var(--ink);
  border-radius: 50%;
  background: var(--paper);
  margin-top: -8.5px;
}
.slider input::-moz-range-thumb { height: 17px; width: 17px; border: 1px solid var(--ink); border-radius: 50%; background: var(--paper); }

.site-footer { border-top: 1px solid var(--line); }
.site-footer { background: var(--inverse-surface); }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 62px; color: var(--inverse-text); }
.wordmark { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; }
.brand-icon { display: inline-block; width: 12px; height: 12px; background: currentColor; clip-path: polygon(0 44%, 28% 44%, 28% 22%, 55% 22%, 55% 0, 100% 0, 100% 100%, 0 100%); }
.privacy { font: 11px var(--mono); white-space: nowrap; }
.privacy span { display: inline-block; width: 6px; height: 6px; background: currentColor; border-radius: 50%; }

@media (min-width: 861px) and (min-height: 960px) {
  .preview { position: sticky; top: var(--header-clearance); }
}
@media (max-width: 1100px) {
  .qr-style .shape-switch { gap: 6px; }
  .qr-style .shape-switch button { padding-inline: 9px; }
  .qr-style .style-icon { display: none; }
}
@media (601px <= width <= 900px) {
  .qr-workshop { --header-clearance: 160px; }
}
@media (max-width: 860px) {
  .frame { width: min(620px, calc(100% - 32px)); }
  .workspace { grid-template-columns: minmax(0, 1fr); }
  .intro h1 { font-size: clamp(47px, 10vw, 82px); }
  .art-stack { width: min(100%, 438px); }
}
@media (max-width: 400px) {
  .qr-workshop { --edge: 14px; }
  .view-switch, .shape-switch { gap: 5px; }
  .export-row label { align-items: start; flex-direction: column; gap: 4px; }
  .density { margin-top: 0; }
}
