:root {
  --bg: #ffffff;
  --panel: #ffffff;
  --panel-strong: #ffffff;
  --ink: #201b18;
  --muted: #5a524b;
  --line: #d8cec3;
  --line-strong: #504640;
  --orange: #f2aa2f;
  --orange-deep: #df8d14;
  --orange-border: #8d5607;
  --cta-ink: #fff;
  --gold: #f5c146;
  --teal: #31c5be;
  --teal-deep: #179b95;
  --good: #31c5be;
  --good-deep: #179b95;
  --danger: #d85d62;
  --danger-deep: #bb4048;
  --danger-border: #8d2f37;
  --danger-ink: #fff9f9;
  --neutral-btn: #eee5da;
  --neutral-btn-strong: #ffffff;
  --neutral-btn-hover: #e4d8ca;
  --support-ink: #f7fffe;
  --shadow: 0 18px 44px rgba(46, 42, 40, 0.08);
  --font-brand: "Nunito", "Avenir Next", "Segoe UI", sans-serif;
  --status-sticky-top: 76px;
  --nav-card-sticky-top: 76px;
}

/* UX simplification refresh */
:root {
  --panel: #ffffff;
  --panel-strong: #ffffff;
  --line: #ded6cc;
  --line-strong: #514942;
  --orange: #ff7a00;
  --orange-deep: #e06700;
  --orange-border: #934500;
  --danger: #df5c63;
  --danger-deep: #c84750;
  --danger-border: #8f3138;
  --neutral-btn: #eee8df;
  --neutral-btn-strong: #ffffff;
  --neutral-btn-hover: #e7ded3;
  --shadow: 0 8px 20px rgba(33, 27, 22, 0.055);
}

body {
  background: #ffffff;
}

.panel {
  border-radius: 12px;
  box-shadow: var(--shadow);
  backdrop-filter: none;
}

.app-navbar,
.controls-panel,
.generate-stage-panel,
.preview-section,
.output,
.instructions,
.finish-panel {
  border-radius: 12px;
}

#exportSectionPanel > .preview-header,
.setup-inline-editor-frame > .setup-inline-editor-header {
  display: none;
}

.controls-panel {
  padding-top: 20px;
}

.setup-workspace,
.controls {
  gap: 18px;
}

.setup-block,
.size-crop-control,
.setup-advanced,
.generate-summary-panel,
.preview-panel,
.export-option,
.setup-inline-editor-frame {
  border: 1px solid rgba(89, 77, 68, 0.13);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: none;
}

.setup-block,
.size-crop-control {
  padding: 16px;
}

.size-crop-control {
  width: min(100%, 360px);
}

.setup-advanced {
  padding: 16px;
}

.setup-advanced summary {
  display: none;
}

.setup-advanced-grid {
  margin-top: 0;
}

.controls-panel[data-flow-card="setup-dimensions"] {
  grid-template-columns: minmax(0, 1fr) !important;
  align-items: start;
}

.controls-panel[data-flow-card="setup-dimensions"] .controls {
  grid-column: 1;
}

.controls-panel[data-flow-card="setup-dimensions"] #setupEnhancePanel {
  grid-column: 1;
  grid-row: auto;
  margin-top: 0;
}

.controls-panel[data-flow-card="setup-dimensions"] .size-crop-control {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(220px, 340px) auto;
  gap: 10px 12px;
  align-items: end;
}

.controls-panel[data-flow-card="setup-dimensions"] .size-crop-control > .label-row {
  grid-column: 1 / -1;
}

.controls-panel[data-flow-card="setup-dimensions"] #boardRecommendation,
.controls-panel[data-flow-card="setup-dimensions"] #aspectRatioWarning,
.controls-panel[data-flow-card="setup-dimensions"] .size-crop-actions {
  grid-column: 1 / -1;
}

.controls-panel[data-flow-card="setup-dimensions"] .setup-inline-editor-frame {
  padding: 0;
  border: 0;
  background: transparent;
}

.controls-panel[data-flow-card="setup-dimensions"] .image-editor-shell {
  grid-template-columns: minmax(0, 1fr);
}

.controls-panel[data-flow-card="setup-dimensions"] #editorCropSidebar {
  display: none;
}

.flow-card-actions,
.sticky-export-cue {
  display: none !important;
}

button.mini-btn,
.mini-btn-link,
.flow-prev-btn,
.flow-next-btn,
.app-substep-pill,
.app-stepper-step,
.navbar-total-card,
.export-option {
  border-radius: 12px !important;
}

button.mini-btn,
.mini-btn-link {
  min-height: 44px;
  padding: 10px 16px;
  box-shadow: none;
}

.flow-prev-btn,
.flow-next-btn {
  min-height: 48px;
  box-shadow: 0 6px 14px rgba(147, 69, 0, 0.16);
}

.flow-prev-btn,
.flow-next-btn,
button.cta-btn,
.mini-btn-link.cta-btn,
.primary-generate-btn,
.primary-export-btn {
  background: linear-gradient(180deg, #ff8a1a 0%, var(--orange) 58%, var(--orange-deep) 100%);
}

.app-stepper-step,
.app-substep-pill,
.navbar-total-card {
  box-shadow: none;
}

.app-stepper-step {
  border-radius: 999px !important;
}

.app-substep-pill {
  min-height: 28px;
  border-radius: 999px !important;
}

.app-substep-pill.active {
  background: rgba(24, 184, 175, 0.12);
  border-color: rgba(24, 184, 175, 0.46);
  color: var(--teal-deep);
}

.app-substep-pill.complete {
  background: #e7e1d7;
  border-color: #b6aba0;
  color: #4f4943;
}

.app-substep-pill.pending,
.app-substep-pill.upcoming {
  background: #f3efe9;
  border-color: rgba(89, 77, 68, 0.12);
  color: #7a7168;
}

.app-substep-pill:not(:last-child)::after {
  background: rgba(89, 77, 68, 0.18);
}

.info-btn {
  border-radius: 999px;
  background: rgba(24, 184, 175, 0.1);
  border-color: rgba(24, 184, 175, 0.62);
  color: #0d7770;
  position: relative;
}

.info-btn:hover,
.info-btn:focus-visible {
  transform: scale(1.06);
}

.info-popover,
.floating-popover {
  border: 1px solid rgba(32, 27, 24, 0.18);
  background: rgba(28, 26, 25, 0.97);
  color: #fff7ef;
  box-shadow: 0 18px 40px rgba(21, 18, 17, 0.32);
  transform-origin: bottom center;
  transition: transform 120ms ease;
}

.floating-popover:hover,
.floating-popover:focus-within {
  transform: scale(1.02);
}

.floating-popover::after {
  display: none;
}

.board-preset-picker {
  position: relative;
  width: min(100%, 340px);
  z-index: 6;
}

.board-preset-trigger {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 18px;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 52px;
  padding: 12px 14px;
  border: 2px solid rgba(23, 155, 149, 0.78);
  border-radius: 10px;
  background: linear-gradient(180deg, #ffffff, #f3fffd);
  color: var(--ink);
  font: inherit;
  font-weight: 900;
  text-align: left;
  box-shadow: 0 3px 0 rgba(17, 128, 121, 0.12), inset 0 0 0 1px rgba(255, 255, 255, 0.72);
}

.board-preset-trigger:hover,
.board-preset-trigger:focus-visible,
.board-preset-trigger.open {
  border-color: var(--teal-deep);
  background: linear-gradient(180deg, #ffffff, #e8fffc);
  box-shadow: 0 0 0 4px rgba(24, 184, 175, 0.15), 0 4px 0 rgba(17, 128, 121, 0.14);
}

.board-preset-trigger-chevron {
  width: 12px;
  height: 12px;
  border-right: 3px solid var(--teal-deep);
  border-bottom: 3px solid var(--teal-deep);
  transform: translateY(-3px) rotate(45deg);
  transition: transform 140ms ease;
}

.board-preset-trigger.open .board-preset-trigger-chevron {
  transform: translateY(2px) rotate(225deg);
}

.board-preset-list {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 30;
  display: grid;
  gap: 6px;
  width: 100%;
  max-height: min(58vh, 380px);
  overflow: auto;
  padding: 8px;
  border: 2px solid rgba(23, 155, 149, 0.78);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 42px rgba(37, 31, 27, 0.18);
}

.board-preset-list.hidden {
  display: none;
}

.board-preset-pill {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 52px;
  text-align: left;
  padding: 11px 13px;
  border: 1px solid rgba(89, 77, 68, 0.16);
  border-radius: 10px;
  background: linear-gradient(180deg, #fffdf9, #fbf7f0);
  color: var(--ink);
  font: inherit;
  font-weight: 900;
  box-shadow: none;
}

.board-preset-pill:hover,
.board-preset-pill:focus-visible {
  border-color: rgba(23, 155, 149, 0.48);
  background: #effffc;
}

.board-preset-pill.active {
  border-color: var(--teal-deep);
  background: rgba(24, 184, 175, 0.14);
  color: var(--teal-deep);
  box-shadow: inset 0 0 0 1px rgba(24, 184, 175, 0.24);
}

.size-crop-actions {
  margin-top: 8px;
}

.setup-inline-editor-frame {
  padding: 18px;
  background: transparent;
  border-color: rgba(89, 77, 68, 0.1);
}

.image-editor-shell {
  grid-template-columns: minmax(250px, 320px) minmax(0, 1fr);
  gap: 20px;
}

.image-editor-sidebar,
.editor-sidebar-panel,
.image-editor-stage,
.editor-stage-panel {
  gap: 16px;
}

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

.cropper-shell {
  width: 100%;
  max-width: 880px;
  min-height: 460px;
  margin-inline: auto;
  border-radius: 14px;
  background: #f8f5ef;
}

.controls-panel[data-flow-card="setup-dimensions"] .cropper-shell {
  max-width: none;
  min-height: clamp(320px, 42vw, 520px);
}

.image-settings-heading {
  align-items: center;
}

.image-toggle-grid {
  display: grid;
  gap: 12px;
}

.editor-advanced-tools {
  border-radius: 16px;
}

.image-setting-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid rgba(89, 77, 68, 0.12);
  border-radius: 12px;
  background: #fffdf9;
}

.setting-label {
  font-weight: 800;
}

.image-slider-controls {
  display: grid;
  gap: 10px;
}

.image-setting-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 7px;
  align-items: stretch;
  padding: 10px 12px;
  border: 1px solid rgba(73, 67, 63, 0.12);
  border-radius: 10px;
  background: #fff;
}

.setting-row-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.setting-value {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  margin-left: 6px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(49, 197, 190, 0.12);
  color: var(--teal-deep);
  font-size: 0.78rem;
  font-weight: 900;
}

.setting-slider-control {
  display: grid;
  grid-template-columns: minmax(150px, 260px);
  align-items: center;
  width: min(100%, 260px);
}

.setting-slider-control input[type="range"] {
  width: 100%;
  accent-color: var(--orange);
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
}

.setting-slider-control input[type="range"]::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 999px;
  background: #d7d7d7;
}

.setting-slider-control input[type="range"]::-webkit-slider-thumb {
  width: 18px;
  height: 18px;
  margin-top: -6px;
  border: 2px solid var(--orange-border);
  border-radius: 50%;
  background: var(--orange);
  cursor: pointer;
  -webkit-appearance: none;
}

.setting-slider-control input[type="range"]::-moz-range-track {
  height: 6px;
  border-radius: 999px;
  background: #d7d7d7;
}

.setting-slider-control input[type="range"]::-moz-range-progress {
  height: 6px;
  border-radius: 999px;
  background: var(--orange);
}

.setting-slider-control input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border: 2px solid var(--orange-border);
  border-radius: 50%;
  background: var(--orange);
  cursor: pointer;
}

.setting-stepper {
  display: inline-grid;
  grid-template-columns: 40px 60px 82px 40px;
  gap: 8px;
  align-items: center;
}

.setting-toggle-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 10px;
  border: 1px solid rgba(89, 77, 68, 0.24);
  border-radius: 10px;
  background: #fff;
  color: #6d655d;
  font-size: 0.86rem;
  font-weight: 800;
  cursor: pointer;
}

.setting-toggle-chip input {
  position: absolute;
  inset: 0;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

.setting-toggle-chip:has(input:checked) {
  background: rgba(49, 197, 190, 0.14);
  border-color: rgba(23, 155, 149, 0.5);
  color: #117d77;
}

.setting-stepper input {
  width: 82px;
  min-height: 42px;
  text-align: center;
  border: 1px solid rgba(89, 77, 68, 0.24);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 800;
}

.stepper-btn {
  min-width: 34px;
  padding-inline: 0;
}

.image-settings-actions,
.crop-tools-row,
.crop-action-row {
  justify-content: flex-start;
  flex-wrap: wrap;
}

#setupPreviewCanvas,
#generateSummaryCanvas,
#imageControlsPreviewCanvas,
#originalCanvas,
#mosaicCanvas {
  aspect-ratio: auto !important;
  height: auto !important;
}

#setupPreviewCanvas {
  display: block;
  width: auto;
  height: auto;
  max-width: 520px;
}

.generate-stage-panel {
  display: grid;
  gap: 18px;
  padding: 24px;
}

.generate-summary-panel {
  grid-template-columns: 1fr;
  justify-items: center;
  gap: 18px;
}

#generateSummaryCanvas {
  width: min(100%, 560px);
  max-width: 560px;
}

.generate-summary-copy {
  width: min(100%, 840px);
  justify-items: stretch;
}

.generate-summary-title-row {
  justify-content: center;
  margin-bottom: 10px;
}

.generate-summary-title-row .info-btn {
  display: none;
}

.generate-summary-band {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  justify-content: center;
  padding: 14px 18px;
  border: 1px solid rgba(89, 77, 68, 0.14);
  border-radius: 14px;
  background: #fffdf9;
  font-weight: 700;
}

.primary-action-wrap {
  width: auto;
  margin-inline: auto;
}

#reviewGenerateCard > .control-actions {
  display: flex !important;
  justify-content: center;
  margin: 0;
}

#reviewGenerateCard .primary-action-wrap {
  width: auto;
}

.primary-generate-btn {
  width: auto;
  min-width: 240px;
}

#processBtn {
  padding-inline: 24px;
}

#processBtn::before {
  content: none;
}

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

.preview-layout > .preview-panel:first-child {
  display: none;
}

.lego-plan-panel {
  padding: 0;
  border: 0;
  background: transparent;
}

.plan-preview-stack {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  justify-items: center;
}

.plan-preview-block {
  display: grid;
  gap: 12px;
  justify-items: center;
  width: 100%;
}

.preview-panel canvas,
.plan-preview-block canvas,
#imageControlsPreviewCanvas {
  width: auto;
  max-width: 100%;
  height: auto !important;
  border-radius: 14px;
  border: 1px solid rgba(89, 77, 68, 0.12);
  background: #fff;
}

#imageControlsPreviewCanvas {
  max-width: 980px;
  margin-inline: auto;
}

.export-options {
  grid-template-columns: 1fr;
}

.export-option {
  padding: 18px;
  width: min(100%, 560px);
}

.finish-panel {
  display: grid;
  justify-items: center;
  gap: 18px;
  padding: 36px 24px;
  text-align: center;
}

.finish-copy h2,
.finish-copy p {
  margin: 0;
}

.finish-copy {
  display: grid;
  gap: 8px;
}

.legacy-image-controls {
  display: none !important;
}

.sticky-export-cue {
  display: none !important;
}

@media (max-width: 900px) {
  .controls-panel[data-flow-card="setup-dimensions"] {
    grid-template-columns: 1fr;
  }

  .controls-panel[data-flow-card="setup-dimensions"] #setupEnhancePanel {
    grid-column: 1;
    grid-row: auto;
  }

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

  .cropper-shell {
    min-height: 380px;
  }

  .plan-preview-stack {
    grid-template-columns: 1fr;
  }

  .image-setting-row {
    grid-template-columns: 1fr;
  }

  .setting-stepper {
    justify-content: start;
  }
}

* {
  box-sizing: border-box;
}

.hidden {
  display: none !important;
}

body {
  margin: 0;
  font-family: var(--font-brand);
  color: var(--ink);
  background: #ffffff;
  overflow-x: hidden;
}

.home-splash {
  position: relative;
  overflow: hidden;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: clamp(18px, 4vw, 52px) clamp(12px, 3vw, 36px);
  background:
    radial-gradient(circle at 18% 16%, rgba(255, 122, 0, 0.24), transparent 34%),
    radial-gradient(circle at 86% 18%, rgba(43, 182, 172, 0.22), transparent 32%),
    radial-gradient(circle at 58% 88%, rgba(255, 122, 0, 0.18), transparent 36%),
    linear-gradient(118deg, rgba(255, 255, 255, 0.94) 0%, rgba(255, 249, 241, 0.88) 50%, rgba(231, 252, 249, 0.8) 100%);
}

.home-splash::before,
.home-splash::after {
  content: "";
  position: absolute;
  inset: -12%;
  pointer-events: none;
}

.home-splash::before {
  opacity: 0.68;
  background:
    radial-gradient(ellipse at 24% 28%, rgba(255, 122, 0, 0.42), transparent 34%),
    radial-gradient(ellipse at 78% 18%, rgba(43, 182, 172, 0.34), transparent 31%),
    radial-gradient(ellipse at 62% 72%, rgba(255, 122, 0, 0.24), transparent 36%),
    conic-gradient(from 120deg at 50% 42%, transparent 0 18%, rgba(43, 182, 172, 0.14) 28%, transparent 38%, rgba(255, 122, 0, 0.18) 55%, transparent 68%);
  filter: blur(34px);
}

.home-splash::after {
  inset: 7% 10% auto;
  height: 42%;
  border-radius: 999px;
  background:
    radial-gradient(ellipse at center, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.34) 64%, transparent 76%);
  filter: blur(18px);
}

.home-splash-inner {
  position: relative;
  z-index: 1;
  width: min(1120px, calc(100vw - 24px));
  display: grid;
  gap: clamp(14px, 2.4vw, 26px);
  justify-items: center;
  text-align: center;
}

.home-brand-block {
  width: 100%;
  display: grid;
  justify-items: center;
  gap: 6px;
}

.home-brand-logo {
  display: block;
  width: min(960px, 100%);
  max-height: 300px;
  object-fit: contain;
}

.home-title {
  margin: clamp(4px, 1vw, 12px) 0 0;
  color: var(--orange);
  font-size: clamp(2.75rem, 8vw, 5.4rem);
  font-weight: 1000;
  line-height: 0.95;
}

.home-brand-copy {
  width: min(960px, 100%);
  margin: 0;
  color: var(--teal-deep);
  font-size: clamp(1.25rem, 3.1vw, 2.45rem);
  font-weight: 1000;
  line-height: 1.35;
}

.home-demo {
  width: min(1040px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(30px, 6vw, 70px) minmax(0, 1fr);
  align-items: center;
  justify-content: center;
  gap: clamp(4px, 1.2vw, 16px);
}

.home-demo-frame {
  min-width: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}

.home-demo-frame img {
  width: 100%;
  aspect-ratio: 4 / 3.35;
  object-fit: cover;
  object-position: center;
  border: 2px solid rgba(255, 122, 0, 0.34);
  border-radius: 6px;
  background: transparent;
}

.home-demo-frame:first-child img {
  object-position: center 42%;
}

.home-demo-frame-mosaic img {
  image-rendering: auto;
  object-position: center;
}

.home-demo-frame figcaption {
  color: var(--teal-deep);
  font-size: clamp(0.92rem, 1.5vw, 1.08rem);
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.home-demo-arrow {
  display: grid;
  place-items: center;
  width: 100%;
  height: clamp(36px, 7vw, 70px);
}

.home-demo-arrow span {
  position: relative;
  display: block;
  width: 100%;
  height: clamp(5px, 1vw, 8px);
  border-radius: 999px;
  background: #12100f;
}

.home-demo-arrow span::after {
  content: "";
  position: absolute;
  right: -2px;
  top: 50%;
  width: clamp(18px, 3vw, 28px);
  height: clamp(18px, 3vw, 28px);
  border-top: clamp(5px, 1vw, 8px) solid #12100f;
  border-right: clamp(5px, 1vw, 8px) solid #12100f;
  transform: translateY(-50%) rotate(45deg);
  border-radius: 3px;
}

.home-start-btn {
  min-width: min(320px, 100%);
  min-height: 64px;
  padding-inline: 36px;
  border-radius: 14px !important;
  font-size: clamp(1.2rem, 2.3vw, 1.55rem);
}

@media (max-width: 768px) {
  .home-splash {
    align-items: start;
    padding: 18px 8px 30px;
  }

  .home-brand-logo {
    width: 100%;
    max-height: 196px;
  }

  .home-title {
    font-size: clamp(2.45rem, 12vw, 4.1rem);
  }

  .home-brand-copy {
    font-size: clamp(1.02rem, 5.2vw, 1.48rem);
  }

  .home-demo {
    grid-template-columns: minmax(0, 1fr) 28px minmax(0, 1fr);
    gap: 2px;
  }

  .home-demo-frame {
    width: 100%;
    justify-self: center;
    gap: 6px;
  }

  .home-demo-frame img {
    aspect-ratio: 4 / 3.35;
  }

  .home-demo-arrow {
    width: 100%;
    height: 40px;
    transform: none;
  }

  .home-demo-arrow span::after {
    right: 0;
  }

  .home-demo-frame figcaption {
    font-size: 0.72rem;
    letter-spacing: 0.04em;
  }

  .home-start-btn {
    width: min(100%, 340px);
  }
}

.app {
  max-width: 1180px;
  margin: 0 auto;
  padding: 8px 24px 104px;
  display: grid;
  gap: 12px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 22px;
  backdrop-filter: none;
}

.section-kicker,
.overlay-eyebrow {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--teal-deep);
}

.preview-header h2,
.preview-header h3,
.preview-panel h3,
.plan-preview-block h4 {
  margin: 0;
  font-family: var(--font-brand);
}

.status-banner {
  position: sticky;
  top: var(--status-sticky-top);
  z-index: 20;
  border: 1px solid #d0c4b8;
  border-radius: 16px;
  background: rgba(255, 249, 240, 0.96);
  color: #473f39;
  padding: 12px 16px;
  backdrop-filter: blur(10px);
  box-shadow: 0 16px 30px rgba(46, 42, 40, 0.08);
}

.status-banner.error {
  border-color: #d8938a;
  background: rgba(255, 241, 239, 0.98);
  color: #7a221a;
}

.status-banner.success {
  border-color: rgba(43, 182, 172, 0.4);
  background: rgba(238, 250, 248, 0.98);
  color: #145f58;
}

.app-navbar {
  position: sticky;
  top: 0;
  z-index: 18;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto minmax(220px, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 72px;
  padding: 7px 16px;
  border-top: 0;
  border-inline: 0;
  border-radius: 0 !important;
  border-color: rgba(89, 77, 68, 0.14);
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(10px);
  transition: grid-template-columns 180ms ease, padding 180ms ease, box-shadow 180ms ease;
  box-shadow: 0 1px 0 rgba(73, 67, 63, 0.1);
}

.app-navbar.navbar-compact {
  grid-template-columns: minmax(220px, 1fr) auto minmax(220px, 1fr);
  box-shadow: 0 1px 0 rgba(73, 67, 63, 0.1);
}

.app-navbar-brand {
  min-width: 0;
  height: 62px;
  overflow: hidden;
  display: flex;
  align-items: center;
}

.app-navbar-logo-button {
  display: inline-grid;
  place-items: center start;
  min-width: 0;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent !important;
  color: inherit;
  box-shadow: none !important;
}

.app-navbar-logo-button:hover,
.app-navbar-logo-button:focus-visible {
  transform: none;
  filter: none;
}

.app-navbar.navbar-compact .app-navbar-brand {
  height: 62px;
}

.app-navbar-logo {
  width: 224px;
  max-width: none;
  display: block;
  margin-left: -13px;
  margin-top: -18px;
  margin-bottom: -22px;
}

.app-navbar-logo-wrap {
  display: block;
}

.app-navbar.navbar-compact .app-navbar-logo {
  width: 224px;
  margin-left: -13px;
  margin-top: -18px;
  margin-bottom: -22px;
}

.app-navbar-timeline {
  position: relative;
  min-width: 0;
  width: min(100%, 360px);
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  justify-self: center;
  gap: 32px;
  align-items: flex-start;
  padding: 6px 0 10px;
}

.app-navbar-timeline::before {
  content: "";
  position: absolute;
  left: calc(50% - 126px);
  right: calc(50% - 126px);
  top: 28px;
  height: 2px;
  border-radius: 999px;
  background: rgba(89, 77, 68, 0.16);
  pointer-events: none;
}

.app-stepper {
  display: contents;
}

.app-stepper-step {
  position: relative;
  z-index: 2;
  flex: 0 0 auto;
  min-width: 52px;
  min-height: 60px;
  width: auto;
  height: auto;
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 6px;
  text-align: center;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent !important;
  color: var(--ink);
  box-shadow: none;
}

.app-navbar.navbar-compact .app-stepper-step {
  min-height: 54px;
  width: auto;
  height: auto;
  padding: 0;
}

.app-stepper-step.active {
  background: transparent;
  box-shadow: none;
}

.app-stepper-step.complete {
  background: transparent;
  color: var(--ink);
}

.app-stepper-step.complete .app-stepper-index {
  background: var(--teal);
  color: var(--support-ink);
}

.app-stepper-step.future {
  background: transparent;
  color: var(--ink);
  box-shadow: none;
}

.app-stepper-step:disabled {
  cursor: not-allowed;
  opacity: 1;
  background: transparent !important;
  color: var(--ink) !important;
  -webkit-text-fill-color: currentColor;
}

.app-stepper-step:disabled .app-stepper-index {
  color: var(--support-ink);
  -webkit-text-fill-color: var(--support-ink);
}

.app-stepper-index {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.88);
  background: var(--teal);
  color: var(--support-ink);
  font-size: 0.84rem;
  font-weight: 900;
  box-shadow: 0 0 0 3px rgba(24, 184, 175, 0.14);
  transition: width 180ms ease, height 180ms ease, transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.app-stepper-step.active .app-stepper-index {
  width: 44px;
  height: 44px;
  font-size: 1.02rem;
  box-shadow: 0 0 0 5px rgba(24, 184, 175, 0.16), 0 10px 22px rgba(24, 128, 121, 0.2);
}

.app-stepper-copy {
  position: static;
  width: auto;
  min-width: 48px;
  height: auto;
  overflow: visible;
  clip: auto;
  white-space: normal;
  color: var(--ink);
}

.app-stepper-copy strong,
.app-stepper-copy small {
  min-width: 0;
  overflow-wrap: anywhere;
}

.app-stepper-copy strong {
  display: block;
  font-size: 0.68rem;
  line-height: 1.1;
}

.app-substep-rail {
  display: none;
}

.setup-tools-fab-menu {
  position: static;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  width: 100%;
  margin-top: 12px;
  transform: none;
}

.review-tools-fab-menu {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 24;
  display: grid;
  justify-items: end;
  gap: 12px;
}

.setup-tools-fab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 58px;
  min-width: 58px;
  padding: 10px;
  border-radius: 8px;
  border-color: rgba(24, 128, 121, 0.34);
  background: rgba(255, 255, 255, 0.96);
  color: var(--teal-deep);
  box-shadow: 0 10px 24px rgba(28, 24, 20, 0.14);
}

.setup-tools-fab.active {
  border-color: rgba(24, 128, 121, 0.48);
  background: rgba(232, 250, 247, 0.98);
  box-shadow: 0 10px 26px rgba(24, 128, 121, 0.18);
}

.setup-tools-fab:hover:not(:disabled) {
  transform: translateY(-1px);
}

.setup-tool-icon {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border-radius: 8px;
  background: rgba(24, 184, 175, 0.12);
  color: var(--teal-deep);
}

.setup-tool-icon svg {
  width: 28px;
  height: 28px;
}

.setup-tool-icon path,
.setup-tool-icon circle {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.setup-tools-fab-label,
.setup-tool-label {
  font-weight: 900;
  line-height: 1.1;
}

.setup-tools-fab-label {
  display: inline-block;
  max-width: 180px;
  opacity: 1;
  overflow: hidden;
  white-space: nowrap;
  transition: max-width 160ms ease, opacity 120ms ease;
}

.review-tools-fab .setup-tools-fab-label {
  max-width: 0;
  opacity: 0;
}

.review-tools-fab:hover .setup-tools-fab-label,
.review-tools-fab:focus-visible .setup-tools-fab-label,
.review-tools-fab:focus-within .setup-tools-fab-label {
  max-width: 180px;
  opacity: 1;
}

.setup-tool-label {
  white-space: normal;
}

.setup-tools-backdrop {
  position: fixed;
  inset: 0;
  z-index: 22;
  background: rgba(32, 28, 24, 0.18);
}

.setup-tools-panel {
  position: fixed;
  top: 12px;
  right: 12px;
  bottom: auto;
  z-index: 25;
  width: min(920px, calc(100vw - 48px));
  max-height: calc(100vh - 24px);
  display: grid;
  pointer-events: none;
}

.setup-tools-shell {
  max-height: calc(100vh - 24px);
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  border: 1px solid rgba(73, 67, 63, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 20px 50px rgba(28, 24, 20, 0.2);
  overflow: hidden;
  pointer-events: auto;
}

.setup-tools-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid rgba(73, 67, 63, 0.1);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(242, 250, 248, 0.92));
}

.setup-tools-header h2 {
  margin: 2px 0 0;
}

.setup-tools-description {
  max-width: 680px;
  margin: 6px 0 0;
}

.setup-tools-close {
  width: auto;
  height: auto;
  min-width: 76px;
  min-height: 40px;
  padding: 9px 14px;
  border-radius: 8px;
  font-size: 0.95rem;
  line-height: 1.1;
}

.setup-tools-body {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

.setup-tools-nav {
  display: none;
  align-content: start;
  gap: 8px;
  padding: 12px;
  border-right: 1px solid rgba(73, 67, 63, 0.1);
  background: rgba(248, 246, 242, 0.82);
}

.setup-tool-tab {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  min-height: 48px;
  padding: 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.76);
  border-color: rgba(73, 67, 63, 0.12);
  color: var(--ink);
  text-align: left;
  box-shadow: none;
}

.setup-tool-tab.active {
  border-color: rgba(24, 128, 121, 0.36);
  background: rgba(232, 250, 247, 0.96);
  color: var(--teal-deep);
}

.setup-tools-content {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  overflow-x: hidden;
  padding: 18px;
}

.setup-tool-mount {
  min-width: 0;
  display: grid;
  gap: 14px;
}

#setupToolDimensionsMount.active {
  grid-template-columns: minmax(250px, 330px) minmax(360px, 1fr);
  grid-template-rows: auto auto;
  align-items: start;
  gap: 18px 32px;
  padding: 20px;
  border: 1px solid rgba(73, 67, 63, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.76);
}

#setupToolDimensionsMount.active .size-crop-control {
  grid-column: 1;
  grid-row: 1;
  width: 100%;
  align-self: start;
}

#setupToolDimensionsMount.active .size-crop-control > .label-row {
  display: none;
}

#setupToolDimensionsMount.active .size-crop-control::before {
  content: "Mosaic dimensions";
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

#setupToolDimensionsMount.active #setupEnhancePanel {
  display: contents;
}

#setupToolDimensionsMount.active .setup-inline-editor-frame,
#setupToolDimensionsMount.active .setup-inline-editor-mount {
  display: contents;
}

#setupToolDimensionsMount.active .image-editor-shell {
  display: contents;
}

#setupToolDimensionsMount.active .image-editor-sidebar {
  grid-column: 1;
  grid-row: 2;
  min-width: 0;
  align-self: start;
}

#setupToolDimensionsMount.active #editorCropSidebar {
  gap: 10px;
  padding-top: 2px;
}

#setupToolDimensionsMount.active .crop-tools-row,
#setupToolDimensionsMount.active .crop-action-row {
  gap: 8px;
}

#setupToolDimensionsMount.active .crop-tools-row .mini-btn,
#setupToolDimensionsMount.active .crop-action-row .mini-btn {
  flex: 1 1 126px;
}

#setupToolDimensionsMount.active .image-editor-stage {
  grid-column: 2;
  grid-row: 1 / span 2;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  align-self: start;
  justify-self: stretch;
}

#setupToolDimensionsMount.active #editorCropStage {
  min-width: 0;
  width: 100%;
}

#setupToolDimensionsMount.active .crop-preview-stage {
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  width: 100%;
  align-items: start;
}

#setupToolDimensionsMount.active .cropper-shell {
  width: 100%;
  min-height: 0;
  max-height: min(72vh, 760px);
  margin-inline: 0;
}

.floating-history-bar {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 4px;
  border: 1px solid rgba(73, 67, 63, 0.13);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 10px 26px rgba(37, 31, 27, 0.14);
  backdrop-filter: blur(10px);
}

.floating-history-btn {
  width: 30px;
  height: 30px;
  min-width: 30px;
  min-height: 30px;
  padding: 0;
  border-radius: 999px !important;
  font-size: 1rem;
  line-height: 1;
}

.crop-history-bar {
  justify-self: start;
  align-self: start;
  margin-top: 2px;
}

.setup-tools-panel .setup-block,
.setup-tools-panel .size-crop-control,
.setup-tools-panel .setup-advanced,
.setup-tools-panel .setup-inline-editor-frame {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.setup-tools-panel .setup-advanced-grid {
  gap: 16px;
}

.setup-inline-editor-mount .image-editor-shell {
  margin-top: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.setup-inline-editor-mount .image-settings-heading,
.setup-inline-editor-mount .image-controls-preview > .label-row,
.setup-inline-editor-mount #editorCropSidebar > .label-row,
.setup-inline-editor-mount #editorCropSidebar h3,
.setup-inline-editor-mount #editorEnhanceSidebar h4,
.setup-inline-editor-mount #editorEnhanceStage h4,
.setup-inline-editor-mount #cropHint {
  display: none;
}

.setup-inline-editor-mount .image-controls-preview {
  padding: 0;
  border: 0;
  background: transparent;
}

.setup-tool-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(73, 67, 63, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
}

.app-substep-pill {
  appearance: none;
  position: relative;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  gap: 0;
  min-height: 34px;
  min-width: 18px;
  padding: 8px 0 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #665f58;
  font-size: 0.72rem;
  font-weight: 800;
  font-family: inherit;
  white-space: nowrap;
  box-shadow: none;
}

.app-navbar.navbar-compact .app-substep-pill {
  min-height: 34px;
  padding: 2px 0;
  font-size: 0.72rem;
}

.app-navbar-side {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, auto) auto;
  justify-self: end;
  align-items: center;
  gap: 8px;
}

.app-navbar-totals {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  width: min(100%, 142px);
  gap: 0;
  margin-top: 2px;
  padding: 6px 8px;
  border: 1px solid rgba(73, 67, 63, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.92);
}

.navbar-total-card {
  min-width: 0;
  display: grid;
  grid-template-columns: 1fr;
  align-items: start;
  gap: 2px;
  padding: 0 10px;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.navbar-total-card.metric-pending {
  background: transparent;
}

.navbar-total-card.metric-pending span,
.navbar-total-card.metric-pending strong {
  color: #948d86;
}

.navbar-total-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.navbar-info-btn {
  width: 20px;
  height: 20px;
  min-width: 20px;
  min-height: 20px;
  font-size: 0.72rem;
}

.app-navbar.navbar-compact .navbar-total-card {
  padding: 0 10px;
}

.navbar-new-project {
  width: 46px;
  min-width: 46px;
  height: 46px;
  min-height: 46px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  justify-content: center;
  justify-self: end;
  border-radius: 12px !important;
  border-color: rgba(14, 124, 118, 0.72) !important;
  background: var(--teal) !important;
  color: #ffffff !important;
  box-shadow: none !important;
  font-size: 2rem;
  font-weight: 900;
  line-height: 1;
}

.navbar-new-project:hover:not(:disabled) {
  background: #20bfb6 !important;
  color: #ffffff !important;
  border-color: rgba(10, 105, 99, 0.88) !important;
  box-shadow: none !important;
}

.navbar-total-card span {
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
}

.navbar-total-card strong {
  min-width: 0;
  color: var(--ink);
  font-size: 1.15rem;
  font-weight: 900;
  line-height: 1.15;
  text-align: left;
  overflow-wrap: anywhere;
}

.navbar-total-card.metric-pending span,
.navbar-total-card.metric-pending strong {
  color: #948d86;
}

.app-substep-pill:not(:last-child)::after {
  content: none;
}

.substep-status {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 11px;
  height: 11px;
  flex: 0 0 auto;
  border: 2px solid rgba(73, 67, 63, 0.24);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.8);
}

.app-substep-pill.active {
  border-color: transparent;
  background: transparent;
  color: var(--teal-deep);
  box-shadow: none;
}

.app-substep-pill.active .substep-status {
  border-color: var(--teal);
  background: var(--teal);
  box-shadow: 0 0 0 3px rgba(24, 184, 175, 0.18);
}

.app-substep-label {
  display: none;
}

.app-substep-pill.active .app-substep-label {
  position: absolute;
  top: -13px;
  left: 50%;
  display: block;
  width: max-content;
  max-width: 150px;
  padding: 4px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--teal-deep);
  font-size: 0.68rem;
  line-height: 1.1;
  text-align: center;
  white-space: normal;
  box-shadow: 0 2px 8px rgba(33, 27, 22, 0.08);
  transform: translateX(-50%);
}

.app-substep-pill.complete {
  border-color: transparent;
  background: transparent;
  color: #4d4945;
}

.app-substep-pill.complete .substep-status {
  border-color: var(--teal-deep);
  background: var(--teal-deep);
}

.app-substep-pill.complete .substep-status::after {
  content: none;
}

.app-substep-pill.upcoming {
  background: transparent;
  color: #756f68;
}

.app-substep-pill.pending {
  background: transparent;
  color: #7c746d;
}

.app-substep-pill:disabled {
  cursor: not-allowed;
  background: transparent !important;
  color: #7c746d;
  opacity: 1;
}

.app-substep-pill.visual-only {
  pointer-events: none;
}

.app-stage-panel {
  display: grid;
  gap: 18px;
}

.stage-switcher {
  position: sticky;
  top: var(--nav-card-sticky-top);
  z-index: 17;
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr) 104px;
  grid-template-areas: "prev title next";
  align-items: center;
  justify-self: center;
  width: min(100%, 560px);
  gap: 8px;
  min-height: 58px;
  padding: 6px 8px;
  border: 1px solid rgba(89, 77, 68, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: none;
}

.stage-switcher-title {
  grid-area: title;
  min-width: 0;
  display: grid;
  gap: 2px;
  justify-items: center;
  text-align: center;
}

.stage-switcher-title span {
  color: var(--teal-deep);
  font-size: clamp(0.62rem, 0.9vw, 0.78rem);
  font-weight: 900;
  letter-spacing: 0.14em;
  line-height: 1;
  text-transform: uppercase;
}

.stage-switcher-title strong {
  min-width: 0;
  color: var(--ink);
  font-size: clamp(1.02rem, 1.7vw, 1.24rem);
  font-weight: 900;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.stage-switcher-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 104px;
  height: 44px;
  min-width: 104px;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 999px;
  border-color: rgba(13, 112, 107, 0.34);
  background: var(--teal);
  color: #ffffff;
  box-shadow: none;
}

#stageSwitcherPrev {
  grid-area: prev;
}

#stageSwitcherNext {
  grid-area: next;
  justify-self: end;
}

.stage-switcher-chevron {
  display: block;
  width: 13px;
  height: 13px;
  border-color: currentColor;
  border-style: solid;
  border-width: 2px 2px 0 0;
  flex: 0 0 auto;
}

.stage-switcher-chevron-prev {
  transform: rotate(-135deg);
}

.stage-switcher-chevron-next {
  transform: rotate(45deg);
}

.stage-switcher-btn-label {
  display: block;
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
}

.stage-switcher-btn:hover:not(:disabled) {
  background: #20bfb6;
  filter: none;
  transform: translateY(-1px);
}

.stage-switcher-btn:disabled {
  cursor: not-allowed;
  opacity: 0.42;
  filter: grayscale(0.1);
}

.home-panel {
  display: grid;
  gap: 18px;
}

.home-panel-header {
  display: flex;
  justify-content: flex-start;
  align-items: end;
  gap: 16px;
}

.home-panel-header h1 {
  margin: 0;
  font-size: clamp(2.2rem, 5vw, 3.25rem);
  line-height: 1;
}

.home-panel-header p {
  margin: 8px 0 0;
}

.home-gallery {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.home-gallery-empty {
  margin: 0;
}

.home-card {
  display: grid;
  gap: 10px;
  align-content: start;
  padding: 14px;
  border: 1px solid rgba(73, 67, 63, 0.12);
  border-radius: 12px;
  background: rgba(255,255,255,0.94);
  box-shadow: 0 8px 18px rgba(61, 52, 46, 0.06);
  min-height: 220px;
  text-align: left;
}

.home-card:hover {
  transform: translateY(-2px);
}

.home-card-thumb {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid rgba(73, 67, 63, 0.12);
  background: #f7f2eb;
}

.home-card-name {
  display: block;
  font-weight: 800;
  word-break: break-word;
}

.home-card-upload {
  place-items: center;
  justify-items: center;
  border-style: dashed;
  background: linear-gradient(180deg, rgba(255,250,244,0.98), rgba(242,250,248,0.92));
  text-align: center;
}

.home-card-plus {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  border-radius: 24px;
  background: rgba(255,255,255,0.92);
  font-size: 2rem;
  font-weight: 900;
  color: var(--teal-deep);
  box-shadow: inset 0 0 0 1px rgba(73, 67, 63, 0.1);
}

.section-intro {
  margin: 6px 0 0;
}

.controls-panel {
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1fr) !important;
}

.controls {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  align-items: start;
}

.setup-upload-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  justify-items: center;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.setup-upload-summary canvas {
  display: block;
  width: auto;
  height: auto !important;
  max-width: min(100%, 520px);
  max-height: 360px;
  justify-self: center;
}

.setup-upload-meta {
  min-width: 0;
  display: grid;
  gap: 4px;
  justify-items: center;
  text-align: center;
}

.setup-upload-meta strong,
.setup-upload-meta p {
  min-width: 0;
  margin: 0;
}

#setupUploadSummaryName {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.setup-advanced {
  border: 1px solid rgba(73, 67, 63, 0.14);
  border-radius: 10px;
  background: #fffdfa;
  padding: 2px 0;
}

.setup-advanced summary {
  cursor: pointer;
  list-style: none;
  padding: 14px 16px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #ffffff;
}

.setup-advanced summary::-webkit-details-marker {
  display: none;
}

.setup-advanced summary::after {
  content: "▾";
  color: var(--teal-deep);
  font-size: 1rem;
  transition: transform 120ms ease;
}

.setup-advanced[open] summary::after {
  transform: rotate(180deg);
}

.setup-advanced-grid {
  padding: 0 16px 14px;
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.setup-advanced-grid label,
.setup-advanced-grid .toggle-group {
  justify-items: start;
}

.piece-settings-tools .mini-btn {
  width: min(100%, 260px);
}

.label-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.size-crop-control {
  padding: 14px;
  border: 1px solid rgba(73, 67, 63, 0.12);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.92);
}

.dimensions-hidden-select {
  display: none;
}

.size-crop-summary {
  display: grid;
  gap: 6px;
  padding: 12px 14px;
  border: 1px solid rgba(73, 67, 63, 0.1);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.9);
}

.size-crop-summary strong,
.size-crop-summary p {
  margin: 0;
}

.size-crop-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

label,
.static-control {
  display: grid;
  gap: 8px;
  font-weight: 700;
}

input,
select,
button {
  font: inherit;
  border-radius: 10px;
}

input,
select {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid #cfc6bc;
  background: #ffffff;
  color: var(--ink);
}

#buildStyle,
#baseboardColor,
#mosaicType {
  width: min(100%, 320px);
}

input[type="file"] {
  padding: 10px 12px;
  background: #ffffff;
}

.file-input-native {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.upload-drop-zone {
  display: grid;
  gap: 14px;
  cursor: pointer;
}

.upload-drop-zone.has-image {
  cursor: default;
}

.upload-drop-zone.has-image > .static-control-label {
  display: none;
}

.upload-drop-zone:focus-visible .file-input-shell {
  outline: 3px solid rgba(24, 184, 175, 0.28);
  outline-offset: 3px;
}

.upload-drop-zone.is-dragging .file-input-shell {
  border-color: rgba(24, 184, 175, 0.7);
  background: rgba(238, 250, 248, 0.96);
  box-shadow: 0 0 0 4px rgba(24, 184, 175, 0.12);
}

.file-input-shell {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-width: 0;
  min-height: 118px;
  padding: 16px;
  border: 2px dashed rgba(89, 77, 68, 0.28);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.78);
  cursor: pointer;
  overflow: visible;
}

.upload-drop-zone.has-image .file-input-shell {
  min-height: auto;
  padding: 10px 0 0;
  border: 0;
  background: transparent;
}

.upload-drop-zone.has-image .upload-drop-copy {
  display: none;
}

.file-input-shell .mini-btn {
  flex: 0 0 auto;
}

.file-input-shell .secondary-image-btn {
  background: #ffffff;
  border-color: rgba(73, 67, 63, 0.22);
  color: var(--ink);
  box-shadow: none;
}

.upload-drop-icon {
  display: none;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: var(--teal);
  color: var(--support-ink);
  font-size: 1.8rem;
  font-weight: 900;
  line-height: 1;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.56);
}

.upload-drop-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.upload-drop-copy strong {
  font-size: 1.05rem;
}

.upload-drop-copy small {
  color: var(--muted);
  font-weight: 700;
}

.image-controls-preview {
  display: grid;
  gap: 10px;
  margin-bottom: 10px;
  justify-items: center;
  width: 100%;
  max-width: 420px;
  overflow: hidden;
}

.image-controls-preview canvas {
  width: min(100%, 420px);
  max-width: 100%;
  border: 1px solid rgba(49, 45, 43, 0.24);
  border-radius: 14px;
  background: #fff;
  image-rendering: auto;
}

.file-input-name {
  display: block;
  grid-column: 1 / -1;
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-input-name.file-name-expanded {
  position: absolute;
  z-index: 30;
  left: var(--file-name-left, 10px);
  right: 10px;
  top: 50%;
  min-height: 38px;
  max-height: 38px;
  display: flex;
  align-items: center;
  padding: 8px 10px;
  transform: translateY(-50%);
  border: 1px solid rgba(73, 67, 63, 0.18);
  border-radius: 12px;
  background: rgba(255, 254, 251, 0.98);
  box-shadow: 0 16px 34px rgba(46, 42, 40, 0.18);
  color: var(--ink);
  white-space: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  text-overflow: clip;
  scrollbar-width: thin;
}

.helper-text {
  font-weight: 500;
  color: var(--muted);
  line-height: 1.45;
}

.price-guidance {
  display: block;
  margin-top: 6px;
  color: #0e7c76;
  font-weight: 800;
}

.streamlined-note {
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(24, 184, 175, 0.08);
  color: #3d4f4c;
}

.aspect-ratio-warning {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 14px;
  border: 1px solid rgba(141, 47, 55, 0.28);
  border-radius: 10px;
  background: rgba(216, 93, 98, 0.1);
  color: #962e35;
}

.aspect-ratio-warning-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: rgba(216, 93, 98, 0.16);
  color: #962e35;
  font-weight: 900;
  line-height: 1;
  flex: 0 0 auto;
}

.aspect-ratio-warning.top-card-warning {
  grid-column: 1 / -1;
  margin-bottom: 4px;
}

.aspect-ratio-warning-copy {
  display: grid;
  gap: 8px;
}

.aspect-ratio-warning-copy p {
  margin: 0;
}

.crop-surface-active {
  cursor: crosshair;
}

.crop-surface-active.crop-surface-moving {
  cursor: move;
}

.section-note {
  margin: 0;
}

.sticky-export-cue {
  display: none !important;
}

.static-control-value {
  display: block;
  padding: 12px 13px;
  border: 1px solid #c8c0b5;
  border-radius: 10px;
  background: #ffffff;
  color: var(--ink);
  font-weight: 700;
}

.control-actions,
.adjust-actions,
.instructions-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.export-pair {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

button {
  border: 1px solid transparent;
  background: linear-gradient(180deg, var(--neutral-btn-strong), var(--neutral-btn));
  color: var(--ink);
  border-color: rgba(67, 59, 54, 0.24);
  cursor: pointer;
  font-family: var(--font-brand);
  font-weight: 900;
  letter-spacing: 0;
  padding: 10px 14px;
  box-shadow: none;
  transition: transform 120ms ease, filter 120ms ease, box-shadow 120ms ease;
}

.primary-action-wrap {
  width: 100%;
}

.primary-generate-btn {
  width: 100%;
  min-height: 60px;
  font-size: 1.12rem;
  padding-inline: 24px;
}

.setup-continue-btn {
  width: auto;
  min-height: 52px;
}

.control-actions {
  justify-content: space-between;
}

.flow-card-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-top: 18px;
}

#setupStagePanel > .panel > .control-actions,
#reviewStagePanel > .panel:not(#reviewGenerateCard) > .control-actions,
.flow-card-actions {
  display: none !important;
}

.flow-prev-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 52px;
  padding: 13px 22px 13px 54px;
  border-radius: 12px;
  background: linear-gradient(180deg, #fffdf8 0%, #f3ece3 100%);
  border-color: rgba(132, 108, 78, 0.3);
  color: #5e5147;
  box-shadow: 0 4px 14px rgba(67, 59, 54, 0.08);
}

.flow-prev-btn::before {
  content: "";
  position: absolute;
  left: 21px;
  width: 12px;
  height: 12px;
  border-top: 3px solid currentColor;
  border-left: 3px solid currentColor;
  transform: rotate(-45deg);
}

.flow-prev-btn:hover:not(:disabled) {
  background: linear-gradient(180deg, #ffffff 0%, #f4ede4 100%);
  border-color: rgba(132, 108, 78, 0.38);
  box-shadow: 0 7px 18px rgba(67, 59, 54, 0.1);
}

.flow-next-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 52px;
  border-radius: 12px;
  background: linear-gradient(180deg, #fffdf8 0%, #f3ece3 100%);
  border-color: rgba(132, 108, 78, 0.3);
  color: #5e5147;
  box-shadow: 0 4px 14px rgba(67, 59, 54, 0.08);
  padding: 13px 54px 13px 22px;
}

.flow-next-btn::before {
  content: "";
  position: absolute;
  right: 21px;
  width: 12px;
  height: 12px;
  border-top: 3px solid currentColor;
  border-right: 3px solid currentColor;
  transform: rotate(45deg);
}

.flow-next-btn:hover:not(:disabled) {
  background: linear-gradient(180deg, #ffffff 0%, #f4ede4 100%);
  border-color: rgba(132, 108, 78, 0.38);
  box-shadow: 0 7px 18px rgba(67, 59, 54, 0.1);
}

.gleam-btn {
  position: relative;
  overflow: hidden;
}

.gleam-btn::after {
  content: "";
  position: absolute;
  top: -18%;
  left: -34%;
  width: 32%;
  height: 140%;
  transform: rotate(18deg);
  background: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.18) 45%, rgba(255,255,255,0.62) 50%, rgba(255,255,255,0.18) 55%, rgba(255,255,255,0) 100%);
  pointer-events: none;
  opacity: 0;
}

.gleam-btn.gleam-active::after {
  opacity: 1;
  animation: gleamSweep 3.4s linear infinite;
}

@keyframes gleamSweep {
  0% { left: -34%; }
  100% { left: 132%; }
}

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

button:disabled {
  cursor: not-allowed;
  opacity: 1;
  color: #6a6158 !important;
  background: #e6ddd2 !important;
  border-color: #b7aa9a !important;
  box-shadow: none !important;
  filter: none;
}

button.mini-btn,
.mini-btn-link {
  background: linear-gradient(180deg, var(--neutral-btn-strong), var(--neutral-btn));
  color: var(--ink);
  border-color: rgba(67, 59, 54, 0.34);
  box-shadow: 0 2px 0 rgba(67, 59, 54, 0.08);
  padding: 9px 13px;
  font-weight: 800;
}

button.mini-btn:hover:not(:disabled),
.mini-btn-link:hover {
  background: linear-gradient(180deg, #fffdf8, var(--neutral-btn-hover));
}

button.cta-btn,
.mini-btn-link.cta-btn,
.primary-generate-btn,
.primary-export-btn,
.sticky-export-action {
  background: linear-gradient(135deg, var(--orange) 0%, var(--orange-deep) 100%);
  border-color: var(--orange-border);
  color: var(--cta-ink);
  box-shadow: 0 14px 28px rgba(143, 90, 3, 0.2);
}

button.cta-btn:hover:not(:disabled),
.mini-btn-link.cta-btn:hover,
.primary-generate-btn:hover:not(:disabled),
.primary-export-btn:hover:not(:disabled),
.sticky-export-action:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--orange) 0%, var(--orange-deep) 100%);
  box-shadow: 0 18px 34px rgba(143, 90, 3, 0.24);
}

#clearCropBtn {
  background: rgba(216, 93, 98, 0.1) !important;
  color: #962e35 !important;
  border-color: rgba(141, 47, 55, 0.28) !important;
  box-shadow: none !important;
}

#clearCropBtn:hover:not(:disabled) {
  background: rgba(216, 93, 98, 0.16) !important;
}

button.success-btn,
.mini-btn-link.success-btn {
  background: linear-gradient(135deg, var(--good) 0%, var(--good-deep) 100%);
  border-color: rgba(15, 126, 120, 0.84);
  color: var(--support-ink);
  box-shadow: 0 12px 24px rgba(15, 126, 120, 0.18);
}

button.success-btn:hover:not(:disabled),
.mini-btn-link.success-btn:hover {
  background: linear-gradient(135deg, #347f79 0%, #255f5b 100%);
  box-shadow: 0 16px 30px rgba(31, 95, 91, 0.22);
}

button.danger-btn,
.mini-btn-link.danger-btn,
.sticky-export-dismiss {
  background: rgba(216, 93, 98, 0.1);
  border-color: rgba(141, 47, 55, 0.28);
  color: #962e35;
  box-shadow: none;
}

button.danger-btn:hover:not(:disabled),
.mini-btn-link.danger-btn:hover,
.sticky-export-dismiss:hover:not(:disabled) {
  background: rgba(216, 93, 98, 0.16);
  box-shadow: none;
}

button:focus-visible,
.mini-btn-link:focus-visible {
  outline: 3px solid #1f1a17;
  outline-offset: 3px;
}

.info-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  min-width: 24px;
  min-height: 24px;
  flex: 0 0 24px;
  aspect-ratio: 1 / 1;
  padding: 0;
  border-radius: 999px;
  border: 1px solid rgba(15, 126, 120, 0.5);
  background: rgba(24, 184, 175, 0.12);
  color: var(--teal-deep);
  box-shadow: none;
  font-size: 0.82rem;
  font-weight: 900;
}

.navbar-info-btn {
  width: 16px;
  height: 16px;
  min-width: 16px;
  min-height: 16px;
  flex-basis: 16px;
  font-size: 0.58rem;
}

.info-btn:hover,
.info-btn:focus-visible {
  border-color: rgba(15, 126, 120, 0.74);
  background: rgba(24, 184, 175, 0.18);
  color: #075e59;
  box-shadow: 0 0 0 3px rgba(24, 184, 175, 0.1);
}

.inline-info-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.info-popover {
  margin-top: 8px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(24, 148, 139, 0.16);
  background: rgba(238, 250, 248, 0.92);
  color: #235853;
  font-size: 0.94rem;
  font-weight: 700;
  line-height: 1.45;
}

.floating-popover {
  position: fixed;
  z-index: 70;
  width: min(320px, calc(100vw - 24px));
  margin-top: 0;
  box-shadow: 0 16px 36px rgba(46, 42, 40, 0.14);
  transform-origin: bottom center;
  background: rgba(238, 250, 248, 0.98);
  color: #1f5f5a;
}

.floating-popover::after {
  display: none;
}

.generate-summary-panel {
  display: grid;
  grid-template-columns: minmax(110px, 150px) minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  padding: 16px 18px;
  border: 1px solid rgba(73, 67, 63, 0.1);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.78);
}

.generate-summary-copy {
  min-width: 0;
  display: grid;
  gap: 12px;
}

.generate-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}

.generate-summary-chip {
  display: grid;
  gap: 3px;
  padding: 12px 14px;
  border: 1px solid rgba(73, 67, 63, 0.08);
  border-radius: 14px;
  background: rgba(250, 247, 242, 0.88);
}

.generate-summary-chip span {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.generate-summary-chip strong,
.generate-summary-panel .helper-text {
  margin: 0;
}

.preview-section,
.preview-step-content,
#summaryStepContent,
#exportStepContent {
  display: grid;
  gap: 18px;
}

.step-empty-state {
  padding: 18px;
  border: 1px dashed rgba(73, 67, 63, 0.22);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 250, 244, 0.88), rgba(255, 255, 255, 0.92));
}

.step-empty-state h3 {
  margin: 0 0 8px;
  font-size: 1.05rem;
}

.step-empty-state p {
  margin: 0;
}

.enhance-panel,
.image-settings-panel {
  display: grid;
  gap: 14px;
  padding: 16px 18px;
  border: 1px solid rgba(73, 67, 63, 0.14);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.84);
}

#setupEnhancePanel {
  width: 100%;
  min-width: 0;
  justify-self: stretch;
}

.enhance-copy h3,
.export-option-title {
  margin: 0;
}

.image-controls-preview h4 {
  margin: 0;
  font-size: 1rem;
}

.enhance-copy p {
  margin: 6px 0 0;
}

.enhance-actions,
.preview-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.preview-quick-actions {
  margin-top: -4px;
}

.lego-palette-board {
  position: relative;
  display: grid;
  justify-items: center;
  width: min(100%, 620px);
  margin-inline: auto;
  padding: 42px 66px 86px 58px;
  border: 6px solid #ca6100;
  border-radius: 52% 48% 47% 45% / 34% 37% 56% 58%;
  background:
    radial-gradient(ellipse at 78% 72%, #fff 0 8.5%, #cc6500 8.9% 10.3%, transparent 10.7%),
    radial-gradient(ellipse at 47% 37%, rgba(255, 238, 127, 0.48), transparent 58%),
    radial-gradient(ellipse at 25% 18%, rgba(255, 255, 255, 0.42), transparent 34%),
    linear-gradient(145deg, #ffc94d 0%, #ffad2f 49%, #fb8b08 100%);
  box-shadow:
    inset 0 7px 0 rgba(255, 255, 255, 0.3),
    inset 0 -10px 0 rgba(166, 72, 0, 0.12),
    0 10px 0 rgba(130, 91, 37, 0.08);
}

.lego-palette-thumb-hole {
  position: absolute;
  right: 25%;
  bottom: 18%;
  width: 72px;
  height: 58px;
  border: 7px solid #cc6500;
  border-radius: 50%;
  background: #fff;
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.76),
    0 2px 0 rgba(255, 208, 102, 0.7);
}

.lego-palette-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(34px, 1fr));
  gap: 14px 18px;
  width: 100%;
  max-width: 500px;
}

.lego-palette-swatch {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  min-width: 0;
  min-height: 34px;
  padding: 0;
  border: 4px solid color-mix(in srgb, var(--swatch-color) 68%, #6c3b00);
  border-radius: 50%;
  background: color-mix(in srgb, var(--swatch-color) 70%, #fff8d4);
  box-shadow:
    inset 0 4px 0 rgba(255, 255, 255, 0.34),
    inset 0 -5px 0 rgba(0, 0, 0, 0.12),
    0 4px 0 rgba(171, 80, 0, 0.2);
  cursor: pointer;
  transition: transform 120ms ease, filter 120ms ease, box-shadow 120ms ease, opacity 120ms ease;
}

.lego-palette-swatch:hover,
.lego-palette-swatch:focus-visible {
  transform: translateY(-2px) scale(1.04);
  filter: brightness(1.03);
}

.lego-palette-swatch.active {
  border-color: var(--teal-deep);
  box-shadow:
    0 0 0 4px rgba(49, 197, 190, 0.28),
    inset 0 2px 0 rgba(255, 255, 255, 0.72),
    0 3px 0 rgba(51, 35, 24, 0.18);
}

.lego-palette-paint {
  position: absolute;
  inset: 4px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 50%;
  background: var(--swatch-color);
  box-shadow:
    inset 5px 6px 0 rgba(255, 255, 255, 0.24),
    inset -5px -6px 0 rgba(0, 0, 0, 0.16);
}

.lego-palette-paint::after {
  content: "";
  position: absolute;
  top: 17%;
  left: 21%;
  width: 34%;
  height: 22%;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.38);
  transform: rotate(-24deg);
}

.lego-palette-swatch.is-disabled {
  opacity: 0.58;
  filter: grayscale(0.36);
}

.lego-palette-swatch.is-disabled .lego-palette-paint {
  box-shadow:
    inset 2px 3px 0 rgba(255, 255, 255, 0.22),
    inset -3px -4px 0 rgba(0, 0, 0, 0.18);
}

.lego-palette-x {
  position: absolute;
  inset: 7px;
  display: none;
  z-index: 2;
}

.lego-palette-x::before,
.lego-palette-x::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 116%;
  height: 4px;
  border-radius: 999px;
  background: #2b211b;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.46);
}

.lego-palette-x::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.lego-palette-x::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.lego-palette-swatch.is-disabled .lego-palette-x {
  display: block;
}

.mosaic-tuning-panel,
.mosaic-color-replace-panel {
  display: grid;
  gap: 16px;
}

.mosaic-tuning-panel {
  position: relative;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 430px);
  align-items: start;
  padding: 14px;
  overflow: visible;
}

.mosaic-modal-header {
  align-items: flex-start;
}

.mosaic-modal-header .helper-text {
  max-width: 760px;
}

.mosaic-modal-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex: 0 0 auto;
}

.mosaic-workspace,
.mosaic-canvas-shell,
.mosaic-tool-panel {
  min-width: 0;
}

.mosaic-workspace {
  display: grid;
}

.mosaic-canvas-shell {
  position: relative;
  display: grid;
}

.mosaic-history-dashboard {
  position: static;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  width: auto;
  padding: 4px;
  border: 1px solid rgba(73, 67, 63, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: none;
  backdrop-filter: blur(10px);
}

.mosaic-history-fab {
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  padding: 0;
  border-radius: 999px !important;
  background: rgba(255, 255, 255, 0.96);
  font-size: 1rem;
}

.mosaic-restore-fab {
  color: #7c3900;
}

.mosaic-tool-panel {
  display: grid;
  gap: 12px;
  align-content: start;
  position: sticky;
  top: 12px;
}

.mosaic-paint-toolbar {
  display: grid;
  gap: 10px;
}

.mosaic-tool-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px;
  align-items: center;
  gap: 8px;
}

.mosaic-toolbar-btn {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  width: 100%;
  min-height: 58px;
  padding: 10px 12px;
  text-align: left;
  border: 1px solid rgba(24, 128, 121, 0.28);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  box-shadow: 0 2px 0 rgba(73, 67, 63, 0.08), 0 10px 20px rgba(24, 128, 121, 0.08);
}

.mosaic-tool-info-btn {
  align-self: center;
}

.mosaic-toolbar-btn:hover,
.mosaic-toolbar-btn:focus-visible,
.mosaic-toolbar-btn[aria-expanded="true"] {
  border-color: rgba(24, 128, 121, 0.62);
  background: rgba(234, 250, 247, 0.96);
  box-shadow: 0 0 0 4px rgba(24, 184, 175, 0.12), 0 2px 0 rgba(73, 67, 63, 0.08);
}

.mosaic-toolbar-btn small,
.mosaic-sheet-header span {
  display: block;
  margin-bottom: 2px;
  font-family: var(--font-display);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--teal-deep);
}

.mosaic-toolbar-btn strong {
  display: block;
  min-width: 0;
  overflow: hidden;
  font-size: 1rem;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.toolbar-swatch,
.toolbar-piece-icon,
.toolbar-replace-icon {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
}

.toolbar-swatch {
  border: 2px solid rgba(43, 33, 27, 0.62);
  box-shadow: inset 2px 2px 0 rgba(255, 255, 255, 0.3), 0 2px 0 rgba(43, 33, 27, 0.14);
}

.toolbar-piece-icon {
  position: relative;
  background: linear-gradient(180deg, #ffbe47, #fb8600);
  border: 2px solid rgba(43, 33, 27, 0.72);
  box-shadow: inset 2px 2px 0 rgba(255, 255, 255, 0.36), 0 2px 0 rgba(43, 33, 27, 0.16);
}

.toolbar-piece-icon::before,
.toolbar-piece-icon::after {
  content: "";
  position: absolute;
  top: 8px;
  width: 8px;
  height: 8px;
  border: 2px solid rgba(43, 33, 27, 0.66);
  border-radius: 999px;
  background: rgba(255, 226, 133, 0.96);
}

.toolbar-piece-icon::before {
  left: 7px;
}

.toolbar-piece-icon::after {
  right: 7px;
}

.toolbar-replace-icon {
  border: 2px solid rgba(24, 128, 121, 0.62);
  background: rgba(232, 250, 247, 0.96);
  color: var(--teal-deep);
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 900;
}

.mosaic-tool-sheet {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(73, 67, 63, 0.12);
  border-radius: 14px;
  background: rgba(255, 253, 250, 0.96);
  box-shadow: 0 14px 34px rgba(37, 31, 27, 0.1);
}

.mosaic-tool-sheet.hidden {
  display: none !important;
}

.mosaic-sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.mosaic-sheet-header h3 {
  margin: 0;
  font-size: 1.1rem;
}

.mosaic-replace-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  align-items: end;
}

.mosaic-picker-card {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.mosaic-paint-window {
  display: grid;
  place-items: center;
  justify-items: center;
  min-height: 360px;
  max-height: min(70vh, 720px);
  padding: 12px;
  border: 1px solid rgba(73, 67, 63, 0.12);
  border-radius: 16px;
  background: #fff;
  overflow: auto;
}

.mosaic-replace-field {
  display: grid;
  gap: 4px;
  min-width: 160px;
  font-size: 0.8rem;
  font-weight: 900;
  color: var(--muted);
}

.mosaic-replace-field select {
  min-height: 38px;
  border-radius: 9px;
}

.mosaic-replace-field option:disabled {
  color: #9a9a9a;
  background: #eeeeee;
}

.icon-btn {
  width: 38px;
  min-width: 38px;
  min-height: 38px;
  padding-inline: 0;
  font-size: 1.2rem;
  line-height: 1;
}

.floating-history-btn,
.mosaic-history-fab {
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  display: inline-grid;
  place-items: center;
  padding: 0 !important;
  border: 1px solid rgba(14, 137, 130, 0.86);
  border-radius: 999px !important;
  background: linear-gradient(180deg, #26beb4, #14958d);
  color: #ffffff;
  box-shadow: 0 2px 0 rgba(13, 95, 90, 0.26), 0 8px 16px rgba(24, 128, 121, 0.18);
}

.floating-history-btn:disabled,
.mosaic-history-fab:disabled {
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  border-color: rgba(24, 128, 121, 0.34) !important;
  background: rgba(232, 250, 247, 0.92) !important;
  color: rgba(17, 118, 112, 0.72) !important;
  box-shadow: none !important;
}

.floating-history-btn:hover:not(:disabled),
.mosaic-history-fab:hover:not(:disabled),
.floating-history-btn:focus-visible,
.mosaic-history-fab:focus-visible {
  background: linear-gradient(180deg, #2ed0c5, #128b83);
  border-color: #0d7771;
  box-shadow: 0 0 0 4px rgba(24, 184, 175, 0.16), 0 2px 0 rgba(13, 95, 90, 0.24);
}

.history-icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.25;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.floating-history-btn:disabled .history-icon,
.mosaic-history-fab:disabled .history-icon {
  opacity: 0.62;
}

.image-settings-layout,
.image-settings-controls,
.image-settings-tools,
.image-slider-grid,
.interactive-customization-panel {
  display: grid;
  gap: 14px;
}

.image-settings-launcher {
  display: grid;
  gap: 10px;
}

.image-settings-launcher p {
  margin: 0;
}

.setup-inline-editor-frame {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.setup-inline-editor-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
}

.setup-inline-editor-header h3 {
  margin: 0;
  font-size: 1.2rem;
}

.setup-inline-editor-header p {
  margin: 6px 0 0;
}

.setup-inline-editor-mount {
  display: grid;
  gap: 0;
  min-height: 0;
  width: 100%;
  min-width: 0;
  padding-top: 14px;
  border-top: 1px solid rgba(73, 67, 63, 0.12);
  overflow: hidden;
}

.setup-inline-editor-mount .image-editor-shell {
  display: grid;
  width: 100%;
  min-width: 0;
  grid-template-columns: minmax(260px, 340px) minmax(260px, 420px);
  align-items: start;
  gap: 18px;
  overflow-x: hidden;
}

.setup-inline-editor-mount .image-editor-stage {
  align-self: start;
  min-width: 0;
  max-width: 420px;
}

#setupPreviewCanvas,
#generateSummaryCanvas {
  width: 100%;
  max-width: 100%;
  display: block;
  aspect-ratio: 1 / 1;
  border: 1px solid rgba(49, 45, 43, 0.16);
  border-radius: 16px;
  background: #fff;
}

.image-editor-modal {
  width: min(1180px, 96vw);
}

.image-editor-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(140px, auto)) 1fr 72px 72px;
  gap: 0;
  align-items: end;
  border-bottom: 1px solid rgba(73, 67, 63, 0.14);
  margin-top: 8px;
}

.image-editor-tab,
.image-editor-tab-ghost {
  min-height: 58px;
  border-radius: 18px 18px 0 0;
  border: 1px solid rgba(73, 67, 63, 0.16);
  border-bottom: none;
  background: rgba(255, 247, 240, 0.92);
}

.image-editor-tab {
  font-weight: 900;
}

.image-editor-tab.active {
  background: #fffaf4;
  box-shadow: 0 -8px 20px rgba(46, 42, 40, 0.06);
}

.image-editor-tab-filler {
  height: 1px;
}

.image-editor-tab-ghost {
  display: block;
  background: rgba(255,255,255,0.72);
}

.image-editor-shell {
  display: grid;
  grid-template-columns: minmax(230px, 290px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.image-editor-sidebar,
.editor-sidebar-panel,
.image-editor-stage,
.editor-stage-panel {
  display: grid;
  gap: 14px;
}

.quick-changes-panel {
  background: linear-gradient(180deg, rgba(255, 250, 244, 0.98), rgba(255, 255, 255, 0.98));
}

.editor-advanced-tools {
  border: 1px solid rgba(73, 67, 63, 0.14);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.9);
  overflow: hidden;
}

.editor-advanced-tools summary {
  cursor: pointer;
  list-style: none;
  padding: 14px 16px;
  font-weight: 800;
  background: linear-gradient(180deg, rgba(255,250,244,0.98), rgba(255,255,255,0.96));
}

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

.editor-advanced-body {
  display: grid;
  gap: 14px;
  padding: 0 16px 16px;
}

.helper-only-tools .image-tool-card {
  background: rgba(255, 255, 255, 0.72);
}

.editor-sidebar-panel h3 {
  font-size: 1.05rem;
}

.image-editor-stage {
  min-width: 0;
}

.editor-stage-panel {
  min-width: 0;
}

.image-settings-layout {
  grid-template-columns: minmax(240px, 320px) minmax(0, 1fr);
  align-items: start;
}

.image-settings-tools {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.interactive-customization-panel {
  padding: 14px 16px;
  border: 1px solid rgba(73, 67, 63, 0.1);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.82);
}

.interactive-customization-header h4,
.interactive-customization-input span {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
}

.interactive-customization-header p {
  margin: 6px 0 0;
}

.interactive-customization-input {
  display: grid;
  gap: 8px;
}

.interactive-customization-input textarea {
  width: 100%;
  min-height: 84px;
  padding: 12px 14px;
  border: 1px solid rgba(73, 67, 63, 0.16);
  border-radius: 14px;
  resize: vertical;
  font: inherit;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
}

.interactive-customization-actions,
.interactive-quick-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

#customizationSummary {
  margin: 0;
}

.image-tool-card {
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  border: 1px solid rgba(73, 67, 63, 0.12);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.86);
}

.image-tool-card p {
  margin: 0;
}

.image-settings-note {
  margin: 0;
}

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

.image-slider-grid label {
  padding: 12px 14px;
  border: 1px solid rgba(73, 67, 63, 0.12);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.78);
}

.image-settings-actions {
  margin-top: 4px;
}

.preview-layout {
  display: grid;
  gap: 18px;
}

.preview-panel {
  min-width: 0;
}

.preview-panel h3,
.plan-preview-block h4 {
  font-size: 1.08rem;
}

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

.lego-plan-panel {
  display: grid;
  gap: 16px;
}

.preview-panel canvas,
canvas {
  width: auto;
  max-width: 100%;
  display: block;
  height: auto !important;
  border: 1px solid rgba(49, 45, 43, 0.24);
  border-radius: 18px;
  background: #fff;
}

#originalCanvas,
#planPlaceholderCanvas,
#mosaicCanvas {
  max-width: 100%;
}

.plan-preview-stack {
  display: grid;
  gap: 18px;
  justify-items: center;
}

.plan-preview-block {
  display: grid;
  gap: 10px;
  justify-items: center;
  width: 100%;
}

.output,
.instructions {
  display: grid;
  gap: 14px;
}

.export-options {
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 460px);
}

.export-option {
  display: grid;
  gap: 8px;
  border: 1px solid rgba(73, 67, 63, 0.14);
  border-radius: 16px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.84);
}

.export-option-primary {
  border-color: rgba(251, 134, 0, 0.2);
  background: linear-gradient(180deg, rgba(255,250,244,0.98), rgba(255,244,232,0.98));
}

.primary-export-btn {
  min-height: 54px;
}

.pickabrick-howto-btn {
  justify-self: start;
}

.pickabrick-howto-note {
  margin: 2px 0 0;
  max-width: 34rem;
  padding: 10px 12px;
  border: 1px solid rgba(251, 134, 0, 0.34);
  border-radius: 12px;
  background: rgba(255, 247, 236, 0.98);
  color: #6b3a08;
  font-size: 0.95rem;
  font-weight: 850;
  line-height: 1.35;
}

.pickabrick-howto-note::before {
  content: "Tip: ";
  color: var(--orange);
  font-weight: 950;
}

.export-option-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.download-feedback-panel {
  display: grid;
  gap: 10px;
  width: min(100%, 560px);
  padding: 14px;
  border: 2px solid rgba(255, 122, 0, 0.72);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255, 250, 244, 0.98), rgba(255, 242, 224, 0.95));
  outline: 3px solid rgba(255, 122, 0, 0.14);
}

.download-feedback-label {
  color: #3f352e;
  font-weight: 900;
  line-height: 1.35;
}

.feedback-rating {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid rgba(255, 122, 0, 0.42);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.58);
}

.feedback-rating legend {
  padding: 0 6px;
  color: var(--teal-deep);
  font-weight: 900;
}

.feedback-rating-stars {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.feedback-star-btn {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 2px solid rgba(255, 122, 0, 0.48);
  border-radius: 10px;
  background: #fffefa;
  color: rgba(105, 91, 78, 0.34);
  font-size: 1.45rem;
  line-height: 1;
  transition: transform 120ms ease, border-color 120ms ease, color 120ms ease, background 120ms ease;
}

.feedback-star-btn:hover,
.feedback-star-btn:focus-visible {
  border-color: var(--orange);
  color: var(--orange);
  transform: translateY(-1px);
}

.feedback-star-btn.is-selected {
  border-color: var(--orange-border);
  background: rgba(255, 122, 0, 0.12);
  color: var(--orange);
}

.feedback-rating-status {
  margin: 0;
  color: #5f534b;
  font-size: 0.92rem;
  font-weight: 800;
}

.download-feedback-textbox {
  width: 100%;
  min-height: 132px;
  resize: vertical;
  border: 2px solid var(--orange);
  border-radius: 12px;
  padding: 12px 14px;
  background: #fffefa;
  color: #2b2622;
  font: inherit;
  line-height: 1.45;
  box-shadow: inset 0 0 0 1px rgba(255, 122, 0, 0.1);
}

.download-feedback-textbox:focus {
  border-color: var(--orange-deep);
  outline: 4px solid rgba(255, 122, 0, 0.22);
}

.download-feedback-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.feedback-submit-status {
  margin: 0;
  color: #5f534b;
  font-size: 0.92rem;
  font-weight: 800;
}

.feedback-submit-status.success {
  color: var(--teal-deep);
}

.feedback-submit-status.error {
  color: #962e35;
}

.summary-metrics {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.summary-insights {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-top: 12px;
}

.insight-pill {
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(73, 67, 63, 0.12);
  background: rgba(255, 255, 255, 0.88);
}

.insight-pill p {
  margin: 0;
}

.insight-label {
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.insight-value {
  margin-top: 6px !important;
  font-size: 1.1rem;
  font-weight: 900;
  color: var(--ink);
}

.metric-card {
  border: 1px solid rgba(43, 182, 172, 0.18);
  border-radius: 18px;
  padding: 14px 16px;
  background: linear-gradient(180deg, rgba(255,255,255,0.92), rgba(255,247,239,0.9));
}

.metric-card p {
  margin: 0;
}

.metric-label {
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--teal-deep);
}

.metric-value {
  margin-top: 6px !important;
  font-size: 1.65rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.metric-value-detail {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: normal;
  color: var(--muted);
}

.mosaic-main-stats {
  display: grid;
  gap: 12px;
  justify-items: center;
  margin-top: 12px;
}

.summary-metrics.mosaic-main-stat-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  justify-self: center;
  width: min(100%, 520px);
}

.mosaic-main-stats .metric-card {
  width: 100%;
  padding: 12px;
}

.mosaic-main-stats .metric-value {
  font-size: clamp(1.15rem, 2.2vw, 1.45rem);
  letter-spacing: 0;
}

.mosaic-details-btn {
  justify-self: center;
}

.piece-counts-details-card {
  width: min(1080px, 94vw);
  background: #fff;
}

.instructions-download-card {
  width: min(1120px, 94vw);
  background: #fff;
}

.instructions-download-actions {
  display: flex;
  justify-content: flex-end;
  margin: 12px 0;
}

.instructions-modal-preview {
  max-height: min(68vh, 760px);
  overflow: auto;
  padding: 14px;
  border: 1px solid rgba(73, 67, 63, 0.12);
  border-radius: 12px;
  background: rgba(248, 246, 242, 0.72);
}

.piece-counts-details-body,
.piece-counts-details-content {
  display: grid;
  gap: 14px;
}

.summary-details {
  border: 1px solid rgba(73, 67, 63, 0.14);
  border-radius: 18px;
  background: #fffdfa;
  padding: 2px 0;
}

.piece-counts-dropdown {
  margin-top: 2px;
}

.summary-details summary {
  cursor: pointer;
  list-style: none;
  padding: 14px 16px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(238, 250, 248, 0.98));
  border-left: 4px solid rgba(24, 184, 175, 0.26);
}

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

.summary-details summary::after {
  content: "▾";
  color: var(--teal-deep);
  font-size: 1rem;
  transition: transform 120ms ease;
}

.summary-details[open] summary::after {
  transform: rotate(180deg);
}

.summary-detail-grid {
  padding: 0 16px 14px;
  display: grid;
  gap: 10px;
  min-width: 0;
}

.nested-summary-details {
  margin-top: 4px;
}

.summary-detail-grid p {
  margin: 0;
  color: #48413b;
}

#colorBreakdown {
  display: grid;
  gap: 14px;
}

#buildInstructions {
  margin-top: 4px;
}

.instruction-meta {
  margin: 0 0 8px;
  color: #4e4741;
}

.instruction-legend,
.instruction-card,
.summary-subsection {
  border: 1px solid #ddd6cb;
  border-radius: 18px;
  background: var(--panel-strong);
}

.instruction-legend {
  padding: 12px 14px;
}

.instruction-legend p,
.pickabrick-export-steps li {
  color: #554f49;
}

.instruction-overview-grid,
.instructions-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

.instruction-card {
  padding: 12px;
}

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

.instruction-card h4,
.summary-subsection h3 {
  margin: 0 0 8px;
}

.instruction-range,
.instruction-step,
.instruction-empty {
  color: #6b645c;
  font-size: 0.93rem;
}

.instruction-canvas {
  width: 100%;
  max-width: none;
  border: 1px solid rgba(49, 45, 43, 0.24);
  border-radius: 12px;
  background: #fff;
}

.summary-subsection {
  padding: 14px 16px;
  min-width: 0;
}

.summary-table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}

.summary-table-wrap table {
  min-width: 540px;
  table-layout: fixed;
}

.summary-table-wrap td:last-child {
  overflow-wrap: anywhere;
}

.summary-table-wrap th,
.summary-table-wrap td {
  vertical-align: top;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.summary-breakdown-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.summary-breakdown-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(43, 182, 172, 0.1);
  color: #2f4946;
  font-size: 0.82rem;
  line-height: 1.25;
}

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

th,
td {
  text-align: left;
  padding: 9px 8px;
  border-bottom: 1px solid rgba(73, 67, 63, 0.1);
}

th {
  color: var(--muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.swatch {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 4px;
  margin-right: 8px;
  border: 1px solid rgba(49, 45, 43, 0.45);
  vertical-align: -2px;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(30, 26, 23, 0.32);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 50;
}

.modal.hidden {
  display: none;
}

.modal-card {
  background: #fffdfa;
  border-radius: 24px;
  border: 1px solid rgba(73, 67, 63, 0.14);
  width: min(980px, 95vw);
  max-height: 92vh;
  overflow: auto;
  padding: 18px;
  box-shadow: 0 24px 60px rgba(46, 42, 40, 0.16);
}

.pickabrick-export-card {
  width: min(620px, 95vw);
}

.pickabrick-howto-card {
  width: min(920px, 95vw);
  background: #fff;
}

.pickabrick-video-frame {
  overflow: hidden;
  border: 1px solid rgba(73, 67, 63, 0.14);
  border-radius: 16px;
  background: #171513;
}

.pickabrick-howto-video {
  display: block;
  width: 100%;
  max-height: min(66vh, 620px);
  background: #171513;
}

.new-project-confirm-card {
  width: min(440px, 92vw);
  background: #fff;
}

.mosaic-tuning-card {
  width: min(1180px, 94vw);
  background: #fff;
}

.change-colors-card {
  width: min(720px, 94vw);
  background: #fff;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.new-project-actions {
  justify-content: space-between;
}

.pickabrick-export-steps {
  margin: 10px 0 0 20px;
  padding: 0;
  display: grid;
  gap: 8px;
}

.pickabrick-skipped-panel {
  margin-top: 12px;
  padding: 0.9rem 1rem;
  border: 1px solid rgba(49, 45, 43, 0.16);
  border-radius: 16px;
  background: rgba(251, 134, 0, 0.08);
}

.pickabrick-skipped-panel h3 {
  margin: 0 0 4px;
  font-size: 1rem;
}

.pickabrick-skipped-list {
  margin: 8px 0 0 18px;
  padding: 0;
  display: grid;
  gap: 6px;
}

.pickabrick-export-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.mini-btn-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 14px;
  text-decoration: none;
  transition: transform 120ms ease, filter 120ms ease, box-shadow 120ms ease;
}

.modal-card-wide {
  width: min(1080px, 96vw);
}

.crop-modal-card {
  width: min(1120px, 96vw);
}

.modal-panel {
  margin-top: 12px;
  padding: 14px;
  border: 1px solid #e4ddd3;
  border-radius: 18px;
  background: #fffaf4;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.modal-header h2,
.modal-panel h3 {
  margin: 0;
}

.crop-modal-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.crop-ratio-sidebar {
  display: grid;
  gap: 12px;
}

.crop-ratio-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.crop-ratio-btn {
  width: 100%;
  min-height: 40px;
  justify-content: center;
  text-align: center;
  line-height: 1.25;
  padding-inline: 10px;
}

.crop-ratio-btn.active {
  background: linear-gradient(135deg, rgba(43, 182, 172, 0.22), rgba(43, 182, 172, 0.34));
  border-color: rgba(24, 148, 139, 0.36);
}

.crop-preview-stage {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 460px);
  align-items: start;
}

.crop-preview-card {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid rgba(73, 67, 63, 0.12);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.9);
  align-self: stretch;
}

.crop-preview-card h4 {
  margin: 0;
}

#cropPreviewCanvas {
  width: 100%;
  max-width: 100%;
  border: 1px solid rgba(49, 45, 43, 0.18);
  border-radius: 14px;
  background: #fff;
}

.cropper-shell {
  width: 100%;
  max-width: 100%;
  min-height: 0;
  max-height: min(74vh, 820px);
  aspect-ratio: 1 / 1;
  border: 1px solid rgba(49, 45, 43, 0.24);
  border-radius: 16px;
  background: #fff;
  overflow: hidden;
  position: relative;
}

.cropper-shell .cropper-container {
  width: 100% !important;
  height: 100% !important;
}

.cropper-shell.ratio-free {
  aspect-ratio: auto;
}

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

.cropper-shell::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.14) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.14) 1px, transparent 1px);
  background-size: 28px 28px;
  opacity: 0;
  transition: opacity 140ms ease;
}

.cropper-shell.cropper-ready::after {
  opacity: 0.18;
}

.cropper-view-box,
.cropper-face {
  border-radius: 8px;
}

.cropper-view-box {
  box-shadow: 0 0 0 1px rgba(251, 134, 0, 0.68);
  outline: 2px solid rgba(251, 134, 0, 0.24);
}

.cropper-view-box::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.24) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.24) 1px, transparent 1px);
  background-size: 18px 18px;
}

.cropper-dashed {
  border-color: rgba(255, 255, 255, 0.35);
}

.cropper-line,
.cropper-point {
  background-color: rgba(251, 134, 0, 0.86);
}

.toggle-group {
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,0.76);
}

.checkbox-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
}

.checkbox-row input {
  width: auto;
}

.pill-list,
.color-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.color-list {
  display: block;
}

.color-list .lego-palette-board {
  width: 100%;
  padding: 32px 48px 72px 38px;
}

.color-list .lego-palette-grid {
  grid-template-columns: repeat(6, minmax(28px, 1fr));
  gap: 12px 14px;
}

.color-list .lego-palette-swatch {
  min-height: 30px;
  border-width: 3px;
}

.pill-btn,
.color-btn {
  background: #fff8ee;
  color: var(--ink);
  border: 1px solid #d8d1c7;
  box-shadow: none;
}

.pill-btn {
  padding: 7px 11px;
  border-radius: 999px;
}

.pill-btn.active {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

.color-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 9px;
  border-radius: 999px;
}

.color-btn.active {
  border-color: var(--teal-deep);
  box-shadow: inset 0 0 0 1px var(--teal-deep);
}

.color-btn .swatch {
  margin-right: 0;
}

#customizeCanvas {
  max-width: 100%;
  width: auto;
  max-height: min(64vh, 680px);
  touch-action: none;
  user-select: none;
  image-rendering: pixelated;
  border: 1px solid rgba(73, 67, 63, 0.14);
  border-radius: 10px;
  background: #fff;
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Cpath fill='%232b211b' d='M20.5 2.5c2.8-1.8 6.4.5 5.7 3.8-.2.9-.7 1.8-1.4 2.5L14.2 19.4l-4.8-4.8L20.5 2.5z'/%3E%3Cpath fill='%23fb8600' d='M21.9 5.1c1.1-1 2.5-.8 2.1.6-.1.4-.4.9-.8 1.3L13.9 16.3l-1.8-1.8 9.8-9.4z'/%3E%3Cpath fill='%232b211b' d='M8.5 15.5c2.7.4 5 2.7 5.4 5.4-2 4.1-5.6 6.8-10.7 7.8.9-5 3.2-9.9 5.3-13.2z'/%3E%3Cpath fill='%23ffb12a' d='M8.7 18.5c1.1.4 2.1 1.4 2.5 2.5-1.2 2.1-3 3.6-5.5 4.5.6-2.6 1.6-5 3-7z'/%3E%3C/svg%3E") 6 25, crosshair;
}

.overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 100;
}

.overlay-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(33, 29, 27, 0.42);
  backdrop-filter: blur(5px);
}

.overlay-card {
  position: relative;
  width: min(440px, calc(100vw - 32px));
  border-radius: 28px;
  border: 1px solid rgba(255,255,255,0.55);
  background: linear-gradient(180deg, rgba(255,250,244,0.98), rgba(255,247,239,0.98));
  padding: 28px 24px;
  text-align: center;
  box-shadow: 0 28px 80px rgba(24, 20, 18, 0.28);
}

.overlay-card h2 {
  margin: 0 0 8px;
  font-size: 1.8rem;
  font-weight: 900;
  letter-spacing: -0.03em;
}

.overlay-card p {
  margin: 0;
  color: var(--muted);
}

.sticky-export-cue {
  position: fixed;
  right: 18px;
  bottom: 16px;
  left: auto;
  transform: none;
  z-index: 60;
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  width: min(calc(100vw - 28px), 360px);
  border-radius: 24px;
  border: 1px solid rgba(251, 134, 0, 0.32);
  background: linear-gradient(135deg, rgba(255, 250, 244, 0.98), rgba(255, 243, 228, 0.98) 48%, rgba(238, 250, 248, 0.96));
  box-shadow: 0 24px 60px rgba(46, 42, 40, 0.16);
  padding: 14px;
  backdrop-filter: blur(10px);
  overflow: hidden;
  animation: stickyExportRise 180ms ease-out;
  transition: opacity 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.sticky-export-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
  position: relative;
  z-index: 1;
}

.sticky-export-kicker {
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--teal-deep);
}

.sticky-export-copy strong {
  font-size: 1.02rem;
  line-height: 1.2;
  color: #5f3a09;
}

.sticky-export-helper {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.sticky-export-actions {
  display: grid;
  gap: 8px;
}

.sticky-export-action {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 52px;
  padding: 0 18px;
  border: 0;
  border-radius: 18px;
  background: linear-gradient(180deg, var(--orange), var(--orange-deep));
  color: #fff;
  font-weight: 900;
  box-shadow: 0 14px 28px rgba(225, 111, 0, 0.28);
  cursor: pointer;
}

.sticky-export-secondary {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 46px;
  padding: 0 16px;
  border: 1px solid rgba(43, 182, 172, 0.22);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.84);
  color: var(--teal-deep);
  font-weight: 800;
  cursor: pointer;
}

.sticky-export-action:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 34px rgba(225, 111, 0, 0.32);
}

.sticky-export-secondary:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.96);
}

.sticky-export-action:focus-visible,
.sticky-export-secondary:focus-visible,
.sticky-export-dismiss:focus-visible {
  outline: 3px solid rgba(43, 182, 172, 0.34);
  outline-offset: 2px;
}

.sticky-export-dismiss {
  position: absolute;
  z-index: 1;
  top: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(126, 34, 25, 0.42);
  border-radius: 999px;
  background: linear-gradient(135deg, var(--danger) 0%, var(--danger-deep) 100%);
  color: #fff;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 12px 24px rgba(169, 47, 35, 0.22);
}

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

.loading-dots {
  display: inline-flex;
  gap: 10px;
  margin-bottom: 18px;
}

.loading-dots span {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: inline-block;
  animation: bounceDots 1.1s infinite ease-in-out both;
}

.loading-dots span:nth-child(1) { background: var(--orange); animation-delay: -0.3s; }
.loading-dots span:nth-child(2) { background: var(--gold); animation-delay: -0.15s; }
.loading-dots span:nth-child(3) { background: var(--teal); animation-delay: 0s; }
.loading-dots span:nth-child(4) { background: var(--orange); animation-delay: 0.15s; }

.success-card {
  background: linear-gradient(135deg, rgba(255,247,239,0.99), rgba(238,250,248,0.98));
}

@keyframes bounceDots {
  0%, 80%, 100% { transform: translateY(0) scale(0.88); opacity: 0.55; }
  40% { transform: translateY(-7px) scale(1); opacity: 1; }
}

@media (min-width: 900px) {
  .preview-layout {
    grid-template-columns: minmax(280px, 0.95fr) minmax(380px, 1.35fr);
  }
}

@media (max-width: 1024px) {
  .app {
    padding: 6px 16px 104px;
  }

  .app-navbar {
    grid-template-columns: minmax(170px, 1fr) auto minmax(170px, 1fr);
    padding-inline: 12px;
  }

  .app-navbar-side {
    grid-column: auto;
  }

  .app-navbar-totals {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: min(100%, 238px);
  }

  .app-navbar-logo {
    width: 198px;
  }

  .app-navbar-timeline {
    width: min(100%, 328px);
    gap: 28px;
  }

  #setupToolDimensionsMount.active {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    padding: 16px;
    gap: 14px;
  }

  #setupToolDimensionsMount.active .size-crop-control,
  #setupToolDimensionsMount.active .image-editor-sidebar,
  #setupToolDimensionsMount.active .image-editor-stage {
    grid-column: 1;
    grid-row: auto;
  }

  .app-stepper-step {
    grid-template-columns: none;
    justify-items: center;
    text-align: center;
  }
}

@media (max-width: 768px) {
  .app {
    padding: 0 12px 96px;
    gap: 8px;
  }

  .controls,
  .controls-panel[data-flow-card="setup-dimensions"] .size-crop-control,
  .instruction-overview-grid,
  .instructions-grid,
  .summary-metrics,
  .export-options,
  .image-settings-layout,
  .image-slider-grid,
  .preview-layout {
    grid-template-columns: 1fr;
  }

  .app-navbar {
    position: sticky;
    top: 0;
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 8px;
    align-items: center;
    min-height: 54px;
    padding: 5px 8px;
    margin-inline: -12px;
    width: calc(100% + 24px);
    border-top: 0;
    border-inline: 0;
    border-radius: 0 !important;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 1px 0 rgba(73, 67, 63, 0.12);
    backdrop-filter: blur(10px);
    z-index: 18;
  }

  .status-banner {
    top: 58px;
  }

  .stage-switcher {
    top: 58px;
    width: min(100%, 340px);
    justify-self: center;
    grid-template-columns: 78px minmax(0, 1fr) 78px;
    gap: 7px;
    min-height: 56px;
    padding: 6px 7px;
    border-radius: 999px;
    box-shadow: none;
  }

  .stage-switcher-btn {
    width: 78px;
    height: 42px;
    min-width: 78px;
    min-height: 42px;
    border-radius: 999px;
    gap: 5px;
    padding-inline: 8px;
  }

  .stage-switcher-chevron {
    width: 10px;
    height: 10px;
    border-width: 1.8px 1.8px 0 0;
  }

  .stage-switcher-btn-label {
    font-size: 0.58rem;
  }

  .stage-switcher-title span {
    font-size: 0.58rem;
    letter-spacing: 0.14em;
  }

  .stage-switcher-title strong {
    font-size: 0.98rem;
  }

  .app-navbar-brand {
    height: 44px;
    justify-content: flex-start;
    align-self: center;
  }

  .app-navbar-logo-wrap {
    display: grid;
    place-items: center start;
    width: 44px;
    height: 44px;
  }

  .app-navbar-logo {
    width: 44px;
    height: 44px;
    object-fit: contain;
    margin: 0;
  }

  .app-navbar-timeline {
    display: none;
  }

  .app-substep-rail {
    display: none;
  }

  .app-substep-pill:not(.active) {
    display: inline-flex;
  }

  .app-substep-pill {
    width: auto;
    min-height: 20px;
    min-width: 7px;
    padding-top: 6px;
    white-space: normal;
    justify-content: center;
    align-items: center;
  }

  .setup-tools-fab-menu,
  .review-tools-fab-menu {
    gap: 8px;
  }

  .review-tools-fab-menu {
    right: 12px;
    bottom: 12px;
  }

  .setup-tools-fab-menu {
    margin-top: 10px;
    justify-content: stretch;
  }

  .setup-tools-fab {
    width: auto;
    flex: 1 1 150px;
    min-height: 44px;
    padding: 7px;
    justify-content: center;
  }

  .review-tools-fab {
    width: 54px;
    height: 54px;
    min-width: 54px;
    min-height: 54px;
    flex: 0 0 auto;
    border-radius: 999px;
  }

  .review-tools-fab .setup-tools-fab-label,
  .setup-tool-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .setup-tools-fab-label {
    position: static;
    width: auto;
    height: auto;
    max-width: none;
    opacity: 1;
    overflow: visible;
    clip: auto;
    white-space: normal;
  }

  .setup-tools-panel {
    inset: 8px;
    width: auto;
  }

  .setup-tools-body {
    grid-template-columns: minmax(0, 1fr);
  }

  .setup-tools-nav {
    padding: 8px;
    gap: 7px;
  }

  .setup-tool-tab {
    grid-template-columns: 1fr;
    min-height: 44px;
    padding: 6px;
    justify-items: center;
  }

  .setup-tools-content {
    padding: 10px;
  }

  .mosaic-tuning-card {
    width: 100vw;
    max-height: 100dvh;
    min-height: 100dvh;
    border-radius: 0;
    padding: 10px;
  }

  .mosaic-tuning-card .modal-header {
    position: sticky;
    top: 0;
    z-index: 32;
    display: grid;
    grid-template-columns: 1fr;
    padding: 4px 0 8px;
    background: #fff;
  }

  .mosaic-tuning-card .modal-header p {
    display: block;
    max-width: none;
    margin-top: 4px;
    font-size: 0.82rem;
    line-height: 1.25;
  }

  .mosaic-modal-actions {
    justify-content: end;
    gap: 6px;
  }

  .mosaic-header-history {
    padding: 3px;
  }

  .mosaic-tuning-panel {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 8px;
    margin-top: 6px;
    border-radius: 16px;
  }

  .mosaic-workspace {
    order: 1;
  }

  .mosaic-tool-panel {
    order: 2;
    position: static;
    gap: 8px;
  }

  .mosaic-paint-window {
    min-height: 0;
    max-height: none;
    padding: 7px;
    overflow: auto;
  }

  .mosaic-paint-toolbar {
    position: sticky;
    bottom: 0;
    z-index: 30;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin: 0 -8px -8px;
    padding: 8px;
    border-top: 1px solid rgba(73, 67, 63, 0.12);
    background: rgba(255, 253, 250, 0.96);
    backdrop-filter: blur(10px);
  }

  .mosaic-tool-row {
    grid-template-columns: minmax(0, 1fr) 24px;
    gap: 6px;
  }

  .mosaic-replace-trigger-row {
    grid-column: 1 / -1;
  }

  .mosaic-toolbar-btn {
    grid-template-columns: 30px minmax(0, 1fr);
    min-height: 50px;
    padding: 8px 9px;
    border-radius: 13px;
  }

  .mosaic-toolbar-btn small {
    font-size: 0.58rem;
  }

  .mosaic-toolbar-btn strong {
    font-size: 0.84rem;
  }

  .toolbar-swatch,
  .toolbar-piece-icon,
  .toolbar-replace-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
  }

  .toolbar-piece-icon::before,
  .toolbar-piece-icon::after {
    top: 6px;
    width: 7px;
    height: 7px;
  }

  .toolbar-piece-icon::before {
    left: 5px;
  }

  .toolbar-piece-icon::after {
    right: 5px;
  }

  .mosaic-replace-trigger {
    grid-column: 1 / -1;
  }

  .mosaic-tool-sheet {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: 10px;
    z-index: 42;
    max-height: min(62dvh, 540px);
    overflow: auto;
    border-radius: 18px;
    box-shadow: 0 24px 60px rgba(37, 31, 27, 0.24);
  }

  .mosaic-replace-row {
    grid-template-columns: 1fr;
    width: 100%;
  }

  .mosaic-history-dashboard {
    justify-content: flex-start;
    gap: 2px;
  }

  .lego-palette-board,
  .color-list .lego-palette-board {
    width: min(100%, 420px);
    padding: 24px 34px 56px 28px;
    border-width: 4px;
    border-radius: 52% 48% 47% 45% / 34% 37% 56% 58%;
  }

  .lego-palette-grid,
  .color-list .lego-palette-grid {
    grid-template-columns: repeat(5, minmax(26px, 1fr));
    gap: 9px;
  }

  .lego-palette-thumb-hole {
    right: 21%;
    bottom: 15%;
    width: 48px;
    height: 38px;
    border-width: 5px;
  }

  .substep-status {
    width: 5px;
    height: 5px;
    border-width: 1.5px;
  }

  .app-substep-pill.active .app-substep-label {
    max-width: 72px;
    padding: 2px 5px;
    font-size: 0.44rem;
    top: -11px;
  }

  .app-navbar-side {
    grid-column: 2;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    justify-items: end;
    gap: 6px;
  }

  .app-navbar-totals {
    width: min(100%, 132px);
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    margin-top: 0;
    justify-self: end;
    padding: 6px 8px;
    border: 1px solid rgba(73, 67, 63, 0.12);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.92);
  }

  .navbar-total-card {
    display: grid;
    grid-template-columns: 1fr;
    align-items: start;
    justify-items: start;
    gap: 2px;
    padding: 0 8px;
    border: 0;
    border-radius: 0;
    background: transparent;
  }

  .navbar-total-card span {
    font-size: 0.52rem;
    letter-spacing: 0.06em;
    line-height: 1;
  }

  .navbar-total-card strong {
    width: 100%;
    font-size: 0.98rem;
    line-height: 1.02;
    text-align: left;
  }

  .navbar-info-btn {
    display: none;
  }

  .navbar-new-project {
    width: 38px;
    min-width: 38px;
    min-height: 38px;
    font-size: 1.75rem;
  }

  .file-input-shell {
    grid-template-columns: 1fr;
    justify-items: stretch;
    min-height: 168px;
    text-align: center;
  }

  .upload-drop-icon {
    justify-self: center;
  }

  .file-input-name {
    grid-column: auto;
  }

  .app-substep-pill:not(:last-child)::after {
    display: none;
  }

  .preview-header {
    align-items: start;
    flex-direction: column;
  }

  .generate-summary-panel {
    grid-template-columns: 1fr;
  }

  .setup-upload-summary {
    grid-template-columns: minmax(0, 1fr);
  }

  .setup-upload-summary canvas {
    max-width: min(100%, 360px);
  }

  .image-slider-controls {
    gap: 8px;
  }

  .image-setting-row {
    padding: 9px 10px;
  }

  .setting-slider-control {
    grid-template-columns: minmax(112px, 1fr);
    width: 100%;
  }

  .lego-palette-board,
  .color-list .lego-palette-board {
    width: min(100%, 420px);
    padding: 24px 34px 56px 28px;
  }

  .lego-palette-grid,
  .color-list .lego-palette-grid {
    grid-template-columns: repeat(5, minmax(26px, 1fr));
    gap: 9px;
  }

  .lego-palette-thumb-hole {
    left: auto;
    top: auto;
    right: 21%;
    bottom: 15%;
    width: 48px;
    height: 38px;
  }

  .mosaic-replace-row {
    width: 100%;
  }

  .mosaic-replace-field {
    min-width: min(100%, 138px);
    flex: 1 1 138px;
  }

  .sticky-export-cue {
    right: 12px;
    left: auto;
    width: min(calc(100vw - 24px), 320px);
    bottom: 12px;
    padding: 14px;
  }

  .sticky-export-action {
    width: 100%;
  }

  .sticky-export-dismiss {
    top: 8px;
    right: 8px;
  }

  .summary-table-wrap {
    overflow: visible;
  }

  .summary-table-wrap table,
  .summary-table-wrap tbody,
  .summary-table-wrap tr,
  .summary-table-wrap td {
    display: block;
    width: 100%;
  }

  .summary-table-wrap table {
    min-width: 0;
    border-collapse: separate;
    border-spacing: 0;
  }

  .summary-table-wrap thead {
    display: none;
  }

  .summary-table-wrap tr {
    margin-bottom: 10px;
    padding: 10px 12px;
    border: 1px solid rgba(73, 67, 63, 0.1);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.82);
  }

  .summary-table-wrap td {
    display: grid;
    grid-template-columns: minmax(96px, 112px) minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    padding: 6px 0;
    border-bottom: 0;
  }

  .summary-table-wrap td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 0;
    font-size: 0.74rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
  }

  .summary-table-wrap td > * {
    min-width: 0;
  }

  .summary-breakdown-list {
    justify-content: flex-start;
  }

  .summary-breakdown-pill {
    max-width: 100%;
  }

  .interactive-customization-actions,
  .interactive-quick-grid {
    grid-template-columns: 1fr;
  }

  .home-panel-header {
    flex-direction: column;
    align-items: start;
  }

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

  .image-editor-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    border-bottom: none;
  }

  .image-editor-tab-filler,
  .image-editor-tab-ghost {
    display: none;
  }

  .image-editor-tab {
    border-bottom: 1px solid rgba(73, 67, 63, 0.16);
    border-radius: 18px;
  }

  .image-editor-shell {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .setup-inline-editor-mount {
    min-height: 0;
  }

  .setup-inline-editor-mount .image-editor-shell {
    grid-template-columns: 1fr;
  }

  .image-editor-shell[data-editor-tab="crop"] .image-editor-stage,
  .image-editor-shell[data-editor-tab="enhance"] .image-editor-stage {
    order: 1;
  }

  .image-editor-shell[data-editor-tab="crop"] .image-editor-sidebar,
  .image-editor-shell[data-editor-tab="enhance"] .image-editor-sidebar {
    order: 2;
  }

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

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

  .crop-ratio-list {
    display: flex;
    flex-wrap: wrap;
  }

  .cropper-shell,
  .image-controls-preview canvas,
  .instruction-canvas,
  #customizeCanvas {
    width: 100% !important;
    max-width: 100%;
    height: auto !important;
  }

  #customizeCanvas {
    max-height: calc(100dvh - 190px);
    touch-action: none;
  }

  .preview-panel,
  .plan-preview-block,
  .crop-preview-stage,
  .image-controls-preview {
    min-width: 0;
    overflow: hidden;
  }

  #cropPreviewCanvas {
    min-height: 280px;
  }

  #imageControlsPreviewCanvas {
    min-height: 0;
  }
}

@media (max-width: 480px) {
  body {
    overflow-x: hidden;
  }

  .panel,
  .modal-card,
  .overlay-card {
    border-radius: 12px;
  }

  button,
  input,
  select {
    min-height: 44px;
  }

  .modal {
    padding: 0;
  }

  .modal-card,
  .modal-card-wide {
    width: 100vw;
    max-height: 100vh;
    border: none;
    border-radius: 0;
  }

  .preview-header .mini-btn,
  .enhance-actions .mini-btn,
  .preview-quick-actions .mini-btn,
  .image-settings-launcher .mini-btn,
  .image-tool-card .mini-btn,
  .image-settings-actions .mini-btn {
    width: 100%;
    justify-content: center;
  }

  .app-substep-rail {
    display: none;
  }

  .setup-upload-summary {
    grid-template-columns: 1fr;
  }

  .setup-upload-summary canvas {
    max-width: min(100%, 360px);
  }

  .generate-summary-panel canvas {
    max-width: min(100%, 280px);
  }
  .preview-header {
    gap: 10px;
  }
}

button:not(.lego-palette-swatch),
.mini-btn-link,
.flow-prev-btn,
.flow-next-btn,
.board-preset-trigger,
.board-preset-list,
.board-preset-pill,
.setup-tools-fab,
.setup-tool-tab,
.mosaic-toolbar-btn,
.floating-history-btn,
.mosaic-history-fab,
.sticky-export-action,
.sticky-export-secondary,
.sticky-export-dismiss,
select {
  background-image: none !important;
  box-shadow: none !important;
  text-shadow: none !important;
}

button:not(.cta-btn):not(.success-btn):not(.danger-btn):not(.primary-generate-btn):not(.primary-export-btn):not(.stage-switcher-btn):not(.navbar-new-project):not(.floating-history-btn):not(.mosaic-history-fab):not(.sticky-export-action):not(.lego-palette-swatch):not(.app-navbar-logo-button),
.mini-btn-link:not(.cta-btn):not(.success-btn):not(.danger-btn),
.flow-prev-btn,
.flow-next-btn,
.board-preset-pill,
.setup-tools-fab,
.setup-tool-tab,
.mosaic-toolbar-btn,
.sticky-export-secondary {
  background-color: #fffdf9 !important;
}

button.cta-btn,
.mini-btn-link.cta-btn,
.primary-generate-btn,
.primary-export-btn,
.sticky-export-action {
  background-color: var(--orange) !important;
}

button.success-btn,
.mini-btn-link.success-btn,
.stage-switcher-btn,
.navbar-new-project,
.floating-history-btn,
.mosaic-history-fab {
  background-color: var(--teal) !important;
}

button.danger-btn,
.mini-btn-link.danger-btn,
.sticky-export-dismiss {
  background-color: rgba(216, 93, 98, 0.1) !important;
}

.board-preset-trigger,
select {
  background-color: #ffffff !important;
}

.board-preset-trigger:hover,
.board-preset-trigger:focus-visible,
.board-preset-trigger.open,
.board-preset-pill:hover,
.board-preset-pill:focus-visible,
.mosaic-toolbar-btn:hover,
.mosaic-toolbar-btn:focus-visible,
.mosaic-toolbar-btn[aria-expanded="true"],
.setup-tools-fab:hover:not(:disabled),
.setup-tools-fab.active,
.setup-tool-tab:hover,
.setup-tool-tab.active {
  background-color: #f2fffc !important;
}

.gleam-btn::after {
  display: none !important;
}

.stage-switcher-btn:hover:not(:disabled),
.navbar-new-project:hover:not(:disabled),
button.success-btn:hover:not(:disabled),
.mini-btn-link.success-btn:hover,
.floating-history-btn:hover:not(:disabled),
.mosaic-history-fab:hover:not(:disabled) {
  background-color: #20bfb6 !important;
}

button.cta-btn:hover:not(:disabled),
.mini-btn-link.cta-btn:hover,
.primary-generate-btn:hover:not(:disabled),
.primary-export-btn:hover:not(:disabled),
.sticky-export-action:hover:not(:disabled) {
  background-color: var(--orange-deep) !important;
}

.navbar-new-project {
  height: 46px !important;
  min-height: 46px !important;
  padding: 0 !important;
  border-radius: 12px !important;
}

@media (max-width: 768px) {
  .navbar-new-project {
    height: 38px !important;
    min-height: 38px !important;
    padding: 0 !important;
    border-radius: 10px !important;
  }
}
