*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --brand: #30ac68;
  accent-color: #30ac68;
  --brand-hover: #269656;
  --bg: #0e1311;
  --surface: #1a221f;
  --ink: #e8eee9;
  --muted: #8a9a90;
  --st-space-1: 8px;
  --st-space-2: 12px;
  --st-space-3: 16px;
  --st-space-4: 24px;
  --st-border-divider: 1px solid #24302b;
  --st-border-hairline: 1px solid #1c2622;
  --st-shadow-sidebar-right: 4px 0 24px -10px rgba(15, 23, 42, 0.09);
  --st-shadow-sidebar-left: -4px 0 24px -10px rgba(15, 23, 42, 0.09);
  --st-shadow-sidebar-stack: 0 6px 28px -12px rgba(15, 23, 42, 0.1);
  --st-transition-fast: 0.15s ease;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #0e1311;
  color: #e8eee9;
}

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem;
}

.sign-tool-header {
  width: 100%;
  max-width: 1440px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  gap: 1rem;
}

.back-link {
  font-size: 0.9rem;
  color: #30ac68;
  text-decoration: none;
}

.back-link:hover {
  text-decoration: underline;
}

.sign-tool-header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.sign-tool-auth-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.9rem;
  color: #c5d0c8;
  text-decoration: none;
  padding: 0.35rem 0.5rem;
  border-radius: 0.5rem;
}

.sign-tool-auth-link:hover {
  background: #24302b;
  color: #e8eee9;
}

.sign-tool-auth-icon {
  font-size: 1.1rem;
}

.btn-save-sign {
  padding: 0.4rem 0.9rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #0a100e;
  background: #30ac68;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
}

.btn-save-sign:hover {
  background: #269656;
}

.btn-import-sheet {
  background: #4b5563;
}

.btn-import-sheet:hover {
  background: #c5d0c8;
}

.btn-import-sheet--inline {
  flex-basis: 100%;
  margin-bottom: 0.15rem;
}

.sign-tool-import-save-stack {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.35rem;
}

.btn-save-sheet-toolbar {
  background: #30ac68;
  color: #1a221f;
  font-weight: 600;
}

.btn-save-sheet-toolbar:hover {
  background: #269656;
}

.sign-tool-project-label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: #c5d0c8;
}

.sign-tool-project-text {
  white-space: nowrap;
}

.sign-tool-project-select {
  padding: 0.25rem 0.5rem;
  font-size: 0.85rem;
  border: 1px solid #354540;
  border-radius: 0.375rem;
  background: #1a221f;
  min-width: 8rem;
  transition: border-color var(--st-transition-fast), box-shadow var(--st-transition-fast), background var(--st-transition-fast);
}

.sign-tool-project-select:hover {
  border-color: #b8c5d4;
  background: #fafbfc;
}

/* Växling Enskild skylt / Skyltark A4 – tvinga rätt innehåll synligt */
body.sign-mode-sheet #single-sign-wrap,
body.sign-mode-sheet #single-preview-wrap {
  display: none !important;
}
body.sign-mode-sheet #sheet-a4-wrap:not([hidden]) {
  display: block !important;
}
body.sign-mode-sheet #sheet-a4-preview-wrap {
  display: flex !important;
}

/* Låt förhandsvisningen ta höjd före köp-CTA (ark-läge). */
body.sign-mode-sheet .purchase-cta--sheet {
  flex-shrink: 0;
}
body.sign-mode-sheet #single-price-badge {
  display: none !important;
}
body:not(.sign-mode-sheet) #sheet-a4-wrap,
body:not(.sign-mode-sheet) #sheet-a4-preview-wrap {
  display: none !important;
}

.shell {
  width: 100%;
  max-width: 1200px;
  background: #1a221f;
  border-radius: 1rem;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.1);
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 4fr);
  overflow: hidden;
}

.shell.sign-tool-shell {
  max-width: 1440px;
  grid-template-columns: minmax(220px, 260px) minmax(0, 1fr) minmax(280px, 340px);
  min-height: min(88vh, 880px);
  align-items: stretch;
}

/* Figma-lik arbetsyta: nav | canvas | inspector */
.figma-canvas.sign-tool-preview-pane {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-right: 1px solid #24302b;
}

.figma-canvas-toolbar {
  flex: 0 0 auto;
  padding-bottom: var(--st-space-2);
  margin-bottom: var(--st-space-2);
  border-bottom: var(--st-border-divider);
}

.figma-top-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--st-space-3);
}

.figma-top-bar__lead {
  flex: 1 1 200px;
  min-width: 0;
}

.figma-doc-title {
  margin: 0 0 var(--st-space-1);
  font-size: 1.15rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  color: #e8eee9;
}

.figma-doc-sub {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: #8a9a90;
}

.figma-top-bar__controls {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--st-space-2);
}

.figma-mode-segment-wrap {
  display: flex;
  align-items: center;
}

.figma-mode-segment {
  display: inline-flex;
  padding: 3px;
  border-radius: 8px;
  background: #24302b;
  border: 1px solid #354540;
  gap: 2px;
}

.figma-mode-segment__option {
  margin: 0;
  position: relative;
}

.figma-mode-segment__option label {
  display: block;
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #9aaba0;
  cursor: pointer;
  transition: background var(--st-transition-fast), color var(--st-transition-fast), box-shadow var(--st-transition-fast);
}

.figma-mode-segment__option input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.figma-mode-segment__option input:focus-visible + label {
  outline: 2px solid #3db873;
  outline-offset: 2px;
}

.figma-mode-segment__option input:checked + label {
  background: #1a221f;
  color: #e8eee9;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12);
}

.btn-toolbar-quiet {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.4rem 0.65rem;
  border-radius: 8px;
  border: 1px solid #354540;
  background: #1a221f;
  color: #9aaba0;
}

.btn-toolbar-quiet:hover {
  background: #161d1a;
  border-color: #6b7a70;
}

.btn-canvas-inline {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.35rem 0.65rem;
  border-radius: 8px;
  border: 1px solid #354540;
  background: #1a221f;
  color: #a8b8ae;
  white-space: nowrap;
}

.btn-canvas-inline:hover {
  background: #121916;
  border-color: #6b7a70;
}

.figma-canvas-toolbar .sign-tool-toolbar {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.figma-canvas-stage {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: var(--st-space-2);
  overflow: auto;
}

.figma-sheet-nav {
  margin-top: var(--st-space-1);
  padding-top: var(--st-space-2);
  border-top: var(--st-border-divider);
}

.figma-section-title {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #8a9a90;
  margin: 0 0 var(--st-space-1);
}

.figma-inspector {
  background: #161d1a;
  border-left: 1px solid #24302b;
  box-shadow: var(--st-shadow-sidebar-left);
  display: flex;
  flex-direction: column;
  min-width: 0;
  max-height: calc(100vh - 5rem);
  overflow: hidden;
}

.figma-inspector-head {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: var(--st-space-1);
  padding-bottom: var(--st-space-2);
  margin-bottom: var(--st-space-1);
  border-bottom: var(--st-border-divider);
}

.figma-inspector-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #6b7a70;
}

.figma-inspector-context {
  font-size: 0.95rem;
  font-weight: 600;
  color: #e8eee9;
}

.figma-inspector-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: var(--st-space-1) var(--st-space-2) var(--st-space-3) var(--st-space-1);
}

.inspector-empty-state {
  margin-bottom: var(--st-space-3);
  padding: var(--st-space-3);
  border-radius: 10px;
  background: #121916;
  border: 1px dashed #354540;
}

.inspector-empty-state__title {
  margin: 0 0 var(--st-space-1);
  font-size: 0.8125rem;
  font-weight: 600;
  color: #a8b8ae;
}

.inspector-empty-state__hint {
  margin: 0;
  font-size: 0.75rem;
  line-height: 1.5;
  color: #8a9a90;
}

.figma-help-muted {
  font-size: 0.75rem !important;
  color: #6b7a70 !important;
}

.figma-inspector .st-section--inspector {
  margin-bottom: var(--st-space-3);
  padding-bottom: var(--st-space-2);
  border-bottom: 1px solid #24302b;
}

.figma-inspector .st-section--inspector:last-of-type {
  border-bottom: none;
  margin-bottom: 0;
}

.figma-inspector .st-section__title {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6b7a70;
  margin: 0 0 var(--st-space-2);
}

.figma-inspector .st-section__lead--subtle {
  font-size: 0.75rem;
  color: #6b7a70;
  margin: 0 0 var(--st-space-2);
}

.figma-inspector .st-field__label {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #8a9a90;
}

.sign-tool-nameplate-picker--inspector {
  display: flex;
  flex-direction: column;
  gap: var(--st-space-1);
  margin-bottom: var(--st-space-2);
  padding-bottom: var(--st-space-2);
  border-bottom: 1px solid #24302b;
}

.sign-tool-nameplate-picker--inspector .sign-tool-nameplate-picker__options {
  display: flex;
  flex-wrap: wrap;
  gap: var(--st-space-1);
}

.sign-tool-nameplate-picker--inspector .sign-tool-nameplate-picker__legend {
  margin-bottom: 0;
}

.sign-tool-nameplate-picker--inspector .sign-tool-product-option {
  flex: 1 1 auto;
  min-width: 4.5rem;
}

.figma-sheet-canvas-frame {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.figma-canvas-placeholder {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--st-space-3);
  pointer-events: none;
  background: rgba(248, 250, 252, 0.72);
  border-radius: 8px;
}

/* display:flex ovan slår annars ut [hidden] — då ligger platshållaren kvar ovanpå förhandsvisningen. */
.figma-canvas-placeholder[hidden] {
  display: none !important;
}

.figma-canvas-placeholder__title {
  margin: 0 0 var(--st-space-1);
  font-size: 0.9375rem;
  font-weight: 600;
  color: #a8b8ae;
}

.figma-canvas-placeholder__hint {
  margin: 0;
  max-width: 18rem;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: #8a9a90;
}

/* Figma-layout: köp-CTA ska alltid synas (ingen wizard-döljning) */
.sign-tool-shell.figma-shell .purchase-cta,
.sign-tool-shell.figma-shell .purchase-cta--sheet {
  display: flex !important;
}

.figma-inspector-scroll > #single-sign-wrap {
  padding-bottom: var(--st-space-3);
  margin-bottom: var(--st-space-3);
  border-bottom: var(--st-border-divider);
}

.figma-inspector-scroll > #sheet-a4-wrap:not([hidden]) {
  padding-bottom: var(--st-space-3);
  margin-bottom: var(--st-space-3);
  border-bottom: var(--st-border-divider);
}

.figma-inspector-scroll > #inspector-sheet-sign-panel:not([hidden]) {
  padding-bottom: var(--st-space-2);
  margin-bottom: var(--st-space-2);
  border-bottom: var(--st-border-divider);
}

.inspector-block {
  margin-bottom: var(--st-space-3);
  padding-bottom: var(--st-space-3);
  border-bottom: var(--st-border-divider);
}

.inspector-block:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.inspector-block__title {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #8a9a90;
  margin: 0 0 var(--st-space-2);
}

.inspector-align-row {
  display: flex;
  flex-direction: column;
  gap: var(--st-space-1);
  margin-top: var(--st-space-1);
}

.inspector-segmented {
  display: flex;
  gap: var(--st-space-1);
  flex-wrap: wrap;
}

.inspector-seg-btn {
  flex: 1 1 auto;
  min-width: 0;
  padding: var(--st-space-1) 10px;
  font-size: 0.8rem;
  border: 1px solid #354540;
  border-radius: 6px;
  background: #1a221f;
  color: #a8b8ae;
  cursor: pointer;
  transition: background var(--st-transition-fast), border-color var(--st-transition-fast), color var(--st-transition-fast), box-shadow var(--st-transition-fast);
}

.inspector-seg-btn:hover {
  background: #121916;
  border-color: #6b7a70;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.inspector-seg-btn--active {
  background: rgba(48, 172, 104, 0.12);
  border-color: #3db873;
  color: #1f7a4a;
  font-weight: 600;
}

.inspector-seg-btn--active:hover {
  background: rgba(48, 172, 104, 0.14);
  border-color: #30ac68;
  color: #269656;
}

.inspector-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--st-space-1);
}

.btn.btn-danger {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
  transition: background var(--st-transition-fast), border-color var(--st-transition-fast), box-shadow var(--st-transition-fast);
}

.btn.btn-danger:hover {
  background: #fee2e2;
  border-color: #fca5a5;
  box-shadow: 0 1px 4px rgba(185, 28, 28, 0.12);
}

.btn.btn-danger:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

.figma-sheet-nav .btn-add-sheet-sign--nav {
  width: 100%;
  margin-bottom: var(--st-space-2);
  box-sizing: border-box;
}

.sheet-signs-list--nav {
  max-height: 40vh;
  overflow-y: auto;
}

.sheet-sign-row--compact .sheet-sign-row__base {
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  align-items: center;
  gap: 8px;
}

.sheet-sign-row__preview {
  font-size: 0.85rem;
  color: #1e293b;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sheet-sign-row__meta {
  font-size: 0.72rem;
  color: #8a9a90;
  white-space: nowrap;
}

.sheet-sign-row--compact {
  transition: background 0.15s ease;
}

.sheet-sign-row--compact:hover {
  background: rgba(59, 130, 246, 0.07);
}

.sheet-sign-item {
  cursor: pointer;
  transition: box-shadow var(--st-transition-fast), outline var(--st-transition-fast), transform var(--st-transition-fast);
}

.sheet-sign-item:hover:not(.sheet-sign-item--active) {
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.08);
}

.sheet-sign-item--active {
  outline: 2px solid #30ac68;
  outline-offset: 2px;
  box-shadow: 0 0 0 3px rgba(48, 172, 104, 0.2), 0 4px 16px rgba(15, 23, 42, 0.1);
  z-index: 3;
}

.sign-tool-settings.figma-inspector {
  border-right: none;
  overflow: hidden;
}

.figma-inspector .form-grid {
  gap: var(--st-space-3);
  column-gap: var(--st-space-3);
}

.figma-inspector .measure-panel {
  margin-top: var(--st-space-3);
  padding-top: var(--st-space-3);
  border-top: var(--st-border-divider);
}

@media (max-width: 1100px) {
  .shell.sign-tool-shell {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .sign-tool-sidebar {
    box-shadow: var(--st-shadow-sidebar-stack);
  }

  .figma-inspector,
  .sign-tool-settings.figma-inspector {
    box-shadow: var(--st-shadow-sidebar-stack);
    border-left: none;
    border-top: var(--st-border-divider);
  }
}

.panel {
  padding: var(--st-space-3) var(--st-space-4);
}

.panel--left {
  border-right: 1px solid #24302b;
}

.panel--right {
  background: radial-gradient(circle at top left, rgba(48, 172, 104, 0.12) 0, #161d1a 48%, #0e1311 100%);
}

.sign-tool-sidebar {
  border-right: 1px solid #24302b;
  background: linear-gradient(180deg, #161d1a 0%, #121916 100%);
  box-shadow: var(--st-shadow-sidebar-right);
  display: flex;
  flex-direction: column;
  gap: var(--st-space-2);
  padding: var(--st-space-3) var(--st-space-2);
  position: sticky;
  top: 0;
  align-self: start;
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
}

.sign-tool-sidebar__brand {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #8a9a90;
}

.sign-tool-page-nav--sidebar {
  flex-direction: column;
  align-items: stretch;
  padding: 0.45rem;
}

.sign-tool-page-nav--sidebar .sign-tool-page-nav__link {
  min-width: 0;
  width: 100%;
  justify-content: flex-start;
  text-align: left;
}

.sign-tool-nameplate-picker--sidebar {
  flex-direction: column;
  margin-top: 0;
}

.sign-tool-nameplate-picker--sidebar .sign-tool-product-option {
  min-width: 0;
  width: 100%;
}

.step-progress--sidebar {
  grid-template-columns: 1fr;
  margin-top: 0.25rem;
  gap: 0.35rem;
}

.step-progress--sidebar .step-progress__item {
  width: 100%;
}

.sign-tool-settings {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
  min-height: 0;
  max-height: calc(100vh - 5rem);
  overflow-y: auto;
  border-right: 1px solid #24302b;
  padding-top: 1.25rem;
  padding-bottom: 2rem;
}

.sign-tool-settings__head {
  margin-bottom: 1rem;
}

.sign-tool-settings__title {
  font-size: 1.35rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  margin: 0;
  color: #e8eee9;
}

.sign-tool-settings__sub {
  margin: 0.4rem 0 0;
}

.sign-tool-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #24302b;
}

.sign-tool-toolbar .heading-actions {
  flex: 1 1 auto;
  min-width: 0;
}

.sign-tool-toolbar .step-quick-summary {
  flex: 0 1 14rem;
}

.sign-tool-preview-pane {
  background: radial-gradient(circle at top left, rgba(48, 172, 104, 0.12) 0, #161d1a 48%, #0e1311 100%);
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  position: sticky;
  top: 0;
  align-self: start;
  max-height: calc(100vh - 5rem);
  overflow: hidden;
}

.sign-tool-preview-pane .preview-wrapper {
  flex: 1;
  min-height: 0;
}

.sign-tool-preview-pane .preview-stage {
  min-height: 280px;
}

/* Diskret rutnät som standard i förhandsytan */
.sign-tool-preview-pane .preview-surface {
  background-color: #121916;
  background-image:
    linear-gradient(rgba(15, 23, 42, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 23, 42, 0.045) 1px, transparent 1px),
    radial-gradient(120% 85% at 50% 40%, rgba(255, 255, 255, 0.75), rgba(248, 250, 252, 0.9) 55%, rgba(241, 245, 249, 0.98) 100%);
  background-size: 16px 16px, 16px 16px, auto;
  background-position: 0 0, 0 0, center;
}

.sign-tool-preview-pane .preview-surface.preview-surface--grid {
  background-size: 20px 20px, 20px 20px, auto, auto;
}

@media (max-width: 1100px) {
  .sign-tool-sidebar,
  .sign-tool-settings,
  .sign-tool-preview-pane {
    position: relative;
    max-height: none;
    border-right: none;
    overflow: visible;
  }

  .sign-tool-settings {
    border-bottom: var(--st-border-divider);
  }

  .figma-canvas.sign-tool-preview-pane {
    border-right: none;
    border-bottom: var(--st-border-divider);
    box-shadow: 0 4px 24px -12px rgba(15, 23, 42, 0.06);
  }
}

/* Inställningssektioner */
.st-section {
  margin-bottom: var(--st-space-3);
  padding-bottom: var(--st-space-3);
  border-bottom: var(--st-border-divider);
}

.st-section:last-of-type {
  border-bottom: none;
  margin-bottom: 0;
}

.st-section__title {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #8a9a90;
  margin: 0 0 var(--st-space-1);
}

.st-section__lead {
  font-size: 0.8rem;
  color: #6b7a70;
  margin: 0 0 var(--st-space-2);
  line-height: 1.45;
}

.st-section--compact {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.st-section--compact .st-section__lead {
  margin-bottom: 0.65rem;
}

.st-field {
  display: block;
  margin-bottom: 0.85rem;
}

.st-field:last-child {
  margin-bottom: 0;
}

.st-field__label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: #9aaba0;
  margin-bottom: 0.35rem;
}

.st-field-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: flex-end;
}

.st-field-row--3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--st-space-2);
}

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

.st-field--inline {
  flex: 1 1 8rem;
  margin-bottom: 0;
}

.st-input,
.st-field .st-input {
  width: 100%;
  padding: var(--st-space-1) 0.65rem;
  font-size: 0.875rem;
  border: 1px solid #354540;
  border-radius: 0.5rem;
  background: #1a221f;
  color: #e8eee9;
  line-height: 1.35;
  transition: border-color var(--st-transition-fast), box-shadow var(--st-transition-fast), background var(--st-transition-fast);
}

.st-input:hover:not(:focus) {
  border-color: #b8c5d4;
  background: #fafbfc;
}

.st-input:focus {
  outline: none;
  border-color: #30ac68;
  box-shadow: 0 0 0 3px rgba(48, 172, 104, 0.15);
}

.dimension-inputs--labeled {
  align-items: flex-end;
}

.dimension-inputs__times {
  padding-bottom: 0.55rem;
  color: #6b7a70;
  font-weight: 600;
}

.st-advanced {
  margin: 1rem 0;
  padding: 0.5rem 0.65rem;
  border: 1px solid #24302b;
  border-radius: 0.65rem;
  background: #fafbfc;
}

.st-advanced__summary {
  font-size: 0.82rem;
  font-weight: 600;
  color: #9aaba0;
  cursor: pointer;
  list-style: none;
  padding: var(--st-space-1) var(--st-space-1);
  margin: calc(-1 * var(--st-space-1));
  border-radius: 0.5rem;
  transition: color var(--st-transition-fast), background var(--st-transition-fast);
}

.st-advanced__summary:hover {
  color: #1f7a4a;
  background: rgba(48, 172, 104, 0.06);
}

.st-advanced__summary::-webkit-details-marker {
  display: none;
}

.st-advanced__body {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid #24302b;
}

.sign-tool-step-nav {
  position: sticky;
  bottom: 0;
  margin-top: 1.5rem;
  padding: 1rem 0 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, #1a221f 18%);
  border-top: 1px solid #24302b;
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  z-index: 2;
}

.sign-tool-floating-actions {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.45rem;
  max-width: min(16rem, calc(100vw - 2rem));
}

.btn-floating-action {
  padding: 0.55rem 1rem;
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: 0.65rem;
  border: 1px solid #354540;
  background: #1a221f;
  color: #1e293b;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.12);
  cursor: pointer;
  text-align: center;
}

.btn-floating-action:hover {
  border-color: #6b7a70;
  background: #161d1a;
}

.btn-floating-action--primary {
  background: #30ac68;
  border-color: #269656;
  color: #1a221f;
}

.btn-floating-action--primary:hover {
  background: #269656;
}

.sign-tool-floating-actions .btn-add-text-line {
  margin-top: 0;
}

.sign-tool-settings #sign-form label.st-field {
  text-transform: none;
  letter-spacing: normal;
  font-weight: 400;
}

.heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
}

.heading-copy {
  flex: 1 1 220px;
  min-width: 0;
}

.heading-side {
  flex: 1 1 260px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.85rem;
}

.heading-title {
  font-size: 1.4rem;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.heading-sub {
  font-size: 0.85rem;
  color: #8a9a90;
  margin: 0.35rem 0 0;
  line-height: 1.5;
}

.step-progress {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.4rem;
  margin-top: 0.75rem;
}

.step-progress__item {
  appearance: none;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: rgba(255, 255, 255, 0.7);
  border-radius: 0.9rem;
  padding: 0.45rem 0.55rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.step-progress__item:hover {
  transform: translateY(-1px);
  border-color: rgba(48, 172, 104, 0.35);
  box-shadow: 0 10px 18px rgba(15, 23, 42, 0.05);
}

.step-progress__dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  border: 2px solid rgba(48, 172, 104, 0.35);
  background: transparent;
  flex: 0 0 auto;
}

.step-progress__label {
  font-size: 0.78rem;
  font-weight: 650;
  color: #e8eee9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.step-progress__item[aria-current="step"] {
  border-color: rgba(48, 172, 104, 0.6);
  background: rgba(48, 172, 104, 0.08);
}

.step-progress__item[aria-current="step"] .step-progress__dot {
  background: #30ac68;
  border-color: #30ac68;
}

.step-panel[hidden] {
  display: none !important;
}

.step-panel {
  animation: stepFadeIn 220ms ease both;
}

@keyframes stepFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.step-nav {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.9rem;
}

.step-nav__back,
.step-nav__next {
  flex: 1;
}

.step-quick-summary {
  margin-top: 0.65rem;
  padding: 0.6rem 0.7rem;
  border-radius: 0.9rem;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: rgba(255, 255, 255, 0.75);
}

.step-quick-summary__row {
  display: flex;
  gap: 0.5rem;
  align-items: baseline;
  justify-content: space-between;
}

.step-quick-summary__label {
  font-size: 0.78rem;
  color: #8a9a90;
}

.step-quick-summary__value {
  font-size: 0.82rem;
  font-weight: 700;
  color: #e8eee9;
  text-align: right;
}

.step-quick-summary__edit {
  margin-top: 0.35rem;
}

.step-hint {
  margin-top: 0.65rem;
}

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

/* Produktväljare (ovanför Importera / Typ) */
.sign-tool-product-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.5rem 0.55rem;
  background: linear-gradient(180deg, #161d1a 0%, #121916 100%);
  border: 1px solid #24302b;
  border-radius: 0.65rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.sign-tool-page-nav__link {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  flex: 1 1 auto;
  min-width: calc(33.333% - 0.4rem);
  min-height: 2.35rem;
  padding: 0.35rem 0.45rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: #9aaba0;
  background: #1a221f;
  border: 1px solid #24302b;
  border-radius: 0.5rem;
  text-decoration: none;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
  box-sizing: border-box;
}

.sign-tool-page-nav__link:hover {
  border-color: #6b7a70;
  color: #e8eee9;
  background: #161d1a;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}

.sign-tool-page-nav__link.is-active {
  border-color: #30ac68;
  background: linear-gradient(180deg, rgba(48, 172, 104, 0.12) 0%, rgba(48, 172, 104, 0.14) 100%);
  color: #269656;
  box-shadow: 0 1px 2px rgba(48, 172, 104, 0.12);
}

.sign-tool-nameplate-picker {
  margin-top: 0.45rem;
}

@media (min-width: 520px) {
  .sign-tool-page-nav__link {
    min-width: calc(20% - 0.4rem);
  }
}

.sign-tool-product-option {
  position: relative;
  flex: 1 1 auto;
  min-width: calc(33.333% - 0.4rem);
}

@media (min-width: 520px) {
  .sign-tool-product-option {
    min-width: calc(20% - 0.4rem);
  }
}

.sign-tool-product-option input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  margin: 0;
}

.sign-tool-product-option label {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 2.35rem;
  padding: 0.35rem 0.45rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: #9aaba0;
  background: #1a221f;
  border: 1px solid #24302b;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
  user-select: none;
}

.sign-tool-product-option label:hover {
  border-color: #6b7a70;
  color: #e8eee9;
  background: #161d1a;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
}

.sign-tool-product-option input:focus-visible + label {
  outline: 2px solid #30ac68;
  outline-offset: 2px;
}

.sign-tool-product-option input:checked + label {
  border-color: #30ac68;
  background: linear-gradient(180deg, rgba(48, 172, 104, 0.12) 0%, rgba(48, 172, 104, 0.14) 100%);
  color: #269656;
  box-shadow: 0 1px 2px rgba(48, 172, 104, 0.12);
}

.sign-tool-product-hint {
  margin: 0 0 0.25rem;
  padding: 0.65rem 0.75rem;
  background: #161d1a;
  border: 1px solid #24302b;
  border-radius: 0.55rem;
  font-size: 0.82rem;
  color: #9aaba0;
  line-height: 1.45;
}

.heading-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.sign-type-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1 1 22rem;
  min-width: min(100%, 22rem);
}

.sign-type-picker {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.4rem;
  padding: 0.35rem;
  background: linear-gradient(180deg, #161d1a 0%, #121916 100%);
  border: 1px solid #24302b;
  border-radius: 0.65rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
  width: 100%;
}

.sign-type-picker__option {
  min-width: auto;
  flex: 1 1 0;
}

.sign-type-picker__option label {
  min-height: 2.1rem;
  font-size: 0.76rem;
  padding: 0.3rem 0.55rem;
  white-space: nowrap;
  width: 100%;
}

/* Segmentväxlare i top bar: åsidosätt äldre .sign-type-picker-fullbredd-stil */
.figma-mode-segment.sign-type-picker {
  width: auto;
  max-width: none;
  flex-wrap: nowrap;
  gap: 2px;
  padding: 3px;
  background: #24302b;
  border: 1px solid #354540;
  border-radius: 8px;
  box-shadow: none;
}

.figma-mode-segment.sign-type-picker .sign-type-picker__option {
  flex: 0 0 auto;
  min-width: 0;
}

.figma-mode-segment.sign-type-picker .sign-type-picker__option label {
  min-height: 0;
  width: auto;
  border: none;
  background: transparent;
  box-shadow: none;
}

.figma-mode-segment.sign-type-picker .sign-type-picker__option input:checked + label {
  border: none;
  background: #1a221f;
  color: #e8eee9;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12);
}

.sign-type-wrap[hidden],
#sign-tool-bg-color-wrap[hidden],
#plakat-innehall-wrap[hidden],
#plakat-bild-wrap[hidden],
.sign-tool-text-fields-wrap[hidden] {
  display: none !important;
}

.plakat-innehall-wrap .plakat-innehall-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.35rem;
}

.plakat-bild-wrap .plakat-image-input {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.85rem;
}

.plakat-image-thumb-wrap {
  margin-top: 0.75rem;
  max-width: 18rem;
}

.plakat-image-thumb-btn {
  display: block;
  padding: 0;
  margin: 0;
  border: 2px solid rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  background: #0e1311;
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.plakat-image-thumb-btn:hover {
  border-color: rgba(59, 130, 246, 0.55);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.plakat-image-thumb-btn:focus-visible {
  outline: 2px solid #3db873;
  outline-offset: 2px;
}

.plakat-image-thumb-btn:disabled {
  cursor: wait;
  opacity: 0.75;
}

.plakat-image-thumb-btn img {
  display: block;
  width: 120px;
  height: 120px;
  object-fit: contain;
}

.plakat-image-thumb-hint {
  margin-top: 0.45rem;
  margin-bottom: 0;
  font-size: 0.8rem;
}

.plakat-bild-wrap .plakat-image-remove {
  display: block;
  margin-top: 0.5rem;
}

.sign-tool-text-fields-wrap .sign-tool-row-2 {
  margin-top: 0.75rem;
}

.plakat-text-style-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1rem;
  width: 100%;
}

@media (max-width: 700px) {
  .plakat-text-style-grid {
    grid-template-columns: 1fr;
  }
}

.sign-type-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #8a9a90;
  margin-bottom: 0;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.sign-type-select {
  width: auto;
  min-width: 10rem;
}

@media (max-width: 640px) {
  .sign-type-wrap {
    width: 100%;
    flex-wrap: wrap;
  }
  .sign-type-picker {
    width: 100%;
  }
}

.price-badge {
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: rgba(48, 172, 104, 0.14);
  border: 1px solid rgba(48, 172, 104, 0.35);
  font-size: 0.85rem;
  color: #30ac68;
  display: inline-flex;
  align-items: baseline;
  gap: 0.25rem;
}

.price-badge strong {
  font-size: 1rem;
  color: #30ac68;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem 1.25rem;
}

.form-row--full {
  grid-column: 1 / -1;
}

label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #8a9a90;
  margin-bottom: 0.35rem;
}

input[type="text"],
input[type="number"],
select {
  width: 100%;
  border-radius: 0.6rem;
  border: 1px solid #354540;
  padding: 0.5rem 0.65rem;
  font-size: 0.9rem;
  outline: none;
  background: #161d1a;
  transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

input[type="text"]:hover:not(:focus),
input[type="number"]:hover:not(:focus),
select:hover:not(:focus) {
  border-color: #b8c5d4;
  background: #1a221f;
}

input[type="text"]:focus,
input[type="number"]:focus,
select:focus {
  border-color: #30ac68;
  box-shadow: 0 0 0 1px rgba(48, 172, 104, 0.35);
  background: #1a221f;
}

input[type="color"] {
  cursor: pointer;
  transition: border-color var(--st-transition-fast), box-shadow var(--st-transition-fast);
}

input[type="color"]:hover {
  border-color: #6b7a70;
  box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.05);
}

input[type="range"] {
  cursor: pointer;
}

input[type="range"]:hover {
  filter: brightness(0.97);
}

.dimension-inputs {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}

.dimension-inputs span {
  font-size: 0.8rem;
  color: #8a9a90;
}

.text-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.text-row input {
  flex: 1;
  min-width: 0;
}

.text-row .align-select {
  width: auto;
  min-width: 6.5rem;
  flex-shrink: 0;
}

.checkbox-row .checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  text-transform: none;
  letter-spacing: normal;
  color: #e8eee9;
  margin-bottom: 0;
  padding: 6px 8px;
  margin: -6px -8px;
  border-radius: 0.5rem;
  transition: background var(--st-transition-fast), color var(--st-transition-fast);
}

.checkbox-row .checkbox-label:hover {
  background: rgba(15, 23, 42, 0.05);
  color: #e8eee9;
}

.checkbox-row input[type="checkbox"] {
  width: auto;
  margin: 0;
  cursor: pointer;
}

.preview-wrapper {
  display: flex;
  flex-direction: column;
  gap: var(--st-space-3);
  height: 100%;
}

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

.preview-meta {
  font-size: 0.8rem;
  color: #8a9a90;
}

.preview-meta span {
  font-weight: 600;
  color: #e8eee9;
}

.preview-surface {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  overflow: auto;
  /* Realistisk “arbetsyta” (utan rutnät som default) */
  background:
    radial-gradient(120% 85% at 50% 15%, rgba(255, 255, 255, 0.92), rgba(248, 250, 252, 0.92) 45%, rgba(241, 245, 249, 0.96) 100%),
    linear-gradient(180deg, rgba(15, 23, 42, 0.03), rgba(15, 23, 42, 0.015));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.preview-surface.preview-surface--grid {
  /* Rutnät kan slås på via toggle */
  background-image:
    linear-gradient(rgba(0, 0, 0, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 0, 0, 0.055) 1px, transparent 1px),
    radial-gradient(120% 85% at 50% 15%, rgba(255, 255, 255, 0.92), rgba(248, 250, 252, 0.92) 45%, rgba(241, 245, 249, 0.96) 100%),
    linear-gradient(180deg, rgba(15, 23, 42, 0.03), rgba(15, 23, 42, 0.015));
  background-size: 20px 20px, 20px 20px, auto, auto;
  background-position: 0 0, 0 0, center, center;
}

.preview-stage {
  position: relative;
  flex: 1;
  min-height: 12rem;
}

.preview-ruler {
  position: absolute;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(15, 23, 42, 0.12);
  color: rgba(15, 23, 42, 0.8);
  font-size: 0.68rem;
  user-select: none;
  opacity: 0;
  pointer-events: none;
  transition: opacity 140ms ease;
  z-index: 20;
}

.preview-stage.is-rulers-on .preview-ruler {
  opacity: 1;
}

.preview-ruler--top {
  left: 34px;
  right: 0;
  top: 0;
  height: 26px;
  border-left: 0;
  border-right: 0;
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
  overflow: hidden;
}

.preview-ruler--left {
  top: 26px;
  bottom: 0;
  left: 0;
  width: 34px;
  border-top: 0;
  border-bottom: 0;
  border-top-left-radius: 8px;
  border-bottom-left-radius: 8px;
  overflow: hidden;
}

.preview-ruler__labels {
  position: absolute;
  inset: 0;
}

.preview-ruler__label {
  position: absolute;
  line-height: 1;
  opacity: 0.85;
  transform: translateX(-50%);
  pointer-events: none;
}

.preview-ruler--left .preview-ruler__label {
  left: 50%;
  transform: translateY(-50%);
}

.preview-stage .preview-surface {
  position: absolute;
  inset: 0;
  padding-top: calc(1.5rem + 26px);
  padding-left: calc(1.5rem + 34px);
}

.measure-panel {
  border: 1px solid #24302b;
  border-radius: 0.85rem;
  background: #1a221f;
  padding: 0.75rem 0.85rem;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.06);
}

.measure-panel__title {
  font-weight: 800;
  color: #e8eee9;
  display: flex;
  gap: 0.5rem;
  align-items: baseline;
  margin-bottom: 0.55rem;
}

.measure-panel__sub {
  font-weight: 600;
  color: #8a9a90;
  font-size: 0.85em;
}

.measure-panel__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
}

.measure-field span {
  display: block;
  font-size: 0.75rem;
  color: #8a9a90;
  margin-bottom: 0.25rem;
}

.measure-field input {
  width: 100%;
  padding: 0.45rem 0.55rem;
  border-radius: 0.65rem;
  border: 1px solid #24302b;
  font-size: 0.9rem;
  transition: border-color var(--st-transition-fast), box-shadow var(--st-transition-fast), background var(--st-transition-fast);
}

.measure-field input:hover:not(:focus) {
  border-color: #354540;
  background: #fafbfc;
}

.measure-field input:focus {
  border-color: #30ac68;
  box-shadow: 0 0 0 2px rgba(48, 172, 104, 0.12);
  outline: none;
  background: #1a221f;
}

.measure-readonly {
  border: 1px solid #1c2622;
  border-radius: 0.75rem;
  padding: 0.55rem 0.6rem;
  background: #161d1a;
}

.measure-readonly__k {
  font-size: 0.75rem;
  color: #8a9a90;
}

.measure-readonly__v {
  font-weight: 800;
  color: #e8eee9;
}

.measure-panel__hint {
  margin-top: 0.55rem;
  font-size: 0.8rem;
  color: #8a9a90;
}

.sign-text-box.is-measured,
.sign-preview__qr.is-measured {
  outline: 2px solid rgba(48, 172, 104, 0.75);
  outline-offset: 2px;
}

.sign-preview {
  /* Storlek sätts endast via JS (width/height) – inga min/max som spärrar */
  position: relative;
  min-width: 0;
  min-height: 0;
  max-width: none;
  max-height: none;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.6rem;
  border: 1px solid rgba(15, 23, 42, 0.18);
  background: #facc15;
  /* Lite mer “riktig skylt”: mjukare skugga + lätt lyft */
  box-shadow:
    0 18px 34px rgba(15, 23, 42, 0.22),
    0 2px 0 rgba(255, 255, 255, 0.35) inset;
  padding: 0.5rem 1.25rem;
  transition: transform 220ms cubic-bezier(0.2, 0.9, 0.2, 1);
  transform-origin: center center;
  will-change: transform;
}

.sign-preview::before,
.sign-preview::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: 2; /* under text (3) och hål (4) */
}

/* Gemensam ljussättning (subtil vignette + top highlight) */
.sign-preview::before {
  background:
    radial-gradient(120% 80% at 30% 10%, rgba(255, 255, 255, 0.35), transparent 55%),
    radial-gradient(140% 120% at 70% 90%, rgba(0, 0, 0, 0.16), transparent 60%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(0, 0, 0, 0.06));
  mix-blend-mode: overlay;
  opacity: 0.75;
}

/* Reflektion (glossy) – aktiveras via material-klasser */
.sign-preview::after {
  opacity: 0;
}

/* Graverad plast: lätt “grain” + mjuk reflection */
.sign-preview--mat-gravplast::before {
  background:
    repeating-linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.06) 0px,
      rgba(255, 255, 255, 0.06) 2px,
      rgba(0, 0, 0, 0.035) 3px,
      rgba(0, 0, 0, 0.035) 6px
    ),
    radial-gradient(120% 80% at 30% 10%, rgba(255, 255, 255, 0.35), transparent 55%),
    radial-gradient(140% 120% at 70% 90%, rgba(0, 0, 0, 0.16), transparent 60%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(0, 0, 0, 0.06));
  mix-blend-mode: overlay;
  opacity: 0.7;
}

.sign-preview--mat-gravplast::after {
  background:
    linear-gradient(115deg, rgba(255, 255, 255, 0.0) 0%, rgba(255, 255, 255, 0.22) 42%, rgba(255, 255, 255, 0.06) 58%, rgba(255, 255, 255, 0.0) 100%);
  opacity: 0.55;
}

/* Metall (printad alu): “brushed” textur + starkare highlight */
.sign-preview--mat-alu::before {
  background:
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.12) 0px,
      rgba(255, 255, 255, 0.12) 1px,
      rgba(0, 0, 0, 0.06) 2px,
      rgba(0, 0, 0, 0.06) 4px
    ),
    radial-gradient(120% 70% at 25% 0%, rgba(255, 255, 255, 0.42), transparent 60%),
    radial-gradient(120% 90% at 75% 100%, rgba(0, 0, 0, 0.22), transparent 62%);
  mix-blend-mode: soft-light;
  opacity: 0.85;
}

.sign-preview--mat-alu::after {
  background:
    linear-gradient(105deg, rgba(255, 255, 255, 0.0) 0%, rgba(255, 255, 255, 0.28) 46%, rgba(255, 255, 255, 0.02) 62%, rgba(255, 255, 255, 0.0) 100%);
  opacity: 0.62;
}

/* Klistermärke: lite “vinyl” gloss och lägre grain */
.sign-preview--mat-klister::before {
  background:
    radial-gradient(120% 70% at 30% 10%, rgba(255, 255, 255, 0.38), transparent 58%),
    radial-gradient(120% 90% at 75% 95%, rgba(0, 0, 0, 0.14), transparent 62%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(0, 0, 0, 0.04));
  mix-blend-mode: overlay;
  opacity: 0.75;
}

.sign-preview--mat-klister::after {
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.0) 0%, rgba(255, 255, 255, 0.32) 40%, rgba(255, 255, 255, 0.04) 62%, rgba(255, 255, 255, 0.0) 100%);
  opacity: 0.6;
}

/* Glas: genomskinlig look + reflektion */
.sign-preview--mat-glass {
  border-color: rgba(15, 23, 42, 0.12);
  box-shadow:
    0 22px 44px rgba(15, 23, 42, 0.18),
    0 2px 0 rgba(255, 255, 255, 0.55) inset;
}

.sign-preview--mat-glass::before {
  background:
    radial-gradient(120% 70% at 30% 0%, rgba(255, 255, 255, 0.55), transparent 60%),
    radial-gradient(120% 90% at 70% 100%, rgba(0, 0, 0, 0.12), transparent 62%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.06));
  mix-blend-mode: screen;
  opacity: 0.85;
}

.sign-preview--mat-glass::after {
  background:
    linear-gradient(115deg, rgba(255, 255, 255, 0.0) 0%, rgba(255, 255, 255, 0.42) 44%, rgba(255, 255, 255, 0.08) 60%, rgba(255, 255, 255, 0.0) 100%);
  opacity: 0.7;
}

/* Plakat etsat alu: hårdare kontrast */
.sign-preview--mat-plakat-alu::before { opacity: 0.9; }
.sign-preview--mat-plakat-alu::after { opacity: 0.55; }

/* Plakat bränt trä: låt trätexturen dominera */
.sign-preview--mat-plakat-tra::before { opacity: 0.55; mix-blend-mode: overlay; }
.sign-preview--mat-plakat-tra::after { opacity: 0.25; }

.sheet-zoom-btn--toggle[aria-pressed="true"] {
  background: #e8eee9;
  color: #1a221f;
  border-color: #e8eee9;
}

.sign-preview__holes {
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  z-index: 4;
}

/* Ram för plakatbild: pan/zoom klipps inom materialet */
.sign-preview__image-frame {
  position: absolute;
  inset: 0.35rem;
  border-radius: 0.35rem;
  overflow: hidden;
  z-index: 5;
  touch-action: none;
}

.sign-preview__image-frame[hidden] {
  display: none !important;
}

.sign-preview__image-frame--interactive {
  cursor: grab;
  -webkit-user-select: none;
  user-select: none;
}

.sign-preview__image-frame--interactive:active {
  cursor: grabbing;
}

.sign-preview__user-image {
  position: absolute;
  left: 50%;
  top: 50%;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  margin: 0;
  object-fit: contain;
  border-radius: 0;
  transform-origin: center center;
  /* Över .sign-text (z-index 3) så bilden syns i bildläge även om display-glitch */
  z-index: 1;
  pointer-events: none;
  will-change: transform;
}

.sign-preview__user-image[hidden] {
  display: none !important;
}

.sign-preview__qr {
  position: absolute;
  z-index: 6;
  border-radius: 0.25rem;
  /* Transparent bakgrund så materialet syns igenom */
  background: transparent;
  padding: 0;
  filter: drop-shadow(0 6px 14px rgba(15, 23, 42, 0.28));
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.sign-preview__qr:active {
  cursor: grabbing;
}

.sign-preview__qr[hidden] {
  display: none !important;
}

.qr-wrap {
  margin-top: 0.25rem;
}

.qr-controls {
  display: grid;
  gap: 0.5rem;
}

.qr-input-row {
  display: grid;
  gap: 0.25rem;
}

.qr-size-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.qr-size-row input[type='range'] {
  flex: 1;
  min-width: 140px;
  max-width: 280px;
}

.qr-size-label {
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
  color: #4b5563;
  min-width: 4.5rem;
}

.qr-color-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.qr-color-row input[type='color'] {
  width: 44px;
  height: 34px;
  padding: 0;
  border: 1px solid rgba(15, 23, 42, 0.18);
  border-radius: 0.5rem;
  background: #1a221f;
}

.qr-hint {
  margin: 0;
  font-size: 0.8rem;
}

.plakat-image-transform-wrap {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(15, 23, 42, 0.1);
}

.plakat-image-transform-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.35rem;
  flex-wrap: wrap;
}

.plakat-image-transform-row label {
  font-size: 0.85rem;
  color: #c5d0c8;
  min-width: 3.5rem;
}

.plakat-image-transform-row input[type='range'] {
  flex: 1;
  min-width: 120px;
  max-width: 220px;
}

.plakat-image-scale-label {
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
  color: #4b5563;
  min-width: 3rem;
}

.plakat-image-transform-hint {
  margin: 0.4rem 0 0;
  font-size: 0.8rem;
}

.plakat-image-transform-reset {
  margin-top: 0.5rem;
}

.sign-preview .hole {
  position: absolute;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(0, 0, 0, 0.5);
}

.sign-preview .hole--round {
  border-radius: 50%;
}

.sign-text {
  position: relative;
  z-index: 3;
  width: 100%;
  height: 100%;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.15em;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #e8eee9;
  word-break: break-word;
  cursor: text;
  transition: font-size 180ms ease;
}

.sign-text-box {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  max-width: calc(100% - 0.8rem);
  max-height: calc(100% - 0.8rem);
  display: flex;
  flex-direction: column;
  gap: 0.15em;
  justify-content: center;
  align-items: stretch;
  cursor: grab;
  touch-action: none;
}

.sign-text-box:active {
  cursor: grabbing;
}

.sign-text.sign-text--editing {
  outline: 2px solid rgba(59, 130, 246, 0.65);
  outline-offset: 4px;
  border-radius: 0.4rem;
}

.sign-text.sign-text--dragging {
  cursor: grabbing;
}

.sign-preview__guide {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 8;
  opacity: 0;
  transition: opacity 120ms ease;
}

.sign-preview__guide.is-on {
  opacity: 1;
}

.sign-preview__guide-line {
  position: absolute;
  background: rgba(48, 172, 104, 0.35);
  box-shadow: 0 0 0 1px rgba(48, 172, 104, 0.18);
}

.sign-preview__guide-line--v {
  width: 1px;
  top: 8px;
  bottom: 8px;
  left: 50%;
}

.sign-preview__guide-line--h {
  height: 1px;
  left: 8px;
  right: 8px;
  top: 50%;
}

.sign-text-line {
  width: 100%;
  flex-shrink: 0;
}

.text-lines-controls {
  display: grid;
  gap: 0.55rem;
  margin: 0.5rem 0 0.6rem;
  padding: 0.6rem 0.65rem;
  border: 1px solid #24302b;
  border-radius: 0.75rem;
  background: #161d1a;
}

.text-lines-controls__row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.35rem;
}

.text-lines-gap-label {
  font-size: 0.8rem;
  color: #8a9a90;
}

.text-lines-list {
  display: grid;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.text-line-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.45rem;
  align-items: center;
  padding: 0.55rem 0.6rem;
  border: 1px solid #24302b;
  border-radius: 0.75rem;
  background: #1a221f;
}

.text-line-item__input {
  width: 100%;
  padding: 0.5rem 0.6rem;
  border: 1px solid #354540;
  border-radius: 0.65rem;
  font-size: 0.95rem;
}

.text-line-item__right {
  display: grid;
  grid-auto-flow: column;
  gap: 0.35rem;
  align-items: center;
}

.text-line-item__btn {
  padding: 0.45rem 0.55rem;
  border-radius: 0.65rem;
  border: 1px solid #354540;
  background: #161d1a;
  cursor: pointer;
}

.text-line-item__btn:hover {
  background: #0e1311;
}

.btn-add-text-line {
  margin-top: 0.6rem;
}

.smart-layout {
  margin-top: 0.65rem;
  padding: 0.6rem 0.65rem;
  border: 1px solid #24302b;
  border-radius: 0.85rem;
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.95), rgba(241, 245, 249, 0.95));
}

.smart-layout__row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.smart-layout__btn {
  white-space: nowrap;
  transition: background var(--st-transition-fast), border-color var(--st-transition-fast), box-shadow var(--st-transition-fast);
}

.smart-layout .btn:hover:not(:disabled) {
  background: #121916;
  border-color: #354540;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.06);
}

.smart-layout__hint {
  font-size: 0.8rem;
  color: #8a9a90;
}

.smart-layout__list {
  margin-top: 0.6rem;
  display: grid;
  gap: 0.55rem;
}

.smart-layout-card {
  border: 1px solid #24302b;
  border-radius: 0.85rem;
  background: #1a221f;
  padding: 0.65rem 0.7rem;
  box-shadow: 0 10px 18px rgba(15, 23, 42, 0.06);
  transition: border-color var(--st-transition-fast), box-shadow var(--st-transition-fast);
}

.smart-layout-card:hover {
  border-color: #354540;
  box-shadow: 0 12px 22px rgba(15, 23, 42, 0.08);
}

.smart-layout-card__title {
  font-weight: 900;
  color: #e8eee9;
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  align-items: baseline;
}

.smart-layout-card__meta {
  font-size: 0.75rem;
  color: #8a9a90;
  font-weight: 600;
}

.smart-layout-card__preview {
  margin-top: 0.35rem;
  font-size: 0.85rem;
  color: #e8eee9;
  line-height: 1.35;
  background: #161d1a;
  border: 1px solid #1c2622;
  border-radius: 0.65rem;
  padding: 0.5rem 0.55rem;
}

.smart-layout-card__actions {
  margin-top: 0.55rem;
  display: flex;
  gap: 0.5rem;
}

.smart-layout-card__apply {
  flex: 1 1 auto;
}

.template-panel {
  margin-top: 0.85rem;
  padding: 0.75rem 0.8rem;
  border: 1px solid #24302b;
  border-radius: 0.95rem;
  background: #1a221f;
  box-shadow: 0 10px 18px rgba(15, 23, 42, 0.06);
}

.template-panel__title {
  font-weight: 900;
  color: #e8eee9;
  margin-bottom: 0.55rem;
}

.template-panel__row {
  display: grid;
  grid-template-columns: 7.5rem 1fr auto;
  gap: 0.55rem;
  align-items: center;
  margin-top: 0.45rem;
}

.template-panel__label {
  font-size: 0.8rem;
  color: #8a9a90;
}

.template-panel__select,
.template-panel__input {
  width: 100%;
  padding: 0.45rem 0.55rem;
  border-radius: 0.7rem;
  border: 1px solid #24302b;
  font-size: 0.9rem;
  background: #1a221f;
  transition: border-color var(--st-transition-fast), box-shadow var(--st-transition-fast), background var(--st-transition-fast);
}

.template-panel__select:hover:not(:focus),
.template-panel__input:hover:not(:focus) {
  border-color: #354540;
  background: #fafbfc;
}

.template-panel .btn {
  transition: background var(--st-transition-fast), border-color var(--st-transition-fast), box-shadow var(--st-transition-fast), color var(--st-transition-fast);
  cursor: pointer;
}

.template-panel .btn:hover:not(:disabled) {
  background: #121916;
  border-color: #354540;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.06);
}

.template-panel__btn--danger:hover:not(:disabled) {
  background: rgba(220, 38, 38, 0.12);
  border-color: rgba(220, 38, 38, 0.45);
}

.template-panel__hint {
  margin-top: 0.55rem;
  font-size: 0.8rem;
  color: #8a9a90;
}

.template-panel__hint-inline {
  font-size: 0.8rem;
  color: #8a9a90;
}

.template-panel__btn--danger {
  border-color: rgba(220, 38, 38, 0.35);
  color: #b91c1c;
  background: rgba(220, 38, 38, 0.06);
}

.template-panel__btn--danger:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

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

.sign-text-editor {
  position: absolute;
  z-index: 9;
  border: 1px solid rgba(59, 130, 246, 0.6);
  background: rgba(255, 255, 255, 0.22);
  color: inherit;
  padding: 0;
  margin: 0;
  border-radius: 0.25rem;
  outline: none;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.12);
  backdrop-filter: blur(6px);
}

.sign-text-editor:focus {
  border-color: rgba(48, 172, 104, 0.9);
  box-shadow: 0 0 0 3px rgba(48, 172, 104, 0.22), 0 10px 26px rgba(15, 23, 42, 0.14);
}

.add-line-btn {
  margin-top: 0.5rem;
  padding: 0;
  border: none;
  background: none;
  font-size: 0.85rem;
  color: #30ac68;
  cursor: pointer;
  text-decoration: underline;
}

.add-line-btn:hover {
  color: #269656;
}

.help {
  font-size: 0.78rem;
  color: #6b7a70;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.purchase-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0.9rem;
  padding: 0.9rem 0.95rem;
  border-radius: 0.9rem;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(248, 250, 252, 0.92));
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.06);
}

/* Wizard: köp-CTA syns endast i steg 4 */
body[data-step="1"] .purchase-cta,
body[data-step="2"] .purchase-cta,
body[data-step="3"] .purchase-cta {
  display: none !important;
}

.purchase-cta__left {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.purchase-cta__actions {
  display: flex;
  gap: 0.55rem;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.btn-export {
  border-color: rgba(48, 172, 104, 0.28);
  background: #1a221f;
  color: #269656;
  font-weight: 750;
}

.btn-export:hover {
  border-color: rgba(48, 172, 104, 0.55);
  box-shadow: 0 0 0 1px rgba(48, 172, 104, 0.18);
}

.purchase-cta__qty {
  display: grid;
  gap: 0.25rem;
  font-size: 0.8rem;
  color: #8a9a90;
}

.purchase-cta__qty input {
  width: 92px;
  padding: 0.45rem 0.55rem;
  border: 1px solid #354540;
  border-radius: 0.65rem;
  background: #1a221f;
  color: #e8eee9;
  font-weight: 650;
  transition: border-color var(--st-transition-fast), box-shadow var(--st-transition-fast), background var(--st-transition-fast);
}

.purchase-cta__qty input:hover:not(:focus) {
  border-color: #b8c5d4;
  background: #fafbfc;
}

.purchase-cta__qty input:focus {
  outline: none;
  border-color: #30ac68;
  box-shadow: 0 0 0 2px rgba(48, 172, 104, 0.15);
}

.purchase-cta__price-label {
  font-size: 0.8rem;
  color: #8a9a90;
}

.purchase-cta__price-value {
  font-size: 1.15rem;
  font-weight: 750;
  letter-spacing: -0.02em;
  color: #e8eee9;
}

.purchase-cta__price-sub {
  font-size: 0.78rem;
  color: #8a9a90;
}

.btn-add-to-cart {
  padding: 0.7rem 1.05rem;
  font-size: 0.95rem;
  font-weight: 750;
  border-radius: 0.8rem;
  box-shadow: 0 12px 28px rgba(48, 172, 104, 0.22);
  transition: background var(--st-transition-fast), border-color var(--st-transition-fast), box-shadow var(--st-transition-fast), filter var(--st-transition-fast), transform 0.12s ease;
}

.btn.btn-primary {
  background: #30ac68;
  color: #1a221f;
  border: 1px solid #269656;
  cursor: pointer;
}

.btn.btn-primary:hover:not(:disabled) {
  background: #269656;
  border-color: #1f7a4a;
  filter: brightness(1.04);
  box-shadow: 0 14px 32px rgba(48, 172, 104, 0.3);
}

.btn.btn-primary:active:not(:disabled) {
  transform: scale(0.99);
  filter: brightness(0.98);
}

.btn-add-to-cart:focus-visible {
  outline: 3px solid rgba(48, 172, 104, 0.35);
  outline-offset: 3px;
}

@media (max-width: 520px) {
  .purchase-cta {
    flex-direction: column;
    align-items: stretch;
  }
  .btn-add-to-cart {
    width: 100%;
  }
  .purchase-cta__actions {
    width: 100%;
  }
  .btn-export {
    width: 100%;
  }
}

.cart-wrap {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-top: 1rem;
}

.cart-list {
  display: grid;
  gap: 0.6rem;
}

.cart-item {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "title price"
    "meta  remove";
  gap: 0.25rem 0.75rem;
  padding: 0.9rem;
  border: 1px solid #24302b;
  border-radius: 0.9rem;
  background: #1a221f;
}

.cart-item__title { grid-area: title; font-weight: 700; color: #e8eee9; }
.cart-item__meta { grid-area: meta; color: #8a9a90; font-size: 0.9rem; }
.cart-item__price { grid-area: price; font-weight: 800; color: #e8eee9; }
.cart-item__remove { grid-area: remove; justify-self: end; }

.cart-summary {
  padding: 1rem;
  border: 1px solid #24302b;
  border-radius: 1rem;
  background: #1a221f;
}

.cart-total-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 1.05rem;
}

.cart-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.75rem;
  align-items: center;
}

@media (min-width: 920px) {
  .cart-wrap {
    grid-template-columns: 1.2fr 0.8fr;
    align-items: start;
  }
}

.pill {
  border-radius: 999px;
  border: 1px solid rgba(48, 172, 104, 0.35);
  padding: 0.3rem 0.7rem;
  font-size: 0.82rem;
  color: #30ac68;
  background: rgba(48, 172, 104, 0.14);
}

.pill strong {
  color: #30ac68;
}

/* ========== Skyltark A4 ========== */
.sheet-a4-wrap {
  margin-top: 0;
}

.sheet-a4-settings-title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 1rem;
  color: #e8eee9;
}

.sheet-a4-settings .form-row--full {
  margin-bottom: var(--st-space-1);
}

.sheet-a4-settings-block {
  margin-bottom: var(--st-space-3);
  padding-bottom: var(--st-space-3);
  border-bottom: var(--st-border-divider);
}

.sheet-a4-settings-block:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.btn-apply-sheet {
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: #1a221f;
  background: #30ac68;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
}

.btn-apply-sheet:hover {
  background: #269656;
}

.sheet-a4-preview-wrap {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-height: 0;
  flex: 1 1 auto;
  overflow: auto;
  overflow-x: hidden;
}

.sheet-a4-preview-header {
  font-size: 0.9rem;
  font-weight: 600;
  color: #e8eee9;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.sheet-a4-header-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.sheet-a4-zoom-controls,
.single-sign-zoom-controls {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.sheet-zoom-btn {
  width: 2rem;
  height: 2rem;
  padding: 0;
  font-size: 1.25rem;
  line-height: 1;
  font-weight: 600;
  border: 1px solid #354540;
  border-radius: 0.375rem;
  background: #1a221f;
  color: #c5d0c8;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--st-transition-fast), border-color var(--st-transition-fast), color var(--st-transition-fast), box-shadow var(--st-transition-fast);
}

.sheet-zoom-btn:hover:not(:disabled) {
  background: #0e1311;
  border-color: #6b7a70;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.07);
}

.sheet-zoom-btn:active {
  background: #24302b;
}

.sheet-zoom-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.sheet-zoom-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: #8a9a90;
  min-width: 2.5rem;
  text-align: center;
}

.sheet-a4-canvas-zoom-wrap {
  overflow: auto;
  display: flex;
  justify-content: center;
  /* flex-start: hela A4-arkets överkant når scrollposition 0 (center klippte toppen). */
  align-items: flex-start;
  flex: 1 1 auto;
  min-height: min(60vh, 640px);
  padding: var(--st-space-3);
  padding-bottom: var(--st-space-4);
  border-radius: 8px;
  background-color: #eef2f6;
  background-image:
    linear-gradient(rgba(15, 23, 42, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 23, 42, 0.04) 1px, transparent 1px);
  background-size: 16px 16px;
  -webkit-overflow-scrolling: touch;
}

.sheet-a4-preview-meta {
  font-size: 0.8rem;
  font-weight: 500;
  color: #8a9a90;
}

.sheet-a4-price-pill {
  font-size: 0.85rem;
  color: #30ac68;
  background: rgba(48, 172, 104, 0.14);
  border: 1px solid rgba(48, 172, 104, 0.35);
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
}

.sheet-a4-price-pill strong {
  color: #30ac68;
}

/* Ark A4 stående (porträtt): bredd bestämmer höjd så att höjd > bredd */
.sheet-a4-canvas {
  flex: 0 0 auto;
  width: 100%;
  max-width: min(96vw, 540px);
  height: auto;
  aspect-ratio: 210 / 297;
  background: #24302b;
  border-radius: 0.5rem;
  padding: 8px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.1);
  position: relative;
  transition: transform 0.15s ease, background-color 0.2s ease;
  margin: 0 auto;
  transform-origin: top center;
}

.sheet-a4-sheet {
  position: absolute;
  left: 8px;
  top: 8px;
  right: 8px;
  bottom: 8px;
  border-radius: 4px;
  /* Klipper skyltar så inget hamnar utanför det vita arket (marginaler räknas inuti) */
  overflow: hidden;
  background: #1a221f;
  border: 1px solid rgba(0, 0, 0, 0.18);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08);
}

/* Pärmhål A4: 4 st i två lodräta par, 30 mm mellan hål i varje par, nära vänsterkant – inte skyltarnas kabelhål */
.sheet-a4-paper-holes {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.45;
}

.sheet-a4-hole {
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 1px;
  background: #1a1a1a;
  transform: translate(-50%, -50%);
  box-sizing: border-box;
}

/*
 * Marginaler inuti det vita arket, proportionellt mot A4 (210×297 mm).
 * Undvik CSS mm här – de skalas inte med förhandsbilden och gör att skyltar hamnar utanför.
 */
.sheet-a4-signs-container {
  position: absolute;
  left: calc(100% * 5 / 210);
  right: calc(100% * 2 / 210);
  top: calc(100% * 2 / 297);
  bottom: calc(100% * 2 / 297);
  border-radius: inherit;
  overflow: hidden;
  z-index: 1;
}

.sheet-sign-item {
  position: absolute;
  box-sizing: border-box;
  border: 1px solid #000000;
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  padding: 0;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08);
  min-width: 0;
  min-height: 0;
  container-type: size;
  container-name: sign;
  text-align: center;
  cursor: pointer;
}

/* Hål under texten i z-ordning; text begränsas till mittzon via .sheet-sign-body */
.sheet-sign-holes {
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  z-index: 0;
}

.sheet-sign-body {
  position: relative;
  z-index: 1;
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  pointer-events: none;
}

/* Text fyller innehållsytan efter padding; hål ligger under (z-index), ingen max-width som klipper */

.sheet-sign-hole {
  position: absolute;
  background: #2d2d2d;
  border: 1px solid #000;
  box-sizing: border-box;
}

/*
 * Hål: alltid samma px-storlek i förhandsvisning (skalar inte med skyltstorlek).
 * Fyrkantiga / rektangulära med liten radius – aldrig cirklar eller ovala piller.
 */
.sheet-sign-hole--round {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.sheet-sign-hole--rect {
  width: 6px;
  height: 3px;
  border-radius: 1px;
  transform: translate(-50%, -50%);
}

.sheet-sign-hole--kabel {
  width: 8px;
  height: 3px;
  border-radius: 1px;
  transform: translate(-50%, -50%);
}

.sheet-sign-item--animate {
  animation: sheet-sign-appear 0.35s ease-out;
}

@keyframes sheet-sign-appear {
  from {
    opacity: 0;
    transform: scale(0.92);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.sheet-sign-size {
  font-size: clamp(6px, 1.8vw, 10px);
  font-weight: 700;
  color: #000000;
  line-height: 1.2;
  flex-shrink: 0;
}

/* Text i skylt: en rad; intrinsic bredd upp till 100 % av ytan (skyltens mm-bredd styr containern) */
.sheet-sign-text {
  color: #e8eee9;
  font-size: clamp(5px, 2.5vmin, 20px);
  line-height: 1.08;
  text-align: center;
  max-width: 100%;
  width: max-content;
  max-inline-size: 100%;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  display: block;
  white-space: nowrap;
  text-overflow: clip;
  flex: 0 1 auto;
  align-self: center;
  max-height: 100%;
  box-sizing: border-box;
  position: relative;
}

@container sign (min-width: 1px) {
  .sheet-sign-text {
    font-size: clamp(4px, 7cqmin, 24px);
  }
}

/* Formulär: lista med skyltrader */
.sheet-signs-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.sheet-sign-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.4rem;
  align-items: center;
  padding: 0.2rem 0;
  cursor: pointer;
  border-bottom: 1px solid rgba(226, 232, 240, 0.9);
}

.sheet-sign-row:hover {
  background: rgba(0, 0, 0, 0.04);
}

.sheet-sign-row--active {
  padding: 0.35rem;
  border-radius: 0.6rem;
  background: rgba(48, 172, 104, 0.12);
  border: 1px solid rgba(48, 172, 104, 0.35);
}

.sheet-sign-row--selected .sheet-sign-row__base {
  box-shadow: inset 0 0 0 2px rgba(48, 172, 104, 0.25);
  border-radius: 0.55rem;
}

.sheet-sign-row__base {
  display: grid;
  grid-template-columns: auto auto 1fr auto auto auto;
  gap: 0.4rem;
  align-items: center;
}

.sheet-sign-row__select input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
}

.sheet-sign-row__drag {
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 0.5rem;
  border: 1px solid #24302b;
  background: #1a221f;
  color: #8a9a90;
  font-weight: 800;
  cursor: grab;
  transition: background var(--st-transition-fast), border-color var(--st-transition-fast), color var(--st-transition-fast), box-shadow var(--st-transition-fast);
}

.sheet-sign-row__drag:hover {
  background: #121916;
  border-color: #354540;
  color: #a8b8ae;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.06);
}

.sheet-sign-row__drag:active {
  cursor: grabbing;
}

.sheet-sign-row--dragover {
  outline: 2px solid rgba(48, 172, 104, 0.35);
  outline-offset: 2px;
}

.sheet-sign-row--dragging {
  opacity: 0.6;
}

.sheet-sign-row__advanced {
  margin-top: 0.35rem;
  padding: 0.6rem;
  border-radius: 0.55rem;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(226, 232, 240, 0.9);
  transition: max-height 0.18s ease, opacity 0.18s ease;
}

.sheet-sign-advanced-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  align-items: end;
}

.sheet-sign-advanced-field {
  display: grid;
  gap: 0.25rem;
}

.sheet-sign-advanced-field__label {
  font-size: 0.72rem;
  font-weight: 600;
  color: #9aaba0;
}

.sheet-sign-align-buttons {
  display: inline-flex;
  gap: 0.35rem;
}

.sheet-sign-align-btn {
  height: 2.1rem;
  min-width: 2.4rem;
  border-radius: 0.55rem;
  border: 1px solid #24302b;
  background: #1a221f;
  color: #a8b8ae;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--st-transition-fast), border-color var(--st-transition-fast), color var(--st-transition-fast), box-shadow var(--st-transition-fast);
}

.sheet-sign-align-btn:hover:not(.sheet-sign-align-btn--active) {
  background: #161d1a;
  border-color: #354540;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
}

.sheet-sign-align-btn--active {
  border-color: #30ac68;
  background: rgba(48, 172, 104, 0.12);
  color: #269656;
}

.sheet-sign-align-btn--active:hover {
  background: rgba(48, 172, 104, 0.14);
  border-color: #269656;
}

.sheet-sign-advanced-actions {
  margin-top: 0.6rem;
  display: flex;
  justify-content: flex-end;
}

.sheet-sign-row input[type="text"],
.sheet-sign-row .sheet-sign-text-input {
  min-width: 0;
  padding: 0.35rem 0.45rem;
  font-size: 0.85rem;
  border-radius: 0.35rem;
  border: 1px solid #354540;
}

.sheet-sign-row input[type="number"] {
  width: 3.5rem;
  padding: 0.35rem 0.4rem;
  font-size: 0.85rem;
}

.sheet-sign-row select {
  width: auto;
  min-width: 7rem;
  padding: 0.35rem 0.4rem;
  font-size: 0.8rem;
}

.btn-add-sign {
  padding: 0.45rem 0.9rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: #1a221f;
  background: #30ac68;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
}

.btn-add-sign:hover {
  background: #269656;
}

.btn-remove-sign {
  padding: 0.25rem 0.5rem;
  font-size: 0.8rem;
  color: #8a9a90;
  background: #0e1311;
  border: 1px solid #24302b;
  border-radius: 0.375rem;
  cursor: pointer;
}

.btn-remove-sign:hover {
  background: #24302b;
  color: #e8eee9;
}

.sheet-default-size .dimension-inputs input {
  width: 4rem;
}

.sheet-import-modal[hidden] {
  display: none;
}

.sheet-import-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
}

.sheet-import-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(17, 24, 39, 0.45);
}

.sheet-import-modal__dialog {
  position: relative;
  max-width: 760px;
  margin: 6vh auto 0;
  max-height: 88vh;
  background: #1a221f;
  border-radius: 0.75rem;
  box-shadow: 0 24px 56px rgba(15, 23, 42, 0.3);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sheet-import-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid #24302b;
}

.sheet-import-modal__header h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
}

.sheet-import-modal__close {
  border: 1px solid #354540;
  background: #1a221f;
  color: #c5d0c8;
  border-radius: 0.45rem;
  width: 2rem;
  height: 2rem;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.sheet-import-modal__close:hover {
  background: #0e1311;
}

.sheet-import-list {
  overflow: auto;
  padding: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.sheet-import-item {
  border: 1px solid #24302b;
  border-radius: 0.6rem;
  padding: 0.7rem 0.8rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.sheet-import-item__meta {
  min-width: 0;
}

.sheet-import-item__title {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: #e8eee9;
}

.sheet-import-item__sub {
  margin: 0.2rem 0 0;
  font-size: 0.8rem;
  color: #8a9a90;
}

.sheet-import-item__btn {
  border: none;
  background: #30ac68;
  color: #1a221f;
  border-radius: 0.45rem;
  padding: 0.4rem 0.75rem;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}

.sheet-import-item__btn:hover {
  background: #269656;
}


/* ===== Physical previews stay light (paper / signs) ===== */
.design-canvas__a4,
.design-canvas__a4-inner,
.design-canvas__a4-sheet-stage,
.design-canvas__sign,
.design-canvas__freeform,
.canvas__card,
.canvas__cell,
.canvas__a4,
.mob-a4-page__sheet,
.mob-a4-page__sign,
.mob-mini-preview__sign,
.saved-sign-thumb,
.saved-sign-preview,
.account-sign-preview,
.sign-preview-card {
  /* keep product/paper readable */
}

.design-canvas__a4-inner,
.design-canvas__a4-sheet-stage,
.canvas__a4,
.mob-a4-page__sheet {
  background: #ffffff !important;
  color: #111827;
  border-color: rgba(15, 23, 42, 0.22) !important;
  box-shadow: 0 1px #fff inset, 0 2px 6px rgba(0,0,0,0.2) !important;
}

.design-canvas__a4 {
  background: linear-gradient(145deg, #1c2622, #141a18) !important;
  border-color: rgba(48, 172, 104, 0.2) !important;
}

.design-canvas__sign,
.canvas__card,
.canvas__cell,
.mob-a4-page__sign,
.mob-mini-preview__sign {
  background: #ffffff !important;
}

.design-canvas__sign:after {
  border-color: #1f2937 !important;
}

.design-canvas__a4-margin-guides:before,
.mob-a4-page__guides::before {
  border-color: rgba(48, 172, 104, 0.35) !important;
}

.design-canvas__sign--selected,
.design-canvas__sign:focus-visible {
  box-shadow: 0 0 0 3px #30ac68, 0 4px 14px rgba(0,0,0,0.35) !important;
}

.sign-renderer__qr-grid {
  background: repeating-conic-gradient(#111827, #111827 25%, #f8fafc 0%, #f8fafc 50%) 50% / 20% 20% !important;
}
