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

:root {
  --bg: #eaebf0;
  --panel: #ffffff;
  --line: #d7dce4;
  --line-2: #c8d0db;
  --text: #203244;
  --muted: #6f7f8f;
  --title: #2e628f;
  --blue: #0c6fc9;
  --blue-dark: #0a4f9a;
  --blue-soft: #e6f2ff;
  --radius: 6px;
  --shadow: 0 2px 8px rgba(32, 50, 68, 0.08);
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Source Sans 3', 'Merriweather Sans', sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, #eef0f5 0%, #e8ebf1 100%);
}

.w2p-page {
  max-width: 1280px;
  margin: 0 auto;
  padding: 28px 18px 32px;
}

.layout-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 26px 24px;
}

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

.section-title {
  margin: 0 0 12px;
  font-size: 38px;
  line-height: 1;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--title);
}

.box {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.product-box,
.templates-box,
.cart-box {
  min-height: 280px;
}

.product-box {
  display: grid;
  grid-template-columns: 1fr 190px;
}

.product-main {
  padding: 22px;
  border-right: 1px solid var(--line);
}

.product-main h3,
.cart-main h3 {
  margin: 0 0 14px;
  font-size: 34px;
}

.product-features {
  margin: 0;
  padding: 0;
  list-style: none;
  color: #415363;
  font-size: 26px;
  line-height: 1.5;
}

.product-features li::before {
  content: '\2713';
  color: #4b6377;
  margin-right: 8px;
}

.product-card-preview {
  width: 220px;
  height: 140px;
  margin-top: 18px;
  border: 1px solid var(--line);
  background: linear-gradient(160deg, #fefefe 0%, #d9dee7 100%);
  box-shadow: 0 8px 20px rgba(10, 28, 49, 0.18);
  transform: perspective(500px) rotateX(16deg) rotateZ(-10deg);
}

.product-meta {
  padding: 18px;
}

.meta-label {
  display: block;
  font-size: 23px;
  font-weight: 700;
  margin-bottom: 8px;
}

.qty-select {
  width: 100%;
  border: 1px solid var(--line-2);
  border-radius: 4px;
  padding: 10px 12px;
  font-size: 24px;
  color: var(--text);
  background: #fff;
}

.meta-price,
.meta-time,
.meta-note {
  margin: 14px 0 0;
  font-size: 24px;
  color: #44586d;
}

.meta-price strong {
  font-size: 40px;
  color: #1d2f42;
}

.meta-link {
  display: inline-block;
  margin-top: 10px;
  color: var(--title);
  font-size: 24px;
  text-decoration: underline;
}

.cta-btn {
  width: 100%;
  margin-top: 16px;
  border: 1px solid #0a5ca7;
  border-radius: 4px;
  background: linear-gradient(180deg, #1084ea 0%, #0d63bc 100%);
  color: #fff;
  font-weight: 700;
  font-size: 30px;
  padding: 11px 12px;
  cursor: pointer;
}

.cta-btn:hover {
  background: linear-gradient(180deg, #0e74d0 0%, #0b569f 100%);
}

.templates-box {
  display: grid;
  grid-template-columns: 1fr 175px;
}

.templates-box > div {
  padding: 16px;
}

.template-toolbar {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}

.temp-pill {
  border: 1px solid var(--line-2);
  background: #f8f9fc;
  color: #3f556a;
  padding: 7px 12px;
  font-size: 20px;
  border-radius: 3px;
}

.temp-pill.active {
  background: #f0f6ff;
  border-color: #9ac3ea;
  color: #1f5c90;
}

.orientation-row {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.format-btn {
  border: 1px solid var(--line-2);
  background: #fff;
  padding: 7px 12px;
  font-size: 21px;
  border-radius: 4px;
  cursor: pointer;
}

.format-btn.active {
  border-color: #6ea7dd;
  background: var(--blue-soft);
  color: #18558a;
  font-weight: 700;
}

.layout-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(110px, 1fr));
  gap: 9px;
}

.layout-card {
  position: relative;
  min-height: 90px;
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
  border-radius: 3px;
}

.layout-card:hover,
.layout-card.active {
  border-color: #73abdc;
  box-shadow: inset 0 0 0 2px #dbeeff;
}

.layout-card--hoch {
  min-height: 120px;
}

.layout-card__thumb {
  display: block;
  width: calc(100% - 10px);
  margin: 5px;
  border: 1px solid #d4dde8;
  border-radius: 2px;
  object-fit: cover;
  background: #f2f6fb;
}

.layout-card--quer .layout-card__thumb {
  aspect-ratio: 85 / 55;
}

.layout-card--hoch .layout-card__thumb {
  aspect-ratio: 55 / 85;
}

.lc-line {
  position: absolute;
  height: 2px;
  background: #8ca2b6;
}

.lc-line--long {
  width: 42px;
}

.lc-line--medium {
  width: 30px;
}

.lc-line--short {
  width: 20px;
}

.lc-logo {
  position: absolute;
  width: 14px;
  height: 12px;
  background: #8ba8c0;
}

.layout-card__name {
  position: absolute;
  left: 6px;
  right: 6px;
  bottom: 4px;
  font-size: 15px;
  color: #49627a;
}

.format-meta {
  border-left: 1px solid var(--line);
  padding: 18px 14px;
}

.format-meta h4 {
  margin: 0 0 3px;
  font-size: 25px;
}

.format-meta p {
  margin: 0 0 10px;
  color: #495f74;
  font-size: 23px;
}

.designer-box {
  padding: 0;
  overflow: hidden;
}

.designer-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border-bottom: 1px solid var(--line);
  background: #f8fafd;
}

.side-tab,
.tool-btn {
  border: 1px solid #9fb8d0;
  border-radius: 3px;
  background: #fff;
  color: #335474;
  font-weight: 600;
  font-size: 19px;
  padding: 7px 11px;
  cursor: pointer;
}

.side-tab.active,
.tool-btn {
  background: linear-gradient(180deg, #1986e8 0%, #0f63bb 100%);
  color: #fff;
  border-color: #0f63bb;
}

.tool-btn.dark {
  background: linear-gradient(180deg, #355b87 0%, #234265 100%);
  border-color: #234265;
}

.tool-btn-outline {
  background: #f8fbff;
  color: #1b588f;
  border-color: #9dc0df;
}

.designer-content {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 550px;
}

.designer-controls {
  border-right: 1px solid var(--line);
  background: #f5f7fb;
  padding: 10px;
  overflow: visible;
  max-height: none;
}

.preview-shell {
  display: flex;
  flex-direction: column;
  background: #fff;
}

.preview-topbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  background: #f9fbff;
}

.preview-topbar-title {
  font-size: 22px;
  font-weight: 700;
  color: #365f85;
}

.tag {
  border: 1px solid #c6d8eb;
  background: #edf5ff;
  border-radius: 999px;
  font-size: 16px;
  padding: 4px 9px;
}

.tag-side {
  margin-left: auto;
}

.preview-warning {
  border: 1px solid #f2b4b4;
  background: #fff1f1;
  color: #b72b2b;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1;
  padding: 4px 8px;
}

.preview-toggle-btn {
  border-color: #c3811f !important;
  background: linear-gradient(180deg, #f7a329 0%, #e28500 100%) !important;
  color: #ffffff !important;
  font-size: 12px !important;
  line-height: 1 !important;
  padding: 5px 10px !important;
  font-weight: 800 !important;
}

.preview-toggle-btn.is-off {
  background: linear-gradient(180deg, #667a91 0%, #46596f 100%) !important;
  border-color: #46596f !important;
}

.preview-area {
  flex: 1;
  min-height: 450px;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    linear-gradient(45deg, #d7dce4 25%, transparent 25%),
    linear-gradient(-45deg, #d7dce4 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #d7dce4 75%),
    linear-gradient(-45deg, transparent 75%, #d7dce4 75%);
  background-size: 14px 14px;
  background-position: 0 0, 0 7px, 7px -7px, -7px 0;
  background-color: #edf0f5;
  overflow: auto;
  padding: 14px;
}

.canvas-stage {
  position: relative;
  padding-top: 24px;
  padding-left: 24px;
}

.canvas-wrap {
  position: relative;
}

.ruler-corner {
  position: absolute;
  left: 0;
  top: 0;
  width: 24px;
  height: 24px;
  border: 1px solid #c6d3e1;
  background: #eef3f9;
  z-index: 9;
}

.ruler {
  position: absolute;
  border: 1px solid #c6d3e1;
  background:
    linear-gradient(90deg, rgba(77, 108, 136, 0.18) 1px, transparent 1px),
    linear-gradient(180deg, rgba(77, 108, 136, 0.18) 1px, transparent 1px),
    #eef3f9;
  z-index: 8;
  cursor: crosshair;
}

.ruler-top {
  left: 24px;
  top: 0;
  height: 24px;
}

.ruler-left {
  left: 0;
  top: 24px;
  width: 24px;
}

.ruler-mark {
  position: absolute;
  color: #5d7690;
  font-size: 9px;
  user-select: none;
  pointer-events: none;
}

.guide-layer {
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
}

.guide-readout {
  position: absolute;
  z-index: 12;
  pointer-events: none;
  border: 1px solid #8fb2d7;
  background: #f4f9ff;
  color: #234b74;
  border-radius: 4px;
  font-size: 11px;
  line-height: 1;
  padding: 4px 6px;
  box-shadow: 0 4px 10px rgba(25, 46, 69, 0.18);
}

.guide-line {
  position: absolute;
  background: rgba(18, 121, 230, 0.8);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.45);
  pointer-events: auto;
  cursor: move;
}

.guide-line.v {
  top: 0;
  bottom: 0;
  width: 1px;
}

.guide-line.h {
  left: 0;
  right: 0;
  height: 1px;
}

.snap-toggle {
  padding: 4px 8px !important;
  font-size: 12px !important;
  line-height: 1 !important;
}

.snap-toggle.is-on {
  background: linear-gradient(180deg, #1a87e9 0%, #0f62bb 100%);
  color: #fff;
  border-color: #0f62bb;
}

.preview-foot {
  font-size: 16px;
  color: #5f7488;
  text-align: center;
  padding: 9px;
  border-top: 1px solid var(--line);
}

.card-canvas {
  position: relative;
  background: #fff;
  border: 1px solid rgba(195, 82, 82, 0.9);
  box-shadow: 0 12px 28px rgba(30, 50, 70, 0.25);
  overflow: hidden;
  --guide-safe: 22px;
}

.card-canvas::before,
.card-canvas::after {
  content: '';
  position: absolute;
  pointer-events: none;
  z-index: 4;
}

.card-canvas::before {
  display: none;
}

.card-canvas::after {
  inset: var(--guide-safe);
  border: 1px dashed rgba(96, 135, 169, 0.55);
}

.card-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
}

.card-logo {
  position: absolute;
  cursor: move;
  user-select: none;
  -webkit-user-drag: none;
}

.card-logo-placeholder {
  position: absolute;
  width: 24mm;
  height: 12mm;
  border: 1px dashed rgba(43, 108, 163, 0.8);
  background:
    linear-gradient(135deg, rgba(152, 188, 220, 0.22), rgba(98, 147, 187, 0.28)),
    #f4f9ff;
  color: #2c5f8f;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  cursor: pointer;
  z-index: 7;
}

.drag-block {
  position: absolute;
  box-sizing: border-box;
  cursor: move;
  white-space: normal;
  user-select: text;
  -webkit-user-select: text;
  border: 1px dashed transparent;
  border-radius: 2px;
  padding: 1px 2px;
  z-index: 7;
}

.drag-block.dragging {
  opacity: 0.7;
  user-select: none;
  -webkit-user-select: none;
}

.resize-handle {
  position: absolute;
  right: -5px;
  bottom: -5px;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  background: var(--blue);
  opacity: 0;
}

.drag-block:hover .resize-handle {
  opacity: 0.85;
}

.drag-block.selected {
  border-color: #2b74b7;
  box-shadow: 0 0 0 1px rgba(43, 116, 183, 0.18);
}

.drag-block .line-placeholder {
  color: rgba(50, 67, 84, 0.58);
  font-style: italic;
}

.drag-block .line-edit {
  display: block;
  box-sizing: border-box;
  width: 100%;
  cursor: text;
  user-select: text;
  -webkit-user-select: text;
  min-height: 1em;
  outline: none;
}

.drag-block.align-justify .line-edit {
  text-align: justify;
  text-align-last: justify;
}

.drag-block.align-justify .line-edit::after {
  content: "";
  display: inline-block;
  width: 100%;
}

.drag-block .line-edit:focus {
  outline: 1px dashed rgba(33, 122, 204, 0.55);
  outline-offset: 1px;
}

.drag-block .line-edit.line-placeholder {
  cursor: text;
}

.template-admin-mode .bcard[id^="blockSection"],
.template-admin-mode .drag-block[id^="dragBlock"] {
  display: none !important;
}

.designer-box.has-active-free-field .bcard[id^="blockSection"] {
  display: none;
}

.designer-box.has-free-fields .bcard[id^="blockSection"],
.designer-box.has-free-fields .stb-block-tabs {
  display: none;
}

.free-field-editor .stb-font-sel {
  width: 100%;
  height: 36px;
}

.free-field-editor .btn-del {
  margin-top: 8px;
}

.free-field {
  position: absolute;
  box-sizing: border-box;
  z-index: 9;
  border: 1px dashed transparent;
  background: transparent;
  cursor: move;
  overflow: hidden;
  min-width: 18px;
  min-height: 14px;
}

.free-field:hover {
  border-color: rgba(43, 116, 183, 0.45);
}

.free-field.selected {
  border-color: #0f62bb;
  box-shadow: 0 0 0 2px rgba(33, 122, 204, 0.18);
}

.free-field.is-position-locked {
  cursor: default;
}

.free-field.is-size-locked .resize-handle {
  display: none;
}

.free-field.is-required::after {
  content: "Pflicht";
  position: absolute;
  right: 2px;
  top: 2px;
  padding: 1px 4px;
  border-radius: 3px;
  background: rgba(180, 83, 9, 0.9);
  color: #fff;
  font-size: 9px;
  line-height: 1.2;
  pointer-events: none;
}

.free-field-text {
  padding: 2px 3px;
  white-space: pre-wrap;
  text-align: inherit;
}

.free-field-text [contenteditable] {
  display: block;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  outline: none;
  min-height: 1em;
  cursor: text;
  user-select: text;
  -webkit-user-select: text;
  white-space: pre-wrap;
  overflow-wrap: break-word;
}

.free-field-text.align-justify [contenteditable] {
  text-align: justify;
  text-align-last: justify;
}

.free-field-textbox div,
.free-field-textbox p {
  margin: 0;
}

.free-field-text.align-justify [contenteditable]::after {
  content: "";
  display: inline-block;
  width: 100%;
}

.free-field-image {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #2c5f8f;
  font-size: 12px;
  font-weight: 700;
  background:
    linear-gradient(135deg, rgba(152, 188, 220, 0.18), rgba(98, 147, 187, 0.25)),
    rgba(244, 249, 255, 0.75);
}

.free-field-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.free-field-placement-active #cardCanvas {
  cursor: crosshair;
}

.tool-btn[data-free-field-tool].is-on {
  border-color: #217acc;
  background: rgba(33, 122, 204, 0.12);
  color: #154f86;
}

.free-field .resize-handle {
  opacity: 0.85;
}

.field-rules {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 10px;
  margin: 8px 0;
  padding: 8px;
  border: 1px solid #d8e3ef;
  border-radius: 6px;
  background: #f8fbff;
  font-size: 12px;
  color: #1f3850;
}

.field-rules label {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.cart-box {
  display: grid;
  grid-template-columns: 1fr 230px;
}

.cart-main {
  padding: 20px;
  border-right: 1px solid var(--line);
}

.cart-design-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.cart-thumb {
  width: 86px;
  height: 64px;
  border: 1px solid var(--line);
  background: linear-gradient(145deg, #ebf5ff 0%, #79a9d9 100%);
}

.cart-design-id {
  margin: 0 0 6px;
  font-size: 24px;
  font-weight: 600;
}

.cart-design-row a {
  display: block;
  margin-top: 3px;
  color: #365f85;
  text-decoration: none;
  font-size: 22px;
}

.cart-totals {
  padding: 18px;
}

.cart-totals div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 23px;
  color: #41586e;
}

.total-row {
  border-top: 1px solid var(--line);
  padding-top: 10px;
  margin-top: 8px;
}

.total-row strong {
  font-size: 34px;
  color: #1f3348;
}

.pdf-msg {
  margin-top: 10px;
  border-radius: 4px;
  padding: 8px 10px;
  font-size: 17px;
}

.pdf-msg.success {
  background: #e4f8ea;
  color: #1f7a43;
}

.pdf-msg.error {
  background: #ffe6e6;
  color: #b02f2f;
}

.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  animation: spin 0.8s linear infinite;
  vertical-align: middle;
  margin-left: 8px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.acc,
.bcard {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 4px;
  margin-bottom: 8px;
  overflow: hidden;
}

.acc-head,
.bcard-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  border-bottom: 1px solid var(--line);
  font-size: 17px;
  font-weight: 700;
  color: #35526d;
}

.bcard-head {
  cursor: pointer;
}

.bcard-chevron {
  margin-left: auto;
  font-size: 11px;
  color: #5e7790;
}

.acc-chevron {
  margin-left: auto;
  font-size: 11px;
}

.acc.is-open .acc-chevron {
  transform: rotate(180deg);
}

.acc-body {
  display: none;
  padding: 8px;
}

.acc.is-open .acc-body {
  display: block;
}

.acc-status {
  background: #e6f5ea;
  color: #2c7b4e;
  border-radius: 999px;
  padding: 0 7px;
  font-size: 12px;
}

.bnum {
  background: #2b6ca3;
  color: #fff;
  border-radius: 4px;
  padding: 0 5px;
  font-size: 12px;
}

.blabel {
  font-size: 17px;
}

.bbody {
  padding: 8px;
  display: grid;
  gap: 8px;
}

.bcard .bbody {
  display: none;
}

.bcard.is-open .bbody {
  display: grid;
}

.bcard.is-open .bcard-chevron {
  transform: rotate(180deg);
}

.bcard.active {
  border-color: #7caad3;
  box-shadow: 0 0 0 1px #d4e5f5;
}

.font-row,
.cp-row,
.color-grp,
.pos-grp,
.upload-row,
.logo-controls,
.slider-row,
.side-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.align-btns {
  display: inline-flex;
  gap: 4px;
}

.align-btn {
  min-width: 28px;
  color: #5f7184;
  padding: 0;
}

.align-btn span {
  display: block;
  width: 15px;
  height: 12px;
  margin: 0 auto;
}

.align-btn.align-left span {
  background:
    linear-gradient(currentColor, currentColor) left 0 top 1px / 13px 1.6px no-repeat,
    linear-gradient(currentColor, currentColor) left 0 center / 10px 1.6px no-repeat,
    linear-gradient(currentColor, currentColor) left 0 bottom 1px / 7px 1.6px no-repeat;
}

.align-btn.align-center span {
  background:
    linear-gradient(currentColor, currentColor) center top 1px / 13px 1.6px no-repeat,
    linear-gradient(currentColor, currentColor) center center / 10px 1.6px no-repeat,
    linear-gradient(currentColor, currentColor) center bottom 1px / 7px 1.6px no-repeat;
}

.align-btn.align-right span {
  background:
    linear-gradient(currentColor, currentColor) right 0 top 1px / 13px 1.6px no-repeat,
    linear-gradient(currentColor, currentColor) right 0 center / 10px 1.6px no-repeat,
    linear-gradient(currentColor, currentColor) right 0 bottom 1px / 7px 1.6px no-repeat;
}

.align-btn.align-justify span {
  background:
    linear-gradient(currentColor, currentColor) left 0 top 0 / 13px 1.6px no-repeat,
    linear-gradient(currentColor, currentColor) left 0 top 4px / 13px 1.6px no-repeat,
    linear-gradient(currentColor, currentColor) left 0 top 8px / 13px 1.6px no-repeat;
}

.cs-wrap {
  position: relative;
  flex: 1;
  min-width: 130px;
}

.line-spacing-wrap {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.line-spacing-label {
  font-size: 11px;
  font-weight: 700;
  color: #52677c;
  white-space: nowrap;
}

.line-spacing-wrap .sz-slider {
  width: 72px;
}

.line-spacing-wrap .sz-num {
  width: 48px;
}

.cs-box,
.txt-in,
.sz-num,
.cmyk-in,
.upload-btn,
.btn-del {
  border: 1px solid var(--line-2);
  border-radius: 4px;
  font-size: 15px;
}

.cs-box {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 7px;
  cursor: pointer;
  background: #fff;
}

.cs-drop {
  display: none;
  position: absolute;
  top: calc(100% + 2px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid var(--line-2);
  max-height: 220px;
  overflow: auto;
  z-index: 9;
}

.cs-drop.open {
  display: block;
}

.cs-opt {
  padding: 5px 8px;
  cursor: pointer;
  font-size: 15px;
}

.cs-opt.selected,
.cs-opt:hover {
  background: var(--blue-soft);
  color: #1d578d;
}

.sty-btn {
  width: 27px;
  height: 27px;
  border: 1px solid var(--line-2);
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
}

.sty-btn.on {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
}

.txt-fields {
  display: grid;
  gap: 5px;
}

.default-text-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}

.txt-in {
  width: 100%;
  padding: 5px 8px;
}

.line-ghost {
  color: #6f8599;
  border: 1px dashed #9db2c7;
  border-radius: 4px;
  display: inline-block;
  padding: 2px 6px;
  background: rgba(244, 249, 255, 0.92);
}

.sz-slider {
  width: 82px;
}

.sz-num {
  width: 42px;
  padding: 3px;
  text-align: center;
}

.cmyk-row {
  display: flex;
  gap: 3px;
  align-items: center;
}

.hex-row {
  display: flex;
  gap: 4px;
  align-items: center;
}

.hex-in {
  width: 92px;
  border: 1px solid var(--line-2);
  border-radius: 4px;
  padding: 2px 4px;
  font-size: 13px;
  text-transform: uppercase;
}

.mm-row {
  display: flex;
  gap: 4px;
  align-items: center;
}

.mm-input {
  width: 58px;
  border: 1px solid var(--line-2);
  border-radius: 4px;
  padding: 2px 4px;
  font-size: 13px;
}

.cmyk-in {
  width: 34px;
  padding: 2px;
  text-align: center;
}

.color-native-in {
  opacity: 0;
  width: 1px;
  height: 1px;
  position: absolute;
}

.color-swatch {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--line-2);
  cursor: pointer;
}

.upload-btn {
  background: #f6f9fd;
  padding: 4px 8px;
  cursor: pointer;
}

.upload-btn input {
  display: none;
}

.btn-del {
  background: #fff;
  color: #9a2d2d;
  padding: 4px 8px;
  cursor: pointer;
}

.upload-hint,
.hint-txt,
.cp-label,
.cmyk-l,
.sz-unit {
  font-size: 12px;
  color: var(--muted);
}

.arrows {
  display: grid;
  grid-template-columns: repeat(3, 22px);
  grid-template-rows: repeat(3, 22px);
  gap: 2px;
}

.arr-btn {
  border: 1px solid var(--line-2);
  border-radius: 3px;
  background: #fff;
  color: #3d5771;
  cursor: pointer;
  font-size: 10px;
}

.arr-btn.empty {
  visibility: hidden;
}

.arr-btn.arr-btn-wide {
  width: auto;
  min-width: 58px;
  padding: 0 6px;
  font-size: 11px;
  font-weight: 700;
}

.center-actions {
  display: flex;
  gap: 5px;
  margin-top: 2px;
}

body.modal-open {
  overflow: hidden;
}

.panel-designer .section-title {
  font-size: 44px;
  margin-bottom: 10px;
}

.template-admin-mode .panel-designer .section-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 30px;
  line-height: 1.15;
}

.section-title-template {
  font-size: 20px;
  font-weight: 600;
  color: #49657f;
}

.panel-designer .designer-box {
  border-color: #d5dce5;
  min-height: 640px;
}

.panel-designer .designer-actions {
  gap: 8px;
  padding: 8px 12px;
  background: #ffffff;
  border-bottom: 1px solid #d4dbe5;
  flex-wrap: wrap;
  align-items: stretch;
}

.template-admin-mode .panel-designer .designer-actions {
  display: grid;
  grid-template-columns: auto auto auto auto minmax(16px, 1fr) auto;
  align-items: stretch;
  gap: 8px;
}

.designer-action-group {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  gap: 4px;
  min-height: 58px;
  padding: 6px 7px;
  border: 1px solid #d8e2ec;
  border-top-width: 3px;
  border-left-width: 1px;
  border-radius: 6px;
  background: #f6f9fc;
}

.designer-action-stack {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.designer-action-row {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: nowrap;
}

.designer-action-label {
  color: #48627a;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  padding: 0 1px;
  text-transform: uppercase;
}

.designer-action-group--side {
  border-top-color: #7f9bb5;
  background: #f6f9fc;
}

.designer-action-group--text {
  border-top-color: #2f80ed;
  background: #eef6ff;
}

.designer-action-group--image {
  border-top-color: #7c3aed;
  background: #f5f0ff;
}

.designer-action-group--background {
  border-top-color: #d97706;
  background: #fff7e8;
}

.designer-action-group--danger {
  border-top-color: #dc2626;
  background: #fff1f1;
}

.designer-action-save {
  justify-content: flex-end;
  margin-left: auto;
  border-top-color: #1f6f43;
  background: #eef5fc;
}

.template-admin-mode .designer-action-group--background {
  grid-column: 1 / -1;
  grid-row: 2;
  flex-direction: row;
  align-items: center;
  min-height: 46px;
}

.template-admin-mode .designer-action-group--danger {
  grid-column: 4;
  grid-row: 1;
}

.template-admin-mode .designer-action-save {
  grid-column: 6;
  grid-row: 1;
  margin-left: 0;
}

.template-admin-mode .designer-action-save .tool-btn {
  min-width: 168px;
}

.panel-designer .side-tab,
.panel-designer .tool-btn {
  font-size: 12px;
  line-height: 1;
  padding: 7px 10px;
  font-weight: 700;
  min-height: 31px;
  white-space: nowrap;
}

.designer-actions-spacer {
  flex: 1;
  min-width: 32px;
}

.top-bg-swatch {
  display: inline-block;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1px solid #8fa6bc;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.65);
  vertical-align: middle;
  margin: auto 2px;
  flex: 0 0 auto;
}

.panel-designer .side-tab {
  background: #f9fbff;
  color: #355f84;
}

.designer-action-group--text .tool-btn-outline {
  border-color: #96c5f4;
  color: #1d5f99;
}

.designer-action-group--image .tool-btn-outline {
  border-color: #c4b5fd;
  color: #5b21b6;
}

.designer-action-group--background .tool-btn-outline {
  border-color: #f3c37b;
  color: #8a4b0b;
}

.designer-action-group--danger .tool-btn-outline {
  border-color: #f0a5a5;
  color: #b42323;
}

.panel-designer .side-tab.active,
.panel-designer .tool-btn {
  background: linear-gradient(180deg, #1a87e9 0%, #0f62bb 100%);
  color: #fff;
}

.template-admin-mode .designer-action-group .tool-btn.tool-btn-outline {
  background: #ffffff;
  color: #31516f;
}

.template-admin-mode .designer-action-group--text .tool-btn.tool-btn-outline {
  border-color: #96c5f4;
  color: #1d5f99;
}

.template-admin-mode .designer-action-group--image .tool-btn.tool-btn-outline {
  border-color: #c4b5fd;
  color: #5b21b6;
}

.template-admin-mode .designer-action-group--background .tool-btn.tool-btn-outline {
  border-color: #f3c37b;
  color: #8a4b0b;
}

.template-admin-mode .designer-action-group--danger .tool-btn.tool-btn-outline {
  border-color: #f0a5a5;
  color: #b42323;
}

.panel-designer .tool-btn.bg-remove-btn,
.template-admin-mode .designer-action-group--background .tool-btn.bg-remove-btn {
  background: #fff1e8;
  border-color: #f97316;
  color: #a34100;
  box-shadow: inset 0 0 0 1px rgba(249, 115, 22, 0.12);
}

.panel-designer .tool-btn.bg-remove-btn:hover,
.template-admin-mode .designer-action-group--background .tool-btn.bg-remove-btn:hover {
  background: #ffe3d1;
  border-color: #ea580c;
  color: #8a3300;
}

.panel-designer .btn-del.bg-remove-btn {
  background: #fff1e8;
  border-color: #f97316;
  color: #a34100;
  font-weight: 800;
}

.panel-designer .btn-del.bg-remove-btn:hover {
  background: #ffe3d1;
  border-color: #ea580c;
  color: #8a3300;
}

.panel-designer .designer-content {
  grid-template-columns: minmax(280px, 320px) minmax(0, 1fr);
  min-height: 560px;
}

.panel-designer .designer-controls {
  background: #f7f9fc;
  border-right: 1px solid #d7dde6;
  padding: 10px 8px;
  overflow: visible;
  max-height: none;
}

.panel-designer .bcard,
.panel-designer .acc {
  overflow: visible;
}

.panel-designer .font-row,
.panel-designer .cp-row {
  gap: 8px;
}

.panel-designer .sz-wrap {
  margin-left: auto;
}

.panel-designer .txt-in {
  font-size: 15px;
}

.panel-designer .cs-box,
.panel-designer .sz-num,
.panel-designer .cmyk-in,
.panel-designer .arr-btn,
.panel-designer .sty-btn {
  font-size: 14px;
}

.panel-designer .cmyk-in {
  width: 42px;
}

.panel-designer .acc,
.panel-designer .bcard {
  border-radius: 2px;
}

.panel-designer .acc-head,
.panel-designer .bcard-head {
  font-size: 15px;
  padding: 8px 10px;
  background: #fff;
}

.panel-designer .preview-shell {
  background: #f7f8fb;
}

.panel-designer .preview-topbar {
  background: #f6f8fc;
}

.panel-designer .preview-topbar-title {
  font-size: 15px;
}

.panel-designer .tag {
  font-size: 12px;
  padding: 3px 8px;
}

.panel-designer .preview-area {
  min-height: 500px;
  padding: 62px 20px 20px;
  position: relative;
  background: #f2f4f8;
}

.preview-action-row {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 0 20px 4px;
}

.preview-action-row .tool-btn {
  min-width: 170px;
}

#expertModeBtn {
  min-width: 170px;
}

.preview-start-layer {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(18, 30, 43, 0.28);
  padding: 20px;
}

.preview-start-card {
  width: min(520px, calc(100% - 20px));
  background: #fff;
  border: 1px solid #d4dee9;
  border-radius: 8px;
  box-shadow: 0 18px 42px rgba(20, 36, 53, 0.25);
  padding: 18px 18px 16px;
}

.preview-start-card p {
  margin: 0;
  font-size: 24px;
  line-height: 1.25;
  color: #2b4f71;
  font-weight: 700;
}

.preview-start-actions {
  margin-top: 16px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.preview-start-actions .tool-btn {
  min-width: 120px;
}

.template-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(18, 31, 46, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.template-modal-card {
  width: min(1100px, calc(100vw - 26px));
  max-height: calc(100vh - 26px);
  overflow: hidden;
  background: #fff;
  border: 1px solid #ccd4df;
  border-radius: 4px;
  box-shadow: 0 16px 42px rgba(13, 27, 41, 0.22);
}

.template-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid #d5dce5;
}

.template-modal-head h3 {
  margin: 0;
  font-size: 22px;
  color: #2d618f;
}

.modal-close {
  border: 1px solid #c2cfdd;
  background: #fff;
  color: #2f4f6d;
  border-radius: 4px;
  width: 28px;
  height: 28px;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
}

.template-modal-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 175px;
  max-height: calc(100vh - 126px);
  overflow: auto;
}

.template-modal-body > div {
  padding: 14px;
}

.inline-start-card {
  width: min(520px, calc(100vw - 26px));
}

.inline-start-body {
  padding: 18px 16px 16px;
}

.inline-start-body p {
  margin: 0;
  font-size: 16px;
  color: #35546f;
}

.inline-start-actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

.template-modal .layout-cards {
  min-height: 220px;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
}

.bg-gallery-card {
  width: min(1280px, calc(100vw - 20px));
}

.bg-toolbar {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid #d9e1ea;
  flex-wrap: wrap;
}

.bg-toolbar input,
.bg-toolbar select {
  border: 1px solid #c8d3df;
  border-radius: 4px;
  padding: 7px 10px;
  font-size: 14px;
  min-width: 180px;
}

.bg-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 8px;
  padding: 10px 12px;
  max-height: 62vh;
  overflow: auto;
}

.bg-item {
  border: 1px solid #d2dae5;
  border-radius: 5px;
  background: #fff;
  cursor: pointer;
  overflow: hidden;
}

.bg-item:hover {
  border-color: #7aaad4;
  box-shadow: 0 0 0 1px #d4e5f5;
}

.bg-item img {
  display: block;
  width: 100%;
  aspect-ratio: 85 / 55;
  object-fit: cover;
  background: #f2f5f9;
}

.bg-item.is-hoch img {
  aspect-ratio: 55 / 85;
}

.bg-item-meta {
  padding: 6px 8px;
}

.bg-item-title {
  font-size: 12px;
  color: #2f4c67;
  line-height: 1.2;
  min-height: 30px;
}

.bg-item-tags {
  font-size: 11px;
  color: #6a7f93;
  margin-top: 3px;
}

.bg-pager {
  border-top: 1px solid #d9e1ea;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px;
}

.color-layer {
  position: fixed;
  z-index: 2100;
  left: 0;
  top: 0;
  width: 250px;
  background: #ffffff;
  border: 1px solid #c8d3df;
  border-radius: 6px;
  box-shadow: 0 12px 32px rgba(22, 39, 57, 0.28);
}

.color-layer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-bottom: 1px solid #d8e0ea;
}

.color-layer-close {
  border: 1px solid #c2cfdd;
  background: #fff;
  color: #2f4f6d;
  border-radius: 4px;
  width: 24px;
  height: 24px;
  cursor: pointer;
  line-height: 1;
}

.color-layer-body {
  display: grid;
  gap: 8px;
  padding: 10px;
}

.layer-color-input {
  width: 100%;
  height: 34px;
  border: 1px solid #c8d3df;
  border-radius: 4px;
  padding: 0;
}

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

  .designer-content {
    grid-template-columns: 1fr;
  }

  .designer-controls {
    max-height: none;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .product-box,
  .templates-box,
  .cart-box {
    grid-template-columns: 1fr;
  }

  .product-main,
  .cart-main,
  .format-meta {
    border-right: 0;
    border-left: 0;
    border-bottom: 1px solid var(--line);
  }

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

  .panel-designer .designer-content {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   Simple Toolbar (Normalmodus)
   ============================================================ */
.simple-toolbar {
  display: flex;
  flex-direction: column;
  border-bottom: 1px solid var(--line);
  background: #f0f4fa;
}

.stb-format-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  flex-wrap: wrap;
}

.stb-block-tabs {
  display: flex;
  gap: 3px;
}

.template-admin-mode .stb-block-tabs,
.template-admin-mode .stb-fields-row {
  display: none !important;
}

.stb-tab {
  border: 1px solid #9fb8d0;
  border-radius: 3px;
  background: #fff;
  color: #335474;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 9px;
  cursor: pointer;
  line-height: 1;
}

.stb-tab.active {
  background: linear-gradient(180deg, #1986e8 0%, #0f63bb 100%);
  color: #fff;
  border-color: #0f63bb;
}

.stb-sep {
  width: 1px;
  height: 22px;
  background: var(--line-2);
  margin: 0 2px;
  flex-shrink: 0;
}

.stb-font-sel {
  border: 1px solid var(--line-2);
  border-radius: 4px;
  font-size: 13px;
  padding: 4px 6px;
  min-width: 120px;
  max-width: 165px;
  background: #fff;
  cursor: pointer;
}

.simple-toolbar .cs-wrap {
  flex: 0 0 auto;
  min-width: 0;
}

.cs-box.stb-font-sel {
  width: 150px;
  height: 28px;
  line-height: 1;
}

.stb-font-drop {
  min-width: 190px;
  max-height: 260px;
  z-index: 30;
}

.stb-font-drop .cs-opt {
  display: flex;
  align-items: center;
  min-height: 28px;
  font-size: 15px;
  line-height: 1.2;
}

.stb-color-wrap {
  display: flex;
  align-items: center;
  gap: 5px;
}

.stb-fields-row {
  display: flex;
  gap: 8px;
  padding: 7px 12px;
  background: #fff;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
  align-items: center;
}

.stb-txt-in {
  flex: 1;
  min-width: 160px;
  max-width: 320px;
  border: 1px solid var(--line-2);
  border-radius: 4px;
  padding: 5px 8px;
  font-size: 14px;
}

/* ============================================================
   Normalmodus: linke Spalte ausgeblendet
   ============================================================ */
.panel-designer .designer-controls {
  display: none;
}

.panel-designer .designer-content {
  grid-template-columns: 1fr;
}

/* ============================================================
   Expertenmodus: linke Spalte eingeblendet
   ============================================================ */
.panel-designer .designer-box.expert-mode .designer-controls {
  display: block;
}

.panel-designer .designer-box.expert-mode .designer-content {
  grid-template-columns: minmax(280px, 320px) minmax(0, 1fr);
}

.panel-designer .designer-box.expert-mode .simple-toolbar {
  display: none;
}

.designer-actions input[type="hidden"],
.designer-actions span:has(input[type="hidden"]) {
  display: none !important;
}

.canvas-controls-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  position: absolute;
  top: 12px;
  right: 20px;
  z-index: 15;
  padding: 0;
  background: transparent;
  border: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
  max-width: min(100%, 560px);
}

.canvas-controls-bar .tool-btn {
  box-shadow: 0 6px 16px rgba(18, 43, 68, 0.16);
}

.canvas-side-tabs {
  position: absolute;
  top: -36px;
  left: 24px;
  z-index: 16;
  display: flex;
  gap: 6px;
}

.canvas-side-tab {
  border: 1px solid #0f63bb;
  background: linear-gradient(180deg, #1986e8 0%, #0f63bb 100%);
  color: #ffffff;
  font-size: 14px;
  line-height: 1;
  font-weight: 700;
  padding: 8px 16px 7px;
  border-radius: 8px 8px 0 0;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(30, 63, 90, 0.2);
}

.canvas-side-tab.active {
  background: linear-gradient(180deg, #1986e8 0%, #0f63bb 100%);
  color: #ffffff;
}

.tool-btn.active-mode {
  background: linear-gradient(180deg, #355b87 0%, #234265 100%);
  border-color: #234265;
}

@media (max-width: 1180px) {
  .template-admin-mode .panel-designer .designer-actions {
    grid-template-columns: 1fr;
  }

  .template-admin-mode .designer-action-group {
    flex-wrap: wrap;
  }

  .template-admin-mode .designer-action-group--background,
  .template-admin-mode .designer-action-group--danger,
  .template-admin-mode .designer-action-save {
    grid-column: auto;
    grid-row: auto;
  }
}

/* ── Dummy / Platzhalter Felder ─────────────────────────────── */
.free-field.is-dummy:hover {
  border-color: rgba(245, 158, 11, 0.5);
  outline: 2px dashed rgba(245, 158, 11, 0.6);
}
.free-field.is-dummy.selected {
  border-color: transparent;
  outline: 2px dashed #f59e0b !important;
}
.free-field.is-dummy::after {
  content: '✎';
  position: absolute;
  top: -10px;
  right: -2px;
  font-size: 9px;
  color: #f59e0b;
  pointer-events: none;
  opacity: 0;
}
.free-field.is-dummy:hover::after,
.free-field.is-dummy.selected::after {
  opacity: 1;
}

/* ── Platzhalter-Text Palette (Template-Admin) ──────────────── */
.acc-sample-texts .acc-body { padding: 8px; }
#sampleTextPalette { display: flex; flex-wrap: wrap; gap: 6px; }
.st-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  padding: 5px 8px;
  background: #f9fafb;
  cursor: pointer;
  text-align: left;
  min-width: 100px;
  max-width: 160px;
  transition: border-color .15s, background .15s;
}
.st-btn:hover { border-color: #3b82f6; background: #eff6ff; }
.st-label { font-size: 11px; font-weight: 600; color: #374151; }
.st-text { font-size: 10px; color: #9ca3af; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 140px; }
.st-empty { font-size: 12px; color: #9ca3af; padding: 4px; }

/* ── Sprachauswahl (Kunden-Modus) ───────────────────────────── */
#accSampleLang { display: none; }
.lang-select-row { display: flex; align-items: center; gap: 8px; padding: 8px; }
.lang-select-row label { font-size: 12px; color: #6b7280; }
.lang-select-row select { font-size: 12px; border: 1px solid #d1d5db; border-radius: 4px; padding: 3px 6px; }

/* ── Druckvorschau-Button ───────────────────────────────────── */
.print-preview-btn { display: inline-flex; align-items: center; }
.print-preview-btn.is-on { background: #1d4ed8; color: #fff; border-color: #1d4ed8; }

/* ── Druckvorschau-Modus ────────────────────────────────────── */
.canvas-stage.print-preview .drag-block { border-color: transparent !important; box-shadow: none !important; }
.canvas-stage.print-preview .drag-block .line-edit:focus { outline: none !important; }
.canvas-stage.print-preview .free-field { border-color: transparent !important; outline: none !important; }
.canvas-stage.print-preview .free-field.selected { border-color: transparent !important; box-shadow: none !important; }
.canvas-stage.print-preview .free-field.is-dummy { outline: none !important; }
.canvas-stage.print-preview .free-field.is-required::after { display: none !important; }
.canvas-stage.print-preview .resize-handle { display: none !important; }
.canvas-stage.print-preview .guide-layer { display: none !important; }
.canvas-stage.print-preview .ruler { visibility: hidden !important; }
.canvas-stage.print-preview .ruler-corner { visibility: hidden !important; }
/* Sicherheitsrand-Hilfslinie und roter Bleed-Rahmen ausblenden */
.canvas-stage.print-preview .card-canvas { border-color: transparent !important; box-shadow: none !important; }
.canvas-stage.print-preview .card-canvas::after { border-color: transparent !important; }
