:root {
  --bg: #f5f2ea;
  --panel: #ffffff;
  --panel-alt: #efede7;
  --border: #ded8ca;
  --text: #191919;
  --muted: #6f6b60;
  --accent: #ffd21c;
  --accent-text: #151515;
  --success: #14824b;
  --shadow: 0 28px 60px rgba(24, 19, 11, 0.08);
  --radius-xl: 2.2rem;
  --radius-lg: 1.6rem;
  --radius-md: 1rem;
  --radius-sm: 0.75rem;
  --content-width: 1800px;
  --heading-font: "Avenir Next", "Trebuchet MS", "Segoe UI", sans-serif;
  --body-font: "Avenir Next", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background:
    radial-gradient(circle at top left, rgba(255, 210, 28, 0.12), transparent 26%),
    linear-gradient(180deg, #fbfaf7 0%, var(--bg) 100%);
  color: var(--text);
  font-family: var(--body-font);
}

h1,
h2,
h3,
strong,
.field-label,
.button-primary,
.shape-chip {
  font-family: var(--heading-font);
}

h1,
h2,
h3,
p {
  margin: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

.builder-shell {
  width: min(calc(100% - 3rem), var(--content-width));
  margin: 0 auto;
  padding: 1.1rem 0 1.1rem;
}

.hero-copy {
  margin-bottom: 1rem;
  display: flex;
  align-items: baseline;
  gap: 1.4rem;
  flex-wrap: wrap;
}

.hero-copy h1 {
  font-size: clamp(1.5rem, 2.4vw, 2rem);
  line-height: 1;
  letter-spacing: -0.03em;
}

.hero-copy__text {
  margin-top: 0;
  max-width: 60rem;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.35;
}

.eyebrow {
  display: none;
}

.builder-grid {
  display: grid;
  grid-template-columns: 0.95fr 1.25fr 0.85fr 1.0fr 0.85fr;
  gap: 1.4rem;
  align-items: start;
}

.builder-panel,
.editor-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--panel) 88%, var(--panel-alt));
  box-shadow: var(--shadow);
}

.builder-panel {
  padding: 1.05rem 1.2rem;
}

/* With only 4 materials, no forced heights needed — panels size to content */
.material-panel {
  min-height: 0;
}

.field-label {
  display: block;
  margin-bottom: 0.9rem;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.select-shell {
  position: relative;
}

.builder-select,
.editor-grid input,
.comment-field textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: #fff;
  color: var(--text);
}

.builder-select,
.editor-grid input {
  min-height: 3.65rem;
  padding: 0 1rem;
}

.stack-gap {
  margin-top: 1rem;
}

.shape-list {
  display: grid;
  gap: 0.45rem;
}

.shape-option {
  display: flex;
  align-items: center;
  gap: 0.95rem;
  padding: 0.5rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: #fff;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
  min-height: 3rem;
}

.shape-option:hover,
.material-card:hover,
.choice-row:hover,
.material-list__item:hover {
  transform: translateY(-1px);
  border-color: #cfc4a7;
}

.shape-option.is-active,
.material-card.is-active,
.choice-row.is-active,
.material-list__item.is-active {
  border-color: #191919;
  background: #ece9df;
}

.shape-option__icon {
  width: 4.8rem;
  height: 4.8rem;
  border: 2px dashed #8a8578;
  background: #fff url('/app/thumbs-up.png') center / 80% no-repeat;
  flex: 0 0 auto;
  overflow: hidden;
  position: relative;
}

/* Contour cut — plain thumbs-up, no border, no clip */
.shape-option[data-shape='contour'] .shape-option__icon {
  border: 0 !important;
  outline: none !important;
  border-radius: 0;
  background-size: 95%;
  background-color: transparent;
  box-shadow: none !important;
}

.shape-option[data-shape='square'] .shape-option__icon {
  border-radius: 0.25rem;
  background-size: 66%;
}

.shape-option[data-shape='circle'] .shape-option__icon {
  border-radius: 50%;
  background-size: 70%;
}

/* Oval — 2:3 aspect ratio (width:height) */
.shape-option[data-shape='oval'] .shape-option__icon {
  width: 3.4rem;
  height: 5.1rem;
  border-radius: 999px;
  background-size: 78% auto;
}

.shape-option[data-shape='rounded_square'] .shape-option__icon {
  border-radius: 1.1rem;
  background-size: 66%;
}

.shape-option__label {
  font-size: 1.1rem;
  font-weight: 700;
}

.builder-note {
  margin-top: 1.5rem;
  padding: 1rem 1.1rem;
  border-radius: var(--radius-md);
  background: #1a1a1a;
  color: #fff;
  line-height: 1.4;
}

.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.6rem;
}

.section-header p {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.35;
}

.material-grid {
  display: grid;
  /* 4 materials → 2×2 grid, no scroll needed */
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

.material-card {
  position: relative;
  display: grid;
  gap: 0.9rem;
  place-items: center;
  min-height: 10.5rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: #fff;
  cursor: pointer;
  text-align: center;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.material-card__swatch {
  position: relative;
  width: 4.4rem;
  height: 4.4rem;
  border-radius: 44% 52% 45% 51%;
  background: var(--material-fill, linear-gradient(135deg, #f7f7f7, #d6d6d6));
  box-shadow: inset -8px -8px 14px rgba(255, 255, 255, 0.85), inset 9px 9px 18px rgba(0, 0, 0, 0.08);
}

.material-card__swatch::after {
  content: "";
  position: absolute;
  top: 0.18rem;
  right: 0.18rem;
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 0 0.45rem 0 0.65rem;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(228, 228, 228, 0.15));
  box-shadow: -2px 2px 7px rgba(0, 0, 0, 0.08);
}

.material-card__label {
  font-size: 0.98rem;
  font-weight: 700;
}

/* ── Finish pill toggle (builder page) ── */
.finish-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}

.finish-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 3.65rem;
  padding: 0 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: #fff;
  color: var(--text);
  cursor: pointer;
  font-size: 1rem;
  font-weight: 700;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.finish-btn:hover {
  transform: translateY(-1px);
  border-color: #cfc4a7;
}

.finish-btn.is-active {
  border-color: #191919;
  background: #ece9df;
}

/* ── Remove-background button (editor topbar) ── */
.remove-bg-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3.65rem;
  padding: 0 1.3rem;
  border: 1px solid var(--border);
  border-radius: 0.9rem;
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 800;
  transition: transform 140ms ease, background 140ms ease, border-color 140ms ease;
}

.remove-bg-button:hover:not(:disabled) {
  transform: translateY(-1px);
  background: #fff;
  border-color: #cfc4a7;
}

.remove-bg-button:disabled {
  opacity: 0.6;
  cursor: progress;
}

.remove-bg-button.is-done {
  background: #ece9df;
  border-color: #191919;
}

.remove-bg-button[hidden] {
  display: none;
}

/* ── Edit artwork button (editor topbar) ── */
.edit-artwork-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3.65rem;
  padding: 0 1.3rem;
  border: 1px solid var(--border);
  border-radius: 0.9rem;
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 800;
  transition: transform 140ms ease, background 140ms ease, border-color 140ms ease;
}

.edit-artwork-button:hover {
  transform: translateY(-1px);
  background: #fff;
  border-color: #cfc4a7;
}

.edit-artwork-button.is-done {
  background: #191919;
  color: #fff;
  border-color: #191919;
}

.edit-artwork-button.is-done:hover {
  background: #2e2e2e;
  border-color: #2e2e2e;
}

.edit-artwork-button[hidden] {
  display: none;
}

.choice-table {
  display: grid;
  gap: 0.35rem;
}

.choice-row {
  display: grid;
  align-items: center;
  gap: 0.65rem;
  min-height: 3.2rem;
  padding: 0.6rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: #fff;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.choice-table--prices .choice-row {
  grid-template-columns: 1fr auto auto;
}

.choice-row__discount {
  color: var(--success);
  font-weight: 800;
}

.choice-row__label,
.choice-row__price {
  font-size: 1.08rem;
  font-weight: 700;
}

.choice-row__meta {
  color: var(--muted);
  font-size: 0.92rem;
}

.custom-input-shell {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
  margin-top: 0.6rem;
}

.custom-input-shell label,
.editor-grid label,
.comment-field {
  display: grid;
  gap: 0.45rem;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.custom-input-shell input,
.comment-field textarea {
  min-height: 2.8rem;
  padding: 0.55rem 0.85rem;
}

.custom-input-shell__wide {
  grid-column: 1 / -1;
}

.qty-error {
  margin-top: 0.5rem;
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-sm);
  background: #fff3cd;
  border: 1px solid #f0c040;
  color: #7a5800;
  font-size: 0.88rem;
  line-height: 1.4;
}

.qty-error a {
  color: #7a5800;
  font-weight: 700;
  text-decoration: underline;
}

/* ── Upload panel (5th grid column) ── */
.upload-panel {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  align-self: stretch;
  padding: 0;
  overflow: hidden;
}

/* ── Preview hint (upper portion) ── */
.upload-panel__preview-hint {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  padding: 1.2rem 1rem 0.8rem;
  text-align: center;
}

.upload-panel__sticker-float {
  animation: sticker-float 3.2s ease-in-out infinite;
  transform-origin: center bottom;
}

.upload-panel__sticker-svg {
  width: 5.5rem;
  height: 5.5rem;
  display: block;
}

@keyframes sticker-float {
  0%,100% { transform: translateY(0) rotate(-3deg); }
  50%      { transform: translateY(-10px) rotate(3deg); }
}

.upload-panel__live-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  background: rgba(20, 130, 75, 0.1);
  color: var(--success);
  font-size: 0.8rem;
  font-weight: 700;
}

.upload-panel__live-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--success);
  animation: dot-pulse 2s ease-in-out infinite;
}

@keyframes dot-pulse {
  0%,100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.4; transform: scale(1.4); }
}

.upload-panel__hint-copy {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.4;
  max-width: 14rem;
}

/* ── Footer (lower portion) ── */
.upload-panel__footer {
  padding: 0.85rem 1rem 1rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  text-align: center;
}

.upload-panel__footer strong {
  font-size: 1rem;
}

.upload-panel__footer p {
  color: var(--muted);
  font-size: 0.82rem;
  margin-bottom: 0.35rem;
}

.upload-panel__btn {
  width: 100%;
  min-width: 0;
}

/* Legacy upload-bar — kept for responsive fallback */
.upload-bar {
  display: none;
}

.upload-bar__details {
  display: grid;
  gap: 0.28rem;
}

.upload-bar__details p {
  color: var(--muted);
}

.button-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 4rem;
  min-width: 16rem;
  padding: 0 1.6rem;
  border: 0;
  border-radius: 1rem;
  background: var(--accent);
  color: var(--accent-text);
  cursor: pointer;
  font-size: 1.12rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  transition: transform 160ms ease, filter 160ms ease;
}

.button-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.02);
}

.button-primary:disabled {
  opacity: 0.55;
  cursor: progress;
}

.button-primary--full {
  width: 100%;
}

.editor-body {
  background:
    radial-gradient(circle at top right, rgba(255, 210, 28, 0.08), transparent 28%),
    linear-gradient(180deg, #f5f5f5 0%, #eceae2 100%);
  overflow: hidden;
}

.editor-body[data-mode='dark'] {
  background:
    radial-gradient(circle at top right, rgba(255, 210, 28, 0.12), transparent 30%),
    linear-gradient(180deg, #1e1f22 0%, #121315 100%);
  color: #f2f1ed;
}

.editor-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 29rem;
  height: 100vh;
}

.editor-stage {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 1rem;
  height: 100vh;
  padding: 1.6rem 1.8rem 1.8rem;
  overflow: hidden;
}

.editor-stage__topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.mode-toggle {
  display: inline-flex;
  gap: 0.35rem;
  padding: 0.35rem;
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.95);
}

.mode-toggle__button {
  min-width: 8.25rem;
  min-height: 2.85rem;
  border: 0;
  border-radius: 0.8rem;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 1rem;
  font-weight: 800;
}

.mode-toggle__button.is-active {
  background: #fff;
  color: var(--text);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.06);
}

.editor-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 4rem;
  padding: 0 1.45rem;
  border-radius: 0.9rem;
  background: #1e1e1e;
  color: #fff;
  font-size: 1rem;
  font-weight: 900;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.preview-frame {
  position: relative;
  min-height: 0;
  border-radius: 2.1rem;
  background: rgba(255, 255, 255, 0.62);
  overflow: hidden;
}

.editor-body[data-mode='dark'] .preview-frame {
  background: rgba(20, 20, 22, 0.76);
}

.preview-canvas-shell {
  position: absolute;
  inset: 1.5rem;
}

#preview-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.preview-empty {
  position: absolute;
  inset: 0;
  display: grid;
  gap: 0.4rem;
  place-items: center;
  text-align: center;
  color: var(--muted);
}

.preview-empty[hidden] {
  display: none;
}

.preview-zoom {
  position: absolute;
  left: 50%;
  bottom: 1.2rem;
  transform: translateX(-50%);
  display: inline-grid;
  grid-template-columns: auto minmax(12rem, 18vw) auto;
  align-items: center;
  gap: 0.8rem;
  padding: 0.7rem 1rem;
  border: 1px solid rgba(25, 25, 25, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 16px 30px rgba(24, 19, 11, 0.1);
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 800;
}

.preview-zoom input {
  width: 100%;
}

.editor-sidebar {
  display: grid;
  grid-template-rows: auto auto auto;
  gap: 0.85rem;
  height: 100vh;
  padding: 1.15rem;
  border-left: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(255, 255, 255, 0.88);
  overflow-y: auto;
  overscroll-behavior: contain;
  color: var(--text);
}

.editor-body[data-mode='dark'] .editor-sidebar {
  background: rgba(29, 30, 34, 0.95);
  border-left-color: rgba(255, 255, 255, 0.08);
}

.editor-sidebar .field-label {
  margin-bottom: 0.72rem;
  font-size: 1.1rem;
}

.editor-card {
  padding: 1rem;
  color: var(--text);
}

.sidebar-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 0.8rem;
  margin-bottom: 0.85rem;
}

.sidebar-heading h1 {
  font-size: 1.85rem;
  line-height: 1;
  letter-spacing: -0.04em;
}

.shape-chip {
  padding: 0.48rem 0.72rem;
  border-radius: 999px;
  background: #ece9df;
  color: var(--text);
  font-size: 0.84rem;
  font-weight: 900;
  white-space: nowrap;
}

.material-list {
  display: grid;
  gap: 0.25rem;
  max-height: 17.5rem;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: #fff;
}

.material-list__item {
  display: grid;
  grid-template-columns: 2.6rem 1fr;
  align-items: center;
  gap: 0.85rem;
  padding: 0.64rem 0.78rem;
  border: 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  background: transparent;
  cursor: pointer;
  text-align: left;
  font-size: 0.95rem;
}

.material-list__item:last-child {
  border-bottom: 0;
}

.material-list__swatch {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 40% 48% 42% 50%;
  background: var(--material-fill, linear-gradient(135deg, #f7f7f7, #d6d6d6));
}

.editor-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
  margin-top: 0.85rem;
}

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

.editor-grid small {
  color: var(--muted);
  font-size: 0.82rem;
}

.comment-field {
  margin-top: 0.85rem;
}

.comment-field textarea {
  resize: vertical;
  min-height: 6.8rem;
  padding: 0.85rem 0.95rem;
}

.price-card {
  display: grid;
  gap: 0.72rem;
}

.price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  color: var(--text);
  font-size: 0.95rem;
}

.price-row--subtle {
  justify-content: flex-start;
  color: var(--muted);
  line-height: 1.45;
}

.price-row--grand {
  padding-top: 0.5rem;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  font-size: 1.16rem;
  font-weight: 900;
}

.error-banner {
  padding: 0.9rem 1rem;
  border: 1px solid rgba(165, 44, 44, 0.18);
  border-radius: 1rem;
  background: rgba(205, 61, 61, 0.1);
  color: #8f1818;
  font-weight: 700;
}

/* Cart confirmation overlay */
.cart-overlay {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 9000;
  width: 23rem;
  max-width: calc(100vw - 2rem);
}

.cart-overlay[hidden] {
  display: none;
}

.cart-overlay__panel {
  border-radius: var(--radius-lg);
  background: #fff;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18), 0 4px 12px rgba(0, 0, 0, 0.08);
  padding: 1.35rem;
  animation: cart-slide-in 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes cart-slide-in {
  from { opacity: 0; transform: translateY(-10px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0)   scale(1);    }
}

.cart-overlay__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.1rem;
}

.cart-overlay__badge {
  font-family: var(--heading-font);
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text);
}

.cart-overlay__badge::before {
  content: "✓ ";
  color: var(--success);
}

.cart-overlay__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.2rem;
  height: 2.2rem;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  transition: background 140ms ease;
}

.cart-overlay__close:hover {
  background: var(--panel-alt);
}

.cart-overlay__item {
  display: grid;
  grid-template-columns: 5.5rem 1fr;
  gap: 1rem;
  padding: 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
  background: var(--panel-alt);
}

.cart-overlay__thumb {
  width: 5.5rem;
  height: 5.5rem;
  border-radius: 0.75rem;
  background: #f0f0f0;
  overflow: hidden;
  flex: 0 0 auto;
}

.cart-overlay__thumb canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.cart-overlay__details {
  display: grid;
  align-content: center;
  gap: 0.2rem;
}

.cart-overlay__details strong {
  display: block;
  font-size: 1rem;
  font-weight: 800;
}

.cart-overlay__details p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.4;
}

.cart-overlay__price {
  margin-top: 0.35rem !important;
  font-weight: 800 !important;
  font-size: 1rem !important;
  color: var(--text) !important;
}

.cart-overlay__actions {
  display: grid;
  gap: 0.55rem;
}

.cart-overlay__link {
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
  padding: 0.4rem;
  text-align: center;
  transition: opacity 140ms ease;
}

.cart-overlay__link:hover {
  opacity: 0.65;
}

@media (max-width: 1300px) {
  .builder-grid {
    grid-template-columns: 1fr 1fr 1fr;
  }
  .upload-panel {
    grid-column: 1 / -1;
    flex-direction: row;
    align-items: center;
    padding: 0.75rem 1rem;
    min-height: 0;
  }
  .upload-panel__thumb {
    width: 5rem;
    height: 5rem;
    flex: 0 0 auto;
    padding: 0;
    object-position: center;
  }
  .upload-panel__footer {
    flex: 1;
    flex-direction: row;
    align-items: center;
    border-top: none;
    border-left: 1px solid var(--border);
    padding: 0 0 0 1rem;
    gap: 0.75rem;
    text-align: left;
  }
  .upload-panel__footer p {
    margin-bottom: 0;
  }
  .upload-panel__btn {
    width: auto;
    min-width: 12rem;
    margin-left: auto;
  }
}

@media (max-width: 980px) {
  .editor-body {
    overflow: auto;
  }

  .builder-shell {
    width: min(calc(100% - 1.4rem), var(--content-width));
    padding-top: 1.4rem;
  }

  .builder-grid,
  .editor-shell {
    grid-template-columns: 1fr;
    height: auto;
  }

  .upload-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .button-primary {
    width: 100%;
  }

  .editor-stage {
    height: auto;
    padding: 1rem;
    overflow: visible;
  }

  .editor-stage__topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .editor-link {
    width: 100%;
  }

  .preview-frame {
    height: auto;
    min-height: 28rem;
  }

  .preview-canvas-shell {
    inset: 1rem;
  }

  .editor-sidebar {
    height: auto;
    border-left: 0;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    overflow: visible;
  }

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

  .preview-zoom {
    grid-template-columns: 1fr;
    width: min(calc(100% - 1.5rem), 22rem);
    justify-items: stretch;
    text-align: center;
  }
}
