[data-reference-office] {
  display: grid;
  gap: 16px;
  padding: clamp(18px, 3vw, 28px);
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--paper);
}

[data-reference-office] .tool-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

[data-reference-office] textarea,
[data-reference-office] input,
[data-reference-office] select {
  width: 100%;
}

[data-reference-office] .table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
}

[data-reference-office] table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

[data-reference-office] th,
[data-reference-office] td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

[data-reference-office] th {
  background: color-mix(in srgb, var(--secondary) 12%, transparent);
  white-space: nowrap;
}

[data-reference-office] tr:last-child td {
  border-bottom: 0;
}

/* QR batch workbench */
.qr-batch-shell {
  --qr-ink: color-mix(in srgb, var(--text) 94%, #13212f);
  --qr-muted: color-mix(in srgb, var(--muted) 92%, #52616f);
  --qr-line: color-mix(in srgb, var(--border) 82%, #6d7a86);
  --qr-soft: color-mix(in srgb, var(--surface-2) 88%, #edf1ef);
  --qr-signal: color-mix(in srgb, var(--primary) 88%, #1b5c77);
  --qr-signal-soft: color-mix(in srgb, var(--qr-signal) 11%, transparent);
  display: grid;
  gap: 0;
  padding: 0;
  overflow: hidden;
  color: var(--qr-ink);
  background: var(--surface, #fff);
}

.qr-batch-shell button,
.qr-batch-shell input,
.qr-batch-shell textarea {
  font-family: inherit;
}

.qr-batch-hero {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: clamp(22px, 4vw, 36px);
  border-bottom: 1px solid var(--qr-line);
  background: linear-gradient(135deg, var(--qr-signal-soft), transparent 58%), var(--surface);
}

.qr-batch-hero h2,
.qr-batch-config h3,
.qr-batch-workspace h3,
.qr-batch-result h4 {
  margin: 0;
  letter-spacing: -.025em;
}

.qr-batch-hero h2 {
  max-width: 24ch;
  font-size: clamp(1.35rem, 2.7vw, 2rem);
  line-height: 1.2;
}

.qr-batch-hero p {
  max-width: 70ch;
  margin: 10px 0 0;
  color: var(--qr-muted);
  line-height: 1.65;
}

.qr-batch-howto {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-bottom: 1px solid var(--qr-line);
  background: color-mix(in srgb, var(--qr-soft) 58%, var(--surface));
}

.qr-batch-howto > div {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  column-gap: 10px;
  align-items: center;
  min-height: 66px;
  padding: 13px clamp(18px, 3vw, 28px);
  border-right: 1px solid var(--qr-line);
}

.qr-batch-howto > div:last-child { border-right: 0; }

.qr-batch-howto span {
  grid-row: span 2;
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 9px;
  color: var(--qr-signal);
  background: var(--qr-signal-soft);
  font: 800 .68rem/1 var(--mono);
}

.qr-batch-howto strong {
  align-self: end;
  color: var(--qr-ink);
  font-size: .78rem;
}

.qr-batch-howto small {
  align-self: start;
  color: var(--qr-muted);
  font-size: .68rem;
  line-height: 1.4;
}

.qr-batch-kicker {
  display: block;
  margin-bottom: 7px;
  color: var(--qr-signal);
  font: 800 .72rem/1 var(--mono);
  letter-spacing: .1em;
  text-transform: uppercase;
}

.qr-batch-local-badge {
  align-self: start;
  flex: 0 0 auto;
  padding: 9px 12px;
  border: 1px solid var(--qr-line);
  border-radius: 999px;
  color: var(--qr-signal);
  background: var(--qr-soft);
  font-size: .78rem;
  font-weight: 800;
  white-space: nowrap;
}

.qr-batch-local-badge span {
  font-size: .58rem;
  vertical-align: 1px;
}

.qr-batch-layout {
  display: grid;
  grid-template-columns: minmax(310px, .78fr) minmax(0, 1.5fr);
  gap: 0;
  align-items: start;
}

.qr-batch-config,
.qr-batch-workspace {
  min-width: 0;
  padding: clamp(18px, 3vw, 28px);
}

.qr-batch-config {
  display: grid;
  gap: 18px;
  border-right: 1px solid var(--qr-line);
  background: color-mix(in srgb, var(--qr-soft) 55%, var(--surface));
}

.qr-batch-config-head,
.qr-batch-workspace-head,
.qr-batch-section-head,
.qr-batch-editor-head,
.qr-batch-result header,
.qr-preview-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.qr-batch-config-head h3,
.qr-batch-workspace-head h3 {
  font-size: 1.15rem;
}

.qr-batch-subcopy {
  max-width: 25ch;
  margin: 5px 0 0;
  color: var(--qr-muted);
  font-size: .72rem;
  line-height: 1.45;
}

.qr-batch-add {
  flex: 0 0 auto;
  padding-inline: 11px;
}

.qr-batch-list {
  display: grid;
  gap: 7px;
  max-height: 260px;
  overflow: auto;
  padding: 2px;
}

.qr-batch-list-item {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px;
  border: 1px solid var(--qr-line);
  border-radius: 10px;
  color: var(--qr-ink);
  background: var(--surface);
  text-align: start;
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease, transform .18s ease;
}

.qr-batch-list-item:hover,
.qr-batch-list-item:focus-visible {
  border-color: var(--qr-signal);
  background: var(--qr-signal-soft);
  transform: translateY(-1px);
}

.qr-batch-list-item.is-active {
  border-color: var(--qr-signal);
  box-shadow: inset 3px 0 0 var(--qr-signal);
  background: var(--qr-signal-soft);
}

.qr-batch-list-number {
  color: var(--qr-signal);
  font: 800 .75rem/1 var(--mono);
}

.qr-batch-list-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.qr-batch-list-copy strong,
.qr-batch-list-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.qr-batch-list-copy strong { font-size: .86rem; }
.qr-batch-list-copy small { color: var(--qr-muted); font-size: .72rem; }
.qr-batch-list-arrow { color: var(--qr-muted); }

.qr-batch-editor {
  display: grid;
  gap: 15px;
  padding: 17px;
  border: 1px solid var(--qr-line);
  border-radius: 14px;
  background: var(--surface);
}

.qr-batch-quick-editor {
  display: grid;
  gap: 16px;
  padding: 17px;
  border: 1px solid color-mix(in srgb, var(--qr-signal) 35%, var(--qr-line));
  border-radius: 14px;
  background: linear-gradient(145deg, var(--qr-signal-soft), transparent 50%), var(--surface);
}

.qr-batch-quick-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.qr-batch-quick-head h4 {
  margin: 0;
  color: var(--qr-ink);
  font-size: 1rem;
  letter-spacing: -.02em;
}

.qr-batch-quick-modes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.qr-batch-quick-mode {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 62px;
  padding: 10px;
  border: 1px solid var(--qr-line);
  border-radius: 11px;
  color: var(--qr-ink);
  background: var(--surface);
  text-align: start;
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease, transform .18s ease;
}

.qr-batch-quick-mode:hover,
.qr-batch-quick-mode:focus-visible {
  border-color: var(--qr-signal);
  background: var(--qr-signal-soft);
  transform: translateY(-1px);
}

.qr-batch-quick-mode.is-active {
  border-color: var(--qr-signal);
  box-shadow: inset 3px 0 0 var(--qr-signal);
  background: var(--qr-signal-soft);
}

.qr-batch-quick-mode-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 9px;
  color: var(--qr-signal);
  background: var(--qr-soft);
  font: 800 .72rem/1 var(--mono);
}

.qr-batch-quick-mode strong,
.qr-batch-quick-mode small {
  display: block;
}

.qr-batch-quick-mode strong {
  font-size: .82rem;
}

.qr-batch-quick-mode small {
  margin-top: 3px;
  color: var(--qr-muted);
  font-size: .68rem;
  line-height: 1.35;
}

.qr-batch-quick-name,
.qr-batch-quick-content {
  margin: 0;
  color: var(--qr-ink);
  font-size: .8rem;
}

.qr-batch-quick-name > span {
  color: var(--qr-muted);
  font-size: .7rem;
  font-weight: 600;
}

.qr-batch-quick-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.qr-batch-quick-label em {
  color: var(--qr-signal);
  font-size: .7rem;
  font-style: normal;
  font-weight: 800;
}

.qr-batch-quick-content textarea {
  min-height: 148px;
  margin-top: 6px;
  resize: vertical;
}

.qr-batch-quick-content > small,
.qr-batch-quick-name > small {
  display: block;
  margin-top: 5px;
  color: var(--qr-muted);
  font-size: .7rem;
  line-height: 1.45;
}

.qr-batch-sample-note {
  display: grid;
  gap: 3px;
  padding: 9px 10px;
  border-left: 3px solid #c9842b;
  border-radius: 0 8px 8px 0;
  color: var(--qr-muted);
  background: color-mix(in srgb, #c9842b 9%, var(--surface));
  font-size: .7rem;
  line-height: 1.45;
}

.qr-batch-sample-note strong { color: #a8651e; }

.qr-batch-quick-callout {
  display: grid;
  gap: 4px;
  padding: 11px 12px;
  border-left: 3px solid var(--qr-signal);
  border-radius: 0 9px 9px 0;
  background: var(--qr-soft);
}

.qr-batch-quick-callout strong {
  color: var(--qr-ink);
  font-size: .8rem;
}

.qr-batch-quick-callout p {
  margin: 0;
  color: var(--qr-muted);
  font-size: .72rem;
  line-height: 1.5;
}

.qr-batch-quick-callout code {
  color: var(--qr-signal);
  font-family: var(--mono);
}

.qr-batch-quick-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.qr-batch-quick-form label {
  margin: 0;
  color: var(--qr-ink);
  font-size: .76rem;
}

.qr-batch-quick-form small {
  display: block;
  margin-top: 4px;
  color: var(--qr-muted);
  font-size: .66rem;
}

.qr-batch-quick-example {
  display: grid;
  gap: 5px;
  padding: 10px 11px;
  border: 1px dashed var(--qr-line);
  border-radius: 9px;
  background: var(--qr-soft);
}

.qr-batch-quick-example span {
  color: var(--qr-muted);
  font-size: .68rem;
  font-weight: 800;
}

.qr-batch-quick-example code {
  overflow-wrap: anywhere;
  color: var(--qr-signal);
  font: 700 .72rem/1.45 var(--mono);
}

.qr-batch-quick-note {
  margin: 0;
  color: var(--qr-muted);
  font-size: .7rem;
  line-height: 1.5;
}

.qr-batch-quick-note strong { color: var(--qr-signal); }

.qr-batch-editor-head {
  align-items: end;
}

.qr-batch-editor-head > label {
  flex: 1 1 auto;
  min-width: 0;
  margin-bottom: 0;
}

.qr-batch-editor-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
}

.qr-batch-editor textarea {
  min-height: 126px;
  margin-top: 2px;
  resize: vertical;
}

.qr-batch-label-note {
  color: var(--qr-muted);
  font-size: .72rem;
  font-weight: 600;
}

.qr-batch-variable-palette {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 6px;
  padding: 10px;
  border: 1px dashed var(--qr-line);
  border-radius: 10px;
  background: var(--qr-soft);
}

.qr-batch-variable-palette > span {
  align-self: center;
  margin-right: 2px;
  color: var(--qr-muted);
  font-size: .74rem;
  font-weight: 800;
}

.qr-batch-variable-palette button {
  display: grid;
  gap: 1px;
  min-height: 42px;
  padding: 6px 9px;
  border: 1px solid var(--qr-line);
  border-radius: 8px;
  color: var(--qr-ink);
  background: var(--surface);
  text-align: start;
  cursor: pointer;
}

.qr-batch-variable-palette button:hover,
.qr-batch-variable-palette button:focus-visible {
  border-color: var(--qr-signal);
  color: var(--qr-signal);
}

.qr-batch-variable-palette code {
  color: inherit;
  font-size: .74rem;
}

.qr-batch-variable-palette small {
  color: var(--qr-muted);
  font-size: .66rem;
}

.qr-batch-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
}

.qr-batch-form-grid label {
  margin: 0;
  font-size: .8rem;
}

.qr-batch-form-grid small {
  display: block;
  margin-top: 4px;
  color: var(--qr-muted);
  font-size: .68rem;
  font-weight: 500;
  line-height: 1.4;
}

.qr-batch-custom-vars {
  display: grid;
  gap: 10px;
  padding-top: 4px;
}

.qr-batch-section-head {
  align-items: center;
}

.qr-batch-section-head h4 {
  margin: 0;
  font-size: .92rem;
}

.qr-batch-section-head h4 span {
  color: var(--qr-muted);
  font-size: .7rem;
  font-weight: 600;
}

.qr-batch-section-head p {
  margin: 3px 0 0;
  color: var(--qr-muted);
  font-size: .72rem;
  line-height: 1.5;
}

.qr-batch-section-head p code,
.qr-batch-editor-hint code {
  color: var(--qr-signal);
}

.qr-batch-variable-list {
  display: grid;
  gap: 8px;
}

.qr-batch-variable-row {
  display: grid;
  grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr) auto;
  align-items: end;
  gap: 7px;
}

.qr-batch-variable-row label {
  margin: 0;
  color: var(--qr-muted);
  font-size: .68rem;
  font-weight: 700;
}

.qr-batch-variable-row input {
  min-height: 38px;
  margin-top: 3px;
  padding-inline: 9px;
  font-size: .8rem;
}

.qr-batch-icon-btn {
  display: inline-grid;
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  place-items: center;
  padding: 0;
  border: 1px solid var(--qr-line);
  border-radius: 8px;
  color: var(--qr-muted);
  background: var(--surface);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.qr-batch-icon-btn:hover,
.qr-batch-icon-btn:focus-visible {
  border-color: var(--danger, #b03024);
  color: var(--danger, #b03024);
}

.qr-batch-editor-hint {
  margin: 0;
  color: var(--qr-muted);
  font-size: .73rem;
  line-height: 1.55;
}

.qr-batch-main-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.qr-batch-main-actions .primary-btn {
  flex: 1 1 190px;
}

.qr-batch-workspace {
  display: grid;
  gap: 16px;
  min-height: 640px;
  background: var(--surface);
}

.qr-batch-workspace-head {
  align-items: center;
}

.qr-batch-result-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.qr-batch-summary {
  padding: 10px 12px;
  border-left: 3px solid var(--qr-signal);
  color: var(--qr-muted);
  background: var(--qr-soft);
  font-size: .78rem;
  font-weight: 700;
}

.qr-batch-empty {
  display: grid;
  min-height: 330px;
  place-items: center;
  align-content: center;
  gap: 7px;
  padding: 28px;
  border: 1px dashed var(--qr-line);
  border-radius: 14px;
  color: var(--qr-muted);
  background: radial-gradient(circle at 50% 0, var(--qr-signal-soft), transparent 62%), var(--qr-soft);
  text-align: center;
}

.qr-batch-empty-mark {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border: 1px solid var(--qr-line);
  border-radius: 15px;
  color: var(--qr-signal);
  background: var(--surface);
  font-size: 2rem;
  line-height: 1;
}

.qr-batch-empty strong { color: var(--qr-ink); }
.qr-batch-empty p { max-width: 42ch; margin: 0; font-size: .8rem; }

.qr-batch-results {
  display: grid;
  gap: 18px;
}

.qr-batch-result {
  display: grid;
  gap: 12px;
  padding: 15px;
  border: 1px solid var(--qr-line);
  border-radius: 14px;
  background: var(--surface);
}

.qr-batch-result header {
  align-items: center;
  padding-bottom: 11px;
  border-bottom: 1px solid var(--qr-line);
}

.qr-batch-result header strong {
  color: var(--qr-signal);
  font: 800 .75rem/1.4 var(--mono);
  white-space: nowrap;
}

.qr-batch-result-index {
  display: block;
  margin-bottom: 3px;
  color: var(--qr-muted);
  font: 700 .68rem/1 var(--mono);
  letter-spacing: .04em;
}

.qr-batch-result h4 { font-size: 1rem; }

.qr-batch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 10px;
}

.qr-preview-card {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--qr-line);
  border-radius: 11px;
  background: var(--qr-soft);
}

.qr-preview-card-top {
  align-items: center;
  color: var(--qr-muted);
  font: 700 .68rem/1 var(--mono);
}

.qr-preview-download {
  padding: 0;
  border: 0;
  color: var(--qr-signal);
  background: transparent;
  font-size: .68rem;
  font-weight: 700;
  line-height: 1.3;
  cursor: pointer;
}

.qr-preview-download:hover,
.qr-preview-download:focus-visible { text-decoration: underline; }

.qr-code-frame {
  display: grid;
  aspect-ratio: 1;
  min-width: 0;
  place-items: center;
  overflow: hidden;
  padding: 10px;
  border: 1px solid var(--qr-line);
  border-radius: 8px;
  background: #fff;
  background-image: linear-gradient(45deg, #f1f1f1 25%, transparent 25%), linear-gradient(-45deg, #f1f1f1 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #f1f1f1 75%), linear-gradient(-45deg, transparent 75%, #f1f1f1 75%);
  background-position: 0 0, 0 7px, 7px -7px, -7px 0;
  background-size: 14px 14px;
}

.qr-code-frame svg {
  display: block;
  width: min(100%, 190px);
  height: auto;
  max-height: 100%;
  background: #fff;
}

.qr-code-frame[data-error]::after {
  content: attr(data-error);
  padding: 10px;
  color: var(--danger, #b03024);
  font-size: .75rem;
  text-align: center;
}

.qr-preview-card p {
  display: -webkit-box;
  min-height: 3.1em;
  margin: 0;
  overflow: hidden;
  color: var(--qr-muted);
  font: 650 .7rem/1.55 var(--mono);
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow-wrap: anywhere;
}

/* QR batch paste-first studio */
.qr-simple-shell {
  background: var(--surface);
}

.qr-simple-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: clamp(20px, 3vw, 30px);
  border-bottom: 1px solid var(--qr-line);
  background: linear-gradient(120deg, var(--qr-signal-soft), transparent 58%), var(--surface);
}

.qr-simple-hero h2,
.qr-simple-preview-head h3 {
  margin: 0;
  letter-spacing: -.025em;
}

.qr-simple-hero h2 {
  font-size: clamp(1.4rem, 2.6vw, 2rem);
}

.qr-simple-hero p {
  margin: 8px 0 0;
  color: var(--qr-muted);
  font-size: .86rem;
}

.qr-simple-tabs {
  display: flex;
  align-items: stretch;
  gap: 7px;
  padding: 11px clamp(14px, 2vw, 22px);
  overflow-x: auto;
  border-bottom: 1px solid var(--qr-line);
  background: color-mix(in srgb, var(--qr-soft) 58%, var(--surface));
}

.qr-simple-tabs .qr-batch-list {
  display: flex;
  flex: 0 1 auto;
  gap: 7px;
  max-height: none;
  overflow: visible;
  padding: 0;
}

.qr-simple-tab,
.qr-simple-add-batch {
  flex: 0 0 auto;
  min-height: 42px;
  padding: 7px 12px;
  border: 1px solid var(--qr-line);
  border-radius: 9px;
  color: var(--qr-ink);
  background: var(--surface);
  cursor: pointer;
}

.qr-simple-tab {
  display: flex;
  align-items: center;
  gap: 9px;
}

.qr-simple-tab strong {
  max-width: 15ch;
  overflow: hidden;
  font-size: .78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.qr-simple-tab span {
  padding: 2px 6px;
  border-radius: 999px;
  color: var(--qr-muted);
  background: var(--qr-soft);
  font: 700 .65rem/1.4 var(--mono);
}

.qr-simple-tab:hover,
.qr-simple-tab:focus-visible,
.qr-simple-add-batch:hover,
.qr-simple-add-batch:focus-visible {
  border-color: var(--qr-signal);
  color: var(--qr-signal);
}

.qr-simple-tab.is-active {
  border-color: var(--qr-signal);
  box-shadow: inset 0 -3px 0 var(--qr-signal);
  color: var(--qr-ink);
  background: var(--qr-signal-soft);
}

.qr-simple-add-batch {
  border-style: dashed;
  color: var(--qr-signal);
  font-size: .76rem;
  font-weight: 800;
}

.qr-simple-layout {
  display: grid;
  grid-template-columns: minmax(340px, .9fr) minmax(0, 1.35fr);
  align-items: start;
}

.qr-simple-compose,
.qr-simple-preview {
  min-width: 0;
  padding: clamp(16px, 2.5vw, 24px);
}

.qr-simple-compose {
  display: grid;
  gap: 12px;
  border-right: 1px solid var(--qr-line);
  background: color-mix(in srgb, var(--qr-soft) 42%, var(--surface));
}

.qr-simple-preview {
  display: grid;
  align-content: start;
  gap: 14px;
  min-height: 620px;
}

.qr-simple-shell .qr-batch-editor {
  padding: 0;
  border: 0;
  background: transparent;
}

.qr-simple-editor {
  display: grid;
  gap: 14px;
}

.qr-simple-editor-head,
.qr-simple-preview-head,
.qr-simple-mode-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.qr-simple-name {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
}

.qr-simple-name > span {
  display: block;
  margin-bottom: 5px;
  color: var(--qr-muted);
  font-size: .68rem;
  font-weight: 800;
}

.qr-simple-name input {
  min-height: 41px;
  margin: 0;
  font-weight: 800;
}

.qr-simple-editor-actions,
.qr-simple-preview-head .qr-batch-result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.qr-simple-editor-actions {
  flex-wrap: nowrap;
}

.qr-simple-editor-actions .secondary-btn {
  min-width: 44px;
  padding-inline: 9px;
  font-size: .72rem;
  white-space: nowrap;
}

.qr-scenario-picker {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--qr-line);
  border-radius: 13px;
  background: linear-gradient(145deg, var(--qr-signal-soft), transparent 48%), var(--surface);
}

.qr-scenario-picker-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
}

.qr-scenario-picker-head > div {
  display: grid;
  gap: 2px;
}

.qr-scenario-picker-head strong {
  color: var(--qr-ink);
  font-size: .82rem;
}

.qr-scenario-picker-head span,
.qr-scenario-picker-head > small {
  color: var(--qr-muted);
  font-size: .66rem;
  line-height: 1.4;
}

.qr-scenario-picker-head > small {
  max-width: 17ch;
  text-align: right;
}

.qr-scenario-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.qr-scenario-card {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 92px;
  gap: 4px;
  padding: 10px;
  overflow: hidden;
  border: 1px solid var(--qr-line);
  border-radius: 10px;
  color: var(--qr-ink);
  background: color-mix(in srgb, var(--surface) 90%, var(--qr-soft));
  text-align: left;
  cursor: pointer;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.qr-scenario-card::after {
  position: absolute;
  right: -7px;
  bottom: -10px;
  width: 54px;
  height: 30px;
  opacity: .11;
  background: repeating-linear-gradient(90deg, currentColor 0 2px, transparent 2px 5px);
  content: "";
  transform: rotate(-8deg);
  pointer-events: none;
}

.qr-scenario-card:hover,
.qr-scenario-card:focus-visible {
  border-color: var(--qr-signal);
  transform: translateY(-1px);
}

.qr-scenario-card.is-active {
  border-color: var(--qr-signal);
  box-shadow: inset 3px 0 0 var(--qr-signal);
  color: var(--qr-signal);
  background: var(--qr-signal-soft);
}

.qr-scenario-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
}

.qr-scenario-card-top b {
  display: grid;
  min-width: 27px;
  height: 22px;
  padding: 0 5px;
  place-items: center;
  border-radius: 6px;
  color: var(--qr-signal);
  background: var(--qr-soft);
  font: 850 .62rem/1 var(--mono);
}

.qr-scenario-card-top small {
  overflow: hidden;
  color: var(--qr-muted);
  font-size: .62rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.qr-scenario-card > strong {
  font-size: .78rem;
}

.qr-scenario-card > code {
  overflow: hidden;
  color: var(--qr-muted);
  font: 700 .67rem/1.35 var(--mono);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.qr-simple-mode-row {
  padding: 10px 12px;
  border: 1px solid var(--qr-line);
  border-radius: 11px;
  background: var(--surface);
}

.qr-simple-mode-row > div {
  display: grid;
  gap: 2px;
}

.qr-simple-mode-row strong {
  font-size: .8rem;
}

.qr-simple-mode-row > div span {
  color: var(--qr-muted);
  font-size: .68rem;
}

.qr-simple-switch {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  cursor: pointer;
  user-select: none;
}

.qr-simple-switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

.qr-simple-switch > span {
  position: relative;
  width: 38px;
  height: 22px;
  border: 1px solid var(--qr-line);
  border-radius: 999px;
  background: var(--qr-soft);
  transition: border-color .18s ease, background .18s ease;
}

.qr-simple-switch > span::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--qr-muted);
  content: "";
  transition: transform .18s ease, background .18s ease;
}

.qr-simple-switch input:checked + span {
  border-color: var(--qr-signal);
  background: var(--qr-signal-soft);
}

.qr-simple-switch input:checked + span::after {
  background: var(--qr-signal);
  transform: translateX(16px);
}

.qr-simple-switch input:focus-visible + span {
  outline: 2px solid var(--qr-signal);
  outline-offset: 2px;
}

.qr-simple-switch b {
  font-size: .72rem;
}

.qr-simple-field {
  display: grid;
  gap: 6px;
  margin: 0;
}

.qr-simple-field-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.qr-simple-field-label strong {
  font-size: .84rem;
}

.qr-simple-field-label em {
  color: var(--qr-signal);
  font-size: .68rem;
  font-style: normal;
  font-weight: 800;
}

.qr-simple-field textarea {
  min-height: 300px;
  margin: 0;
  resize: vertical;
  font: 650 .82rem/1.65 var(--mono);
}

.qr-simple-field input {
  margin: 0;
}

.qr-simple-field small {
  color: var(--qr-muted);
  font-size: .69rem;
  line-height: 1.45;
}

.qr-code-builder {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 16px minmax(82px, .72fr) 16px minmax(0, 1fr);
  align-items: end;
  gap: 5px;
  padding: 12px;
  border: 1px solid var(--qr-line);
  border-radius: 12px;
  background: var(--surface);
}

.qr-code-part {
  display: grid;
  min-width: 0;
  gap: 5px;
  margin: 0;
}

.qr-code-part > span {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 5px;
}

.qr-code-part strong {
  font-size: .76rem;
}

.qr-code-part em {
  color: var(--qr-muted);
  font-size: .62rem;
  font-style: normal;
}

.qr-code-part input {
  min-width: 0;
  min-height: 43px;
  margin: 0;
  font: 750 .76rem/1.2 var(--mono);
}

.qr-code-builder-plus {
  align-self: center;
  color: var(--qr-muted);
  font: 800 .8rem/1 var(--mono);
  text-align: center;
}

.qr-code-variable {
  display: grid;
  min-width: 0;
  min-height: 67px;
  place-content: center;
  gap: 2px;
  padding: 7px;
  border: 1px dashed color-mix(in srgb, var(--qr-signal) 62%, var(--qr-line));
  border-radius: 9px;
  background: var(--qr-signal-soft);
  text-align: center;
}

.qr-code-variable span {
  color: var(--qr-muted);
  font-size: .58rem;
  font-weight: 700;
}

.qr-code-variable strong {
  color: var(--qr-ink);
  font-size: .68rem;
}

.qr-code-variable code {
  overflow: hidden;
  color: var(--qr-signal);
  font: 850 .76rem/1.25 var(--mono);
  text-overflow: ellipsis;
}

.qr-scenario-caution {
  margin: 0;
  padding: 9px 10px;
  border-left: 3px solid #c9842b;
  border-radius: 0 8px 8px 0;
  color: var(--qr-muted);
  background: color-mix(in srgb, #c9842b 9%, var(--surface));
  font-size: .67rem;
  line-height: 1.5;
}

.qr-scenario-caution strong {
  color: #b36f20;
}

.qr-simple-sequence-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.qr-simple-sequence-grid label {
  margin: 0;
  color: var(--qr-muted);
  font-size: .68rem;
}

.qr-simple-sequence-grid input {
  min-height: 40px;
  margin-top: 4px;
}

.qr-sequence-limit-note {
  margin: -3px 0 0;
  color: var(--qr-muted);
  font-size: .67rem;
  line-height: 1.45;
}

.qr-simple-advanced {
  border: 1px solid var(--qr-line);
  border-radius: 11px;
  background: var(--surface);
}

.qr-simple-advanced summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 11px 12px;
  color: var(--qr-ink);
  font-size: .76rem;
  font-weight: 800;
  cursor: pointer;
}

.qr-simple-advanced summary span {
  color: var(--qr-muted);
  font-size: .66rem;
  font-weight: 600;
}

.qr-simple-advanced-body {
  display: grid;
  gap: 12px;
  padding: 0 12px 12px;
  border-top: 1px solid var(--qr-line);
}

.qr-simple-advanced-body > p {
  margin: 10px 0 0;
  color: var(--qr-muted);
  font-size: .7rem;
  line-height: 1.5;
}

.qr-simple-advanced .qr-batch-variable-palette {
  padding: 8px;
}

.qr-simple-advanced .qr-batch-variable-palette button {
  min-height: 38px;
}

.qr-simple-advanced .qr-batch-variable-row {
  grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr) auto auto;
}

.qr-simple-insert-variable {
  min-height: 38px;
  padding: 0 9px;
  border: 1px solid var(--qr-line);
  border-radius: 8px;
  color: var(--qr-signal);
  background: var(--surface);
  font-size: .7rem;
  font-weight: 800;
  cursor: pointer;
}

.qr-simple-insert-variable:hover,
.qr-simple-insert-variable:focus-visible {
  border-color: var(--qr-signal);
}

.qr-simple-preview-head h3 {
  font-size: 1.15rem;
}

.qr-simple-preview .qr-batch-empty {
  min-height: 390px;
}

.qr-simple-preview .qr-batch-results {
  align-self: start;
}

.qr-large-batch-notice {
  display: grid;
  min-height: 300px;
  place-content: center;
  gap: 9px;
  padding: clamp(24px, 5vw, 48px);
  border: 1px dashed color-mix(in srgb, var(--qr-signal) 55%, var(--qr-line));
  border-radius: 14px;
  background: repeating-linear-gradient(135deg, transparent 0 14px, color-mix(in srgb, var(--qr-signal-soft) 55%, transparent) 14px 15px), var(--qr-soft);
  text-align: center;
}

.qr-large-batch-notice > span {
  justify-self: center;
  padding: 4px 9px;
  border-radius: 999px;
  color: var(--qr-signal);
  background: var(--qr-signal-soft);
  font-size: .66rem;
  font-weight: 850;
}

.qr-large-batch-notice > strong {
  color: var(--qr-ink);
  font-size: clamp(1.3rem, 3vw, 2rem);
  letter-spacing: -.03em;
}

.qr-large-batch-notice > p {
  max-width: 48ch;
  margin: 0;
  color: var(--qr-muted);
  font-size: .76rem;
  line-height: 1.65;
}

.qr-large-batch-notice > code {
  max-width: min(100%, 58ch);
  margin-top: 4px;
  overflow: hidden;
  color: var(--qr-signal);
  font: 750 .7rem/1.5 var(--mono);
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 980px) {
  .qr-batch-layout { grid-template-columns: 1fr; }
  .qr-batch-config { border-right: 0; border-bottom: 1px solid var(--qr-line); }
  .qr-batch-workspace { min-height: 0; }
  .qr-simple-layout { grid-template-columns: 1fr; }
  .qr-simple-compose { border-right: 0; border-bottom: 1px solid var(--qr-line); }
  .qr-simple-preview { min-height: 0; }
}

@media (max-width: 640px) {
  .qr-batch-howto { grid-template-columns: 1fr; }
  .qr-batch-howto > div { min-height: 51px; border-right: 0; border-bottom: 1px solid var(--qr-line); }
  .qr-batch-howto > div:last-child { border-bottom: 0; }
  .qr-batch-hero,
  .qr-simple-hero,
  .qr-simple-editor-head,
  .qr-simple-preview-head,
  .qr-batch-workspace-head,
  .qr-batch-section-head,
  .qr-batch-editor-head,
  .qr-batch-quick-head { display: grid; }
  .qr-batch-hero { gap: 15px; }
  .qr-batch-local-badge { justify-self: start; }
  .qr-batch-result-actions { justify-content: start; }
  .qr-batch-quick-modes,
  .qr-batch-quick-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .qr-simple-mode-row { align-items: flex-start; }
  .qr-scenario-picker-head { align-items: start; }
  .qr-code-builder { grid-template-columns: minmax(0, 1fr) minmax(88px, .72fr); }
  .qr-code-builder-plus { display: none; }
  .qr-code-builder .qr-code-part:last-child { grid-column: 1 / -1; }
  .qr-simple-sequence-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .qr-simple-advanced .qr-batch-variable-row { grid-template-columns: minmax(0, 1fr) auto auto; }
  .qr-simple-advanced .qr-batch-variable-row label:first-child { grid-column: 1 / -1; }
  .qr-simple-advanced .qr-batch-variable-row label:nth-child(2) { grid-column: 1; }
  .qr-batch-variable-row { grid-template-columns: minmax(0, 1fr) 44px; }
  .qr-batch-variable-row label:first-child { grid-column: 1 / -1; }
  .qr-batch-variable-row label:nth-child(2) { grid-column: 1; }
  .qr-batch-variable-row .qr-batch-icon-btn { grid-column: 2; grid-row: 2; }
  .qr-batch-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .qr-batch-config,
  .qr-batch-workspace { padding: 15px; }
}

@media (max-width: 420px) {
  .qr-scenario-picker-head { display: grid; }
  .qr-scenario-picker-head > small { max-width: none; text-align: left; }
  .qr-scenario-list { grid-template-columns: 1fr; }
}
