:root {
  --radius: 0.625rem;
  --background: oklch(0.97 0.006 250);
  --foreground: oklch(0.145 0 0);
  --card: oklch(1 0 0);
  --card-foreground: oklch(0.145 0 0);
  --popover: oklch(1 0 0);
  --popover-foreground: oklch(0.145 0 0);
  --primary: oklch(0.205 0 0);
  --primary-foreground: oklch(0.985 0 0);
  --secondary: oklch(0.97 0 0);
  --secondary-foreground: oklch(0.205 0 0);
  --muted: oklch(0.97 0 0);
  --muted-foreground: oklch(0.556 0 0);
  --accent: oklch(0.97 0 0);
  --accent-foreground: oklch(0.205 0 0);
  --destructive: oklch(0.577 0.245 27.325);
  --border: oklch(0.922 0 0);
  --input: oklch(0.922 0 0);
  --ring: oklch(0.708 0 0);
  --header: oklch(1 0 0);
  --overlay: oklch(0.145 0 0 / 50%);
  --radius-sm: calc(var(--radius) * 0.6);
  --radius-md: calc(var(--radius) * 0.8);
  --radius-lg: var(--radius);
  --radius-xl: calc(var(--radius) * 1.4);
  --radius-2xl: calc(var(--radius) * 1.8);
  --shadow-xs: 0 1px 2px 0 oklch(0 0 0 / 0.05);
  --shadow-sm: 0 1px 3px 0 oklch(0 0 0 / 0.06), 0 1px 2px -1px oklch(0 0 0 / 0.06);
  --shadow-lg: 0 10px 15px -3px oklch(0 0 0 / 0.1), 0 4px 6px -4px oklch(0 0 0 / 0.1);
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --success: oklch(0.63 0.15 145);
  --warning: oklch(0.75 0.15 75);
  --danger: oklch(0.577 0.245 27.325);
}

.dark {
  --background: oklch(0.145 0 0);
  --foreground: oklch(0.985 0 0);
  --card: oklch(0.205 0 0);
  --card-foreground: oklch(0.985 0 0);
  --popover: oklch(0.205 0 0);
  --popover-foreground: oklch(0.985 0 0);
  --primary: oklch(0.922 0 0);
  --primary-foreground: oklch(0.205 0 0);
  --secondary: oklch(0.269 0 0);
  --secondary-foreground: oklch(0.985 0 0);
  --muted: oklch(0.269 0 0);
  --muted-foreground: oklch(0.708 0 0);
  --accent: oklch(0.269 0 0);
  --accent-foreground: oklch(0.985 0 0);
  --destructive: oklch(0.704 0.191 22.216);
  --border: oklch(1 0 0 / 10%);
  --input: oklch(1 0 0 / 15%);
  --ring: oklch(0.556 0 0);
  --header: oklch(0.205 0 0);
  --overlay: oklch(0 0 0 / 70%);
  --shadow-xs: 0 1px 2px 0 oklch(0 0 0 / 0.35);
  --shadow-sm: 0 1px 3px 0 oklch(0 0 0 / 0.4);
  --shadow-lg: 0 10px 15px -3px oklch(0 0 0 / 0.5), 0 4px 6px -4px oklch(0 0 0 / 0.45);
  --success: oklch(0.72 0.16 145);
  --warning: oklch(0.8 0.14 75);
  --danger: oklch(0.704 0.191 22.216);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  border-color: var(--border);
}

html,
body {
  margin: 0;
  min-height: 100%;
  overflow-x: hidden;
}

html {
  color-scheme: light;
}

html.dark {
  color-scheme: dark;
}

body {
  font-family: var(--font);
  font-size: 0.875rem;
  line-height: 1.5;
  background: var(--background);
  color: var(--foreground);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

button {
  cursor: pointer;
}

img,
svg {
  display: block;
}

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

:focus-visible {
  outline: none;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--header);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4rem;
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 0.75rem 0;
}

.header-start {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  color: var(--foreground);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.brand-mark {
  width: 1.5rem;
  height: 1.5rem;
  color: var(--foreground);
}

.brand-name {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.layout {
  width: min(1120px, calc(100% - 2rem));
  margin: 1.5rem auto 2.5rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1rem;
}

[hidden] {
  display: none !important;
}

.card {
  background: var(--card);
  color: var(--card-foreground);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xs);
  padding: 1.5rem;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.stack-group {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.stack-group + .stack-group {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.section-title {
  font-size: 0.925rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.section-copy {
  color: var(--muted-foreground);
  font-size: 0.8125rem;
}

.separator {
  height: 1px;
  background: var(--border);
  border: 0;
  margin: 1.1rem 0;
}

.qr-types {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.qr-type {
  flex: 0 0 calc((100% - 2.5rem) / 6);
  width: auto;
  max-width: 4.75rem;
  min-height: 4.2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  padding: 0.45rem 0.25rem;
  background: var(--card);
  color: var(--foreground);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  transition: background 150ms, border-color 150ms, box-shadow 150ms;
}

.qr-type svg {
  width: 1.15rem;
  height: 1.15rem;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.qr-type span {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.qr-type:hover {
  background: var(--accent);
}

.qr-type[aria-checked="true"] {
  border-color: var(--foreground);
  background: var(--card);
  box-shadow: var(--shadow-sm);
}

.qr-type:focus-visible,
.btn:focus-visible,
.switch:focus-visible,
.input:focus-visible,
.textarea:focus-visible,
.select:focus-visible,
.choice:focus-visible,
.preset:focus-visible,
.icon-btn:focus-visible {
  border-color: var(--ring);
  box-shadow: 0 0 0 3px color-mix(in oklch, var(--ring) 50%, transparent);
}

.fields {
  display: grid;
  gap: 1rem;
}

.field {
  display: grid;
  gap: 0.5rem;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.label {
  font-size: 0.8125rem;
  font-weight: 500;
}

.hint {
  color: var(--muted-foreground);
  font-size: 0.8125rem;
}

.input,
.textarea,
.select {
  width: 100%;
  min-width: 0;
  background: var(--card);
  border: 1px solid var(--input);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xs);
  transition: border-color 150ms, box-shadow 150ms;
}

.input,
.select {
  height: 2.25rem;
  padding: 0 0.75rem;
}

.textarea {
  min-height: 6.5rem;
  padding: 0.7rem 0.75rem;
  resize: vertical;
}

.input::placeholder,
.textarea::placeholder {
  color: var(--muted-foreground);
}

.select {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23737373' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='m6 9 6 6 6-6'/></svg>");
  background-repeat: no-repeat;
  background-position: right 0.6rem center;
  padding-right: 2rem;
}

.dark .select {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23a1a1a1' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='m6 9 6 6 6-6'/></svg>");
}

.char-count {
  justify-self: end;
  color: var(--muted-foreground);
  font-size: 0.75rem;
}

.multi-row,
.logo-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.switch {
  position: relative;
  width: 2rem;
  height: 1.15rem;
  flex: none;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: var(--input);
  box-shadow: var(--shadow-xs);
  transition: background 150ms;
}

.switch::after {
  content: "";
  position: absolute;
  top: 1.2px;
  left: 1.2px;
  width: 1rem;
  height: 1rem;
  border-radius: 999px;
  background: var(--card);
  box-shadow: var(--shadow-xs);
  transition: transform 150ms;
}

.switch[aria-checked="true"] {
  background: var(--primary);
}

.switch[aria-checked="true"]::after {
  transform: translateX(0.82rem);
}

.dark .switch::after {
  background: oklch(0.985 0 0);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  height: 2.25rem;
  padding: 0 1rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
  border: 1px solid transparent;
  white-space: nowrap;
  text-decoration: none;
  transition: background 150ms, color 150ms, border-color 150ms, box-shadow 150ms, opacity 150ms;
}

.btn svg {
  width: 1rem;
  height: 1rem;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.btn:disabled {
  opacity: 0.5;
  pointer-events: none;
}

.btn-primary {
  background: var(--primary);
  color: var(--primary-foreground);
}

.btn-primary:hover {
  background: color-mix(in oklch, var(--primary) 90%, black);
}

.dark .btn-primary:hover {
  background: color-mix(in oklch, var(--primary) 90%, white);
}

.btn-outline {
  background: var(--card);
  color: var(--foreground);
  border-color: var(--border);
  box-shadow: var(--shadow-xs);
}

.btn-outline:hover {
  background: var(--accent);
}

.btn-secondary {
  background: var(--secondary);
  color: var(--secondary-foreground);
}

.btn-secondary:hover {
  background: color-mix(in oklch, var(--secondary) 85%, var(--foreground));
}

.btn-ghost {
  background: transparent;
  color: var(--muted-foreground);
  border-color: transparent;
  box-shadow: none;
}

.btn-ghost:hover {
  background: var(--accent);
  color: var(--accent-foreground);
}

#history-btn[aria-expanded="true"] {
  background: var(--accent);
  color: var(--accent-foreground);
}

.btn-sm {
  height: 2rem;
  padding: 0 0.75rem;
  font-size: 0.8125rem;
}

.preview-stage {
  display: grid;
  place-items: center;
}

#preview {
  width: 188px;
  height: 188px;
}

#preview canvas,
#preview svg {
  width: 188px !important;
  height: 188px !important;
}

.presets {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.5rem;
}

.preset {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.2rem 0.45rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  min-width: 0;
  transition: border-color 150ms, background 150ms;
}

.preset-thumb {
  width: 3.15rem;
  height: 3.15rem;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.preset-thumb canvas,
.preset-thumb svg {
  width: 3.15rem !important;
  height: 3.15rem !important;
}

.preset span {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--muted-foreground);
}

.preset:hover {
  background: var(--accent);
}

.preset[aria-checked="true"] {
  border-color: var(--foreground);
}

.preset[aria-checked="true"] span {
  color: var(--foreground);
}

.templates {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
  margin-top: 0.85rem;
}

.template {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 0.4rem 0.5rem;
  background: var(--card);
  color: var(--foreground);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  min-width: 0;
  transition: border-color 150ms, background 150ms;
}

.template:hover {
  background: var(--accent);
}

.template[aria-pressed="true"] {
  border-color: var(--foreground);
}

.template-frame {
  display: grid;
  justify-items: center;
  gap: 0.2rem;
  padding: 0.35rem 0.4rem 0.3rem;
  background: #fff;
  color: #111;
  border-radius: calc(var(--radius) - 2px);
}

.template-thumb {
  width: 4.25rem;
  height: 4.25rem;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.template-thumb canvas,
.template-thumb svg {
  width: 4.25rem !important;
  height: 4.25rem !important;
}

.template-caption {
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #111;
  text-align: center;
  line-height: 1.2;
}

.template-label {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--muted-foreground);
  text-align: center;
}

.template[aria-pressed="true"] .template-label {
  color: var(--foreground);
}

.custom-options {
  display: none;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.custom-options.is-open {
  display: grid;
}

.colors {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 0.5rem;
  align-items: end;
}

.color-field {
  display: grid;
  gap: 0.5rem;
  min-width: 0;
}

.color-control {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  height: 2.25rem;
  padding: 0 0.4rem 0 0.7rem;
  border: 1px solid var(--input);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xs);
  background: var(--card);
  min-width: 0;
}

.color-control input[type="text"] {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  height: 100%;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.color-control input[type="text"]:focus-visible {
  outline: none;
  box-shadow: none;
}

.color-control input[type="color"] {
  -webkit-appearance: none;
  appearance: none;
  width: 1.25rem;
  height: 1.25rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 0.3rem;
  background: transparent;
  cursor: pointer;
  flex: none;
}

.color-control input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}

.color-control input[type="color"]::-webkit-color-swatch {
  border: 0;
  border-radius: 0.22rem;
}

.icon-btn {
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  margin-bottom: 0.1rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card);
  box-shadow: var(--shadow-xs);
  color: var(--muted-foreground);
}

.icon-btn svg {
  width: 0.9rem;
  height: 0.9rem;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-btn:hover,
.icon-btn[aria-pressed="true"] {
  background: var(--accent);
  color: var(--foreground);
}

.logo-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.logo-chip {
  display: none;
  align-items: center;
  gap: 0.5rem;
  padding: 0.2rem 0.4rem 0.2rem 0.2rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--secondary);
}

.logo-chip.is-on {
  display: inline-flex;
}

.logo-chip img {
  width: 1.5rem;
  height: 1.5rem;
  object-fit: cover;
  border-radius: 0.3rem;
}

.logo-chip button {
  border: 0;
  background: transparent;
  color: var(--muted-foreground);
  padding: 0.15rem;
}

.item-list {
  display: grid;
  gap: 0.75rem;
}

.item-card {
  display: grid;
  gap: 1rem;
}

.fields:not(.is-multi) .item-card {
  border: 0;
  padding: 0;
  background: transparent;
}

.fields.is-multi .item-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0.85rem;
  background: var(--card);
}

.item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.item-head strong {
  font-size: 0.8125rem;
  font-weight: 600;
}

.hidden-file {
  display: none;
}

.dialog-root[hidden] {
  display: none;
}

.dialog-root {
  position: fixed;
  inset: 0;
  z-index: 50;
}

.dialog-overlay {
  position: absolute;
  inset: 0;
  background: var(--overlay);
}

.dialog {
  position: relative;
  z-index: 1;
  width: min(32rem, calc(100% - 2rem));
  margin: 8vh auto 0;
  background: var(--popover);
  color: var(--popover-foreground);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 1.5rem;
  animation: dialog-in 180ms ease-out;
}

.dialog h2 {
  font-size: 1.125rem;
  letter-spacing: -0.02em;
}

.dialog-copy {
  margin-top: 0.35rem;
  color: var(--muted-foreground);
}

.dialog-section {
  margin-top: 1.15rem;
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.5rem;
  margin-top: 0.55rem;
}

.choice-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.55rem;
}

.choice {
  min-width: 0;
  height: 2.5rem;
  padding: 0 0.7rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--card);
  box-shadow: var(--shadow-xs);
  font-size: 0.78rem;
  font-weight: 500;
}

.choice-grid .choice {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 3.4rem;
  gap: 0.1rem;
}

.choice small {
  color: var(--muted-foreground);
  font-size: 0.65rem;
  font-weight: 400;
}

.choice[aria-checked="true"] {
  border-color: var(--foreground);
  background: var(--secondary);
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1.35rem;
}

.toast {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 60;
  min-width: 14rem;
  max-width: calc(100% - 2rem);
  padding: 0.8rem 1rem;
  background: var(--primary);
  color: var(--primary-foreground);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  transform: translateY(120%);
  opacity: 0;
  pointer-events: none;
  transition: transform 180ms ease, opacity 180ms ease;
}

.toast.is-on {
  transform: translateY(0);
  opacity: 1;
}

@keyframes dialog-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.menu-wrap {
  position: relative;
}

.popover {
  position: absolute;
  right: 0;
  top: calc(100% + 0.4rem);
  z-index: 40;
  min-width: 13.5rem;
  max-width: 20rem;
  padding: 0.3rem;
  background: var(--popover);
  color: var(--popover-foreground);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
}

.popover-wide {
  min-width: 18rem;
  max-height: 22rem;
  overflow: auto;
}

.popover-start {
  left: 0;
  right: auto;
}

.menu-item {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 0.55rem;
  padding: 0.5rem 0.6rem;
  border: 0;
  border-radius: calc(var(--radius) - 2px);
  background: transparent;
  color: inherit;
  font-size: 0.8125rem;
  text-align: left;
}

.menu-item:hover,
.menu-item[aria-checked="true"] {
  background: var(--accent);
}

.menu-item svg {
  width: 1rem;
  height: 1rem;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.chip {
  height: 1.85rem;
  padding: 0 0.65rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--secondary);
  color: var(--secondary-foreground);
  font-size: 0.75rem;
  font-weight: 500;
}

.chip:hover,
.chip[aria-pressed="true"] {
  border-color: var(--foreground);
}

.palette {
  width: 1.85rem;
  height: 1.85rem;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background:
    linear-gradient(135deg, var(--swatch-bg, #fff) 50%, var(--swatch-fg, #000) 50%);
}

.palette[aria-pressed="true"] {
  border-color: var(--foreground);
  box-shadow: 0 0 0 2px var(--background), 0 0 0 3px var(--foreground);
}

.preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.scan-badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  border: 1px solid color-mix(in oklch, var(--success) 30%, var(--border));
  background: color-mix(in oklch, var(--success) 16%, var(--secondary));
  color: var(--success);
}

.scan-badge[data-level="warn"] {
  border-color: color-mix(in oklch, var(--warning) 30%, var(--border));
  background: color-mix(in oklch, var(--warning) 16%, var(--secondary));
  color: oklch(0.52 0.12 75);
}

.dark .scan-badge[data-level="warn"] {
  color: var(--warning);
}

.scan-badge[data-level="bad"] {
  border-color: color-mix(in oklch, var(--danger) 30%, var(--border));
  background: color-mix(in oklch, var(--danger) 16%, var(--secondary));
  color: var(--danger);
}

.scan-notes {
  margin-top: 0.45rem;
  color: var(--muted-foreground);
  font-size: 0.75rem;
}

.qr-frame {
  display: grid;
  justify-items: center;
  gap: 0.65rem;
  padding: 0.85rem 1rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--card);
}

.qr-caption {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-align: center;
}

.preview-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.85rem;
  justify-content: center;
}

.slider-row {
  display: grid;
  gap: 0.5rem;
  width: 100%;
}

.slider-row .label {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
}

.slider-row input[type="range"] {
  width: 100%;
  accent-color: var(--foreground);
}

.history-item {
  display: grid;
  gap: 0.1rem;
}

.history-item small {
  color: var(--muted-foreground);
}

.icon-btn.header-icon,
.btn.header-icon {
  margin-bottom: 0;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border-radius: var(--radius-md);
}

.choice-grid.cols-6 {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.dialog.wide {
  width: min(38rem, calc(100% - 2rem));
  max-height: min(86vh, 52rem);
  overflow: auto;
}

@media (max-width: 1080px) {
  .qr-type {
    flex-basis: calc((100% - 2rem) / 5);
    max-width: none;
  }

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

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

  .choice-grid,
  .choice-grid.cols-6 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .qr-type {
    flex-basis: calc((100% - 1.5rem) / 4);
  }

  .header-inner {
    width: calc(100% - 1rem);
  }

  .layout {
    width: calc(100% - 1rem);
    margin-top: 0.75rem;
  }

  .field-row,
  .custom-options,
  .colors {
    grid-template-columns: 1fr;
  }

  .colors {
    gap: 0.75rem;
  }

  .icon-btn {
    justify-self: start;
  }

  .brand-name {
    font-size: 0.95rem;
  }

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

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
