/* Authoring chrome only. QR cells, source colours and export canvases keep their own rendering. */
.authoring-studio .editor-canvas .pixel-cell--brush-conflict {
  outline: 2px solid #a33b00;
  outline-offset: -2px;
}
.authoring-studio .editor-brush-feedback {
  margin-top: 16px; padding: 12px 16px; border-left: 3px solid #a33b00;
  background: #fff5e9; color: #542b16; font-size: 14px; line-height: 1.5;
}
.authoring-studio .editor-brush-feedback p { margin: 0 0 8px; }
.authoring-studio .editor-brush-feedback p:last-child { margin-bottom: 0; }
body.authoring-create, body.authoring-studio {
  margin: 0; padding: 0; background: var(--px-canvas); color: var(--px-ink);
  font: 16px/1.5 var(--px-font);
  --editor-bg: var(--px-canvas); --editor-surface: var(--px-surface);
  --editor-ink: var(--px-ink); --editor-muted: var(--px-muted);
  --editor-border: var(--px-line); --editor-accent: var(--px-accent);
  --editor-shadow: none; --editor-shadow-soft: none;
}
.authoring-create .container, body.authoring-studio .app-container {
  max-width: 1320px; margin: 0 auto; padding: 32px 24px 48px; width: 100%;
}
.authoring-create .container {
  grid-template-columns: minmax(0, 1fr) minmax(340px, 420px);
  grid-template-areas: 'auth auth' 'title title' 'form preview'; gap: 24px 32px;
}
.authoring-create .authoring-intro { grid-area: title; }
.authoring-intro h1, body.authoring-studio .editor-intro h1 {
  font-size: clamp(28px, 3.5vw, 38px); line-height: 1.15; letter-spacing: -1px; margin: 0 0 12px;
}
.authoring-intro > p:not(.px-eyebrow), body.authoring-studio .editor-intro p:not(.px-eyebrow) {
  font-size: 15px; color: var(--px-muted); max-width: 64ch;
}
.authoring-steps { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.authoring-steps a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 9px 14px;
  color: var(--px-ink); background: transparent; border: 1px solid var(--px-line); border-radius: var(--px-radius);
  font-size: 14px; font-weight: 500; text-decoration: none;
}
.authoring-steps a:hover { border-color: var(--px-ink); }
.authoring-section { padding: 24px; border: 1px solid var(--px-line); background: var(--px-surface); border-radius: var(--px-radius-panel); margin-bottom: 24px; }
.authoring-section-heading { width: 100%; margin-bottom: 20px; }
.authoring-section-heading h2 { font-size: 21px; line-height: 1.3; letter-spacing: -.5px; margin: 0; }
.authoring-section-heading > p:not(.px-eyebrow), .authoring-hint { color: var(--px-muted); font-size: 14px; line-height: 1.5; margin: 8px 0 0; }
.authoring-create .form-section { max-width: none; }
.authoring-create .form-label { font-size: 15px; color: var(--px-ink); margin-bottom: 8px; }
.authoring-create .form-input { font: 16px/1.4 var(--px-font); min-height: 44px; border: 1px solid var(--px-line); border-radius: var(--px-radius); padding: 11px 12px; }
.authoring-create :is(.submit-btn, .add-to-qr-btn, .google-btn, .text-chip, .arrow-btn, .preview-subtle-btn) {
  font-family: var(--px-font); border-radius: var(--px-radius); min-height: 44px; box-shadow: none; transform: none;
}
.authoring-create :is(.submit-btn, .add-to-qr-btn) { font-size: 14px !important; border-width: 1px; line-height: 1.4 !important; }
.authoring-create :is(.google-btn, .text-chip, .preview-subtle-btn) { font-size: 14px; }
.authoring-create .text-chip { padding: 8px 12px; border: 1px solid var(--px-line); }
.authoring-create :is(.auth-bar, .qr-codes-link, .auth-help-link) { font: 14px/1.5 var(--px-font); }
.authoring-create .auth-bar { padding: 0; margin: 0; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.authoring-create :is(#createModeHint, #fixedDestinationNote, #gs1Section, #gs1Section div, #gs1Section p, #fullContrastLabel span, .result-info) { font-size: 14px !important; line-height: 1.5 !important; }
.authoring-create #gs1Section { border: 1px solid var(--px-line) !important; border-radius: var(--px-radius-panel); margin-top: 0 !important; }
.authoring-create #gs1Section .form-input { font-size: 15px !important; }
.authoring-create .preview-section { top: 20px; max-height: none; min-width: 0; }
.authoring-create .preview-card { border: 1px solid var(--px-line); border-radius: var(--px-radius-panel); box-shadow: none; padding: 24px; }
.authoring-create .preview-card__body { max-height: none; }
.authoring-create .preview-card__footer { width: 100%; }
.authoring-create #studioSavedGs1Link:not([hidden]) { display: flex; align-items: center; min-height: 44px; padding: 8px 0; color: var(--px-accent); font: 600 14px/1.5 var(--px-font); }
.authoring-create .preview-note { margin: 16px 0 10px; font-size: 14px; }
.authoring-create .preview-note__body { font-size: 14px; }
.authoring-primary { display: flex; justify-content: center; align-items: center; gap: 12px; min-height: 48px; padding: 12px 16px; border-radius: var(--px-radius); background: var(--px-accent); color: white; font: 650 15px/1.4 var(--px-font); text-decoration: none; }
.authoring-primary:hover { background: var(--px-accent-strong); color: white; }
.authoring-create .preview-maximize-btn { width: 44px; height: 44px; top: 12px; right: 12px; border-radius: var(--px-radius); }
.authoring-create .preview-card > .authoring-section-heading { padding-right: 40px; }
.authoring-create :is(.gs1-advanced-panel, .gs1-verifier-advanced) { border: 1px solid var(--px-line); border-radius: var(--px-radius-panel); box-shadow: none; }
.authoring-create :is(.gs1-advanced-panel__title, .gs1-advanced-panel__meta, .gs1-verifier-intro, .gs1-verifier-exports__help) { font-size: 14px; line-height: 1.5; }
.authoring-create #authoring-review > #gs1VerificationPanel { margin-top: 20px; }
body.authoring-studio header.px-app-header { position: static; margin: 0; padding: 0; color: var(--px-ink); background: var(--px-surface); backdrop-filter: none; }
body.authoring-studio header.px-app-header::after { display: none; }
/* Override legacy header inheritance in main.css and editorLayout.pug. */
body.authoring-studio .px-app-header .px-brand { color: var(--px-ink); }
body.authoring-studio .px-app-header .px-app-nav a { color: var(--px-muted); }
body.authoring-studio .px-app-header .px-app-nav a:hover,
body.authoring-studio .px-app-header .px-app-nav a:focus-visible { color: var(--px-ink); background: var(--px-canvas); }
body.authoring-studio .px-app-header .px-app-nav a[aria-current] { color: var(--px-accent); background: var(--px-accent-soft); }
body.authoring-studio .px-app-header a:focus-visible { outline: 3px solid var(--px-focus); outline-offset: 3px; }
body.authoring-studio .px-app-nav a { font-size: 14px; }
body.authoring-studio .editor-app { font-family: var(--px-font); background: transparent; }
body.authoring-studio .editor-container { gap: 24px; }
body.authoring-studio .editor-context-strip { box-shadow: none; border: 1px solid var(--px-line); }
body.authoring-studio .editor-grid { grid-template-columns: minmax(0, 1fr) minmax(320px, 360px); gap: 24px; }
body.authoring-studio .editor-workspace-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; align-items: start; }
body.authoring-studio .editor-card { border: 1px solid var(--px-line); border-radius: var(--px-radius-panel); box-shadow: none; padding: 22px; }
body.authoring-studio .editor-card__title { font: 650 19px/1.3 var(--px-font); }
body.authoring-studio .editor-card :is(p, .editor-field-hint, .editor-project__hint, .editor-helper-text, .editor-link-meta, .preview-box__health) { font-size: 14px; line-height: 1.5; }
body.authoring-studio .editor-card :is(button, select, input:not([type='range'])) { font-family: var(--px-font); min-height: 44px; }
body.authoring-studio .editor-card :is(input, select, textarea) { font-size: 16px; }
body.authoring-studio .editor-sidebar { position: static; }
body.authoring-studio .editor-project__actions { margin-top: 16px; gap: 10px; }
/* Studio owns its control layout; legacy pixel-app dimensions must not squeeze
   the workspace or mix 30px grid tracks with 44px controls. */
body.authoring-studio .editor-container :is(h2, h3):not(.custom-color-dialog *) {
  position: static; top: auto; display: block; padding-right: 0;
}
body.authoring-studio .editor-card__header { flex-wrap: wrap; align-items: baseline; }
body.authoring-studio .editor-card__meta { white-space: normal; font-size: 14px; }
body.authoring-studio :is(.editor-main, .editor-sidebar, .editor-workspace-row, .editor-card) { min-width: 0; }
body.authoring-studio .editor-card--workspace .editor-canvas { overflow: visible; margin-top: 18px; }
body.authoring-studio .editor-canvas .grid-container { width: 100%; max-width: 512px; }
/* Include grid borders in the square; percentage padding otherwise adds one
   extra vertical pixel per row. Export canvas rendering is independent. */
body.authoring-studio .editor-canvas .grid-container .pixel-cell { padding-bottom: 0 !important; aspect-ratio: 1; }
body.authoring-studio .editor-canvas-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 16px; }
body.authoring-studio .editor-payload-bootstrap {
  padding: 18px 22px; margin-bottom: 0; border: 1px solid var(--px-line);
  border-radius: var(--px-radius-panel); background: var(--px-surface); box-shadow: none;
}
body.authoring-studio .editor-payload-bootstrap h2 { font: 650 19px/1.3 var(--px-font); }
body.authoring-studio .editor-payload-bootstrap :is(p, label) { font-size: 14px; line-height: 1.5; }
body.authoring-studio .editor-payload-form input { font: 16px/1.4 var(--px-font); min-height: 44px; }
body.authoring-studio :is(.editor-card__meta-pill, .editor-session__badge) { border-width: 1px; border-radius: var(--px-radius); box-shadow: none; }
body.authoring-studio .editor-card--tools { padding: 22px; }
body.authoring-studio .editor-tools { display: grid; gap: 18px; }
body.authoring-studio .editor-tools__section {
  padding: 0; border: 0; border-radius: 0; background: transparent;
}
body.authoring-studio .editor-tools__section + .editor-tools__section { margin-top: 0; }
body.authoring-studio .editor-tools__section-title { font-size: 14px; font-weight: 650; color: var(--px-ink); }
body.authoring-studio .editor-tools__row { gap: 12px; }
body.authoring-studio .editor-tools__cluster { gap: 12px; flex: 1 1 240px; align-items: flex-start; }
body.authoring-studio :is(.editor-tool-button, .undo-redo button, .rotate-control button,
  .reset button, .text .text__button, .paste-art .paste-art__button,
  .dark-assignment .dark-assignment__button, .editor-inline-button,
  .editor-project__actions button, .editor-project__actions a, .editor-destination-form button) {
  min-height: 44px; min-width: 44px; padding: 10px 14px !important;
  border: 1px solid var(--px-line) !important; border-radius: var(--px-radius) !important;
  background: var(--px-surface) !important; color: var(--px-ink) !important;
  box-shadow: none !important; transform: none !important;
  font: 600 14px/1.4 var(--px-font) !important; text-decoration: none;
}
body.authoring-studio :is(.editor-tool-button, .undo-redo button, .rotate-control button,
  .reset button, .text .text__button, .paste-art .paste-art__button,
  .dark-assignment .dark-assignment__button, .editor-inline-button,
  .editor-project__actions button, .editor-project__actions a, .editor-destination-form button):hover:not(:disabled) {
  border-color: var(--px-accent) !important; background: var(--px-accent-soft) !important;
  box-shadow: none !important; transform: none !important;
}
body.authoring-studio .editor-tool-button { width: 44px; height: 44px; padding: 0 !important; flex: 0 0 auto; }
body.authoring-studio .editor-tool-button--wide { width: auto; padding: 10px 14px !important; }
body.authoring-studio .editor-tool-button.selected {
  color: var(--px-accent) !important; background: var(--px-accent-soft) !important;
  border-color: var(--px-accent) !important;
}
body.authoring-studio .editor-container .editor-inline-button--primary,
body.authoring-studio .editor-container .editor-inline-button--primary:hover:not(:disabled) {
  background: var(--px-accent) !important; border-color: var(--px-accent) !important; color: #fff !important;
}
body.authoring-studio .editor-tool-group {
  border: 1px solid var(--px-line); border-radius: var(--px-radius); box-shadow: none; overflow: visible;
}
body.authoring-studio .editor-tool-group > * + * { border-left: 1px solid var(--px-line); }
body.authoring-studio .editor-tool-group .editor-tool-button { border: 0 !important; }
body.authoring-studio .color-picker-switch--compact { max-width: 100%; flex-wrap: wrap; }
body.authoring-studio :is(.undo-redo, .rotate-control) { gap: 8px; flex-wrap: wrap; }
body.authoring-studio .unified-mover {
  width: 176px; flex: 0 0 176px; max-width: 100%; padding: 12px;
  border: 1px solid var(--px-line); border-radius: var(--px-radius-panel); box-shadow: none; gap: 8px;
}
body.authoring-studio .unified-mover__pad { grid-template-columns: repeat(3, 44px); grid-template-rows: repeat(3, 44px); gap: 4px; }
body.authoring-studio .editor-container button:is(.unified-mover__btn, .unified-mover__font) {
  width: 44px; height: 44px; min-height: 44px; border: 1px solid var(--px-line) !important;
  border-radius: var(--px-radius); box-shadow: none !important; transform: none !important;
}
body.authoring-studio .editor-container button:is(.unified-mover__btn, .unified-mover__font):is(:hover, :active) {
  box-shadow: none !important; transform: none !important;
}
body.authoring-studio .unified-mover__center { border: 1px solid var(--px-line); border-radius: var(--px-radius); }
body.authoring-studio :is(.unified-mover__title, .unified-mover__mode, .unified-mover__hint,
  .editor-softness__label, .editor-softness__value, .editor-context-strip__title,
  .editor-context-strip__hint, .editor-session__badge, .editor-card__meta-pill,
  .editor-command-row__label, .editor-tool-button__label, .editor-health__status, .editor-health__boundary,
  .editor-project__identity label, .editor-destination-form label, .preview-box__health p) {
  font-size: 14px; line-height: 1.45;
}
body.authoring-studio .editor-softness__row { flex-wrap: nowrap; }
body.authoring-studio .editor-softness__slider { min-width: 0; width: auto; padding: 0; }
body.authoring-studio .editor-project__identity input { min-width: 0; }
body.authoring-studio .editor-field-hint,
body.authoring-studio .editor-card :is(p, .editor-helper-text, .editor-shorturl__value) { overflow-wrap: anywhere; }
body.authoring-studio .palette-grid {
  grid-template-columns: repeat(auto-fill, 44px); grid-auto-rows: 44px; gap: 10px;
  padding: 4px; overflow: visible;
}
body.authoring-studio .palette-grid::before,
body.authoring-studio .palette-grid::after { content: none; }
body.authoring-studio .palette-color,
body.authoring-studio .palette-page-button {
  width: 44px !important; height: 44px !important; min-height: 44px;
  padding: 0 !important; border: 2px solid var(--px-line) !important;
  border-radius: var(--px-radius); box-shadow: none !important; transform: none !important;
}
body.authoring-studio .palette-color:hover,
body.authoring-studio .palette-page-button:hover { box-shadow: none !important; transform: none !important; outline: 2px solid var(--px-ink); outline-offset: 1px; }
body.authoring-studio .palette-color.selected { border-color: #fff !important; outline: 3px solid var(--px-accent); outline-offset: 1px; }
body.authoring-studio .palette-color.add-color { background: var(--px-accent-soft) !important; color: var(--px-accent); font: 600 26px/1 var(--px-font); }
body.authoring-studio .palette-page-button { font: 600 14px/1 var(--px-font); }
body.authoring-studio .palette-color:focus-visible,
body.authoring-studio .palette-page-button:focus-visible { outline: 3px solid var(--px-focus); outline-offset: 3px; }
body.authoring-studio .editor-notice[aria-labelledby="recovery-choice-title"] {
  padding: 20px; border: 1px solid var(--px-line); border-radius: var(--px-radius-panel);
  background: var(--px-surface); box-shadow: none; font: 14px/1.5 var(--px-font);
}
body.authoring-studio #recovery-choice-title { margin: 0 0 10px; font: 650 19px/1.3 var(--px-font); }
body.authoring-studio .editor-notice[aria-labelledby="recovery-choice-title"] p { margin: 8px 0; }
body.authoring-studio .editor-notice[aria-labelledby="recovery-choice-title"] button {
  min-height: 44px; margin: 8px 8px 0 0; padding: 10px 14px; border: 1px solid var(--px-line);
  border-radius: var(--px-radius); background: var(--px-accent-soft); color: var(--px-accent); font: 650 14px/1.4 var(--px-font);
  cursor: pointer;
}
body.authoring-studio .editor-notice[aria-labelledby="recovery-choice-title"] button:focus-visible { outline: 3px solid var(--px-focus); outline-offset: 3px; }
body.authoring-studio .editor-notice[aria-labelledby="recovery-choice-title"] button:disabled { opacity: .6; cursor: default; }
.authoring-disclosure > summary { cursor: pointer; font: 650 15px/1.5 var(--px-font); min-height: 44px; display: list-item; padding: 10px 0; color: var(--px-ink); }
.authoring-disclosure > summary::marker { color: var(--px-accent); }
.authoring-disclosure[open] > summary { margin-bottom: 16px; border-bottom: 1px solid var(--px-line); }
body.authoring-studio .editor-card.authoring-disclosure > .editor-card__header { margin-top: 10px; }
.authoring-create [id^='authoring-'], .authoring-studio [id^='editor-'] { scroll-margin-top: 20px; }
.authoring-tool-nav { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 24px; }
.authoring-tool-nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 9px 13px; border: 1px solid var(--px-line); border-radius: var(--px-radius); color: var(--px-accent); font: 650 14px/1.5 var(--px-font); text-decoration: none; }
.authoring-tool-nav a:hover { background: var(--px-accent-soft); }
.authoring-tool-nav a[hidden], .authoring-tool-panel[hidden] { display: none; }
.authoring-tool-panel { border-top: 1px solid var(--px-line); margin-top: 20px; padding-top: 4px; }
.authoring-tool-panel > summary { cursor: pointer; padding: 14px 0; min-height: 44px; font: 650 16px/1.5 var(--px-font); }
.authoring-tool-panel > summary::marker { color: var(--px-accent); }
.authoring-tool-panel > summary span { display: block; margin-left: 20px; color: var(--px-muted); font: 400 13px/1.5 var(--px-font); }
.authoring-tool-panel[open] > .authoring-hint { margin: 0 0 16px; }
.authoring-create :is(#textInput, #templateSection, #colorControlsSection, #studioTransferLink) { scroll-margin-top: 24px; }
.authoring-create #textCommitHint { padding: 10px 12px; border-left: 3px solid var(--px-accent); background: var(--px-accent-soft); }
.authoring-create :is(.authoring-tool-nav a, .authoring-tool-panel summary, .authoring-mobile-nav a, #snippetGrid button, #colorOptions button):focus-visible { outline: 3px solid var(--px-focus); outline-offset: 3px; }
.authoring-create :is(#snippetGrid button, #colorOptions button):focus-visible { outline-offset: -4px; }
.authoring-create :is(#snippetCarouselContainer, #colorCarouselContainer) { min-width: 0; overflow-x: auto !important; overscroll-behavior-x: contain; scroll-padding: 6px; padding: 6px; }
.authoring-create :is(#snippetGrid, #colorOptions) { transform: none !important; transition: none !important; }
.authoring-create :is(#snippetPrevBtn, #snippetNextBtn, #colorPrevBtn, #colorNextBtn) { width: 44px !important; height: 44px !important; border: 1px solid var(--px-line) !important; border-radius: var(--px-radius); color: var(--px-ink); }
.authoring-create :is(#snippetPrevBtn, #snippetNextBtn, #colorPrevBtn, #colorNextBtn):disabled { opacity: .4; cursor: default !important; }
.authoring-create #colorOptions button { width: 44px !important; height: 44px !important; flex-shrink: 0; }
.authoring-create .dipole-preset { min-width: 44px; min-height: 44px; align-items: center; justify-content: center; }
.authoring-create #paletteImportSection { border: 1px solid var(--px-line) !important; border-radius: var(--px-radius-panel); background: var(--px-canvas) !important; }
.authoring-create #paletteImportSection :is(div, span), .authoring-create #colorDipoleContainer :is(div, label) { font-size: 13px !important; line-height: 1.5 !important; }
.authoring-mobile-nav { display: none; }
@media (max-width: 1100px) {
  body.authoring-studio .editor-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .authoring-create .container { display: flex; flex-direction: column; gap: 20px; padding: 24px 16px 40px; }
  .authoring-create .container > *, .authoring-create .preview-section { order: 0; }
  .authoring-create .preview-section { position: static; width: 100%; }
  .authoring-create .preview-card { display: block; }
  /* The former compact mobile card capped both preview and canvas at 104px. */
  .authoring-create .qr-preview { width: 100%; height: auto; aspect-ratio: 1; flex-basis: 100%; }
  .authoring-create .qr-canvas { width: 100%; height: auto; max-width: 100% !important; max-height: none !important; }
  .authoring-create .authoring-section, .authoring-create .preview-card { padding: 18px; }
  body.authoring-studio .app-container { padding: 24px 16px 40px; }
  body.authoring-studio .editor-intro { gap: 16px; }
  body.authoring-studio .editor-card { padding: 18px; }
  .authoring-create #gs1Section > div[style*='grid-template-columns'] { grid-template-columns: minmax(0, 1fr) !important; }
  .authoring-create .gs1-qualifier-row { grid-template-columns: minmax(0, 1fr) auto !important; }
  .authoring-create .gs1-qualifier-row > * { min-width: 0; max-width: 100%; }
  .authoring-create .gs1-qualifier-ai-select { grid-column: 1 / -1; }
  .authoring-create #gs1Section div[style*='justify-content: flex-end'] { flex-wrap: wrap; }
  .authoring-create .authoring-primary { width: 100%; }
  body.authoring-create { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
  .authoring-create .preview-section { z-index: auto; }
  .authoring-mobile-nav { display: flex; position: fixed; z-index: 100; bottom: 0; left: 0; right: 0; gap: 8px; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid var(--px-line); background: var(--px-surface); }
  .authoring-mobile-nav a { display: flex; align-items: center; justify-content: center; flex: 1; min-height: 44px; padding: 8px; border-radius: var(--px-radius); text-decoration: none; font: 650 14px/1.5 var(--px-font); color: var(--px-accent); background: var(--px-accent-soft); }
  .authoring-mobile-nav a[data-authoring-target] { color: white; background: var(--px-accent); }
  .authoring-create :is(input, button, summary, a, #templateSection, #colorControlsSection, #authoring-review) { scroll-margin-bottom: 85px; }
}
@media (max-width: 720px) {
  body.authoring-studio .px-app-nav a { font-size: 12px; }
  /* Six links do not fit one phone-width row; wrap them instead of widening the page. */
  body.authoring-create .px-app-nav { flex-wrap: wrap; justify-content: flex-start; }
  .authoring-steps { gap: 6px; }
  .authoring-steps a { padding: 9px 10px; font-size: 13px; }
  body.authoring-studio .editor-card { padding: 16px; }
  body.authoring-studio .editor-context-strip__copy { min-width: 0; }
  body.authoring-studio .editor-tools__cluster { flex-basis: 100%; }
  body.authoring-studio .editor-project__actions { grid-template-columns: minmax(0, 1fr); }
  body.authoring-studio .editor-container :is(.editor-context-strip, .editor-session__badges, .editor-status-line) { min-width: 0; }
  body.authoring-studio :is(.editor-session__badge, .editor-card__meta-pill) { white-space: normal; }
}

/* Logo fitting shares the same compact controls in Create and Studio. */
.image-artwork-tool { margin-block: 18px; padding: 16px; border: 1px solid var(--px-border, #d5d9df); border-radius: var(--px-radius-panel); background: #fff; color: #17202c; }
.image-artwork-tool h3 { margin-top: 0; font-size: 1.15rem; font-weight: 700; line-height: 1.3; }
.image-artwork-tool p, .image-artwork-tool figcaption { font-family: inherit; font-size: .9rem; line-height: 1.5; }
.image-artwork-tool input, .image-artwork-tool button { max-width: 100%; min-height: 44px; font: inherit; }
.image-artwork-tool input[type=number] { width: 76px; }
.image-artwork-tool input[type=range] { width: min(240px, 70%); }
.image-artwork-tool [hidden] { display: none !important; }
.image-artwork-previews { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 14px 0; }
.image-artwork-previews figure { margin: 0; min-width: 0; }
.image-artwork-previews img, .image-artwork-previews svg, .image-artwork-previews canvas { width: 100%; height: auto; aspect-ratio: 1; object-fit: contain; display: block; background: repeating-conic-gradient(#eee 0% 25%, #fff 0% 50%) 0 / 16px 16px; }
.image-artwork-previews canvas, .image-artwork-previews svg { image-rendering: pixelated; }
.image-artwork-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

.image-artwork-tool button, .image-artwork-tool input[type=file] {
  border: 1px solid var(--px-line, #d5d9df); border-radius: var(--px-radius); padding: 10px 14px;
  background: var(--px-surface, #fff); color: var(--px-ink, #17202c); min-height: 44px;
}
.image-artwork-tool button { cursor: pointer; font-weight: 600; }
.image-artwork-tool button:hover:not(:disabled) { background: var(--px-canvas, #f4f6f3); }
.image-artwork-actions > button:first-child { background: var(--px-accent, #166534); border-color: var(--px-accent, #166534); color: #fff; }
.image-artwork-actions > button:first-child:hover:not(:disabled) { background: var(--px-accent-strong); border-color: var(--px-accent-strong); }
.image-artwork-tool button:disabled { opacity: .6; cursor: default; }
.image-artwork-tool input[type=file] { width: 100%; margin-bottom: 10px; }
.image-artwork-tool input[type=file]::file-selector-button { font: inherit; min-height: 32px; border: 0; border-radius: 4px; padding: 6px 10px; margin-right: 10px; background: var(--px-canvas, #f4f6f3); color: var(--px-ink, #17202c); cursor: pointer; }
.image-artwork-tool :is(button, input):focus-visible { outline: 2px solid var(--px-accent, #166534); outline-offset: 3px; }

/* Studio review: render the existing output first, then show full-width actions.
   These rules style surrounding controls only; QR pixels and canvas dimensions
   continue to be owned by the existing preview and export renderers. */
body.authoring-studio .editor-card--preview .preview-box {
  display: grid; gap: 16px; min-width: 0;
}
body.authoring-studio .editor-card--preview .preview-box__container {
  margin: 0; padding: 24px 0; min-width: 0; width: 100%;
  border: 1px solid var(--px-line); border-radius: var(--px-radius-panel);
  background: var(--px-surface); box-sizing: border-box;
}
body.authoring-studio .editor-card--preview .preview-box > .buttons {
  display: grid; gap: 12px; min-width: 0; margin: 0;
}
body.authoring-studio .editor-card--preview .download-control__actions {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px;
}
body.authoring-studio .editor-card--preview :is(.download-btn, .download-control__save, .preview-box__check button) {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  flex: none; width: 100%; max-width: 100%; min-width: 0; min-height: 44px;
  box-sizing: border-box; margin: 0; padding: 11px 14px;
  border: 1px solid var(--px-line); border-radius: var(--px-radius);
  background: var(--px-surface); color: var(--px-accent);
  box-shadow: none; transform: none; filter: none;
  font: 600 14px/1.4 var(--px-font); text-align: center; text-decoration: none;
  white-space: normal; cursor: pointer;
}
body.authoring-studio .editor-card--preview .download-control :is(.download-btn, .download-control__save) {
  border-color: var(--px-accent); background: var(--px-accent); color: var(--px-surface);
}
body.authoring-studio .editor-card--preview .download-control--ready .download-btn {
  border-color: var(--px-line); background: var(--px-surface); color: var(--px-accent);
}
body.authoring-studio .editor-card--preview :is(.download-btn, .download-control__save):hover:not(:disabled) {
  border-color: var(--px-accent); background: var(--px-accent-strong); color: var(--px-surface); filter: none;
}
body.authoring-studio .editor-card--preview :is(.download-control--ready .download-btn, .preview-box__check button):hover:not(:disabled) {
  border-color: var(--px-accent); background: var(--px-accent-soft); color: var(--px-accent);
}
body.authoring-studio .editor-card--preview .download-control__icon { width: 20px; height: 20px; flex: 0 0 20px; }
body.authoring-studio .editor-card--preview :is(.download-btn, .preview-box__check button):disabled { cursor: not-allowed; opacity: .55; }
body.authoring-studio .editor-card--preview :is(.download-btn, .download-control__save, .preview-box__check button):focus-visible {
  outline: 3px solid var(--px-focus); outline-offset: 3px;
}
body.authoring-studio .editor-card--preview .download-control__status {
  margin: 0; color: var(--px-muted); font: 400 13px/1.5 var(--px-font); overflow-wrap: anywhere;
}
body.authoring-studio .editor-card--preview .preview-box__health {
  padding-top: 12px; border-top: 1px solid var(--px-line); min-width: 0;
}
body.authoring-studio .editor-card--preview .preview-box__health p {
  margin: 0; font-size: 13px; line-height: 1.5; overflow-wrap: anywhere;
}
body.authoring-studio .editor-card--preview .preview-box__health p + p:not(:empty) { margin-top: 8px; }
body.authoring-studio .editor-card--preview .editor-softness {
  margin: 20px 0 12px; border-color: var(--px-line); background: var(--px-canvas);
}
body.authoring-studio .editor-softness select {
  display: block; width: 100%; min-height: 44px; margin: 8px 0;
  padding: 8px 12px; border: 1px solid var(--px-line); border-radius: var(--px-radius-panel);
  font: 400 14px/1.5 var(--px-font); color: var(--px-ink); background: var(--px-surface);
}
body.authoring-studio .editor-softness select:focus-visible { outline: 3px solid var(--px-focus); outline-offset: 2px; }

/* The source-layer and Exact GS1 controls use the same form language as Create.
   Keep selectors away from the pixel grid, artwork SVGs and palette swatches. */
body.authoring-studio .editor-card:is([aria-labelledby='source-layer-title'], [aria-labelledby='exact-gs1-controls-title']) {
  --editor-ink: var(--px-ink); --editor-muted: var(--px-muted); --editor-accent: var(--px-accent);
}
body.authoring-studio .editor-card:is([aria-labelledby='source-layer-title'], [aria-labelledby='exact-gs1-controls-title']) fieldset {
  min-inline-size: 0; max-width: 100%; margin: 0; padding: 0; border: 0;
}
body.authoring-studio .editor-card:is([aria-labelledby='source-layer-title'], [aria-labelledby='exact-gs1-controls-title']) legend {
  margin: 12px 0 8px; padding: 0; font: 600 14px/1.5 var(--px-font); color: var(--px-ink);
}
body.authoring-studio .editor-card[aria-labelledby='exact-gs1-controls-title'] :is(button, select, textarea, input:not([type='range']):not([type='color'])) {
  min-height: 44px; max-width: 100%; box-sizing: border-box; padding: 10px 12px;
  border: 1px solid var(--px-line); border-radius: var(--px-radius);
  background: var(--px-surface); color: var(--px-ink);
  box-shadow: none; transform: none; font: 400 16px/1.4 var(--px-font);
}
body.authoring-studio .editor-card:is([aria-labelledby='source-layer-title'], [aria-labelledby='exact-gs1-controls-title']) button {
  min-width: 44px; color: var(--px-accent); font-size: 14px; font-weight: 600;
  white-space: normal; overflow-wrap: anywhere; cursor: pointer;
}
body.authoring-studio .editor-card:is([aria-labelledby='source-layer-title'], [aria-labelledby='exact-gs1-controls-title']) button:hover:not(:disabled):not([aria-disabled='true']) {
  border-color: var(--px-accent); background: var(--px-accent-soft);
}
body.authoring-studio .editor-card:is([aria-labelledby='source-layer-title'], [aria-labelledby='exact-gs1-controls-title']) button[aria-pressed='true'] {
  border-color: var(--px-accent); background: var(--px-accent-soft); box-shadow: inset 0 0 0 1px var(--px-accent);
}
body.authoring-studio .editor-card:is([aria-labelledby='source-layer-title'], [aria-labelledby='exact-gs1-controls-title']) :is(button, select, textarea, input):disabled {
  cursor: not-allowed; opacity: .55;
}
body.authoring-studio .editor-card:is([aria-labelledby='source-layer-title'], [aria-labelledby='exact-gs1-controls-title']) :is(button, select, textarea, input):focus-visible {
  outline: 3px solid var(--px-focus); outline-offset: 3px; box-shadow: none;
}
body.authoring-studio .editor-card[aria-labelledby='source-layer-title'] textarea { resize: vertical; }
body.authoring-studio .editor-card[aria-labelledby='source-layer-title'] input[type='range'] { min-height: 44px; max-width: 100%; accent-color: var(--px-accent); }
body.authoring-studio .editor-card[aria-labelledby='source-layer-title'] input[type='file'] { width: 100%; padding: 6px; font-size: 14px; }
body.authoring-studio .editor-card[aria-labelledby='source-layer-title'] input[type='file']::file-selector-button {
  min-height: 44px; margin-right: 10px; padding: 10px 12px;
  border: 1px solid var(--px-line); border-radius: var(--px-radius);
  background: var(--px-accent-soft); color: var(--px-accent); font: 600 14px/1.4 var(--px-font); cursor: pointer;
}
body.authoring-studio .editor-card[aria-labelledby='source-layer-title'] section[aria-label='Original artwork and drawing'] {
  padding-top: 20px; border-top: 1px solid var(--px-line);
}
body.authoring-studio .editor-card[aria-labelledby='source-layer-title'] h3 {
  margin: 24px 0 12px; font: 650 17px/1.4 var(--px-font); color: var(--px-ink); letter-spacing: -.3px;
}
body.authoring-studio .editor-card[aria-labelledby='source-layer-title'] .image-artwork-tool > h3:first-child { margin-top: 0; }
@media (max-width: 390px) {
  body.authoring-studio .editor-card--preview .preview-box__container { padding-top: 20px; padding-bottom: 20px; }
  body.authoring-studio .editor-card--preview :is(.download-btn, .download-control__save, .preview-box__check button) { padding-left: 10px; padding-right: 10px; }
}

/* Layer inspector: shared by local Studio and the hosted editor. These rules
   style controls and source thumbnails, never encoded QR cells or exports. */
body:is(.editor-v2, .authoring-studio) .editor-card.source-layer-panel {
  --layer-ink: var(--px-ink, #17202c);
  --layer-muted: var(--px-muted, #627066);
  --layer-line: var(--px-line, #d7dfda);
  --layer-accent: var(--px-accent, #166534);
  --layer-soft: var(--px-accent-soft, #edf5ef);
  --layer-font: var(--px-font, system-ui, sans-serif);
  padding: 20px; border-radius: var(--px-radius-panel); box-shadow: none; color: var(--layer-ink);
  font-family: var(--layer-font);
}
body:is(.editor-v2, .authoring-studio) .editor-card.source-layer-panel .source-layer-panel__header {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  flex-wrap: wrap; margin: 0;
}
body:is(.editor-v2, .authoring-studio) .editor-card.source-layer-panel h2 {
  position: static; margin: 0; padding: 0; font: 650 19px/1.3 var(--layer-font);
}
body:is(.editor-v2, .authoring-studio) .editor-card.source-layer-panel h3 {
  position: static; margin: 0 0 6px; padding: 0; letter-spacing: 0;
  font: 650 14px/1.4 var(--layer-font); color: var(--layer-ink);
}
body:is(.editor-v2, .authoring-studio) .editor-card.source-layer-panel :is(p, .editor-field-hint) {
  margin: 8px 0; font: 400 13px/1.5 var(--layer-font); color: var(--layer-muted);
}
body:is(.editor-v2, .authoring-studio) .editor-card.source-layer-panel .source-layer-panel__intro { margin: 8px 0 18px; }
body:is(.editor-v2, .authoring-studio) .editor-card.source-layer-panel fieldset {
  min-inline-size: 0; max-width: 100%; margin: 0; padding: 0; border: 0;
}
body:is(.editor-v2, .authoring-studio) .editor-card.source-layer-panel :is(button, select, textarea, input:where(:not([type='range']):not([type='color']))) {
  min-height: 44px; min-width: 0; max-width: 100%; box-sizing: border-box;
  margin: 0; padding: 10px 12px; border: 1px solid var(--layer-line); border-radius: var(--px-radius);
  background: #fff; color: var(--layer-ink); box-shadow: none; transform: none;
  font: 400 16px/1.4 var(--layer-font);
}
body:is(.editor-v2, .authoring-studio) .editor-card.source-layer-panel button {
  min-width: 44px; font-size: 14px; font-weight: 600; cursor: pointer;
  white-space: normal; overflow-wrap: anywhere;
}
body:is(.editor-v2, .authoring-studio) .editor-card.source-layer-panel button:hover:not(:disabled):not([aria-disabled='true']) {
  border-color: var(--layer-accent); background: var(--layer-soft); color: var(--layer-accent);
}
body:is(.editor-v2, .authoring-studio) .editor-card.source-layer-panel :is(button, input, select, textarea):disabled,
body:is(.editor-v2, .authoring-studio) .editor-card.source-layer-panel button[aria-disabled='true'],
body:is(.editor-v2, .authoring-studio) .editor-card.source-layer-panel fieldset:disabled button {
  cursor: not-allowed; opacity: .55;
}
body:is(.editor-v2, .authoring-studio) .editor-card.source-layer-panel :is(button, input, select, textarea, summary):focus-visible {
  outline: 3px solid var(--px-focus, #ad642a); outline-offset: 3px;
}
body:is(.editor-v2, .authoring-studio) .editor-card.source-layer-panel .source-layer-history { display: flex; gap: 4px; }
body:is(.editor-v2, .authoring-studio) .editor-card.source-layer-panel .source-layer-history button { padding: 8px 10px; border-color: transparent; }
body:is(.editor-v2, .authoring-studio) .editor-card.source-layer-panel .source-layer-inspector {
  display: flex; flex-wrap: wrap; align-items: flex-start; gap: 22px;
}
body:is(.editor-v2, .authoring-studio) .editor-card.source-layer-panel .source-layer-stack { flex: 1 1 180px; min-width: 0; }
body:is(.editor-v2, .authoring-studio) .editor-card.source-layer-panel .source-layer-properties { flex: 2 1 250px; min-width: 0; }
body:is(.editor-v2, .authoring-studio) .editor-card.source-layer-panel .source-layer-stack__heading {
  display: flex; justify-content: space-between; margin: 0 0 8px;
  font-size: 12px; font-weight: 650; color: var(--layer-muted);
}
body:is(.editor-v2, .authoring-studio) .editor-card.source-layer-panel .source-layer-list {
  display: grid; gap: 5px; max-height: 280px; overflow-y: auto; padding: 4px; margin: -4px;
  list-style: none;
}
body:is(.editor-v2, .authoring-studio) .editor-card.source-layer-panel .source-layer-list li { padding: 0; margin: 0; list-style: none; }
body:is(.editor-v2, .authoring-studio) .editor-card.source-layer-panel .source-layer-item {
  display: flex; width: 100%; align-items: center; gap: 10px; padding: 8px;
  text-align: left; border-color: transparent; background: var(--px-canvas, #f5f7f5);
}
body:is(.editor-v2, .authoring-studio) .editor-card.source-layer-panel .source-layer-item[aria-pressed='true'] {
  border-color: var(--layer-accent); background: var(--layer-soft); box-shadow: none;
}
body:is(.editor-v2, .authoring-studio) .editor-card.source-layer-panel .source-layer-thumbnail {
  display: block; flex: 0 0 40px; width: 40px; height: 40px; border: 1px solid var(--layer-line);
  border-radius: 4px; background: #fff; image-rendering: pixelated; shape-rendering: crispEdges;
}
body:is(.editor-v2, .authoring-studio) .editor-card.source-layer-panel .source-layer-item__copy { flex: 1; min-width: 0; display: grid; gap: 2px; }
body:is(.editor-v2, .authoring-studio) .editor-card.source-layer-panel .source-layer-item__copy strong {
  display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 600;
}
body:is(.editor-v2, .authoring-studio) .editor-card.source-layer-panel .source-layer-item__copy > span { color: var(--layer-muted); font-size: 12px; font-weight: 400; }
body:is(.editor-v2, .authoring-studio) .editor-card.source-layer-panel .source-layer-item__check { color: var(--layer-accent); }
body:is(.editor-v2, .authoring-studio) .editor-card.source-layer-panel .source-layer-position {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px 12px;
  padding-bottom: 16px; margin-bottom: 16px; border-bottom: 1px solid var(--layer-line);
}
body:is(.editor-v2, .authoring-studio) .editor-card.source-layer-panel .source-layer-move {
  display: grid; grid-template-columns: repeat(3, 44px); grid-template-rows: repeat(2, 44px); gap: 4px;
}
body:is(.editor-v2, .authoring-studio) .editor-card.source-layer-panel .source-layer-move button { padding: 0; font-size: 22px; line-height: 1; }
body:is(.editor-v2, .authoring-studio) .editor-card.source-layer-panel .source-layer-move__up { grid-area: 1 / 2; }
body:is(.editor-v2, .authoring-studio) .editor-card.source-layer-panel .source-layer-move__left { grid-area: 2 / 1; }
body:is(.editor-v2, .authoring-studio) .editor-card.source-layer-panel .source-layer-move__down { grid-area: 2 / 2; }
body:is(.editor-v2, .authoring-studio) .editor-card.source-layer-panel .source-layer-move__right { grid-area: 2 / 3; }
body:is(.editor-v2, .authoring-studio) .editor-card.source-layer-panel .source-layer-remove { grid-column: 1 / -1; justify-self: start; }
body:is(.editor-v2, .authoring-studio) .editor-card.source-layer-panel .source-layer-danger { border-color: transparent; color: #a53632; }
body:is(.editor-v2, .authoring-studio) .editor-card.source-layer-panel .source-layer-danger:hover:not(:disabled) { color: #8e2824; border-color: #dbb7b3; background: #fff5f4; }
body:is(.editor-v2, .authoring-studio) .editor-card.source-layer-panel :is(.source-layer-text textarea, .source-layer-font select) { width: 100%; }
body:is(.editor-v2, .authoring-studio) .editor-card.source-layer-panel .source-layer-text textarea { min-height: 72px; resize: vertical; }
body:is(.editor-v2, .authoring-studio) .editor-card.source-layer-panel .source-layer-text__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
body:is(.editor-v2, .authoring-studio) .editor-card.source-layer-panel button.source-layer-primary { background: var(--layer-accent); border-color: var(--layer-accent); color: #fff; }
body:is(.editor-v2, .authoring-studio) .editor-card.source-layer-panel button.source-layer-primary:hover:not(:disabled) { background: var(--px-accent-strong); border-color: var(--px-accent-strong); color: #fff; }
body:is(.editor-v2, .authoring-studio) .editor-card.source-layer-panel .source-layer-busy { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 12px; font-size: 14px; }
body:is(.editor-v2, .authoring-studio) .editor-card.source-layer-panel .source-layer-manage { margin-top: 8px; }
body:is(.editor-v2, .authoring-studio) .editor-card.source-layer-panel .source-layer-manage summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; font-size: 13px; color: var(--layer-muted); }
body:is(.editor-v2, .authoring-studio) .editor-card.source-layer-panel .source-artwork-tools { padding-top: 0; margin-top: 22px; border-top: 1px solid var(--layer-line); }
body:is(.editor-v2, .authoring-studio) .editor-card.source-layer-panel .source-artwork-disclosure { border-bottom: 1px solid var(--layer-line); }
body:is(.editor-v2, .authoring-studio) .editor-card.source-layer-panel .source-artwork-disclosure summary {
  display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 8px 0;
  box-sizing: border-box; cursor: pointer; list-style: none; font: 600 14px/1.4 var(--layer-font);
}
body:is(.editor-v2, .authoring-studio) .editor-card.source-layer-panel summary::-webkit-details-marker { display: none; }
body:is(.editor-v2, .authoring-studio) .editor-card.source-layer-panel summary::after { content: '+'; margin-left: auto; font-size: 20px; }
body:is(.editor-v2, .authoring-studio) .editor-card.source-layer-panel details[open] > summary::after { content: '−'; }
body:is(.editor-v2, .authoring-studio) .editor-card.source-layer-panel .source-artwork-disclosure summary > span { margin-left: auto; color: var(--layer-muted); font-size: 12px; font-weight: 400; }
body:is(.editor-v2, .authoring-studio) .editor-card.source-layer-panel .source-artwork-disclosure summary::after { margin-left: 0; }
body:is(.editor-v2, .authoring-studio) .editor-card.source-layer-panel .source-artwork-disclosure__body { padding: 0 0 16px; }
body:is(.editor-v2, .authoring-studio) .editor-card.source-layer-panel .source-artwork-tools .image-artwork-tool { margin: 0; padding: 0 0 16px; border: 0; border-radius: 0; }
@media (max-width: 480px) {
  body:is(.editor-v2, .authoring-studio) .editor-card.source-layer-panel { padding: 16px; }
  body:is(.editor-v2, .authoring-studio) .editor-card.source-layer-panel .source-layer-inspector { gap: 18px; }
  body:is(.editor-v2, .authoring-studio) .editor-card.source-layer-panel .source-layer-stack,
  body:is(.editor-v2, .authoring-studio) .editor-card.source-layer-panel .source-layer-properties { flex-basis: 100%; }
  body:is(.editor-v2, .authoring-studio) .editor-card.source-layer-panel .source-layer-list { max-height: 190px; }
  body:is(.editor-v2, .authoring-studio) .editor-card.source-layer-panel .source-artwork-disclosure summary > span { display: none; }
  body:is(.editor-v2, .authoring-studio) .editor-card.source-layer-panel .source-artwork-disclosure summary::after { margin-left: auto; }
}
