:root {
  --bg: #121820;
  --bg-glow-1: rgba(56, 68, 85, 0.28);
  --bg-glow-2: rgba(255, 179, 71, 0.12);
  --body-start: #273142;
  --body-end: #121820;
  --surface: rgba(18, 24, 32, 0.92);
  --surface-strong: #273142;
  --sidebar-bg: rgba(18, 24, 32, 0.82);
  --control-bg: rgba(18, 24, 32, 0.92);
  --panel-bg: rgba(255, 255, 255, 0.06);
  --overview-bg: rgba(255, 255, 255, 0.06);
  --preview-bg: rgba(255, 255, 255, 0.06);
  --token-bg: rgba(255, 255, 255, 0.07);
  --footer-bg: rgba(18, 24, 32, 0.82);
  --input-bg: rgba(18, 24, 32, 0.94);
  --button-start: #384455;
  --button-end: #ffb347;
  --button-secondary-bg: rgba(255, 255, 255, 0.08);
  --card-media-start: #384455;
  --card-media-end: #273142;
  --editor-stage-start: #384455;
  --editor-stage-end: #273142;
  --editor-stage-glow: rgba(255, 255, 255, 0.08);
  --editor-preview-bg: rgba(18, 24, 32, 0.96);
  --line: rgba(255, 179, 71, 0.18);
  --line-strong: rgba(255, 179, 71, 0.34);
  --text: #eef4fb;
  --muted: #a8b5c8;
  --accent: #ffb347;
  --accent-dark: #ffd38f;
  --success: #6bc78b;
  --danger: #ef8181;
  --warning: #efc46d;
  --shadow: 0 18px 34px rgba(0, 0, 0, 0.34);
  --shadow-strong: 0 24px 48px rgba(0, 0, 0, 0.44);
  --radius: 26px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--text);
  font-family: "Manrope", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, var(--bg-glow-1), transparent 26%),
    radial-gradient(circle at bottom right, var(--bg-glow-2), transparent 22%),
    linear-gradient(180deg, var(--body-start) 0%, var(--body-end) 100%);
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

.shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  padding: 28px 20px;
  background: var(--sidebar-bg);
  backdrop-filter: blur(18px);
  border-right: 1px solid var(--line);
}

.brand {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 28px;
}

.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #de9d7a 0%, var(--accent) 100%);
  color: #152033;
  font-weight: 800;
}

.brand p,
.topbar p,
.muted,
.card-body p {
  margin: 4px 0 0;
  color: var(--muted);
}

.nav {
  display: grid;
  gap: 8px;
}

.nav-link {
  padding: 14px 16px;
  border-radius: 16px;
  color: #d7e2f1;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.05);
  transition: background 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.nav-link:hover,
.nav-link.is-active {
  background: rgba(220, 188, 109, 0.14);
  border-color: rgba(220, 188, 109, 0.24);
  transform: translateX(2px);
}

.logout-form {
  margin-top: 24px;
}

.content {
  padding: 28px;
}

.topbar {
  margin-bottom: 20px;
}

.topbar h1,
.panel-head h2,
.auth-card h1 {
  margin: 0;
  font-size: clamp(28px, 4vw, 38px);
  letter-spacing: -0.03em;
}

.panel {
  background: var(--surface);
  backdrop-filter: blur(18px);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
  padding: 26px;
  margin-bottom: 18px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  margin-bottom: 18px;
}

.grid-2,
.grid-3,
.grid-4,
.stats-row,
.cards {
  display: grid;
  gap: 16px;
}

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

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

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

.cards {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

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

.template-card {
  display: grid;
}

.template-card-link {
  display: block;
}

.template-card-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.template-card-media-link {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.template-mode-pill {
  border-color: var(--line-strong);
  color: var(--accent-dark);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02));
}

.template-view-switch {
  display: inline-flex;
  gap: 8px;
  align-items: center;
}

.template-view-switch .button[aria-pressed="true"] {
  border-color: var(--line-strong);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.04));
}

.template-list-table .button {
  white-space: nowrap;
}

.cards-wide {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-strong);
  border-color: var(--line-strong);
}

.card-media {
  background: linear-gradient(180deg, var(--card-media-start) 0%, var(--card-media-end) 100%);
  min-height: 220px;
  display: grid;
  place-items: center;
  position: relative;
}

.card-body {
  padding: 18px;
}

.template-card-delete {
  appearance: none;
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  background: linear-gradient(135deg, #a92d2d 0%, #ef5e5e 100%);
  color: #fff;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(169, 45, 45, 0.28);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: transform 0.18s ease, filter 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease, visibility 0.18s ease;
}

.template-card:hover .template-card-delete,
.template-card:focus-within .template-card-delete {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.template-card-delete:hover {
  transform: translateY(0);
  filter: saturate(1.05);
  box-shadow: 0 14px 26px rgba(169, 45, 45, 0.34);
}

.template-delete-modal-card {
  width: min(480px, 100%);
}

.template-delete-confirm {
  background: linear-gradient(135deg, #a92d2d 0%, #ef5e5e 100%);
  color: #fff;
}

.field {
  display: grid;
  gap: 8px;
}

.field span {
  font-size: 13px;
  color: var(--muted);
  font-weight: 700;
  letter-spacing: 0.01em;
}

.field-marketplaces {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.field-marketplace-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid transparent;
  line-height: 1.2;
}

.field-marketplace-pill.is-dual {
  color: #b8d9ff;
  border-color: rgba(132, 176, 245, 0.44);
  background: rgba(44, 86, 160, 0.22);
}

.field-marketplaces-note {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}

.field-required > span::after {
  content: " обязательное";
  color: var(--accent-dark);
  font-size: 11px;
  font-weight: 700;
}

.field input:not([type="file"]):not([type="checkbox"]):not([type="radio"]),
.field textarea,
.field select {
  width: 100%;
  border: 1px solid rgba(220, 188, 109, 0.22);
  border-radius: 16px;
  padding: 14px 16px;
  background: var(--input-bg);
  color: var(--text);
  font: inherit;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.field select {
  min-height: 48px;
  line-height: 1.35;
}

.field select:not([multiple]) {
  appearance: none;
  padding-right: 42px;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position:
    calc(100% - 22px) 50%,
    calc(100% - 16px) 50%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

.field select[multiple] {
  padding: 10px;
}

.field select[multiple] option {
  padding: 8px 10px;
  border-radius: 10px;
  margin-bottom: 4px;
}

.field-required input:not([type="file"]),
.field-required select,
.required-input {
  border-color: rgba(255, 179, 71, 0.55) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.03),
    0 0 0 1px rgba(255, 179, 71, 0.12);
}

.field input:not([type="file"]):not([type="checkbox"]):not([type="radio"]):focus,
.field textarea:focus,
.field select:focus,
.size-row input:focus {
  outline: 2px solid var(--line-strong);
  outline-offset: 2px;
  border-color: var(--line-strong);
}

.field input[type="file"] {
  width: 100%;
  min-height: 56px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 8px 10px;
  background: var(--input-bg);
  color: var(--muted);
  font: inherit;
  line-height: 1.35;
  box-shadow: none;
}

.field input[type="file"]::file-selector-button {
  appearance: none;
  border: 0;
  border-radius: 14px;
  padding: 10px 14px;
  margin-right: 12px;
  background: linear-gradient(135deg, var(--button-start) 0%, var(--button-end) 100%);
  color: #152033;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s ease, filter 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.18);
}

.field input[type="file"]::file-selector-button:hover {
  transform: translateY(-1px);
  filter: saturate(1.04);
  box-shadow: 0 14px 24px rgba(220, 188, 109, 0.22);
}

.field-full {
  grid-column: 1 / -1;
}

.button {
  appearance: none;
  border: 0;
  background: linear-gradient(135deg, var(--button-start) 0%, var(--button-end) 100%);
  color: #152033;
  border-radius: 16px;
  padding: 14px 18px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
  box-shadow: 0 12px 24px rgba(220, 188, 109, 0.18);
}

.button:hover {
  transform: translateY(-1px);
  filter: saturate(1.04);
  box-shadow: 0 16px 28px rgba(220, 188, 109, 0.22);
}

.button-secondary {
  background: var(--button-secondary-bg);
  color: #d7e2f1;
  border: 1px solid var(--line);
  box-shadow: none;
}

.button-download {
  background: linear-gradient(135deg, #2f8f5b 0%, #7adf8f 100%);
  color: #08180f;
}

.button.is-disabled,
.button[aria-disabled="true"] {
  pointer-events: none;
  opacity: 0.55;
  filter: grayscale(0.15);
  box-shadow: none;
}

.button-full {
  width: 100%;
}

.form-actions {
  display: flex;
  align-items: end;
}

.product-article-form {
  margin-bottom: 18px;
}

.product-article-grid {
  align-items: end;
}

.product-export-actions {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.product-selection-toolbar {
  display: flex;
  gap: 14px;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
}

.product-selection-count strong {
  font-size: 24px;
}

.product-selection-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.export-mode-field {
  flex: 0 1 220px;
  min-width: 180px;
  gap: 6px;
}

.export-mode-field span {
  font-size: 12px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.export-mode-field select {
  min-height: 44px;
  border-radius: 14px;
  padding: 10px 38px 10px 14px;
  font-size: 14px;
  font-weight: 800;
  background-color: rgba(18, 24, 32, 0.82);
}

input[type="checkbox"][data-product-select],
input[type="checkbox"][data-select-all-in-table] {
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  border: 1px solid rgba(255, 179, 71, 0.55);
  background: rgba(18, 24, 32, 0.95);
  cursor: pointer;
  position: relative;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

input[type="checkbox"][data-product-select]:hover,
input[type="checkbox"][data-select-all-in-table]:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

input[type="checkbox"][data-product-select]:checked,
input[type="checkbox"][data-select-all-in-table]:checked {
  background: linear-gradient(135deg, var(--button-start), var(--button-end));
  border-color: rgba(255, 179, 71, 0.9);
}

input[type="checkbox"][data-product-select]:checked::after,
input[type="checkbox"][data-select-all-in-table]:checked::after {
  content: "";
  position: absolute;
  left: 7px;
  top: 3px;
  width: 5px;
  height: 10px;
  border: solid #0b1320;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

input[type="checkbox"][data-product-select]:focus-visible,
input[type="checkbox"][data-select-all-in-table]:focus-visible {
  outline: 2px solid var(--line-strong);
  outline-offset: 2px;
}

.product-export-panel {
  margin-bottom: 18px;
}

.product-export-hint {
  color: var(--muted);
  margin: -4px 0 14px;
}

.product-stage-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.stage-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
}

.stage-badge-generation.is-done {
  background: rgba(44, 138, 93, 0.16);
  border-color: rgba(44, 138, 93, 0.28);
  color: var(--success);
}

.stage-badge-export {
  background: rgba(127, 143, 179, 0.12);
  color: #c5d0e2;
}

.stage-badge-export-state.is-ready {
  background: rgba(44, 138, 93, 0.16);
  border-color: rgba(44, 138, 93, 0.28);
  color: var(--success);
}

.stage-badge-export.is-locked {
  opacity: 0.55;
}

.product-stage-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(360px, 0.9fr);
  gap: 18px;
  margin-top: 18px;
}

.stage-card {
  padding: 18px;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.stage-card.is-locked {
  opacity: 0.6;
  filter: grayscale(0.12);
}

.stage-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.product-stage-lock {
  margin: 0 0 16px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(239, 196, 109, 0.28);
  background: rgba(239, 196, 109, 0.1);
  color: var(--muted);
}

.stage-card.is-locked .product-stage-lock {
  border-color: rgba(127, 143, 179, 0.22);
  background: rgba(127, 143, 179, 0.08);
}

.product-result-gallery {
  grid-auto-flow: column;
  grid-auto-columns: minmax(210px, 260px);
  overflow-x: auto;
  padding-bottom: 4px;
  scroll-snap-type: x proximity;
}

.image-card .card-media {
  aspect-ratio: 3 / 4;
  min-height: 0;
  overflow: hidden;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.image-card .card-media img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.image-card .card-body {
  padding: 14px;
}

.image-card .card-body strong {
  display: block;
  line-height: 1.3;
  font-size: 13px;
  word-break: break-word;
}

.image-card .card-body p {
  font-size: 12px;
  line-height: 1.3;
}

.stats-row-compact {
  grid-template-columns: repeat(auto-fit, minmax(140px, max-content));
  justify-content: flex-start;
}

.stat-card-compact {
  padding: 12px 14px;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.stat-card-compact strong {
  font-size: 22px;
  white-space: nowrap;
}

.stat-card-error {
  border-color: rgba(239, 129, 129, 0.28);
}

.stat-card-error span,
.stat-card-error .stat-card-caption {
  color: var(--danger);
}

.product-export-actions-column {
  justify-content: flex-start;
  margin-bottom: 16px;
}

.queue-card {
  margin-bottom: 16px;
  padding: 13px 14px;
  border-radius: 18px;
  border: 1px solid rgba(127, 143, 179, 0.18);
  background:
    radial-gradient(circle at top right, rgba(127, 143, 179, 0.12), transparent 40%),
    rgba(255, 255, 255, 0.04);
}

.queue-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.queue-card-head span {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.queue-card-head strong {
  font-size: 22px;
  line-height: 1;
  color: var(--accent-dark);
}

.queue-inline-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.queue-inline-meta strong {
  color: var(--text);
  font-size: 14px;
}

.queue-inline-divider {
  color: rgba(127, 143, 179, 0.6);
}

.export-lines {
  display: grid;
  gap: 10px;
}

.export-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-top: 1px solid rgba(127, 143, 179, 0.12);
}

.export-line:first-child {
  border-top: 0;
  padding-top: 0;
}

.export-line span {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.export-line strong {
  margin: 0;
  font-size: 14px;
  line-height: 1.35;
  text-align: right;
}

.export-line-error strong {
  color: var(--danger);
  font-size: 13px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  margin-top: 10px;
  background: rgba(107, 114, 128, 0.12);
}

.status-ready,
.status-completed {
  background: rgba(44, 138, 93, 0.16);
  color: var(--success);
}

.status-generation,
.status-exporting {
  background: rgba(208, 136, 29, 0.14);
  color: var(--warning);
}

.status-generated {
  background: rgba(54, 143, 219, 0.16);
  color: #4ea3ff;
}

.status-exported {
  background: rgba(44, 138, 93, 0.16);
  color: var(--success);
}

.status-queued,
.status-processing {
  background: rgba(208, 136, 29, 0.14);
  color: var(--warning);
}

.status-failed,
.status-partial,
.status-draft {
  background: rgba(203, 78, 78, 0.12);
  color: var(--danger);
}

.status-not_exported {
  background: rgba(127, 143, 179, 0.14);
  color: #c5d0e2;
}

.stats-row {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-bottom: 18px;
}

.stats-row-marketplace {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.quota-panel {
  margin-bottom: 18px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 18px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
}

.stat-card span {
  color: var(--muted);
  display: block;
  margin-bottom: 8px;
}

.stat-card strong {
  font-size: 28px;
}

.stat-card-caption {
  color: var(--muted);
  display: block;
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.45;
}

.quota-card {
  display: grid;
  gap: 16px;
}

.quota-card-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.quota-card-head span {
  color: var(--muted);
  display: block;
  margin-bottom: 8px;
}

.quota-card-head strong {
  font-size: clamp(34px, 4vw, 44px);
  line-height: 1;
}

.quota-percentage {
  min-width: 84px;
  padding: 10px 14px;
  border-radius: 999px;
  text-align: center;
  font-size: 18px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
}

.quota-percentage.is-ok,
.quota-progress-fill.is-ok {
  color: #7de3b1;
  background: rgba(66, 179, 116, 0.16);
}

.quota-percentage.is-warning,
.quota-progress-fill.is-warning {
  color: #ffd68a;
  background: rgba(208, 136, 29, 0.16);
}

.quota-percentage.is-danger,
.quota-progress-fill.is-danger {
  color: #ff9e9e;
  background: rgba(203, 78, 78, 0.16);
}

.quota-progress {
  height: 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  overflow: hidden;
}

.quota-progress-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #66d6a8 0%, #3cb7f0 100%);
  transition: width 0.35s ease;
}

.quota-progress-fill.is-warning {
  background: linear-gradient(90deg, #f7c879 0%, #e3a43e 100%);
}

.quota-progress-fill.is-danger {
  background: linear-gradient(90deg, #f59d9d 0%, #d85b5b 100%);
}

.quota-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.quota-metric {
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
}

.quota-metric span {
  color: var(--muted);
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
}

.quota-metric strong {
  font-size: 22px;
}

.queue-stat-card p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.4;
}

.queue-breakdown {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.queue-breakdown span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  line-height: 1;
  white-space: nowrap;
}

.queue-breakdown b {
  color: var(--text);
  font-size: 14px;
}

.marketplace-error {
  margin: 10px 0 0;
  color: var(--danger);
  font-size: 13px;
  line-height: 1.4;
}

.stack {
  display: grid;
  gap: 16px;
}

.checkbox {
  display: flex;
  gap: 10px;
  align-items: center;
}

.checkbox input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.inset-panel {
  padding: 20px;
  background: var(--panel-bg);
  border: 1px solid var(--line);
  border-radius: 22px;
}

.sizes-table {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.groups-panel {
  overflow: hidden;
}

.group-create-panel {
  margin-top: 34px;
  border-top: 3px solid rgba(220, 188, 109, 0.24);
}

.groups-panel .panel-head p,
.section-title p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.group-form {
  gap: 22px;
}

.group-common-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

.group-primary-section {
  min-height: 100%;
  background:
    linear-gradient(145deg, rgba(220, 188, 109, 0.16), rgba(255, 255, 255, 0.045)),
    var(--panel-bg);
  border-color: rgba(220, 188, 109, 0.32);
}

.group-primary-section .grid-2 {
  grid-template-columns: minmax(220px, 0.8fr) minmax(280px, 1.2fr);
  align-items: start;
}

.form-section {
  display: grid;
  gap: 16px;
  padding: 18px;
  border-radius: 22px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.065), rgba(255, 255, 255, 0.028)),
    var(--panel-bg);
  border: 1px solid var(--line);
}

.form-section-compact {
  gap: 14px;
  padding: 16px;
  border-radius: 18px;
}

.group-form select[multiple] {
  min-height: 122px;
}

.form-section-accent,
.group-inset-panel {
  background:
    radial-gradient(circle at top right, color-mix(in srgb, var(--accent) 18%, transparent), transparent 42%),
    var(--panel-bg);
}

.marketplace-accordion-grid {
  display: grid;
  gap: 16px;
}

.marketplace-accordion {
  display: grid;
  gap: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.035);
}

.marketplace-accordion summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  cursor: pointer;
  color: var(--accent-dark);
  font-weight: 700;
  list-style: none;
}

.marketplace-accordion summary::-webkit-details-marker {
  display: none;
}

.marketplace-ready-status {
  flex: 0 0 auto;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.marketplace-accordion.is-ready {
  border-color: rgba(75, 181, 123, 0.65);
  box-shadow: 0 0 0 1px rgba(75, 181, 123, 0.22);
}

.marketplace-accordion.is-ready .marketplace-ready-status {
  border-color: rgba(75, 181, 123, 0.65);
  color: #4bb57b;
}

.marketplace-accordion.is-invalid {
  border-color: rgba(214, 93, 93, 0.65);
  box-shadow: 0 0 0 1px rgba(214, 93, 93, 0.2);
}

.marketplace-accordion.is-invalid .marketplace-ready-status {
  border-color: rgba(214, 93, 93, 0.65);
  color: #d65d5d;
}

.field-note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.section-title {
  display: grid;
  gap: 2px;
}

.section-title h3,
.group-inset-panel .panel-head h3 {
  margin: 0;
  color: var(--accent-dark);
  font-size: 18px;
  line-height: 1.2;
}

.group-checkbox {
  align-items: flex-start;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.group-checkbox span {
  line-height: 1.35;
}

.group-inset-panel {
  display: grid;
  gap: 14px;
  padding: 16px;
  margin: 8px 0 0;
  border-radius: 18px;
  border: 1px solid var(--line);
}

.compact-groups-wrap {
  border: 1px solid rgba(220, 188, 109, 0.14);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.025);
}

.compact-groups-table th,
.compact-groups-table td {
  padding: 10px 12px;
  vertical-align: middle;
}

.compact-groups-table tr:last-child td {
  border-bottom: 0;
}

.group-table-link {
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
}

.group-table-link:hover {
  color: var(--accent-dark);
}

.group-table-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  white-space: nowrap;
}

.button-compact {
  padding: 8px 10px;
  min-height: 34px;
  border-radius: 12px;
  font-size: 13px;
}

.button-field-action {
  width: 100%;
  min-height: 38px;
  padding: 9px 12px;
  border-radius: 12px;
}

.template-order-actions {
  display: flex;
  gap: 8px;
}

.template-order-list {
  display: grid;
  gap: 8px;
}

.template-order-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
}

.template-order-index {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.template-order-name {
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.template-order-help {
  display: grid;
  gap: 2px;
  color: var(--muted);
  font-size: 12px;
}

.group-form-submit {
  display: flex;
  justify-content: flex-end;
  padding-top: 4px;
}

.size-row input {
  width: 100%;
  min-width: 0;
  border: 1px solid rgba(220, 188, 109, 0.22);
  border-radius: 16px;
  padding: 14px 16px;
  background: var(--input-bg);
  color: var(--text);
  font: inherit;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.size-row input::placeholder {
  color: var(--muted);
}

.group-cards {
  align-items: stretch;
}

.group-card {
  position: relative;
  min-height: 132px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.025)),
    var(--surface);
}

.group-card-link {
  color: inherit;
  text-decoration: none;
  display: block;
}

.group-card .card-body {
  min-height: 132px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.group-card strong {
  display: block;
  font-size: 18px;
  line-height: 1.25;
}

.group-card .status-pill {
  flex: none;
  margin-top: 0;
}

.group-card-delete {
  appearance: none;
  border: 0;
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: rgba(169, 45, 45, 0.92);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(169, 45, 45, 0.28);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: transform 0.18s ease, filter 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease, visibility 0.18s ease;
}

.group-card:hover .group-card-delete,
.group-card:focus-within .group-card-delete {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.group-card-delete:hover {
  transform: translateY(0);
  filter: saturate(1.05);
  box-shadow: 0 14px 26px rgba(169, 45, 45, 0.34);
}

.group-delete-modal-card {
  width: min(480px, 100%);
}

.group-delete-confirm {
  background: linear-gradient(135deg, #a92d2d 0%, #ef5e5e 100%);
  color: #fff;
}

.table-wrap {
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  text-align: left;
  padding: 14px 12px;
  border-bottom: 1px solid rgba(220, 188, 109, 0.14);
}

.bulk-launch-list {
  display: grid;
  gap: 16px;
}

.bulk-launch-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
  padding: 14px;
}

.bulk-launch-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  cursor: pointer;
  list-style: none;
}

.bulk-launch-head::-webkit-details-marker {
  display: none;
}

.bulk-launch-content {
  margin-top: 12px;
}

.bulk-launch-name-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 12px;
}

.bulk-launch-export-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.bulk-launch-meta {
  display: grid;
  gap: 2px;
}

.bulk-launch-meta span {
  color: var(--muted);
  font-size: 13px;
}

.bulk-launch-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.bulk-launch-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 92px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 179, 71, 0.4);
  background: rgba(255, 179, 71, 0.1);
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  transition: background 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}

.bulk-launch-head:hover .bulk-launch-toggle {
  background: rgba(255, 179, 71, 0.2);
  border-color: rgba(255, 179, 71, 0.7);
  transform: translateY(-1px);
}

.bulk-images-cell {
  width: 280px;
  min-width: 280px;
}

.bulk-image-slider {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.bulk-image-slider img {
  width: 72px;
  height: 72px;
  border-radius: 10px;
  border: 1px solid var(--line);
  object-fit: cover;
  background: rgba(255, 255, 255, 0.03);
  flex: none;
  cursor: zoom-in;
}

.bulk-image-placeholder {
  color: var(--muted);
  font-size: 12px;
}

.table-open-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid rgba(127, 143, 179, 0.28);
  background: rgba(127, 143, 179, 0.12);
  color: #dbe5f6;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.01em;
  transition: border-color 0.16s ease, background 0.16s ease, transform 0.16s ease;
}

.table-open-link:hover {
  border-color: rgba(255, 179, 71, 0.55);
  background: rgba(255, 179, 71, 0.15);
  transform: translateY(-1px);
}

.products-page {
  display: grid;
  gap: 20px;
}

.products-page .panel {
  margin-bottom: 0;
  padding: 24px;
}

.products-page .panel-head {
  margin-bottom: 16px;
}

.products-page .panel-head p {
  margin: 6px 0 0;
  max-width: 780px;
  line-height: 1.45;
}

.products-page .products-top-row {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
}

.products-page .products-top-row > .panel {
  height: 100%;
}

.products-page .products-top-row .panel-head {
  margin-bottom: 14px;
}

.products-page .products-top-row .panel-head p {
  max-width: none;
  color: rgba(219, 229, 246, 0.82);
}

.products-page .grid-3 {
  gap: 14px;
  align-items: end;
}

.products-page .form-actions {
  min-height: 48px;
}

.products-page .table-wrap {
  border: 1px solid rgba(220, 188, 109, 0.12);
  border-radius: 14px;
  background: rgba(7, 11, 20, 0.18);
}

.products-page .table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: rgba(16, 23, 35, 0.96);
  backdrop-filter: blur(6px);
}

.products-page .table th,
.products-page .table td {
  padding: 13px 12px;
  vertical-align: middle;
}

.products-page .table tbody tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.015);
}

.products-page .table tbody tr:hover td {
  background: rgba(255, 179, 71, 0.06);
}

.products-page .product-selection-toolbar {
  border: 1px solid rgba(255, 179, 71, 0.18);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  padding: 14px;
}

.products-page .product-selection-count {
  min-width: 94px;
}

.products-page .product-selection-count strong {
  font-size: 28px;
  line-height: 1;
}

.products-page .products-top-row .product-selection-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.products-page .products-top-row .product-selection-actions .button {
  width: 100%;
  justify-content: center;
}

.product-export-actions .button,
.bulk-launch-export-row .button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding-top: 11px;
  padding-bottom: 11px;
}

.products-page .top-combined-panel .product-selection-toolbar {
  margin-bottom: 14px;
}

.products-page .products-top-row .grid-3 {
  grid-template-columns: 1fr;
  gap: 12px;
}

.products-page .bulk-launch-card {
  padding: 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
}

.products-page .bulk-launch-content {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(220, 188, 109, 0.14);
}

.products-page .bulk-launch-name-row,
.products-page .bulk-launch-export-row {
  margin-bottom: 14px;
}

.products-page .bulk-image-slider {
  padding-bottom: 2px;
}

.products-page .pagination {
  margin-top: 14px;
}

.products-page .pagination a {
  min-width: 40px;
  text-align: center;
}

.bulk-image-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 20px;
}

.bulk-image-modal[hidden] {
  display: none;
}

.bulk-image-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 6, 12, 0.82);
  backdrop-filter: blur(4px);
}

.bulk-image-modal-card {
  position: relative;
  z-index: 1;
  width: min(92vw, 1100px);
  max-height: 88vh;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(18, 24, 32, 0.96);
  padding: 14px;
  box-shadow: var(--shadow-strong);
}

.bulk-image-modal-viewport {
  width: 100%;
  max-height: calc(88vh - 48px);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bulk-image-modal-image {
  width: auto;
  height: auto;
  object-fit: contain;
  transform-origin: center center;
  transition: transform 0.08s ease;
  cursor: grab;
  user-select: none;
  max-width: none;
  max-height: none;
}

.bulk-image-modal-image.is-dragging {
  cursor: grabbing;
}

.bulk-image-modal-zoom-controls {
  position: absolute;
  top: 8px;
  left: 8px;
  display: flex;
  gap: 8px;
  z-index: 2;
}

.bulk-image-modal-zoom-button {
  appearance: none;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(8, 12, 18, 0.72);
  color: #e8edf9;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.bulk-image-modal-close {
  appearance: none;
  position: absolute;
  top: 8px;
  right: 8px;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(15, 24, 42, 0.9);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.pagination {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

.pagination a {
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--line);
}

.pagination a.is-active {
  background: rgba(220, 188, 109, 0.2);
}

.template-editor {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 24px;
  align-items: start;
}

.template-editor .stack {
  align-content: start;
}

.editor-visual {
  display: grid;
  gap: 18px;
}

.editor-intro {
  display: grid;
  grid-template-columns: minmax(0, 65%) minmax(0, 35%);
  gap: 18px;
  align-items: stretch;
  margin-bottom: 18px;
  padding: 18px;
  border-radius: 24px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.04) 100%),
    radial-gradient(circle at top right, rgba(220, 188, 109, 0.14), transparent 44%);
  border: 1px solid rgba(220, 188, 109, 0.18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.editor-intro-copy {
  display: grid;
  gap: 10px;
  align-content: start;
}

.editor-kicker {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 12px;
  font-weight: 800;
  color: var(--accent-dark);
}

.editor-intro h3 {
  margin: 0;
  font-size: clamp(22px, 3vw, 30px);
  letter-spacing: -0.03em;
  line-height: 1.12;
}

.editor-note {
  margin: 0;
  max-width: 460px;
  color: var(--muted);
  line-height: 1.5;
}

.editor-intro-aside {
  display: grid;
  gap: 12px;
  align-content: center;
}

.editor-stat {
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(8, 10, 35, 0.2);
  border: 1px solid rgba(220, 188, 109, 0.14);
}

.editor-stat span {
  display: block;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.editor-stat small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.35;
}

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

.editor-stage {
  position: relative;
  border-radius: 28px;
  overflow: hidden;
  background:
    radial-gradient(circle at top left, var(--editor-stage-glow), transparent 38%),
    linear-gradient(180deg, var(--editor-stage-start) 0%, var(--editor-stage-end) 100%);
  box-shadow: 0 26px 54px rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(220, 188, 109, 0.22);
}

.editor-stage-tools {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 6;
  display: flex;
  gap: 8px;
}

.editor-stage-tool {
  position: relative;
  display: inline-flex;
}

.editor-stage-tool input {
  position: absolute;
  inset: 0;
  opacity: 0;
  margin: 0;
  cursor: pointer;
}

.editor-stage-tool-icon {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 14px;
  border: 1px solid rgba(255, 211, 143, 0.22);
  background:
    radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.1), transparent 58%),
    rgba(255, 255, 255, 0.04);
  box-shadow:
    var(--shadow-soft),
    inset 0 0 0 1px rgba(255, 211, 143, 0.08);
  backdrop-filter: blur(12px);
  pointer-events: none;
}

.editor-stage-tool input:focus-visible + .editor-stage-tool-icon {
  outline: 2px solid rgba(220, 188, 109, 0.8);
  outline-offset: 2px;
}

.editor-stage-tool input:not(:checked) + .editor-stage-tool-icon {
  border-color: rgba(255, 211, 143, 0.2);
  background:
    radial-gradient(circle at 30% 30%, rgba(255, 211, 143, 0.09), transparent 58%),
    rgba(255, 211, 143, 0.05);
}

.editor-stage-tool input:not(:checked) + .editor-stage-tool-icon::before {
  border-color: rgba(255, 211, 143, 0.52);
}

.editor-stage-tool input:not(:checked) + .editor-stage-tool-icon::after {
  opacity: 0.45;
}

.editor-stage-tool::after {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 10px;
  background: linear-gradient(135deg, transparent 44%, rgba(255, 120, 120, 0.94) 46%, rgba(255, 120, 120, 0.94) 54%, transparent 56%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}

.editor-stage-tool:has(input:not(:checked))::after {
  opacity: 1;
}

.editor-stage-tool-icon::before,
.editor-stage-tool-icon::after {
  content: "";
  position: absolute;
}

.editor-stage-tool-icon::before {
  inset: 8px;
  border: 2px solid var(--accent-dark);
  border-radius: 10px;
}

.editor-stage-tool-icon-points::before {
  inset: auto;
  width: 6px;
  height: 6px;
  left: 9px;
  top: 9px;
  border: 0;
  border-radius: 999px;
  background: var(--accent-dark);
  box-shadow:
    16px 0 0 0 var(--accent-dark),
    16px 16px 0 0 var(--accent-dark),
    0 16px 0 0 var(--accent-dark);
}

.editor-stage-tool-icon-points::after {
  inset: auto;
  left: 12px;
  top: 12px;
  width: 16px;
  height: 16px;
  border-left: 2px solid rgba(220, 188, 109, 0.72);
  border-top: 2px solid rgba(220, 188, 109, 0.72);
  border-right: 0;
  border-bottom: 0;
  border-radius: 0;
  background: transparent;
  transform: none;
}

.editor-stage-tool-icon-resize::before {
  width: 14px;
  height: 2px;
  left: 7px;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  border-radius: 999px;
  background: var(--accent-dark);
}

.editor-stage-tool-icon-resize::after {
  width: 14px;
  height: 2px;
  right: 7px;
  top: 50%;
  transform: translateY(-50%);
  border-radius: 999px;
  background: var(--accent-dark);
}

.editor-stage-tool-icon-move::before {
  width: 16px;
  height: 16px;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  border: 2px solid rgba(220, 188, 109, 0.96);
  border-radius: 999px;
  background: transparent;
}

.editor-stage-tool-icon-move::after {
  width: 6px;
  height: 6px;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  border-radius: 999px;
  background: var(--accent);
}

.editor-stage-tool-icon-move {
  box-shadow:
    var(--shadow-soft),
    inset 0 0 0 1px rgba(220, 188, 109, 0.08);
}

.editor-image {
  width: 100%;
  height: auto;
}

.editor-overlay {
  position: absolute;
  inset: 0;
}

.editor-magnifier {
  position: absolute;
  left: 0;
  top: 0;
  width: 120px;
  height: 120px;
  border-radius: 999px;
  border: 3px solid rgba(220, 188, 109, 0.92);
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.28);
  background-repeat: no-repeat;
  background-color: var(--editor-preview-bg);
  display: none;
  pointer-events: none;
  transform: translate(-50%, -115%);
  z-index: 4;
  --grid-step: 12px;
  --crosshair-color: rgba(220, 188, 109, 0.95);
}

.editor-magnifier::before,
.editor-magnifier::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
}

.editor-magnifier::before {
  background:
    repeating-linear-gradient(
      to right,
      rgba(220, 188, 109, 0.24) 0,
      rgba(220, 188, 109, 0.24) 1px,
      transparent 1px,
      transparent var(--grid-step)
    ),
    repeating-linear-gradient(
      to bottom,
      rgba(220, 188, 109, 0.24) 0,
      rgba(220, 188, 109, 0.24) 1px,
      transparent 1px,
      transparent var(--grid-step)
    );
  mix-blend-mode: screen;
}

.editor-magnifier::after {
  background:
    linear-gradient(
      to right,
      transparent calc(50% - 0.5px),
      var(--crosshair-color) calc(50% - 0.5px),
      var(--crosshair-color) calc(50% + 0.5px),
      transparent calc(50% + 0.5px)
    ),
    linear-gradient(
      to bottom,
      transparent calc(50% - 0.5px),
      var(--crosshair-color) calc(50% - 0.5px),
      var(--crosshair-color) calc(50% + 0.5px),
      transparent calc(50% + 0.5px)
    );
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22);
}

.editor-point {
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: var(--accent);
  border: 3px solid rgba(30, 44, 63, 0.95);
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.28);
  transform: translate(-50%, -50%);
  cursor: grab;
  touch-action: none;
  z-index: 3;
}

.editor-point:focus-visible,
.editor-center:focus-visible,
.editor-resize-x:focus-visible,
.editor-resize-y:focus-visible,
.editor-corner-card:focus-visible,
.editor-corner-pill:focus-visible,
.editor-modal-close:focus-visible {
  outline: 2px solid rgba(220, 188, 109, 0.8);
  outline-offset: 2px;
}

.editor-center {
  position: absolute;
  width: 40px;
  height: 40px;
  border-radius: 14px;
  border: 1px solid rgba(255, 211, 143, 0.32);
  background:
    radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.1), transparent 58%),
    rgba(255, 255, 255, 0.04);
  box-shadow: inset 0 0 0 1px rgba(255, 211, 143, 0.08);
  transform: translate(-50%, -50%);
  cursor: grab;
  touch-action: none;
  z-index: 4;
}

.editor-center::before,
.editor-center::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  border-radius: 999px;
  transform: translate(-50%, -50%);
}

.editor-center::before {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(220, 188, 109, 0.96);
  border-radius: 999px;
  background: transparent;
}

.editor-center::after {
  width: 6px;
  height: 6px;
  background: var(--accent);
  box-shadow: none;
}

.editor-center:hover {
  transform: translate(-50%, -50%) scale(1.04);
}

.editor-resize-y {
  position: absolute;
  width: 22px;
  height: 54px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.1), transparent 58%),
    rgba(255, 255, 255, 0.04);
  transform: translate(-50%, -50%);
  cursor: ns-resize;
  touch-action: none;
  z-index: 4;
}

.editor-resize-y::before,
.editor-resize-y::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.editor-resize-y::before {
  top: 7px;
  width: 2px;
  height: 14px;
  border-radius: 999px;
  background: var(--accent-dark);
}

.editor-resize-y::after {
  bottom: 7px;
  width: 2px;
  height: 14px;
  border-radius: 999px;
  background: var(--accent-dark);
}

.editor-resize-x {
  position: absolute;
  width: 54px;
  height: 22px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.1), transparent 58%),
    rgba(255, 255, 255, 0.04);
  transform: translate(-50%, -50%);
  cursor: ew-resize;
  touch-action: none;
  z-index: 4;
}

.editor-resize-x::before,
.editor-resize-x::after {
  content: "";
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
}

.editor-resize-x::before {
  left: 7px;
  width: 14px;
  height: 2px;
  border-radius: 999px;
  background: var(--accent-dark);
}

.editor-resize-x::after {
  right: 7px;
  width: 14px;
  height: 2px;
  border-radius: 999px;
  background: var(--accent-dark);
}

.editor-brightness {
  display: grid;
  gap: 10px;
}

.editor-rounding {
  display: grid;
  gap: 16px;
  padding: 18px;
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02)),
    var(--overview-bg);
  border: 1px solid var(--line);
}

.editor-rounding[hidden] {
  display: none !important;
}

.editor-rounding summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 0;
}

.editor-rounding summary::-webkit-details-marker {
  display: none;
}

.editor-rounding summary span {
  font-weight: 800;
  color: var(--text);
}

.editor-rounding summary small {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.editor-rounding-note {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
  font-size: 13px;
}

.editor-corner-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.editor-corner-card,
.editor-corner-pill {
  appearance: none;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border-radius: 20px;
  padding: 14px 16px;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.editor-corner-card {
  display: grid;
  place-items: center;
  min-height: 84px;
  padding: 16px;
}

.editor-corner-card:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 179, 71, 0.26);
  background: rgba(255, 255, 255, 0.06);
}

.editor-corner-card-mark {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.1), transparent 58%),
    rgba(255, 255, 255, 0.04);
  position: relative;
}

.editor-corner-card-mark::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 2px solid var(--accent-dark);
}

.editor-corner-card[data-corner-key="topLeft"] .editor-corner-card-mark::before {
  border-right: 0;
  border-bottom: 0;
  border-top-left-radius: 10px;
}

.editor-corner-card[data-corner-key="topRight"] .editor-corner-card-mark::before {
  border-left: 0;
  border-bottom: 0;
  border-top-right-radius: 10px;
}

.editor-corner-card[data-corner-key="bottomRight"] .editor-corner-card-mark::before {
  border-left: 0;
  border-top: 0;
  border-bottom-right-radius: 10px;
}

.editor-corner-card[data-corner-key="bottomLeft"] .editor-corner-card-mark::before {
  border-right: 0;
  border-top: 0;
  border-bottom-left-radius: 10px;
}

.editor-corner-card.is-active,
.editor-corner-pill.is-active {
  border-color: var(--line-strong);
  background: linear-gradient(180deg, rgba(220, 188, 109, 0.16), rgba(220, 188, 109, 0.08));
  box-shadow: inset 0 0 0 1px rgba(255, 211, 143, 0.08);
}

.editor-corner-card.is-active .editor-corner-card-mark {
  border-color: rgba(255, 211, 143, 0.18);
  background:
    radial-gradient(circle at 30% 30%, rgba(255, 211, 143, 0.16), transparent 58%),
    rgba(255, 211, 143, 0.06);
}

.editor-corner-summary {
  display: grid;
  gap: 8px;
}

.editor-corner-pill {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.editor-corner-pill span {
  font-size: 12px;
}

.editor-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 20px;
}

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

.editor-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 8, 16, 0.56);
  backdrop-filter: blur(6px);
}

.editor-modal-card {
  position: relative;
  z-index: 1;
  width: min(980px, 100%);
  display: grid;
  gap: 18px;
  padding: 22px;
  border-radius: 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-strong);
}

.editor-modal-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.editor-modal-kicker {
  margin: 0 0 6px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 12px;
  font-weight: 800;
  color: var(--accent-dark);
}

.editor-modal-head h3 {
  margin: 0;
  font-size: 24px;
  letter-spacing: -0.03em;
}

.editor-modal-close {
  appearance: none;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  width: 40px;
  height: 40px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 26px;
  line-height: 1;
}

.editor-modal-body {
  display: grid;
  gap: 18px;
}

.editor-modal-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.85fr);
  gap: 18px;
  align-items: start;
}

.editor-corner-preview {
  display: grid;
  gap: 10px;
}

.editor-corner-preview-frame {
  position: relative;
  min-height: 420px;
  aspect-ratio: 4 / 3;
  border-radius: 22px;
  border: 1px solid var(--line);
  background:
    radial-gradient(circle at top left, rgba(220, 188, 109, 0.18), transparent 40%),
    rgba(255, 255, 255, 0.04);
  overflow: hidden;
}

.editor-corner-preview-frame::before {
  content: "";
  position: absolute;
  inset: 14px;
  border-radius: 18px;
  border: 1px dashed rgba(220, 188, 109, 0.22);
  pointer-events: none;
}

.editor-corner-preview-frame.is-guides-hidden::before {
  display: none;
}

.editor-corner-preview-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: grab;
  touch-action: none;
}

.editor-corner-preview-canvas:active {
  cursor: grabbing;
}

.editor-corner-guides-toggle {
  appearance: none;
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(10, 18, 28, 0.78);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
}

.editor-corner-guides-toggle[aria-pressed="false"] {
  color: var(--muted);
}

.editor-corner-zoom {
  position: absolute;
  right: 12px;
  bottom: 12px;
  display: flex;
  gap: 8px;
  z-index: 2;
}

.editor-corner-zoom-btn {
  appearance: none;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(10, 18, 28, 0.78);
  color: var(--text);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
}

.editor-corner-preview-caption {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.editor-corner-settings {
  display: grid;
  gap: 14px;
  align-content: start;
}

.editor-modal .field input[type="range"] {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  accent-color: var(--accent);
}

.editor-modal .field input[type="number"] {
  max-width: 160px;
}

.editor-modal-note {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.editor-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

@media (max-width: 900px) {
  .editor-modal-card {
    width: min(100%, 980px);
  }

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

  .editor-corner-preview-frame {
    min-height: 320px;
  }
}

.editor-controls {
  position: sticky;
  top: 20px;
  display: grid;
  gap: 16px;
  padding: 22px;
  border-radius: 28px;
  background: var(--control-bg);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-strong);
  backdrop-filter: blur(18px);
}

.editor-controls [data-overlay-editor-section] {
  display: grid;
  gap: 16px;
}

.editor-controls [data-no-overlay-hide],
.editor-controls [data-overlay-editor-block] {
  display: grid;
  gap: 16px;
}

.editor-controls > [data-no-overlay-hide] {
  margin-top: 0;
}

.editor-save {
  width: 100%;
}

.editor-surface-switcher {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.editor-surface-tab {
  appearance: none;
  min-height: 46px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.editor-surface-tab:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: var(--line-strong);
}

.editor-surface-tab.is-active {
  border-color: var(--line-strong);
  background: linear-gradient(180deg, rgba(220, 188, 109, 0.18), rgba(220, 188, 109, 0.08));
}

.editor-surface-tab.is-disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.editor-panel {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-radius: 22px;
  background: var(--panel-bg);
  border: 1px solid var(--line);
}

.editor-panel .editor-toggle {
  margin-bottom: 0;
}

.editor-panel .editor-toggle-note {
  margin: 0;
}

.editor-toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.editor-toggle-row .editor-toggle,
.editor-toggle-row .field {
  flex: 1 1 auto;
  margin-bottom: 0;
}

[data-watermark-controls] {
  display: grid;
  gap: 12px;
}

[data-watermark-controls][hidden] {
  display: none !important;
}

.editor-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  font-weight: 700;
  cursor: pointer;
}

.editor-toggle input {
  appearance: none;
  margin: 0;
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  border: 1px solid rgba(220, 188, 109, 0.28);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02)),
    rgba(18, 24, 32, 0.92);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 6px 14px rgba(0, 0, 0, 0.18);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.editor-toggle input::before {
  content: "";
  width: 10px;
  height: 6px;
  border-left: 2px solid #152033;
  border-bottom: 2px solid #152033;
  transform: rotate(-45deg) scale(0.2);
  opacity: 0;
  transition: transform 0.18s ease, opacity 0.18s ease;
}

.editor-toggle input:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 179, 71, 0.4);
}

.editor-toggle input:checked {
  border-color: rgba(255, 211, 143, 0.26);
  background: linear-gradient(135deg, var(--button-start) 0%, var(--button-end) 100%);
  box-shadow: 0 10px 18px rgba(220, 188, 109, 0.2);
}

.editor-toggle input:checked::before {
  transform: rotate(-45deg) scale(1);
  opacity: 1;
}

.editor-toggle-note {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  margin: 0;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: linear-gradient(135deg, var(--button-start) 0%, var(--accent) 100%);
  color: #152033;
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
  cursor: help;
  user-select: none;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.28);
}

.editor-toggle-note::after {
  content: attr(data-note);
  position: absolute;
  left: 50%;
  top: calc(100% + 8px);
  min-width: 220px;
  max-width: min(360px, calc(100vw - 32px));
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(10, 14, 19, 0.96);
  color: #fff;
  font-size: 12px;
  line-height: 1.4;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -4px);
  transition: opacity 0.16s ease, transform 0.16s ease;
  z-index: 20;
}

.editor-toggle-note:hover::after,
.editor-toggle-note:focus-visible::after {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 760px) {
  .editor-toggle-note::after {
    left: auto;
    right: 0;
    min-width: 180px;
    transform: translateY(-4px);
  }

  .editor-toggle-note:hover::after,
  .editor-toggle-note:focus-visible::after {
    transform: translateY(0);
  }
}

.editor-inline-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 92px;
  gap: 10px;
  align-items: center;
}

.editor-inline-field input[type="range"] {
  width: 100%;
}

.editor-inline-field input[type="number"] {
  min-width: 0;
}

.editor-secondary-controls[hidden] {
  display: none;
}

.editor-preview-modal-card {
  width: min(520px, 100%);
}

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

.editor-overview {
  display: grid;
  gap: 14px;
  padding: 16px;
  border-radius: 22px;
  background: var(--overview-bg);
  border: 1px solid var(--line);
}

.editor-overview[hidden] {
  display: none !important;
}

.editor-overview summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
  font-weight: 800;
  color: var(--text);
  padding: 2px 0 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.editor-overview summary::-webkit-details-marker {
  display: none;
}

.editor-overview-zoom {
  display: inline-flex;
  gap: 6px;
  pointer-events: auto;
}

.editor-overview-zoom .editor-corner-zoom-btn {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  font-size: 18px;
}

.editor-overview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.editor-overview-tile {
  display: grid;
  gap: 8px;
}

.editor-overview-label {
  font-size: 12px;
  color: #c4cfde;
  font-weight: 700;
}

.editor-overview-preview {
  aspect-ratio: 1 / 1;
  border-radius: 20px;
  border: 1px solid rgba(220, 188, 109, 0.18);
  background-color: var(--editor-preview-bg);
  background-repeat: no-repeat;
  background-position: center center;
  background-size: cover;
  position: relative;
  overflow: hidden;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.05),
    0 10px 22px rgba(0, 0, 0, 0.16);
}

.editor-overview-preview::before,
.editor-overview-preview::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  pointer-events: none;
}

.editor-overview-preview::before {
  width: 100%;
  height: 1px;
  transform: translate(-50%, -50%);
  background: rgba(220, 188, 109, 0.92);
}

.editor-overview-preview::after {
  width: 1px;
  height: 100%;
  transform: translate(-50%, -50%);
  background: rgba(220, 188, 109, 0.92);
}

.editor-shape {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
  z-index: 2;
}

.editor-shape-path {
  fill: rgba(200, 107, 60, 0.08);
  stroke-width: 2.5;
  transition: opacity 0.18s ease, stroke-width 0.18s ease, fill 0.18s ease;
}

.editor-shape-path.is-primary {
  stroke: rgba(220, 188, 109, 0.8);
}

.editor-shape-path.is-secondary {
  fill: rgba(92, 189, 198, 0.08);
  stroke: rgba(92, 189, 198, 0.76);
}

.editor-shape-path:not(.is-active) {
  opacity: 0.55;
  stroke-dasharray: 8 6;
}

.editor-shape-path.is-active {
  opacity: 1;
  stroke-width: 3.5;
}

.preview-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: 24px;
  align-items: start;
}

.preview-controls {
  display: grid;
  gap: 16px;
  align-content: start;
  padding: 20px;
  border-radius: 22px;
  background: var(--panel-bg);
  border: 1px solid var(--line);
}

.preview-controls .button {
  width: 100%;
  text-align: center;
  justify-content: center;
}

.preview-box {
  border-radius: 22px;
  background: var(--preview-bg);
  border: 1px solid var(--line);
  display: grid;
  gap: 16px;
  padding: 20px;
  align-content: start;
}

.preview-image-frame {
  position: relative;
  overflow: auto;
  height: 100vh;
  max-height: 100vh;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    radial-gradient(circle at top left, rgba(220, 188, 109, 0.08), transparent 36%),
    rgba(255, 255, 255, 0.02);
  padding: 16px;
  display: block;
  text-align: left;
  cursor: grab;
  touch-action: none;
}

.preview-placeholder {
  min-height: 280px;
  width: 100%;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  text-align: center;
  color: var(--muted);
  padding: 32px 20px;
}

.preview-placeholder strong {
  color: var(--text);
  font-size: 18px;
}

.preview-placeholder p {
  margin: 0;
  max-width: 320px;
  line-height: 1.5;
}

.preview-image-frame.is-dragging {
  cursor: grabbing;
  height: 100vh;
  max-height: 100vh;
}

.preview-image-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.preview-box-image {
  max-width: none;
  width: auto;
  height: auto;
  display: none;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
  transition:
    width 0.18s ease,
    filter 0.18s ease;
}

.preview-image-zoom {
  display: flex;
  gap: 6px;
  align-items: center;
  pointer-events: auto;
  padding: 10px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--overview-bg);
}

.preview-image-brightness {
  display: inline-grid;
  gap: 6px;
  min-width: min(260px, 100%);
  padding: 10px 12px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--overview-bg);
}

.preview-image-brightness span {
  font-size: 12px;
  color: var(--muted);
}

.preview-image-brightness input[type="range"] {
  width: min(240px, 100%);
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  accent-color: var(--accent);
}

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

.placeholder {
  color: var(--muted);
  padding: 40px 20px;
}

.token-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.token-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  background: var(--token-bg);
  border: 1px solid var(--line);
  border-radius: 18px;
}

.token-row p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.token-row.is-saved {
  border-color: rgba(107, 199, 139, 0.42);
  background:
    radial-gradient(circle at top right, rgba(107, 199, 139, 0.16), transparent 42%),
    rgba(107, 199, 139, 0.08);
  box-shadow: 0 0 24px rgba(107, 199, 139, 0.12);
}

.token-row.is-empty {
  border-color: rgba(127, 143, 179, 0.22);
  background: rgba(127, 143, 179, 0.08);
}

.token-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 148px;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.token-status-saved {
  color: #baf3cc;
  background: rgba(107, 199, 139, 0.18);
  border: 1px solid rgba(107, 199, 139, 0.36);
  box-shadow: 0 0 18px rgba(107, 199, 139, 0.16);
}

.token-status-empty {
  color: #c5d0e2;
  background: rgba(127, 143, 179, 0.12);
  border: 1px solid rgba(127, 143, 179, 0.24);
}

.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-card {
  width: min(520px, 100%);
  padding: 36px;
  border-radius: 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-strong);
}

.hero-badge {
  display: inline-flex;
  padding: 10px 12px;
  border-radius: 999px;
  background: rgba(220, 188, 109, 0.14);
  color: var(--accent-dark);
  font-weight: 700;
  margin-bottom: 20px;
}

.alert {
  padding: 14px 16px;
  border-radius: 16px;
  margin-bottom: 14px;
  background: rgba(107, 199, 139, 0.12);
  color: var(--success);
}

.alert-error {
  background: rgba(239, 129, 129, 0.12);
  color: var(--danger);
}

.toast-stack {
  position: fixed;
  right: 20px;
  top: 20px;
  z-index: 1000;
  display: grid;
  gap: 10px;
}

.toast {
  background: var(--footer-bg);
  color: white;
  padding: 14px 16px;
  border-radius: 16px;
  min-width: 240px;
}

.toast.is-error {
  background: rgba(188, 76, 76, 0.92);
}

.app-footer {
  padding: 0 28px 28px;
}

.app-footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-radius: 24px;
  background: var(--footer-bg);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.app-footer-inner p {
  margin: 4px 0 0;
  color: var(--muted);
}

.theme-switcher {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.theme-button {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  border-radius: 999px;
  padding: 8px 12px 8px 10px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.theme-button:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.08);
}

.theme-button.is-active {
  border-color: var(--line-strong);
  background: rgba(222, 176, 29, 0.12);
}

.theme-button-swatch {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--theme-swatch-a, #114378), var(--theme-swatch-b, #deb01d));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
  flex: none;
}

@media (max-width: 1080px) {
  .shell,
  .template-editor {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 10;
  }

  .grid-4,
  .grid-3,
  .grid-2,
  .group-primary-section .grid-2,
  .group-common-grid {
    grid-template-columns: 1fr;
  }

  .group-common-grid .form-section:nth-child(3) {
    grid-column: auto;
  }

  .product-stage-grid {
    grid-template-columns: 1fr;
  }

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

  .product-result-gallery {
    grid-auto-columns: minmax(260px, 1fr);
  }

  .editor-controls {
    position: static;
  }

  .app-footer {
    padding: 0 18px 18px;
  }

  .app-footer-inner {
    align-items: flex-start;
    flex-direction: column;
  }

  .theme-switcher {
    justify-content: flex-start;
  }
}

@media (max-width: 720px) {
  .content {
    padding: 18px;
  }

  .panel {
    padding: 20px;
    border-radius: 22px;
  }

  .panel-head,
  .group-card .card-body {
    flex-direction: column;
    align-items: stretch;
  }

  .group-table-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .bulk-launch-head {
    flex-direction: column;
    align-items: stretch;
  }

  .bulk-launch-actions {
    justify-content: flex-start;
  }

  .bulk-launch-name-row {
    grid-template-columns: 1fr;
  }

  .compact-groups-table th,
  .compact-groups-table td {
    padding: 9px 10px;
  }

  .product-export-actions {
    justify-content: flex-start;
  }

  .stage-card-head {
    flex-direction: column;
    align-items: stretch;
  }

  .token-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .group-card .status-pill {
    align-self: flex-start;
  }

  .products-page {
    gap: 14px;
  }

  .products-page .panel {
    padding: 18px;
  }

  .products-page .products-top-row {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .products-page .table th,
  .products-page .table td {
    padding: 11px 10px;
  }

  .products-page .product-selection-toolbar {
    padding: 10px 12px;
  }

  .products-page .product-selection-actions {
    width: 100%;
  }

  .products-page .product-selection-actions .button {
    flex: 1 1 180px;
  }
}

@media (max-width: 640px) {
  .template-cards,
  .product-result-gallery {
    grid-auto-columns: 1fr;
  }

  .editor-corner-grid {
    grid-template-columns: 1fr;
  }

  .editor-overview-grid {
    grid-template-columns: 1fr;
  }

  .editor-modal {
    padding: 14px;
  }
}
