:root {
  color-scheme: light;
  --primary: #087b96;
  --primary-dark: #076276;
  --ink: #18212b;
  --muted: #526171;
  --line: #e3e7e9;
  font-family: "PingFang TC","Microsoft JhengHei","Noto Sans TC",system-ui,sans-serif;
  color: var(--ink);
  background: #f8f9fa;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  font-size: 1.125rem;
  line-height: 1.75;
}

button, input, textarea, select {
  font: inherit;
}

button, a, input, summary, select, textarea {
  -webkit-tap-highlight-color: transparent;
}

button, a, summary {
  touch-action: manipulation;
}

button {
  cursor: pointer;

  &:disabled {
    opacity: .45;
    cursor: not-allowed;
  }
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  border: 0;
}

.icon {
  display: inline-block;
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  background-color: currentColor;
  -webkit-mask: var(--icon-url) center / contain no-repeat;
  mask: var(--icon-url) center / contain no-repeat;
}

h1, h2, h3, p {
  margin: 0;
}

h2 {
  font-size: 1rem;
  font-weight: 600;
}

h3 {
  font-size: 1rem;
  font-weight: 600;
}

:focus-visible {
  outline: 3px solid #22b3d3;
  outline-offset: 4px;
}

.skip-link {
  position: absolute;
  left: 20px;
  top: -60px;
  padding: 12px;
  background: white;
  z-index: 10;

  &:focus {
    top: 10px;
  }
}

.site-header {
  height: 72px;
  background: #fff;
  border-bottom: 1px solid var(--line);

  & nav {
    display: flex;
    height: 100%;
    align-items: center;
    gap: 20px;
    color: var(--muted);
    font-size: 1rem;

    & a {
      display: flex;
      align-items: center;
      height: 100%;
      border-bottom: 2px solid transparent;

      &:hover, &.active {
        color: var(--ink);
        border-color: #596771;
      }
    }
  }
}

.header-inner {
  max-width: 1080px;
  margin: auto;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 1.4375rem;
  font-weight: 700;
  letter-spacing: -.4px;
}

.brand-light {
  margin-left: 5px;
  font-weight: 450;
}

.brand-mark {
  color: var(--ink);
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;

  & img {
    width: 28px;
    height: 28px;
    fill: none;
    stroke: none;
  }
}

.locale {
  position: relative;
  flex-shrink: 0;
  font-size: 1rem;
  color: #475569;

  & summary {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 8px 10px;
    border-radius: 6px;
    list-style: none;
    cursor: pointer;

    &:hover {
      background: #f0f3f4;
    }
  }

  & .icon {
    width: 18px;
    height: 18px;
  }

  & .icon-chevron {
    width: 14px;
    height: 14px;
  }

  &[open] {
    & summary {
      background: #f0f3f4;
    }

    & .icon-chevron {
      transform: rotate(180deg);
    }
  }

  & .locale-options {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 10;
    width: 216px;
    padding: 6px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 6px 18px #18212b12;

    & p {
      padding: 7px 10px;
      font-size: 1rem;
      color: var(--muted);
    }

    & a {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 16px;
      width: 100%;
      min-height: 48px;
      padding: 10px;
      border-radius: 5px;
      background: transparent;
      color: var(--ink);
      text-align: left;
      font-size: 1rem;

      &[aria-current="page"] {
        color: var(--primary-dark);
        background: #f0f9fb;
      }

      &:hover:not(:disabled) {
        background: #edf4f6;
      }

      &:disabled {
        opacity: 1;
        color: var(--muted);
      }

      & small {
        font-size: 1rem;
      }
    }
  }
}

main {
  max-width: 1080px;
  margin: auto;
  padding: 0 18px;
}

.intro {
  text-align: center;
  padding: 26px 0 20px;

  & h1 {
    font-size: 1.875rem;
    letter-spacing: -.6px;
    font-weight: 600;
    line-height: 1.4;
    margin: 0 0 8px;
  }

  & > p {
    color: var(--muted);
    font-size: 1rem;
  }
}

.workspace {
  background: #fff;
  border: 1px solid #dfe5e8;
  border-radius: 12px;
  overflow: hidden;
}





.tool-grid {
  display: grid;
  grid-template-columns: minmax(0,1.3fr) minmax(0,1fr);
}

.input-panel {
  padding: 22px;
  min-width: 0;
}

.step-heading {
  display: flex;
  align-items: center;
  gap: 10px;
}

.type-grid {
  display: grid;
  grid-template-columns: repeat(5,minmax(0,1fr));
  gap: 3px;
  margin: 10px 0 20px;
  border-bottom: 1px solid var(--line);
}

.type-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  min-height: 70px;
  padding: 6px 0 8px;
  color: #64717d;
  font-size: 1rem;

  & .icon {
    width: 28px;
    height: 28px;
  }

  &:hover {
    color: var(--ink);
    background: #f6f8f9;
  }

  &.is-selected {
    color: var(--primary-dark);
    border-bottom-color: var(--primary);
    background: #f5fbfc;
  }
}

.content-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.text-button {
  font-size: 1rem;
  background: none;
  color: var(--muted);
  padding: 8px;
  min-height: 48px;

  &:hover {
    color: var(--primary);
  }
}

#fields {
  display: grid;
  gap: 12px;
}

.security-field {
  border: 0;
  padding: 0;
  margin: 0;

  & legend {
    color: #435268;
    font-size: 1rem;
    margin-bottom: 5px;
    white-space: nowrap;
  }
}

.choice-buttons {
  --choice-columns: 3;
  display: grid;
  grid-template-columns: repeat(var(--choice-columns), minmax(0, 1fr));
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f6f8f9;

  & label {
    position: relative;
    min-width: 0;
    margin: 0;

    & + label {
      border-left: 1px solid var(--line);
    }

    &:first-child span {
      border-radius: 5px 0 0 5px;
    }

    &:last-child span {
      border-radius: 0 5px 5px 0;
    }
  }

  & input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    min-height: 0;
    margin: 0;
    padding: 0;
    opacity: 0;
    cursor: pointer;
  }

  & span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 8px 4px;
    text-align: center;
  }

  & input:hover + span {
    background: #eef5f6;
  }

  & input:checked + span {
    background: #e7f5f8;
    color: var(--primary-dark);
    font-weight: 600;
    box-shadow: inset 0 0 0 1px var(--primary);
  }

  & input:focus-visible + span {
    outline: 2px solid var(--primary);
    outline-offset: 3px;
  }

  & input:disabled {
    cursor: default;
  }

  & input:disabled + span {
    background: #f4f7f8;
    color: #9aa6af;
    cursor: default;
  }
}

.security-group {
  --choice-columns: 2;
}


label {
  font-size: 1rem;
  color: #435268;
  display: block;
}

input:not([type=range]), textarea, select {
  display: block;
  border: 1px solid #cfd8dd;
  background: #fff;
  color: var(--ink);
  border-radius: 6px;
  width: 100%;
  padding: 8px 10px;
  margin-top: 5px;
  min-height: 47px;
}

input::placeholder, textarea::placeholder {
  color: #687582;
}

textarea {
  min-height: 96px;
  resize: vertical;
}

input:focus, textarea:focus, select:focus {
  outline: 2px solid #a9e3ef;
  outline-offset: 1px;
  border-color: var(--primary);
}

.field-hint {
  color: var(--muted);
  font-size: 1rem;
  margin: 8px 0 16px;
}

.advanced {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;

  & summary {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 10px 0;
    font-size: 1rem;
    cursor: pointer;
    list-style: none;

    &:before {
      content: '+';
      color: var(--muted);
      font-size: 1.125rem;
    }
  }

  &[open] summary:before {
    content: '−';
  }

  & small {
    margin-left: auto;
    color: var(--muted);
    font-size: 1rem;
  }
}

.settings {
  padding: 0 0 17px;

  & output {
    float: right;
    color: var(--primary);
  }

  & input[type=range] {
    width: 100%;
    accent-color: var(--primary);
    margin: 15px 0;
  }
}

.settings-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

[data-generator-type="event"] #fields {
  grid-template-columns: minmax(0, 1fr);
}

[data-generator-type="event"] #fields .settings-row {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 14.5rem), 1fr));
}

[data-generator-type="event"] #fields input:is([type="date"], [type="datetime-local"]) {
  min-inline-size: 0;
  inline-size: 100%;
}

.qr-templates {
  min-width: 0;
  margin: 18px 0 0;
  padding: 18px 0 0;
  border: 0;
  border-top: 1px solid var(--line);

  & legend {
    padding: 0;
    color: #435268;
    font-size: 1rem;
    font-weight: 500;
  }

  & #template-status {
    margin-left: 6px;
    color: var(--muted);
    font-weight: 400;
  }

  & .template-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-top: 10px;
  }

  & button {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    min-height: 46px;
    padding: 7px 9px;
    border: 1px solid #d5e0e6;
    border-radius: 6px;
    color: #435268;
    background: #fff;
    text-align: left;
  }

  & button[aria-pressed="true"] {
    border-color: var(--primary);
    background: #eef9fb;
    color: #075e70;
  }

  & .template-swatch {
    flex: 0 0 28px;
    width: 28px;
    height: 28px;
    border: 1px solid #cbd5df;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--template-foreground) 0 50%, var(--template-background) 50% 100%);
  }

  & small {
    display: block;
    margin-top: 9px;
    color: var(--muted);
    line-height: 1.5;
  }
}

.qr-colors {
  min-width: 0;
  margin: 18px 0 0;
  padding: 18px 0 0;
  border: 0;
  border-top: 1px solid var(--line);

  & legend {
    padding: 0;
    color: #435268;
    font-size: 1rem;
    font-weight: 500;
  }

  & .qr-color-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-top: 10px;
  }

  & label, & .qr-color-control {
    min-width: 0;
  }

  & .qr-color-control {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 8px;
    margin-top: 5px;
  }

  & input[type="color"] {
    width: 52px;
    height: 50px;
    padding: 4px;
    border: 1px solid #cbd5df;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
  }

  & input[type="text"] {
    width: 100%;
    min-width: 0;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    text-transform: uppercase;
  }

  & .color-reset {
    margin-top: 12px;
  }

  & .color-error {
    margin-bottom: 0;
  }
}

.qr-logo {
  min-width: 0;
  margin: 18px 0 0;
  padding: 18px 0 0;
  border: 0;
  border-top: 1px solid var(--line);

  & legend {
    padding: 0;
    color: #435268;
    font-size: 1rem;
    font-weight: 500;
  }

  & > small {
    display: block;
    margin: 9px 0 0;
    color: var(--muted);
    line-height: 1.55;
  }

  & .logo-picker {
    margin-top: 10px;
    cursor: pointer;
  }
}

.logo-preview {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f8fbfc;

  &[hidden] {
    display: none;
  }

  & img {
    width: 56px;
    height: 56px;
    object-fit: contain;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
  }

  & span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

.logo-status {
  margin: 10px 0 0;
  color: var(--muted);

  &[data-state="success"] {
    color: #087443;
  }

  &[data-state="error"] {
    color: var(--danger);
  }
}

.primary-button, .secondary-button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  min-height: 48px;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 500;
}

.primary-button {
  background: var(--primary);
  color: white;

  &:hover {
    background: var(--primary-dark);
  }
}

.secondary-button {
  background: white;
  color: #46576a;
  border: 1px solid #dce5eb;

  &:hover {
    background: #eff8fa;
    border-color: #a3cfda;
  }
}

.generate-button {
  width: auto;
  min-width: 160px;
}

.preview-panel {
  padding: 22px 20px;
  background: #fff;
  border-left: 1px solid var(--line);
  min-width: 0;
}

.preview-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;

  & h2 {
    font-size: 1rem;
  }
}

.ready {
  font-size: 1rem;
  color: var(--muted);
}

.proofing {
  padding: 16px 0 0;
  display: grid;
  place-items: center;
  margin-top: 6px;
}

.qr-paper {
  width: 220px;
  height: 220px;
  background: white;
  display: grid;
  place-items: center;

  & canvas {
    width: 100%;
    height: 100%;
    stroke: none;
  }
}

.preview-note {
  font-size: 1rem;
  color: var(--muted);
  text-align: center;
  margin: 4px 0 12px;
  overflow-wrap: anywhere;
}

.preview-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: var(--muted);
  margin-bottom: 13px;

  & span+span {
    border-left: 1px solid #d2dde5;
    margin-left: 10px;
    padding-left: 10px;
  }
}

.download-actions {
  display: flex;
  gap: 8px;

  & .primary-button {
    flex: 1;
  }

  & .icon {
    width: 20px;
    height: 20px;
  }
}

.vector-export-settings {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px;
  align-items: center;
  gap: 8px 12px;
  padding-top: 14px;
  border-top: 1px solid var(--line);

  & label {
    color: #435268;
    font-weight: 500;
  }

  & select {
    width: 100%;
    min-height: 42px;
  }

  & p, & small {
    grid-column: 1 / -1;
    margin: 0;
    color: var(--muted);
    font-size: .9375rem;
    line-height: 1.55;
  }

  & .vector-warning {
    color: #9a6700;
  }

  & .vector-warning[data-state="error"] {
    color: var(--danger);
  }
}

.icon-button {
  padding: 12px;
}

.download-hint {
  font-size: 1rem;
  color: var(--muted);
  text-align: center;
  margin-top: 10px;
}

.workbench-footer {
  border-top: 1px solid var(--line);
  padding: 10px 22px;
  font-size: 1rem;
  color: var(--muted);
  background: #fcfdfd;
}

.section-caption {
  & h2 {
    font-size: 1.125rem;
    font-weight: 500;
    margin: 12px 0;
  }
}

.faq {
  padding: 26px 0 32px;
  display: grid;
  grid-template-columns: 1fr 2.6fr;
  gap: 24px;
  scroll-margin-top: 18px;

  & details {
    border-bottom: 1px solid var(--line);

    &[open] summary:after {
      content: '−';
    }

    & p {
      font-size: 1rem;
      color: var(--muted);
      padding: 0 25px 16px 0;
      line-height: 1.9;
    }
  }

  & summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    gap: 18px;
    padding: 10px 0;
    font-size: 1rem;

    &:after {
      content: '+';
      color: #748898;
    }
  }
}

summary::-webkit-details-marker {
  display: none;
}

.site-footer {
  max-width: 1080px;
  margin: auto;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 18px;
  color: var(--muted);
  font-size: 1rem;

  & .brand {
    font-size: 1.1875rem;
    color: var(--ink);
    gap: 8px;
  }

  & .brand-mark {
    width: 25px;
    height: 25px;

    & img {
      width: 24px;
      height: 24px;
    }
  }

  & > a:not(.brand) {
    margin-left: auto;
  }
}

.decode-layout {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 24px;
  padding: 22px;

  & > div, & > .decode-result-column {
    min-width: 0;
  }
}

.decode-image-preview {
  margin: 0 0 16px;

  & canvas {
    display: block;
    width: 100%;
    height: auto;
    max-height: 280px;
    object-fit: contain;
  }

  & figcaption {
    margin-top: 10px;
    color: var(--muted);
    font-size: 1rem;
    overflow-wrap: anywhere;
  }
}

.drop-zone {
  border: 1px dashed #bdcbd2;
  border-radius: 8px;
  background: #fafcfc;
  text-align: center;
  padding: 22px 12px;
  margin-top: 16px;

  &.dragover {
    background: #dff6fb;
    border-color: var(--primary);
  }

  & #decode-upload-prompt > .icon {
    width: 50px;
    height: 50px;
    color: var(--primary);
    margin-bottom: 10px;
  }

  & p {
    color: var(--muted);
    font-size: 1rem;
    margin: 7px 0 20px;
  }

  & small {
    display: block;
    font-size: 1rem;
    color: var(--muted);
    margin-top: 16px;
  }
}

.camera-button {
  width: 100%;
  margin-top: 15px;
}

#decode-status {
  font-size: 1rem;
  color: var(--muted);
  margin-top: 10px;
}

#camera-video {
  width: 100%;
  margin-top: 15px;
  border-radius: 10px;
}

.result-panel {
  background: #fafbfc;
  border-radius: 8px;
  padding: 22px;
  min-width: 0;
}

#empty-result {
  text-align: center;
  padding: 80px 0;

  & .icon {
    width: 42px;
    height: 42px;
    color: #98adbb;
    margin-bottom: 13px;
  }

  & p {
    font-size: 1rem;
    color: var(--muted);
    margin-top: 12px;
  }
}

#decode-result {
  padding-top: 24px;
}

#result-domain {
  font-weight: 600;
  margin-top: 16px;
  overflow-wrap: anywhere;
}

#result-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: white;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 15px;
  font-size: 1rem;
  max-height: 300px;
  overflow: auto;
}

.result-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.error {
  color: #b42318;
  font-size: 1rem;
  margin: 10px 0;
}

#toast {
  position: fixed;
  bottom: 25px;
  left: 50%;
  transform: translateX(-50%);
  background: #163847;
  color: white;
  border-radius: 12px;
  padding: 12px 22px;
  box-shadow: 0 5px 20px #16384720;
  z-index: 20;
  max-width: 90%;
  width: max-content;
}

.noscript {
  text-align: center;
  padding: 20px;
  color: #b42318;
}

/* SVG artwork lives in assets/icons; masks inherit each control’s text color. */

.icon-globe {
  --icon-url: url("../icons/globe.svg");
}

.icon-link {
  --icon-url: url("../icons/link.svg");
}

.icon-text {
  --icon-url: url("../icons/text.svg");
}

.icon-wifi {
  --icon-url: url("../icons/wifi.svg");
}

.icon-contact {
  --icon-url: url("../icons/contact.svg");
}

.icon-email {
  --icon-url: url("../icons/email.svg");
}

.icon-sms {
  --icon-url: url("../icons/sms.svg");
}

.icon-phone {
  --icon-url: url("../icons/result-phone.svg");
}

.icon-whatsapp {
  --icon-url: url("../icons/result-sms.svg");
}

.icon-location {
  --icon-url: url("../icons/result-location.svg");
}

.icon-event {
  --icon-url: url("../icons/event.svg");
}

.icon-download {
  --icon-url: url("../icons/download.svg");
}

.icon-copy {
  --icon-url: url("../icons/copy.svg");
}

.icon-upload {
  --icon-url: url("../icons/upload.svg");
}

.icon-scan {
  --icon-url: url("../icons/scan.svg");
}

.icon-external {
  --icon-url: url("../icons/external.svg");
}

.icon-chevron {
  --icon-url: url("../icons/chevron.svg");
}

.icon-check {
  --icon-url: url("../icons/check.svg");
}

.icon-close {
  --icon-url: url("../icons/close.svg");
}

.icon-trash {
  --icon-url: url("../icons/trash.svg");
}

.art-workspace {

  & .art-form > .content-heading {
    margin-bottom: 12px;
  }

  & .art-upload-heading {
    margin-top: 16px;

    & h3 {
      margin: 0;
      font-size: 1rem;
      font-weight: 400;
      color: #435268;
    }

  }

  & .art-drop-zone {
    margin: 6px 0 16px;
    padding: 22px 16px;

    & .art-upload-prompt > .icon {
      width: 50px;
      height: 50px;
      color: var(--primary);
      margin-bottom: 10px;
    }

    & h3 {
      margin: 0;
      font-size: 1rem;
    }

    & #art-upload {
      margin-top: 12px;
      background: transparent;
      color: var(--primary-dark);
      text-decoration: underline;
      text-underline-offset: 4px;

      &::after {
        content: "";
        position: absolute;
        inset: 0;
        border-radius: 8px;
      }
    }
  }

  & .art-beta {
    color: var(--muted);
    font-size: 1rem;
  }

  & .art-source {
    display: grid;
    grid-template-columns: minmax(180px, 42%) minmax(0, 1fr);
    align-items: stretch;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    padding: 24px;
    margin-bottom: 16px;

    & .art-source-preview {
      display: flex;
      align-items: center;
      justify-content: center;
      padding-right: 24px;
    }

    & canvas {
      width: min(100%, 300px);
      height: auto;
      aspect-ratio: 1;
      border-radius: 6px;
      object-fit: cover;
      cursor: move;
      touch-action: none;
      outline-offset: 3px;
    }

    & .art-crop-controls {
      min-width: 0;
      display: flex;
      flex-direction: column;
      padding-left: 28px;
      border-left: 1px solid var(--line);
    }

    & .art-drag-title {
      margin: 2px 0 0;
      padding: 0 0 22px;
      border-bottom: 1px solid var(--line);
      color: #435268;
      font-size: 1rem;
      font-weight: 600;
    }

    & .art-zoom-control {
      padding: 22px 0 24px;

      & .art-zoom-heading {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 12px;
      }

      & input[type="range"] {
        width: 100%;
        height: auto;
        margin: 0;
        writing-mode: horizontal-tb;
        direction: ltr;
      }

      & output {
        color: #435268;
        font-size: 1rem;
        text-align: right;
      }
    }

    & .art-remove-image {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      width: 100%;
      margin-top: auto;
      color: var(--muted);

      & .icon {
        width: 20px;
        height: 20px;
        margin: 0;
      }
    }
  }

  & input[type="file"]:not([hidden]) {
    padding: 9px;
    font-size: 1rem;
  }

  & input::file-selector-button {
    padding: 7px 10px;
    margin-right: 9px;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: #f5f8fa;
    color: var(--ink);
    cursor: pointer;
  }

  & .range-labels {
    display: flex;
    justify-content: space-between;
    color: var(--muted);
    font-size: 1rem;
  }

  & .art-pattern-colors {
    min-width: 0;
    margin: 4px 0 0;
    padding: 16px 0 0;
    border: 0;
    border-top: 1px solid var(--line);

    & legend {
      padding: 0;
      color: #435268;
      font-size: 1rem;
      font-weight: 400;
    }
  }

  & .art-color-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 10px;

    & > label {
      min-width: 0;
    }
  }

  & .art-color-control {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 6px;
    padding: 6px 10px 6px 6px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;

    & input[type="color"] {
      width: 38px;
      height: 38px;
      flex: 0 0 38px;
      padding: 2px;
      border: 0;
      border-radius: 4px;
      background: transparent;
      cursor: pointer;
    }

    & output {
      min-width: 0;
      color: var(--muted);
      font-size: .875rem;
      font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    }
  }

  & .art-contrast-toggle {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 14px;
    cursor: pointer;

    & input {
      width: 18px;
      height: 18px;
      margin: 3px 0 0;
      accent-color: var(--primary);
    }

    & span {
      color: #435268;
    }

    & small {
      display: block;
      margin-top: 3px;
      color: var(--muted);
      font-size: .875rem;
      line-height: 1.45;
    }
  }

  & .art-strength {
    border: 0;
    padding: 0;
    margin: 16px 0 0;
    min-width: 0;

    & legend {
      padding: 0;
      font-size: 1rem;
      color: #435268;
    }


  }



  & .art-status {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  & .art-output {
    display: flex;
    flex-direction: column;
    min-height: 0;
  }

  & .art-proofing-area {
    flex: 1;
    min-height: 320px;
    display: grid;
    place-items: center;
    padding: 16px 0;
  }

  & .art-output-settings {
    margin-top: 16px;
  }

  & #art-generate {
    width: 100%;
    margin-top: 16px;
  }

  & .art-preview {
    width: min(100%, 430px);
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    margin: 0;
    border: 1px solid var(--line);
    background: #fff;

    & canvas {
      display: block;
      width: 100%;
      height: auto;
    }

    & .art-empty {
      width: min(260px, 72%);
      aspect-ratio: 1;
      background: url("../illustrations/qr-placeholder.svg?v=20260920-logo") center / contain no-repeat;
    }
  }

  & .art-result {
    font-size: 1rem;
    color: var(--muted);
    margin-bottom: 18px;
    line-height: 1.8;
  }

  & .art-download-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 48px;
    gap: 8px;

    & button {
      width: 100%;
    }
  }
}

.tool-note {
  margin: 0 0 16px;
  font-size: 1rem;
  color: var(--muted);

  & a {
    color: var(--primary-dark);
    text-decoration: underline;
    text-underline-offset: 3px;
  }
}



.use-case {
  margin: 24px 0 0;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
  max-width: 780px;

  & h2 {
    font-size: 1.25rem;
    margin: 0 0 12px;
  }

  & p {
    color: var(--muted);
    line-height: 1.9;
  }

  & a {
    color: var(--primary-dark);
    text-decoration: underline;
    text-underline-offset: 4px;
  }
}

.batch-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr);

  & .input-panel {
    min-width: 0;
  }

  & textarea {
    min-height: 250px;
    resize: vertical;
  }

  & .batch-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 16px;
  }

  & #batch-status {
    font-size: 1rem;
    color: var(--muted);
  }

  & .batch-output {
    min-width: 0;
    border-left: 1px solid var(--line);
    padding: 22px 20px;

    & .preview-heading {
      flex-wrap: wrap;
      gap: 12px;
    }

    & #batch-download {
      font-size: 1rem;
    }
  }

  & .batch-results {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-top: 16px;
  }

  & .batch-card {
    min-width: 0;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 6px;

    & h3 {
      margin: 0 0 12px;
      font-size: 1rem;
      color: var(--muted);
    }

    & img {
      display: block;
      max-width: 100%;
      height: auto;
      margin: 0 auto;
    }

    & .batch-content {
      overflow-wrap: anywhere;
      white-space: pre-wrap;
      font-size: 1rem;
      max-height: 76px;
      overflow: auto;
    }

    & button {
      width: 100%;
      font-size: 1rem;
      padding: 8px;
    }
  }
}

.usage-guide {
  margin: 28px 0 0;
  padding: 22px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  scroll-margin-top: 18px;

  & h2 {
    font-size: 1.5rem;
    margin-bottom: 16px;
  }

  & ol {
    margin: 0;
    padding-left: 28px;
  }

  & li {
    padding: 0 0 18px 4px;

    &:last-child {
      padding-bottom: 0;
    }

    &::marker {
      color: var(--primary-dark);
      font-weight: 600;
    }
  }

  & h3 {
    font-size: 1.25rem;
    margin-bottom: 8px;
  }

  & p {
    max-width: 75ch;
    line-height: 1.9;

    & + p {
      margin-top: 10px;
    }
  }

  & a {
    color: var(--primary-dark);
    text-decoration: underline;
    text-underline-offset: 4px;
  }
}

.batch-view-switch, .batch-mode {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  border: 0;
  padding: 0;
  margin: 16px 0;

  & legend {
    margin-bottom: 8px;
    font-weight: 600;
  }

  & label {
    position: relative;
    flex: 1;
  }

  & input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    min-height: 0;
    margin: 0;
    padding: 0;
    opacity: 0;
    cursor: pointer;
  }

  & span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 8px;
    border: 1px solid #8796a1;
    border-radius: 6px;
  }

  & input:checked + span {
    background: #e7f5f8;
    border: 2px solid var(--primary);
    color: var(--primary-dark);
    font-weight: 600;
  }

  & input:focus-visible + span {
    outline: 3px solid var(--primary);
    outline-offset: 3px;
  }
}

.batch-mode {
  margin-top: 0;
}

.batch-csv-picker {
  margin-top: 8px;
  cursor: pointer;
}

#batch-csv-summary {
  color: var(--muted);
}

.batch-csv-errors {
  margin: 8px 0 0;
  padding-left: 22px;
  color: var(--danger);
  max-height: 150px;
  overflow: auto;
}

.batch-record-meta {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.batch-single {
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  background: #fff;

  & #batch-slide-position {
    color: var(--muted);
    margin-bottom: 16px;
  }

  & img {
    display: block;
    width: min(100%, 420px);
    height: auto;
    margin: 0 auto;
  }

  & #batch-slide-content {
    overflow-wrap: anywhere;
    white-space: pre-wrap;
    margin: 16px 0;
    text-align: left;
    max-height: 180px;
    overflow: auto;
  }

  & .batch-slide-navigation {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 12px;
  }

  & #batch-slide-download {
    width: 100%;
  }
}

.batch-failures {
  display: grid;
  gap: 12px;
  margin-top: 16px;

  & .batch-card {
    background: #fff8f6;
  }
}

/* Larger reading and touch targets throughout every tool. */
button {
  min-height: 48px;
}

input:not([type=range]):not([type=radio]):not([type=checkbox]), textarea, select {
  font-size: 1.125rem;
  min-height: 50px;
}

.checkbox-label {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  min-height: 44px;

  & input { width: 20px; height: 20px; }
}

.intro > p, .usage-guide p {
  font-size: 1.125rem;
}

.advanced summary, .content-heading, .preview-heading {
  flex-wrap: wrap;
  gap: 10px;
}

.batch-layout .batch-card button {
  min-height: 48px;
}

/* The empty preview illustration is never exported. */


.qr-paper:empty {
  background: url("../illustrations/qr-placeholder.svg?v=20260920-logo") center / contain no-repeat;
}

.drop-zone {
  position: relative;
  border: 2px dashed #b5d5de;
  background: #f6fbfc;
  padding: 24px 16px;

  &:hover, &:focus-within {
    background: #edf7f9;
    border-color: var(--primary);
  }

  & #upload {
    background: transparent;
    color: var(--primary-dark);
    text-decoration: underline;
    text-underline-offset: 4px;
  }

  & p {
    margin: 6px 0;
  }

  & small {
    margin-top: 6px;
  }
}

/* Instructions and FAQ share one card treatment and typographic scale. */
.usage-guide, .faq {
  margin: 28px 0;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.faq {
  display: block;

  & .section-caption h2 {
    margin: 0 0 16px;
    font-size: 1.5rem;
    font-weight: 600;
  }

  & summary {
    font-size: 1.25rem;
    font-weight: 600;
    padding: 14px 0;
  }

  & details {
    &:last-child {
      border-bottom: 0;
    }

    & p {
      color: var(--ink);
      font-size: 1.125rem;
      line-height: 1.9;
      padding: 0 28px 18px 0;
    }
  }
}

#fields {
  margin-bottom: 16px;
}

.utm-settings {
  margin-top: 14px;
  padding: 0 0 14px;
  border-bottom: 1px solid var(--line);

  & summary {
    min-height: 44px;
    padding: 10px 0;
    color: #435268;
    font-weight: 500;
    cursor: pointer;
  }

  & .utm-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 4px 0 12px;
  }

  & .utm-toggle input {
    width: 20px;
    height: 20px;
  }

  & .utm-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 12px;
    margin-bottom: 12px;
  }

  & textarea {
    min-height: 88px;
    margin-top: 5px;
    background: #f8fafb;
    overflow-wrap: anywhere;
  }

  & .utm-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
  }

  & p {
    margin: 10px 0 0;
    color: var(--muted);
    line-height: 1.55;
  }
}

.generator-actions {
  display: block;

  & .generate-button {
    width: 100%;
    min-width: 0;
    padding-inline: 24px;
  }
}

/* Keep the preview and its actions together without explanatory filler. */
.generator-preview {
  display: flex;
  flex-direction: column;

  & .preview-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 24px;
    padding: 24px 0 8px;
  }

  & .proofing {
    flex: 1;
    min-height: 0;
    padding: 0;
    margin: 0;
  }

  & .download-actions {
    margin-top: 0;
    flex-wrap: wrap;

    & .primary-button {
      flex-basis: 100%;
    }
  }

  & .qr-paper {
    width: min(260px, 100%);
    height: auto;
    aspect-ratio: 1;
  }
}

/* One reading surface, with instructions above permanently visible answers. */
.help-card {
  margin: 28px 0;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;

  & .usage-guide, & .faq {
    display: block;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
  }

  & .help-heading {
    margin-bottom: 24px;

    & h2 {
      position: relative;
      padding-left: 16px;
      margin: 0 0 8px;
      font-size: 1.5rem;
      font-weight: 600;
      line-height: 1.5;

      &::before {
        content: "";
        position: absolute;
        left: 0;
        top: .25em;
        width: 4px;
        height: 1em;
        border-radius: 2px;
        background: var(--primary);
      }
    }

    & p {
      margin: 0;
      color: var(--muted);
      font-size: 1.125rem;
      line-height: 1.75;
    }
  }

  & .usage-guide ol {
    list-style: none;
    counter-reset: help-step;
    padding: 0;
    margin: 0;
  }

  & .usage-guide li {
    position: relative;
    counter-increment: help-step;
    padding: 0 0 24px 56px;

    &::before {
      content: counter(help-step, decimal-leading-zero);
      position: absolute;
      left: 0;
      top: 0;
      display: grid;
      place-items: center;
      width: 38px;
      height: 38px;
      border-radius: 50%;
      background: #eaf5f7;
      color: var(--primary-dark);
      font-size: 1rem;
      font-weight: 600;
    }

    &:last-child {
      padding-bottom: 0;
    }
  }

  & h3 {
    margin: 0 0 8px;
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.75;
  }

  & .usage-guide li p, & .faq-item p {
    max-width: none;
    color: var(--ink);
    font-size: 1.125rem;
    line-height: 1.9;
  }

  & .faq {
    margin-top: 32px;
    padding-top: 28px;
    border-top: 1px solid var(--line);
  }

  & .faq-item {
    margin-bottom: 24px;

    &:last-child {
      margin-bottom: 0;
    }
  }
}

#decode-status:empty {
  display: none;
}

#decode-result-panel {
  border: 1px solid transparent;

  &[data-state="success"] {
    background: #eff9f2;
    border-color: #b9dcc6;

    & #decode-status { color: #21653a; }
  }

  &[data-state="error"] {
    background: #fff2f0;
    border-color: #edc4be;

    & #decode-status { color: #a72f26; }
  }

  & #decode-status {
    font-weight: 600;
    line-height: 1.8;
  }

  & #result-domain:empty { display: none; }

  & .raw-format-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 48px;
    margin: 12px 0;
    cursor: pointer;

    & input {
      width: 20px;
      height: 20px;
      min-height: 0;
      margin: 0;
      padding: 0;
      accent-color: var(--primary);
    }
  }

  & #result-fields {
    margin: 12px 0 20px;
    padding: 16px;
    border: 1px solid #cddfd2;
    border-radius: 6px;
    background: #fff;

    & dt {
      color: var(--muted);
      font-size: 1rem;
    }

    & dd {
      margin: 0;
      white-space: pre-wrap;
      overflow-wrap: anywhere;

      &:last-child { margin-bottom: 0; }
    }
  }
}

/* Status remains available to assistive technology without visible helper copy. */
#decode-result-panel {
  display: flex;
  flex-direction: column;
  min-height: 300px;
  position: relative;

  & #decode-status {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  & #decode-result {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
    padding-top: 0;
  }

  & #result-text {
    margin: 0 0 20px;
  }

  & .result-actions {
    margin-top: auto;
    padding-top: 16px;
  }

  & #decode-failed {
    display: grid;
    place-items: center;
  }
}

/* Balance concise results around their content, with a grounded action row. */
#decode-result-panel {
  &[data-state="success"] {
    background: #f1f8f4;
    border-color: #c8dfd1;
  }

  & .decoded-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    padding: 28px 4px;
  }

  & .result-symbol {
    display: none;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    margin: 0 auto 24px;
    border: 1px solid #d0e3d8;
    border-radius: 18px;
    color: #397458;
    background: #fff;

    & .icon { width: 30px; height: 30px; }
  }

  &[data-format="url"] .result-symbol { display: flex; }

  & #result-text {
    margin: 0;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    font-family: inherit;
    font-size: 1.25rem;
    line-height: 1.8;
    max-height: 340px;
    text-align: left;
  }

  &[data-format="url"] #result-text {
    text-align: center;
    font-weight: 500;
  }

  &[data-format="structured"] {
    & .decoded-content { justify-content: flex-start; padding-top: 0; }
    & #result-text { font-family: ui-monospace, monospace; font-size: 1rem; }
  }

  & #result-fields {
    background: transparent;
    border: 0;
    padding: 0;
    margin: 12px 0 0;
  }

  & .result-actions {
    border-top: 1px solid #d4e4da;
    padding-top: 18px;
    gap: 10px;

    & > button, & > a {
      flex: 1;
      min-height: 50px;
    }
  }
}

.decode-result-column {
  min-width: 0;

  & #decode-result-panel {
    margin-top: 16px;
  }
}

#decode-result-panel[data-state="success"][data-format="url"] {
  & .decoded-content {
    flex: 1;
    min-height: 260px;
    padding: 24px 4px;
  }

  & .result-symbol {
    margin-bottom: 16px;
  }
}

/* The content viewport grows with the panel, never with its decoded text. */
#decode-result-panel[data-state="success"][data-format] {
  & .decoded-content {
    position: relative;
    flex: 1 1 0;
    min-height: 260px;
    min-width: 0;
    padding: 0;
    margin-bottom: 18px;
    border: 1px solid #d7e4dc;
    border-radius: 6px;
    isolation: isolate;
  }

  & .result-scroll {
    position: absolute;
    inset: 0;
    overflow: auto;
    scrollbar-gutter: stable both-edges;
    scrollbar-width: thin;
    scrollbar-color: #a8bdb0 transparent;
    display: flex;
    padding: 18px 12px;
    z-index: 1;

    &::-webkit-scrollbar { width: 8px; height: 8px; }
    &::-webkit-scrollbar-thumb { background: #a8bdb0; border-radius: 4px; }
  }

  & .result-content-body {
    width: 100%;
    min-width: 0;
    margin: auto;
  }

  & .result-symbol {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 128px;
    height: 128px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #24593b;
    opacity: .035;
    pointer-events: none;
    z-index: 0;

    & .icon { width: 128px; height: 128px; }
  }

  & #result-text {
    max-height: none;
    overflow: visible;
    text-align: center;
    font-size: 1.25rem;
    font-weight: 500;
    line-height: 1.8;
    overflow-wrap: anywhere;
  }

  & #result-fields {
    margin: 0;
    text-align: left;
  }

  & .raw-format-toggle {
    margin-top: 0;
  }
}

#drop-zone {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;

  & > * {
    flex-shrink: 0;
    max-width: 100%;
  }

  & .decode-image-preview {
    width: 100%;
  }
}

#decode-result-panel {
  & #result-text, & #result-fields dd {
    color: var(--muted);
  }
}

/* Explicit actions remain usable on touch devices without a hardware keyboard. */
.decode-source-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
  max-width: 390px;
  margin-top: 14px;

  & > button {
    width: 100%;
    min-width: 0;
    min-height: 48px;
    white-space: nowrap;
  }

  & #start-camera { grid-column: 1 / -1; }

  & #upload {
    background: var(--primary);
    color: white;
    text-decoration: none;

    &:hover { background: var(--primary-dark); }
  }
}

.camera-scan-panel {
  width: min(100%, 520px);
  margin-top: 16px;

  & > p {
    margin: 12px 0;
  }

  & > button {
    width: 100%;
  }
}

.camera-viewport {
  position: relative;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 8px;
  background: #111827;
}

#camera-video {
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  object-fit: cover;
}

.camera-viewfinder {
  position: absolute;
  inset: 50% auto auto 50%;
  width: min(58%, 260px);
  aspect-ratio: 1;
  translate: -50% -50%;
  border: 3px solid rgb(255 255 255 / 92%);
  border-radius: 12px;
  box-shadow: 0 0 0 999px rgb(15 23 42 / 38%);
  pointer-events: none;
}

.mobile-paste-target {
  width: 100%;
  max-width: 390px;
  min-height: 64px;
  margin-top: 12px;
  padding: 18px 14px;
  border: 1px dashed var(--primary);
  border-radius: 6px;
  background: #fff;
  color: var(--primary-dark);
  text-align: center;
  outline: none;

  &:focus {
    border-style: solid;
    box-shadow: 0 0 0 3px rgb(8 145 178 / 14%);
  }
}

/* Decoded information card: individual fields, optional source, and recreation. */
.result-icon {
  &[data-icon="wifi"] { --icon-url: url("../icons/result-wifi.svg"); }
  &[data-icon="shield"] { --icon-url: url("../icons/result-shield.svg"); }
  &[data-icon="key"] { --icon-url: url("../icons/result-key.svg"); }
  &[data-icon="code"] { --icon-url: url("../icons/result-code.svg"); }
  &[data-icon="copy"] { --icon-url: url("../icons/result-copy.svg"); }
  &[data-icon="chevron"] { --icon-url: url("../icons/result-chevron.svg"); }
  &[data-icon="qr"] { --icon-url: url("../icons/result-qr.svg"); }
  &[data-icon="contact"] { --icon-url: url("../icons/result-contact.svg"); }
  &[data-icon="email"] { --icon-url: url("../icons/result-email.svg"); }
  &[data-icon="sms"] { --icon-url: url("../icons/result-sms.svg"); }
  &[data-icon="link"] { --icon-url: url("../icons/result-link.svg"); }
  &[data-icon="text"] { --icon-url: url("../icons/result-text.svg"); }
  &[data-icon="phone"] { --icon-url: url("../icons/result-phone.svg"); }
  &[data-icon="company"] { --icon-url: url("../icons/result-company.svg"); }
  &[data-icon="location"] { --icon-url: url("../icons/result-location.svg"); }
}

#decode-result-panel[data-state="success"][data-format] {
  padding: 16px;
  background: #edf8f2;
  border-color: #cce7d9;

  & #decode-result { gap: 10px; }

  & .decoded-heading {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 2px 2px;

    & > div { min-width: 0; }
    & h3 { font-size: 1.625rem; font-weight: 650; line-height: 1.4; }
    & p { margin-top: 2px; font-size: 1rem; color: var(--muted); }
  }

  & .decoded-type-icon {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    flex-shrink: 0;
    border-radius: 50%;
    background: #d2efdf;
    color: #087b39;

    & .icon { width: 30px; height: 30px; }
  }

  & #result-fields {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr) 40px;
    column-gap: 10px;
    margin: 0;
    padding: 2px 14px;
    border: 0;
    border-radius: 12px;
    background: #fff;
    max-height: none;
    overflow: visible;
  }

  & .result-field {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: subgrid;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
    min-width: 0;

    & + .result-field { border-top: 1px solid var(--line); }
    & dt { display: flex; align-items: center; gap: 10px; min-width: 0; margin: 0; color: var(--muted); font-size: 1.125rem; line-height: 1.6; }
    & dt span { white-space: nowrap; }
    & dt .icon { width: 24px; height: 24px; flex-shrink: 0; color: #30495e; }
    & dd { margin: 0; min-width: 0; font-size: 1.125rem; line-height: 1.6; font-weight: 500; color: var(--muted); overflow-wrap: anywhere; white-space: pre-wrap; }
  }

  & .result-field-long {
    grid-template-columns: subgrid;
    row-gap: 4px;
    padding-bottom: 12px;

    & dt { grid-column: 1 / -2; grid-row: 1; }
    & .field-copy { grid-column: -2 / -1; grid-row: 1; }
    & dd {
      grid-column: 1 / -1;
      grid-row: 2;
      max-height: 180px;
      overflow: auto;
      scrollbar-width: thin;
      scrollbar-color: #b5c8bd transparent;
      line-height: 1.75;
      font-weight: 400;
      padding-right: 6px;
    }
  }

  & .field-copy {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    min-height: 44px;
    padding: 8px;
    border-radius: 6px;
    background: transparent;
    color: #496176;
    cursor: pointer;

    &:hover { background: #e9f4ee; }
  }

  & .raw-result {
    border: 1px solid #d4e8df;
    border-radius: 10px;
    background: #f6fbf8;

    & summary {
      display: flex;
      align-items: center;
      gap: 12px;
      min-height: 48px;
      padding: 8px 14px;
      list-style: none;
      cursor: pointer;
      color: #30495e;
      font-size: 1.125rem;
    }
    & .raw-chevron { margin-left: auto; width: 20px; height: 20px; }
    &[open] .raw-chevron { transform: rotate(180deg); }
  }

  & .raw-result-body {
    padding: 0 12px 10px;
  }

  & .raw-result-value {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 10px;
    background: #f3f6f7;
    border: 1px solid #d9e2e6;
    border-radius: 8px;
  }

  & #result-text {
    flex: 1;
    min-width: 0;
    margin: 0;
    padding: 0;
    font-family: ui-monospace, monospace;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.8;
    text-align: left;
    max-height: 220px;
    overflow: auto;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    color: var(--muted);
  }

  & .result-actions {
    margin-top: auto;
    padding-top: 2px;
    border: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;

    & > a, & > button { width: 100%; min-height: 52px; flex: none; }
    & #regenerate-result { background: #0d6266; }
    & #regenerate-result:hover { background: #084c50; }
  }
}

@media (max-width: 850px) {
  .site-header nav {
    gap: 12px;
  }

  .art-workspace .art-beta {
    display: none;
  }

  .site-header {
    & nav {
      gap: 20px;
    }
  }

  .input-panel, .preview-panel {
    padding: 20px 16px;
  }

  .type-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
  }

  .type-card {
    flex-direction: row;
    min-height: 47px;
    padding: 8px 4px;

    & .icon {
      width: 25px;
      height: 25px;
    }
  }

  .qr-paper {
    width: 190px;
    height: 190px;
  }

  .download-actions {
    flex-wrap: wrap;

    & .primary-button {
      min-width: 100%;
    }
  }

  .faq {
    grid-template-columns: 1fr 2fr;
    gap: 24px;
  }
}

@media (max-width: 620px) {
  .art-workspace .art-source {
    grid-template-columns: 1fr;
    padding: 18px;

    & .art-source-preview {
      justify-content: center;
      padding: 0 0 20px;
    }

    & .art-crop-controls {
      padding: 20px 0 0;
      border-left: 0;
      border-top: 1px solid var(--line);
    }
  }
}

@media (max-width: 620px) {
  .site-header {
    height: auto;

    & .header-inner {
      flex-wrap: wrap;
      padding-top: 8px;
    }

    & nav {
      order: 3;
      width: 100%;
      height: auto;
      gap: 4px 12px;
      flex-wrap: wrap;
      padding-top: 4px;

      & a {
        min-height: 44px;
      }
    }
  }

  .header-inner {
    padding: 0 14px;
  }

  .brand {
    font-size: 1.3125rem;
  }

  main {
    padding: 0 12px;
  }

  .intro {
    padding: 20px 0 16px;

    & h1 {
      font-size: 1.625rem;
    }

    & > p {
      font-size: 1rem;
      max-width: 100%;
      line-height: 1.8;
    }
  }

  .workspace {
    border-radius: 9px;
  }





  .tool-grid, .decode-layout {
    grid-template-columns: 1fr;
  }

  .input-panel {
    padding: 18px 14px;
  }

  .type-grid {
    margin-bottom: 24px;
  }

  .generate-button {
    width: 100%;
  }

  .preview-panel {
    border-left: 0;
    border-top: 1px solid var(--line);
    padding: 18px 14px;
  }

  .qr-paper {
    width: 220px;
    height: 220px;
  }

  .download-actions {
    & .primary-button {
      min-width: 0;
    }
  }

  .workbench-footer {
    padding: 10px 14px;
    font-size: 1rem;
  }

  .faq {
    grid-template-columns: 1fr;
    gap: 4px;
    padding: 22px 0 30px;

    & summary {
      font-size: 1rem;
    }
  }

  .site-footer {
    flex-wrap: wrap;
    gap: 14px;
    padding: 20px;

    & > span {
      flex-basis: 100%;
    }
  }

  .decode-layout {
    padding: 16px 14px;
    gap: 16px;
  }

  .decode-source-actions {
    & > button {
      padding-inline: 8px;
    }
  }

  #empty-result {
    padding: 35px 0;
  }

  .settings-row {
    gap: 8px;
  }

  .utm-settings .utm-grid {
    grid-template-columns: 1fr;
  }

  .qr-colors .qr-color-grid {
    grid-template-columns: 1fr;
  }

  .qr-templates .template-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .settings {
    & select {
      font-size: 1rem;
    }
  }

  .advanced {
    & small {
      font-size: 1rem;
    }
  }
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }

  button, a {
    transition: background-color .16s, color .16s, border-color .16s;
  }
}

@media (max-width: 620px) {
  .batch-layout {
    grid-template-columns: 1fr;
  }

  .batch-layout .batch-output {
    border-left: 0;
    border-top: 1px solid var(--line);
    padding: 18px 14px;
  }
}

@media (min-width: 621px) and (max-width: 1050px) {
  .site-header {
    height: auto;

    & .header-inner {
      flex-wrap: wrap;
      row-gap: 8px;
      padding-top: 10px;
      padding-bottom: 10px;
    }

    & nav {
      order: 3;
      width: 100%;
      justify-content: center;
    }
  }
}

@media (max-width: 620px) {
  .usage-guide {
    padding: 18px 14px;

    & ol {
      padding-left: 22px;
    }
  }

  .batch-single {
    padding: 12px;
  }

  .batch-layout .batch-results {
    grid-template-columns: 1fr;
  }


}





@media (max-width: 620px) {
  .usage-guide, .faq {
    padding: 18px 14px;
  }

  .faq summary {
    font-size: 1.25rem;
  }
}

@media (max-width: 620px) {
  .help-card {
    padding: 20px 14px;

    & .usage-guide li {
      padding-left: 46px;
    }

    & .faq {
      margin-top: 28px;
      padding-top: 24px;
    }
  }
}

@media (min-width: 621px) {
  .decode-layout {
    align-items: stretch;

    & > div, & > .decode-result-column {
      display: flex;
      flex-direction: column;
      min-width: 0;
    }

    & .drop-zone, & #decode-result-panel {
      flex: 1;
      margin-top: 16px;
    }
  }
}

@media (max-width: 850px) {
  #decode-result-panel[data-state="success"][data-format] {
    padding: 14px;

    & .decoded-heading { gap: 12px; }
    & .decoded-type-icon { width: 52px; height: 52px; }
    & #result-fields { grid-template-columns: minmax(0, 1fr) 40px; }
    & .result-field:not(.result-field-long) {
      grid-template-columns: subgrid;
      row-gap: 4px;

      & dt { grid-column: 1; }
      & dd { grid-column: 1; }
      & .field-copy { grid-column: 2; grid-row: 1 / 3; }
    }
  }
}
