/* --- LAYERMAP DESIGN SYSTEM --- */
:root {
  --bg-app: #f0f2ee;
  --bg-sidebar: #ffffff;
  --bg-stage: #e7eae4;
  --text-main: #181d19;
  --text-muted: #5e6861;
  --text-faint: #8f9892;
  --border-light: #e2e6e1;
  --border-focus: #283e33;
  --primary: #213329;
  --primary-hover: #2c4437;
  --accent-red: #ff0000;
  --accent-grey: #808080;
  --backing-color: #1e2925;
  --land-color: #d8a467;
  --roads-color: #fdfbf7;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-serif: "Iowan Old Style", "Palatino Linotype", "URW Palladio L", P052, Georgia, serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-app);
  color: var(--text-main);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.app-layout {
  display: flex;
  min-height: 100vh;
}

/* --- LEFT SIDEBAR --- */
.sidebar {
  width: 360px;
  min-width: 340px;
  max-width: 400px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-light);
  padding: 28px 24px;
  height: 100vh;
  overflow-y: auto;
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
  box-shadow: 2px 0 12px rgba(0,0,0,0.02);
}

.sidebar-header {
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 20px;
}

.eyebrow {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  display: block;
  margin-bottom: 6px;
}

.sidebar-header h1 {
  font-family: var(--font-serif);
  font-size: 26px;
  font-weight: 500;
  line-height: 1.15;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

.tagline {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 6px;
}

.settings-sections {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.section-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 20px;
}

.section-card:last-child {
  border-bottom: none;
  padding-bottom: 10px;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sec-num {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-faint);
}

.section-title h2 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-group label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
}

.unit {
  color: var(--text-faint);
  font-weight: normal;
}

.label-with-value {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.live-val {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
}

input[type="text"],
input[type="number"],
select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 13px;
  color: var(--text-main);
  background: #fbfcfb;
  transition: border-color 0.15s, box-shadow 0.15s;
}

input[type="text"]:focus,
input[type="number"]:focus,
select:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 2px rgba(40, 62, 51, 0.12);
  background: #ffffff;
}

select:disabled {
  background: #f1f3f0;
  color: var(--text-faint);
  cursor: not-allowed;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--primary);
  height: 5px;
  cursor: pointer;
  margin: 4px 0;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.help-text {
  font-size: 11px;
  color: var(--text-faint);
  line-height: 1.35;
}

.toggle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
}

.toggle-row label {
  font-size: 13px;
  font-weight: 400;
  color: var(--text-muted);
  cursor: pointer;
}

/* Modern Toggle Switch */
.toggle-switch {
  position: relative;
  width: 38px;
  height: 20px;
  appearance: none;
  -webkit-appearance: none;
  background-color: #d1d5db;
  outline: none;
  border-radius: 20px;
  cursor: pointer;
  transition: background-color 0.2s;
  flex-shrink: 0;
}

.toggle-switch::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background-color: #ffffff;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
}

.toggle-switch:checked {
  background-color: var(--primary);
}

.toggle-switch:checked::before {
  transform: translateX(18px);
}

/* --- MAP ART STYLE SELECTOR --- */
.map-style-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  background: #f0f3ee;
  padding: 4px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
}

.style-option {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 7px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.style-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.style-icon-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
}

.style-option:hover {
  background: rgba(255, 255, 255, 0.6);
}

.style-option.active {
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.style-option.active .style-icon-label {
  color: var(--primary);
  font-weight: 600;
}

.color-chip.ocean-deep { background-color: #173149; }
.color-chip.ocean-shelf { background-color: #6ea4c4; }
.color-chip.accents { background-color: #cda06b; }

.btn-reset {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 12px;
  background: transparent;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  margin-top: 6px;
}

.btn-reset:hover {
  background: #f4f6f3;
  color: var(--text-main);
  border-color: #cbd2ca;
}

/* --- MAIN WORKBENCH --- */
.workbench {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 24px 32px;
  max-width: 1200px;
  margin: 0 auto;
  gap: 20px;
}

.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.brand {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  display: block;
}

.workbench-title h2 {
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 500;
  color: var(--text-main);
}

.top-controls {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Tabs */
.tab-group {
  display: flex;
  background: #e1e5de;
  border-radius: 6px;
  padding: 3px;
  gap: 2px;
}

.tab-btn {
  padding: 6px 14px;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.tab-btn.active {
  background: #ffffff;
  color: var(--text-main);
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.tab-btn:hover:not(.active) {
  color: var(--text-main);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
}

.btn-secondary:hover {
  background: #f7f9f6;
  color: var(--text-main);
  border-color: #cbd2ca;
}

.btn-listing-pack {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
  color: #ffffff;
  border: 1px solid #92400e;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(180, 83, 9, 0.25);
  transition: all 0.15s ease;
}

.btn-listing-pack:hover {
  background: linear-gradient(135deg, #b45309 0%, #92400e 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(180, 83, 9, 0.35);
}

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

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #2e7d32;
}

/* --- PREVIEW VIEWPORT --- */
.preview-container {
  background: var(--bg-stage);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: inset 0 2px 8px rgba(0,0,0,0.03);
}

.preview-stage {
  min-height: 440px;
  height: 55vh;
  max-height: 600px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  perspective: 1200px;
  overflow: hidden;
}

/* FLOATING ZOOM TOOLBAR */
.zoom-toolbar {
  position: absolute;
  top: 14px;
  right: 14px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  padding: 3px 4px;
  gap: 2px;
  box-shadow: 0 3px 10px rgba(0,0,0,0.08);
  z-index: 60;
  user-select: none;
}

.zoom-btn {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.15s ease;
}

.zoom-btn:hover {
  background: #edf1ec;
  color: var(--primary);
}

.zoom-btn:active {
  transform: scale(0.94);
}

.zoom-level-indicator {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 0 6px;
  min-width: 44px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

/* PANZOOM VIEWPORT */
.panzoom-viewport {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  transform-origin: center center;
  cursor: grab;
  transition: transform 0.15s cubic-bezier(0.2, 0, 0.2, 1);
  user-select: none;
}

.panzoom-viewport.is-dragging {
  cursor: grabbing;
  transition: none !important;
}

.svg-wrapper {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
  pointer-events: none; /* Let drag/zoom events pass smoothly to viewport */
}

/* 3D Perspective Stack Tilts */
.preview-stage.mode-assembled .svg-wrapper {
  transform: rotateX(24deg) rotateZ(-12deg) scale(0.92);
}

.preview-stage.mode-exploded .svg-wrapper {
  transform: rotateX(32deg) rotateZ(-14deg) scale(0.90);
}

.preview-stage.mode-laser_paths .svg-wrapper,
.preview-stage.mode-mockup .svg-wrapper,
.preview-stage.mode-catalog .svg-wrapper {
  transform: none;
}

.preview-stage.mode-mockup .svg-wrapper > svg,
.preview-stage.mode-catalog .svg-wrapper > svg {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  box-shadow: 0 16px 36px -8px rgba(0, 0, 0, 0.18);
  border-radius: 8px;
}

.spinner-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: var(--text-muted);
  font-size: 13px;
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(40, 62, 51, 0.15);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.btn-analytics-dash {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  color: #0f766e;
  background: rgba(20, 184, 166, 0.1);
  border: 1px solid rgba(20, 184, 166, 0.25);
  border-radius: 6px;
  text-decoration: none;
  transition: all 0.2s ease;
}

.btn-analytics-dash:hover {
  background: rgba(20, 184, 166, 0.2);
  color: #115e59;
  border-color: rgba(20, 184, 166, 0.4);
}

/* ==========================================================================
   HIGH-TECH COUNTRY CHANGING LOADING OVERLAY
   ========================================================================== */
.map-loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(246, 248, 246, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 40;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: scale(0.98);
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1), 
              transform 0.25s cubic-bezier(0.16, 1, 0.3, 1),
              visibility 0.25s;
  border-radius: 12px;
}

.map-loading-overlay.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: scale(1);
}

.loading-graphic-wrapper {
  position: relative;
  width: 88px;
  height: 88px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.radar-scan-ring {
  position: absolute;
  border-radius: 50%;
  border: 1.5px solid rgba(40, 62, 51, 0.15);
  animation: radar-pulse 2s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
}

.radar-scan-ring.ring-1 {
  width: 44px;
  height: 44px;
  border-color: rgba(16, 185, 129, 0.4);
  animation-delay: 0s;
}

.radar-scan-ring.ring-2 {
  width: 66px;
  height: 66px;
  border-color: rgba(56, 189, 248, 0.3);
  animation-delay: 0.4s;
}

.radar-scan-ring.ring-3 {
  width: 88px;
  height: 88px;
  border-color: rgba(40, 62, 51, 0.2);
  animation-delay: 0.8s;
}

.laser-contour-pulse {
  position: relative;
  z-index: 2;
  width: 44px;
  height: 44px;
  background: #ffffff;
  border-radius: 50%;
  box-shadow: 0 4px 18px -2px rgba(16, 185, 129, 0.3), 0 2px 8px rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: float-pulse 1.8s ease-in-out infinite alternate;
}

.laser-contour-pulse svg {
  animation: compass-spin 6s linear infinite;
}

.loading-text-group {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 320px;
}

.loading-country-name {
  font-family: var(--font-heading, serif);
  font-size: 1.15rem;
  font-weight: 700;
  color: #1e293b;
  letter-spacing: -0.01em;
}

.loading-step-status {
  font-size: 0.82rem;
  color: #64748b;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.loading-step-status::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  animation: blink-dot 1.2s infinite ease-in-out;
}

.loading-progress-bar {
  width: 160px;
  height: 4px;
  background: rgba(40, 62, 51, 0.1);
  border-radius: 99px;
  overflow: hidden;
  position: relative;
}

.loading-progress-fill {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50%;
  background: linear-gradient(90deg, #10b981, #38bdf8);
  border-radius: 99px;
  animation: indeterminate-fill 1.4s infinite cubic-bezier(0.65, 0.05, 0.36, 1);
}

@keyframes radar-pulse {
  0% { transform: scale(0.7); opacity: 0.8; }
  100% { transform: scale(1.3); opacity: 0; }
}

@keyframes float-pulse {
  0% { transform: scale(0.96); }
  100% { transform: scale(1.05); }
}

@keyframes compass-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes blink-dot {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

@keyframes indeterminate-fill {
  0% { left: -50%; width: 40%; }
  50% { left: 25%; width: 60%; }
  100% { left: 100%; width: 40%; }
}

.stage-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 16px;
  border-top: 1px solid rgba(0,0,0,0.06);
  flex-wrap: wrap;
  gap: 10px;
}

.layer-tags {
  display: flex;
  gap: 14px;
}

.layer-tag {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
}

.color-chip {
  width: 10px;
  height: 10px;
  border-radius: 2px;
}

.color-chip.backing { background-color: var(--backing-color); }
.color-chip.land { background-color: var(--land-color); }
.color-chip.roads { background-color: #ffffff; border: 1px solid #d0d0d0; }

.dimension-info {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

#dim-text {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
}

.dim-sub {
  font-size: 11px;
  color: var(--text-faint);
}

/* --- CUTTING SHEETS SECTION --- */
.sheets-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sheets-header h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-main);
}

.sheet-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.sheet-card {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  box-shadow: var(--shadow-sm);
}

.sheet-card:hover {
  border-color: #cbd2ca;
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.sheet-card.selected {
  border-color: var(--primary);
  background: #fafbfa;
  box-shadow: 0 0 0 1px var(--primary);
}

.card-thumb {
  width: 60px;
  height: 60px;
  background: #1e2925;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.card-thumb svg {
  width: 90%;
  height: 90%;
}

.card-meta {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  flex: 1;
}

.card-num {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-faint);
  margin-top: 1px;
}

.card-meta h4 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
}

.card-meta p {
  font-size: 11px;
  color: var(--text-muted);
}

.btn-card-dl {
  background: transparent;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
}

.btn-card-dl:hover {
  background: #f0f2ee;
  color: var(--text-main);
  border-color: #b8c0b7;
}

/* --- ACTION FOOTER --- */
.action-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 16px 0 6px 0;
  flex-wrap: wrap;
}

.legend-callout {
  max-width: 580px;
}

.legend-swatches {
  display: flex;
  gap: 16px;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 4px;
}

.swatch-cut { color: #d32f2f; }
.swatch-engrave { color: #616161; }

.legend-hint {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}

.btn-primary-pack {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background-color: var(--primary);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-md);
  padding: 12px 22px;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(33, 51, 41, 0.25);
  transition: all 0.2s ease;
}

.btn-primary-pack:hover {
  background-color: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(33, 51, 41, 0.35);
}

.btn-primary-pack:active {
  transform: translateY(0);
}

.btn-primary-listing {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  color: #ffffff;
  border: 1px solid #334155;
  border-radius: var(--radius-md);
  padding: 12px 22px;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.25);
  transition: all 0.2s ease;
}

.btn-primary-listing:hover {
  background: linear-gradient(135deg, #334155 0%, #1e293b 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.35);
}

.btn-primary-listing:active {
  transform: translateY(0);
}

.btn-pack-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
}

.pack-main {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.pack-sub {
  font-size: 11px;
  opacity: 0.85;
}

/* --- EXPORT SIZES CHECKBOXES PANEL --- */
.export-sizes-box {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.export-sizes-header {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.export-title-group {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--primary);
}

.export-title-group h4 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
}

.export-hint {
  font-size: 11px;
  color: var(--text-muted);
}

.export-sizes-checkboxes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
}

.size-checkbox-card {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 10px 12px;
  background: #fbfdfa;
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}

.size-checkbox-card:hover {
  background: #f4f7f2;
  border-color: #cbd5cb;
}

.size-checkbox-card.checked {
  background: #f2f7f1;
  border-color: var(--primary);
  box-shadow: 0 1px 3px rgba(33, 51, 41, 0.08);
}

.size-checkbox-card.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary), var(--shadow-sm);
}

.size-checkbox-card.active .btn-preview-tier {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  opacity: 1;
}

.size-checkbox-card input[type="checkbox"] {
  margin-top: 2px;
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  cursor: pointer;
  flex-shrink: 0;
}

.cb-card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 2px;
}

.cb-tier-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
}

.cb-tier-dim {
  font-size: 11px;
  font-weight: 500;
  color: var(--primary);
}

.cb-tier-desc {
  font-size: 10px;
  color: var(--text-faint);
}

.btn-preview-tier {
  align-self: flex-start;
  padding: 2px 6px;
  font-size: 10px;
  font-weight: 500;
  color: var(--text-muted);
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.15s;
  opacity: 0.75;
  white-space: nowrap;
}

.btn-preview-tier:hover {
  opacity: 1;
  background: #eef2ed;
  color: var(--primary);
  border-color: #bcc5bc;
}

/* --- EXPANDABLE DESIGN NOTES --- */
.design-notes-drawer {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.notes-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: transparent;
  border: none;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  text-align: left;
  transition: background-color 0.15s;
}

.notes-toggle:hover {
  background: #f8faf7;
  color: var(--text-main);
}

.notes-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #eef2ed;
  color: var(--primary);
  font-size: 11px;
  font-weight: bold;
}

.chevron {
  margin-left: auto;
  transition: transform 0.2s ease;
}

.design-notes-drawer.open .chevron {
  transform: rotate(180deg);
}

.notes-content {
  display: none;
  padding: 16px;
  border-top: 1px solid var(--border-light);
  font-size: 12px;
  color: var(--text-muted);
  background: #fcfdfb;
}

.design-notes-drawer.open .notes-content {
  display: block;
}

.notes-content ul {
  list-style: square;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.bounds-table-container h5 {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 6px;
}

.bounds-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}

.bounds-table th,
.bounds-table td {
  padding: 6px 10px;
  text-align: left;
  border: 1px solid var(--border-light);
}

.bounds-table th {
  background: #f1f4ef;
  color: var(--text-main);
}

/* --- MODAL --- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  display: none; /* Hidden by default */
  align-items: center;
  justify-content: center;
  z-index: 2000;
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.modal-overlay.open {
  display: flex !important;
  opacity: 1;
}

.modal-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  max-width: 620px;
  width: 90%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

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

.modal-header h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-main);
}

.modal-close {
  background: transparent;
  border: none;
  font-size: 24px;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
}

.modal-body {
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-body h4 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  margin-top: 4px;
}

.modal-body ul,
.modal-body ol {
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Responsive */
@media (max-width: 960px) {
  .app-layout {
    flex-direction: column;
  }
  .sidebar {
    width: 100%;
    max-width: 100%;
    height: auto;
    position: static;
  }
  .preview-stage {
    min-height: 320px;
    height: 40vh;
  }
}

/* --- CANVAS WATERMARK OVERLAY --- */
.watermark-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  user-select: none;
}

.watermark-pattern {
  transform: rotate(-25deg);
  display: flex;
  flex-direction: column;
  gap: 32px;
  align-items: center;
  opacity: 0.12;
}

.watermark-line {
  font-family: ui-sans-serif, system-ui, -apple-system, sans-serif;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 4px;
  color: #1e293b;
  white-space: nowrap;
  text-transform: uppercase;
}

/* --- CHECKOUT & PAYWALL MODALS --- */
.modal-card-checkout,
.modal-card-success {
  max-width: 580px;
  background: #0f172a;
  color: #e2e8f0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
  border-radius: 16px;
  padding: 0;
  overflow: hidden;
}

.modal-card-checkout .modal-header,
.modal-card-success .modal-header {
  padding: 20px 24px;
  background: linear-gradient(to right, #1e293b, #0f172a);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.modal-card-checkout .modal-body,
.modal-card-success .modal-body {
  padding: 24px;
  gap: 18px;
}

.badge-commercial {
  display: inline-block;
  padding: 3px 8px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 9999px;
  margin-bottom: 4px;
}

.badge-success {
  display: inline-block;
  padding: 3px 8px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 9999px;
  margin-bottom: 4px;
}

.badge-demo {
  display: inline-block;
  padding: 3px 8px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: rgba(148, 163, 184, 0.15);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 9999px;
  margin-bottom: 4px;
}

.modal-title-group h3 {
  font-size: 17px;
  font-weight: 700;
  color: #f8fafc;
  margin: 0;
}

.modal-subtitle {
  font-size: 12px;
  color: #94a3b8;
  margin: 3px 0 0 0;
}

.checkout-feature-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 14px;
  border-radius: 12px;
}

.feature-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 11.5px;
  color: #cbd5e1;
}

.feature-check {
  color: #10b981;
  font-weight: bold;
}

.feature-item strong {
  display: block;
  color: #f1f5f9;
}

.feature-item small {
  display: block;
  color: #94a3b8;
  font-size: 10px;
  margin-top: 1px;
}

.checkout-price-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(to right, rgba(16, 185, 129, 0.1), rgba(15, 23, 42, 0.8));
  border: 1px solid rgba(16, 185, 129, 0.25);
  padding: 16px;
  border-radius: 12px;
}

.price-info h4 {
  margin: 2px 0;
  font-size: 13px;
  font-weight: 700;
  color: #f8fafc;
}

.price-info p {
  margin: 0;
  font-size: 11px;
  color: #94a3b8;
}

.price-tag {
  text-align: right;
  flex-shrink: 0;
}

.price-val {
  display: block;
  font-size: 24px;
  font-weight: 900;
  color: #34d399;
  line-height: 1;
}

.price-note {
  font-size: 10px;
  color: #94a3b8;
}

.checkout-actions {
  display: flex;
  gap: 12px;
  margin-top: 4px;
}

.btn-pay-stripe {
  flex: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(to right, #10b981, #059669);
  color: #ffffff;
  border: none;
  padding: 12px 18px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
}

.btn-pay-stripe:hover {
  background: linear-gradient(to right, #059669, #047857);
  transform: translateY(-1px);
}

.btn-pay-test {
  flex: 1;
  background: #1e293b;
  color: #cbd5e1;
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 12px 14px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s ease;
  text-align: center;
}

.btn-pay-test:hover {
  background: #334155;
  color: #f8fafc;
}

.order-receipt-box {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 12px;
}

.receipt-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 8px;
}

.receipt-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.btn-download-bundle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 14px;
  background: linear-gradient(to right, #10b981, #059669);
  color: #ffffff;
  font-weight: 800;
  font-size: 14px;
  border-radius: 12px;
  text-decoration: none;
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.35);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-download-bundle:hover {
  background: linear-gradient(to right, #059669, #047857);
  transform: translateY(-1px);
}

.btn-copy-link {
  width: 100%;
  margin-top: 8px;
  background: transparent;
  border: 1px dashed rgba(255, 255, 255, 0.2);
  color: #94a3b8;
  font-size: 11px;
  padding: 8px;
  border-radius: 8px;
  cursor: pointer;
}

.btn-copy-link:hover {
  color: #e2e8f0;
  border-color: rgba(255, 255, 255, 0.4);
}
