/* ========= QR Code Generator — Design Moderne ========= */

/* Alias pour compatibilité */
:root {
  --text: var(--text-primary);
  --muted: var(--text-secondary);
  --bg-elev: var(--bg-elevated);
  --stroke: var(--border);
  --brand-600: var(--brand-dark);
}

/* S'assurer que le header global conserve son style sur la page QR code */
body .app-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--bg-card, #151a21);
  background-image: 
    linear-gradient(180deg, rgba(99, 102, 241, 0.05) 0%, transparent 100%);
  border-bottom: 1px solid var(--border, #1e2530);
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow-sm, 0 1px 2px 0 rgba(0, 0, 0, 0.05));
  position: relative;
  overflow: hidden;
}

body .app-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.1), transparent);
  animation: headerShine 10s ease-in-out infinite;
  pointer-events: none;
}

@keyframes headerShine {
  0% {
    left: -100%;
  }
  50%, 100% {
    left: 100%;
  }
}

/* S'assurer que le container du header a la bonne largeur */
body .app-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px 24px;
  max-width: 1400px;
  margin: 0 auto;
}

/* Préserver les styles des boutons du header */
body .app-header .actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

body .app-header .actions .btn {
  padding: 10px 20px;
  border-radius: var(--radius, 12px);
  border: 1px solid var(--border, #1e2530);
  background: var(--bg-elevated, #0f1419);
  color: var(--text-primary, #e8ecf0);
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  transition: var(--transition, all 0.2s cubic-bezier(0.4, 0, 0.2, 1));
  font-family: inherit;
  text-decoration: none;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

body .app-header .actions .btn:hover:not([disabled]) {
  border-color: var(--brand, #6366f1);
  background: var(--brand-light, rgba(99, 102, 241, 0.1));
  color: var(--brand, #6366f1);
  transform: translateY(-2px);
}

body .app-header .actions .btn.btn-small {
  padding: 8px 16px;
  font-size: 0.875rem;
}

body .app-header .actions .btn.btn-outline {
  background: transparent;
  border-color: var(--border, #1e2530);
  color: var(--text-primary, #e8ecf0);
}

body .app-header .actions .btn.btn-outline:hover {
  background: var(--bg-card, #151a21);
  border-color: var(--brand, #6366f1);
  color: var(--brand, #6366f1);
}

/* Préserver les styles du switch theme */
body .app-header .theme-toggle {
  position: relative;
  display: inline-block;
  width: 56px;
  height: 32px;
  cursor: pointer;
  flex-shrink: 0;
}

body .app-header .theme-toggle-slider {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--bg-card, #151a21);
  border: 1px solid var(--border, #1e2530);
  border-radius: 32px;
  transition: var(--transition, all 0.2s cubic-bezier(0.4, 0, 0.2, 1));
  display: flex;
  align-items: center;
  padding: 4px;
}

body .app-header .theme-toggle-slider:before {
  content: '';
  position: absolute;
  height: 24px;
  width: 24px;
  left: 4px;
  bottom: 3px;
  background-color: var(--text-primary, #e8ecf0);
  border-radius: 50%;
  transition: var(--transition, all 0.2s cubic-bezier(0.4, 0, 0.2, 1));
  z-index: 2;
}

body .app-header .theme-toggle-input:checked + .theme-toggle-slider {
  background-color: var(--brand, #6366f1);
  border-color: var(--brand, #6366f1);
}

body .app-header .theme-toggle-input:checked + .theme-toggle-slider:before {
  transform: translateX(24px);
  background-color: white;
}

body .app-header .theme-toggle:hover .theme-toggle-slider {
  border-color: var(--brand, #6366f1);
  box-shadow: 0 0 0 3px var(--brand-light, rgba(99, 102, 241, 0.1));
}

/* S'assurer que le footer conserve son style et son positionnement */
body .site-footer {
  background: var(--bg-elevated, #0f1419);
  background-image: 
    radial-gradient(circle at 50% 0%, rgba(99, 102, 241, 0.04) 0%, transparent 50%);
  border-top: 1px solid var(--border, #1e2530);
  margin-top: 60px;
  padding: 48px 0 24px;
  position: relative;
  overflow: hidden;
}

body .site-footer::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--brand, #6366f1), transparent);
  animation: footerGlow 3s ease-in-out infinite;
  opacity: 0.5;
}

@keyframes footerGlow {
  0%, 100% {
    opacity: 0.3;
    transform: scaleX(0.8);
  }
  50% {
    opacity: 0.7;
    transform: scaleX(1);
  }
}

body .site-footer .container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Page principale avec animations de background */
.qr-page {
  position: relative;
  min-height: calc(100vh - 200px);
  /* Le background est géré par body dans global.css, on ne le surcharge pas ici */
  /* background: 
    radial-gradient(circle at 20% 30%, rgba(99, 102, 241, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(99, 102, 241, 0.06) 0%, transparent 50%);
  background-size: 100% 100%;
  background-position: 0% 0%, 100% 100%;
  animation: qrPageGlow 25s ease infinite; */
}

@keyframes qrPageGlow {
  0%, 100% {
    background-position: 0% 0%, 100% 100%;
  }
  50% {
    background-position: 100% 100%, 0% 0%;
  }
}

.qr-studio {
  position: relative;
  z-index: 1;
}

/* Header */
.qr-page .qr-header {
  margin: 24px 0 32px;
  text-align: center;
}

.qr-page .qr-header h1 {
  font-size: 2.5rem;
  line-height: 1.2;
  margin: 0;
  color: var(--text-primary);
  font-weight: 700;
  background: linear-gradient(135deg, var(--text-primary), var(--brand));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.qr-page .qr-sub {
  color: var(--text-secondary);
  margin: 12px 0 0;
  font-size: 1.1rem;
}

/* Toolrail - Barre d'outils */
.toolrail {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 24px;
  flex-wrap: wrap;
  position: relative;
  overflow: hidden;
}

.toolrail::before {
  content: '';
  position: absolute;
  inset: 0;
  background: 
    radial-gradient(circle at 0% 0%, rgba(99, 102, 241, 0.05) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
  animation: toolrailGlow 20s ease infinite;
}

.toolrail > * {
  position: relative;
  z-index: 1;
}

@keyframes toolrailGlow {
  0%, 100% {
    background-position: 0% 0%;
  }
  50% {
    background-position: 100% 100%;
  }
}

.toolrail .spacer {
  flex: 1;
}

.tool {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}

.tool input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.tool svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
  transition: var(--transition);
}

.tool:hover {
  border-color: var(--brand);
  color: var(--brand);
  background: var(--brand-light);
  transform: translateY(-2px);
}

.tool.active,
.tool:has(input[type="radio"]:checked) {
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  border-color: var(--brand);
  color: white;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.tool.gear {
  margin-left: auto;
}

/* Zone de contenu toujours visible */
.content-section {
  margin-bottom: 24px;
  padding: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.content-header {
  margin-bottom: 16px;
}

.content-header h3 {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* Stage - Zone principale */
.stage {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 24px;
  margin-bottom: 24px;
}

@media (max-width: 1024px) {
  .stage {
    grid-template-columns: 1fr;
  }
}

/* Preview */
.preview {
  position: sticky;
  top: 80px;
  align-self: start;
  max-height: calc(100vh - 100px);
  overflow: hidden; /* Pas de scroll du tout */
}

.preview-box {
  display: grid;
  place-items: center;
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  min-height: 400px;
  height: 100%;
  max-height: calc(100vh - 100px);
  padding: 32px;
  background: var(--bg-card);
  background-image: 
    radial-gradient(circle at 50% 50%, rgba(99, 102, 241, 0.05) 0%, transparent 70%);
  background-size: 200% 200%;
  background-position: 50% 50%;
  animation: previewGlow 15s ease infinite;
  position: relative;
  overflow: hidden;
}

.preview-box::before {
  content: '';
  position: absolute;
  inset: 0;
  background: 
    radial-gradient(circle at 50% 50%, rgba(99, 102, 241, 0.08) 0%, transparent 60%);
  animation: previewRipple 8s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}

.preview-box > * {
  position: relative;
  z-index: 1;
}

@keyframes previewGlow {
  0%, 100% {
    background-position: 50% 50%;
  }
  50% {
    background-position: 0% 100%;
  }
}

@keyframes previewRipple {
  0%, 100% {
    transform: scale(1);
    opacity: 0.5;
  }
  50% {
    transform: scale(1.1);
    opacity: 0.8;
  }
}

#qrImg {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  background: var(--bg-elevated);
  object-fit: contain;
  object-position: center;
}

/* Dock - Panneau de contrôle */
.dock {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  position: relative;
  overflow: hidden;
}

.dock::before {
  content: '';
  position: absolute;
  inset: 0;
  background: 
    linear-gradient(180deg, rgba(99, 102, 241, 0.03) 0%, transparent 100%);
  pointer-events: none;
  z-index: 0;
}

.dock > * {
  position: relative;
  z-index: 1;
}

.dock-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dock-advanced {
  margin-top: 8px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.dock-advanced[hidden] {
  display: none !important;
}

/* Catégories dépliantes */
.dock-category {
  margin-bottom: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-elevated);
  display: block;
  visibility: visible;
}

.dock-category-header {
  width: 100%;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.9rem;
}

.dock-category-header:hover {
  background: var(--bg-hover);
}

.dock-category-header .category-arrow {
  transition: transform 0.2s ease;
  color: var(--text-secondary);
}

.dock-category-header[aria-expanded="true"] .category-arrow {
  transform: rotate(180deg);
}

.dock-category-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.dock-category-content[aria-hidden="false"] {
  max-height: 2000px;
}

.dock-category-content .dock-group {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
}

.dock-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.dock-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* Switch */
.switch {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: var(--text-primary);
  font-size: 0.875rem;
}

.switch input[type="checkbox"] {
  width: 40px;
  height: 20px;
  appearance: none;
  background: var(--border);
  border-radius: 20px;
  position: relative;
  cursor: pointer;
  transition: var(--transition);
}

.switch input[type="checkbox"]::before {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: white;
  top: 2px;
  left: 2px;
  transition: var(--transition);
}

.switch input[type="checkbox"]:checked {
  background: var(--brand);
}

.switch input[type="checkbox"]:checked::before {
  transform: translateX(20px);
}

/* Colors */
.colors {
  display: flex;
  align-items: center;
  gap: 8px;
}

.color {
  width: 48px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  background: transparent;
  padding: 0;
  transition: var(--transition);
}

.color:hover {
  border-color: var(--brand);
  transform: scale(1.05);
}

.color::-webkit-color-swatch-wrapper {
  padding: 0;
}

.color::-webkit-color-swatch {
  border: none;
  border-radius: calc(var(--radius) - 1px);
}

/* Range input pour l'angle du dégradé */
.range-input {
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  outline: none;
  transition: var(--transition);
  cursor: pointer;
}

.range-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  background: var(--brand);
  border-radius: 50%;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.range-input::-webkit-slider-thumb:hover {
  background: var(--brand-dark);
  transform: scale(1.1);
}

.range-input::-moz-range-thumb {
  width: 16px;
  height: 16px;
  background: var(--brand);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.range-input::-moz-range-thumb:hover {
  background: var(--brand-dark);
  transform: scale(1.1);
}

.range-input:focus {
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.range-input::-moz-range-track {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
}

.grad-preview {
  height: 40px;
  width: 80px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: linear-gradient(90deg, #000000, #1a73e8);
}

/* Shapes */
.shapes {
  display: flex;
  gap: 8px;
}

.shape {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  background: var(--bg-elevated);
  border: 2px solid var(--border);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: var(--transition);
}

.shape:hover {
  border-color: var(--brand);
  background: var(--brand-light);
  transform: translateY(-2px);
}

.shape.active {
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  border-color: var(--brand);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.shape-icon {
  width: 20px;
  height: 20px;
  display: block;
  position: relative;
}

.shape-icon::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--text-primary);
  border-radius: 2px;
  transition: var(--transition);
}

.shape.active .shape-icon::before {
  background: white;
}

.shape-icon[data-kind="square"]::before {
  border-radius: 0px;
}

.shape-icon[data-kind="rounded"]::before {
  border-radius: 6px;
}

.shape-icon[data-kind="circle"]::before {
  border-radius: 50%;
}

.shape-icon[data-kind="dots"]::before {
  border-radius: 50%;
  width: 12px;
  height: 12px;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

/* Stepper */
.stepper {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.stepper .label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-right: auto;
}

.stepper button {
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 600;
  transition: var(--transition);
}

.stepper button:hover {
  border-color: var(--brand);
  background: var(--brand-light);
  color: var(--brand);
}

.stepper button:active {
  transform: scale(0.95);
}

.stepper .val {
  min-width: 60px;
  text-align: center;
  font-weight: 600;
  color: var(--text-primary);
}

/* Pills */
.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-weight: 500;
  font-size: 0.875rem;
  cursor: pointer;
  transition: var(--transition);
}

.pill:hover {
  border-color: var(--brand);
  background: var(--brand-light);
  color: var(--brand);
  transform: translateY(-2px);
}

.pill.active {
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  border-color: transparent;
  color: white;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

/* File input */
.file {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-size: 0.875rem;
  cursor: pointer;
  transition: var(--transition);
}

.file:hover {
  border-color: var(--brand);
  background: var(--brand-light);
}

/* Actions card - uniquement pour la page QR code, pas le header */
.qr-page .actions,
aside.actions {
  padding: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  position: relative;
  overflow: hidden;
}

.qr-page .actions::before,
aside.actions::before {
  content: '';
  position: absolute;
  inset: 0;
  background: 
    radial-gradient(circle at 0% 0%, rgba(99, 102, 241, 0.04) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
  animation: actionsGlow 20s ease infinite;
}

.qr-page .actions > *,
aside.actions > * {
  position: relative;
  z-index: 1;
}

@keyframes actionsGlow {
  0%, 100% {
    background-position: 0% 0%;
  }
  50% {
    background-position: 100% 100%;
  }
}

.row.gap {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
}

.row.gap:last-child {
  margin-bottom: 0;
}

/* Inputs */
.input,
.select,
.textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-size: 0.875rem;
  transition: var(--transition);
  font-family: inherit;
}

.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-light);
}

.textarea {
  min-height: 100px;
  resize: vertical;
}

.select {
  cursor: pointer;
}

/* Buttons - uniquement pour la page QR code, pas le header */
.qr-page .btn,
aside.actions .btn {
  padding: 10px 20px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}

.qr-page .btn:hover:not([disabled]),
aside.actions .btn:hover:not([disabled]) {
  border-color: var(--brand);
  background: var(--brand-light);
  color: var(--brand);
  transform: translateY(-2px);
}

.qr-page .btn:active:not([disabled]),
aside.actions .btn:active:not([disabled]) {
  transform: translateY(0);
}

.qr-page .btn[disabled],
aside.actions .btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

.qr-page .btn.primary,
aside.actions .btn.primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  border-color: transparent;
  color: white;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.qr-page .btn.primary:hover:not([disabled]),
aside.actions .btn.primary:hover:not([disabled]) {
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
  transform: translateY(-2px);
}

.qr-page .btn.ghost,
aside.actions .btn.ghost {
  background: transparent;
  border-color: var(--border);
}

.qr-page .btn.ghost:hover:not([disabled]),
aside.actions .btn.ghost:hover:not([disabled]) {
  background: var(--bg-elevated);
}

/* Checkbox */
.check {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-primary);
  cursor: pointer;
  font-size: 0.875rem;
}

.check input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--brand);
  cursor: pointer;
}

/* Grid */
.grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, 1fr);
}

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

/* Sheet overlay */
.sheet-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 1100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.sheet-overlay.active {
  opacity: 1;
  pointer-events: all;
}

/* Sheet - Panneau latéral */
.sheet {
  position: fixed;
  top: 0;
  right: 0;
  width: 100%;
  max-width: 480px;
  height: 100vh;
  background: var(--bg-card);
  border-left: 1px solid var(--border);
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.2);
  z-index: 1101;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
}

.sheet:not([hidden]) {
  transform: translateX(0);
}

.sheet header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px;
  border-bottom: 1px solid var(--border);
}

.sheet header h3 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
}

.sheet .close {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 1.5rem;
  cursor: pointer;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.sheet .close:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.sheet-body {
  padding: 24px;
  flex: 1;
}

.sheet-body .grid {
  grid-template-columns: 1fr;
}

/* Panel */
.panel {
  display: block;
}

.panel[hidden] {
  display: none;
}

/* Field inline */
.field-inline {
  display: flex;
  align-items: center;
  gap: 12px;
}

.field-inline .label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  min-width: 100px;
}

/* Mobile button */
.btn-advanced-mobile {
  display: none;
  width: 48px;
  height: 48px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  align-items: center;
  justify-content: center;
}

.btn-advanced-mobile svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.btn-advanced-mobile:hover {
  border-color: var(--brand);
  color: var(--brand);
  background: var(--brand-light);
}

@media (max-width: 768px) {
  .btn-advanced-mobile {
    display: flex;
  }
  
  .toolrail .gear {
    display: none;
  }
}

/* Responsive */
@media (max-width: 1024px) {
  .qr-page .qr-header h1 {
    font-size: 2rem;
  }
  
  .stage {
    grid-template-columns: 1fr;
  }
  
  .dock {
    order: -1;
  }
}
