@import url("https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,600..900&display=swap");

:root {
  --paper: #f7f3ec;
  --surface: #ffffff;
  --surface-soft: #fbfaf7;
  --ink: #1f2926;
  --muted: #66736e;
  --line: #d9ddd6;
  --brand: #365951;
  --brand-dark: #243d37;
  --accent: #8f6f3e;
  --danger: #8a2f2f;
  --focus: #a77c25;
  --font-ui: "Segoe UI", Roboto, Arial, Helvetica, sans-serif;
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.5;
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--brand);
}

button,
input,
select,
textarea {
  font: inherit;
  font-size: 1rem;
  line-height: 1.25;
}

button,
select,
input,
textarea {
  border-radius: 6px;
}

button {
  border: 1px solid var(--brand);
  background: var(--brand);
  color: #fff;
  min-height: 42px;
  padding: 10px 14px;
  font-weight: 700;
  cursor: pointer;
}

button:hover,
button:focus-visible {
  background: var(--brand-dark);
}

button:disabled {
  cursor: not-allowed;
  opacity: .55;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  min-height: 42px;
  padding: 9px 11px;
}

.file-control {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  border: 1px solid var(--line);
  background: #fff;
  min-height: 42px;
  padding: 6px;
  border-radius: 6px;
}

.file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.file-picker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  border: 1px solid var(--brand);
  background: var(--surface-soft);
  color: var(--brand);
  margin: 0;
  padding: 6px 10px;
  border-radius: 5px;
  font-size: 0.88rem;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
  width: 100%;
  cursor: pointer;
}

.file-summary {
  min-width: 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.file-input:focus-visible + .file-picker {
  outline: 3px solid color-mix(in srgb, var(--focus), transparent 55%);
  outline-offset: 2px;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--focus), transparent 55%);
  outline-offset: 2px;
}

textarea {
  resize: vertical;
}

fieldset {
  border: 0;
  margin: 0;
  padding: 0;
}

fieldset + fieldset {
  margin-top: 22px;
}

legend {
  color: var(--ink);
  font-size: 0.98rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 12px;
}

label {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.25;
  margin: 10px 0 6px;
}

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

.skip-link {
  position: absolute;
  left: 16px;
  top: -80px;
  z-index: 30;
  background: var(--ink);
  color: #fff;
  padding: 10px 14px;
}

.skip-link:focus {
  top: 12px;
}

.editor-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid rgba(31, 41, 38, .1);
  background: rgba(255, 255, 255, .96);
  padding: 14px clamp(18px, 4vw, 48px);
}

.editor-logo {
  display: inline-flex;
  flex: 0 0 auto;
}

.editor-logo img {
  display: block;
  height: auto;
  max-width: 125px;
}

.editor-nav {
  display: flex;
  align-items: center;
  gap: clamp(10px, 2vw, 24px);
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1.2;
}

.editor-nav a {
  color: var(--ink);
  text-decoration: none;
}

.editor-nav a:hover {
  color: var(--brand);
}

.editor-nav .editor-nav-cta,
.intro-cta {
  border: 1px solid var(--brand);
  background: var(--brand);
  color: #fff;
  padding: 10px 14px;
  border-radius: 6px;
  text-decoration: none;
}

.editor-shell {
  width: min(1760px, 100%);
  margin: 0 auto;
  padding: 12px clamp(10px, 2vw, 24px) 42px;
}

.editor-intro {
  display: none;
}

.workflow-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  width: 100%;
  border: 1px solid rgba(54, 89, 81, .18);
  background: rgba(255, 255, 255, .7);
  margin: 0;
  padding: 4px;
  border-radius: 8px;
}

.workflow-option {
  min-height: 36px;
  border-color: transparent;
  background: transparent;
  color: var(--muted);
  border-radius: 6px;
  font-size: 0.78rem;
  line-height: 1.2;
  padding: 7px 8px;
}

.workflow-option:hover,
.workflow-option:focus-visible,
.workflow-option.is-active {
  background: var(--brand);
  color: #fff;
}

.free-design-actions {
  display: none;
  margin-top: 18px;
}

.free-design-actions {
  display: none !important;
}

.finish-design-button {
  width: 100%;
  background: var(--accent);
  border-color: var(--accent);
}

.finish-design-button:hover,
.finish-design-button:focus-visible {
  background: #765b31;
}

.editor-grid.is-free-design:not(.is-free-product-stage) #product-step {
  display: none !important;
}

.editor-grid.is-free-canvas .canvas-panel {
  grid-column: 1 / -1;
}

.editor-grid.is-free-canvas .canvas-wrap {
  background:
    linear-gradient(90deg, rgba(54, 89, 81, .055) 1px, transparent 1px),
    linear-gradient(180deg, rgba(54, 89, 81, .055) 1px, transparent 1px),
    #f4eee2;
  background-size: 36px 36px;
}

.mobile-stepper,
.mobile-sticky-cta,
.mobile-form-status,
.mobile-step-heading {
  display: none;
}

.eyebrow {
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.2;
  margin: 0 0 4px;
  text-transform: uppercase;
}

h1 {
  font-family: var(--font-display);
  font-size: 3.25rem;
  font-weight: 800;
  line-height: 1.08;
  margin: 0;
  letter-spacing: 0;
}

h2,
h3 {
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.16;
}

.tool-panel h2,
.request-panel h2 {
  font-size: 1.22rem;
  margin-top: 0;
}

.editor-grid {
  display: grid;
  grid-template-columns: minmax(270px, 306px) minmax(620px, 1fr) minmax(270px, 310px);
  gap: 14px;
  align-items: start;
}

.editor-grid.is-design-phase {
  grid-template-columns: minmax(0, 1fr);
}

.editor-grid.is-request-phase {
  grid-template-columns: minmax(620px, 1fr) minmax(300px, 340px);
}

.editor-grid.is-design-phase .canvas-panel {
  grid-column: 1 / -1;
}

.editor-grid.is-design-phase .request-panel,
.editor-grid.is-request-phase .tool-panel {
  display: none !important;
}

.editor-grid.is-request-phase .canvas-panel {
  grid-column: 1;
}

.tool-panel,
.request-panel,
.canvas-panel {
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: 0 14px 28px rgba(31, 41, 38, .06);
  min-width: 0;
}

.tool-panel,
.request-panel {
  padding: 18px;
  border-radius: 8px;
}

.tool-panel {
  display: grid;
  grid-template-columns: 26px 50px minmax(0, 1fr);
  gap: 9px;
  padding: 8px;
  overflow: hidden;
}

.request-panel {
  padding: 14px;
}

@media (min-width: 821px) {
  .request-panel {
    height: var(--studio-canvas-panel-height, auto);
    max-height: var(--studio-canvas-panel-height, 720px);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
  }

  .tool-panel {
    position: fixed;
    left: var(--toolbox-left, 24px);
    top: var(--toolbox-top, 156px);
    z-index: 24;
    width: min(380px, calc(100vw - 24px));
    height: auto;
    max-height: calc(100vh - 24px);
    backdrop-filter: blur(16px);
    background: rgba(255, 255, 255, .94);
    box-shadow: 0 18px 42px rgba(31, 41, 38, .16);
    transition: box-shadow .18s ease, transform .18s ease;
  }

  .tool-drawer {
    min-height: 0;
    max-height: calc(100vh - 64px);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
  }
}

.toolbox-grip {
  display: grid;
  place-items: center;
  width: 26px;
  min-height: 36px;
  align-self: stretch;
  border-color: rgba(54, 89, 81, .1);
  background: #f9f7f2;
  color: var(--muted);
  padding: 0;
  border-radius: 7px;
  cursor: grab;
}

.toolbox-grip:hover,
.toolbox-grip:focus-visible {
  background: #edf1ed;
  color: var(--brand-dark);
}

.toolbox-grip-svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 3.2;
  stroke-linecap: round;
}

.tool-panel.is-dragging {
  box-shadow: 0 22px 52px rgba(31, 41, 38, .24);
  transform: scale(1.008);
}

.tool-panel.is-dragging .toolbox-grip {
  cursor: grabbing;
}

.studio-phase-actions {
  position: fixed;
  right: clamp(18px, 3vw, 42px);
  bottom: clamp(18px, 3vw, 34px);
  z-index: 23;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  pointer-events: none;
}

.studio-phase-actions button {
  width: auto;
  min-width: 150px;
  min-height: 46px;
  box-shadow: 0 14px 30px rgba(31, 41, 38, .16);
  pointer-events: auto;
}

.studio-phase-actions [hidden] {
  display: none !important;
}

.edit-design-button {
  margin-top: 0;
  background: #fff;
}

.tool-rail {
  display: grid;
  align-content: start;
  gap: 7px;
  border: 1px solid rgba(54, 89, 81, .13);
  background: linear-gradient(180deg, #fff, #f7f4ee);
  padding: 6px;
  border-radius: 8px;
}

.tool-rail-button {
  position: relative;
  display: grid;
  place-items: center;
  width: 36px;
  min-height: 36px;
  border-color: transparent;
  background: transparent;
  color: var(--muted);
  padding: 0;
  border-radius: 7px;
  transition: background-color .18s ease, border-color .18s ease, color .18s ease, transform .18s ease;
}

.tool-rail-button:hover,
.tool-rail-button:focus-visible {
  background: #edf1ed;
  border-color: rgba(54, 89, 81, .18);
  color: var(--brand-dark);
}

.tool-rail-button.is-active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  box-shadow: 0 8px 18px rgba(54, 89, 81, .18);
}

.tool-rail-button.is-active::after {
  content: "";
  position: absolute;
  right: -9px;
  width: 3px;
  height: 22px;
  background: var(--accent);
  border-radius: 999px;
}

.tool-rail-svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tool-drawer {
  min-width: 0;
}

.tool-drawer .tool-section:not(.is-open) {
  display: none;
}

.tool-section {
  overflow: hidden;
  border: 1px solid rgba(54, 89, 81, .13);
  background: #fff;
  border-radius: 8px;
  animation: tool-panel-in .18s ease both;
}

.tool-section-mode {
  background: #fff;
}

.tool-section legend:not(.sr-only) {
  display: block;
  width: 100%;
  margin: 0;
}

.tool-section-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 40px;
  border: 0;
  background: transparent;
  color: var(--ink);
  padding: 9px 11px;
  border-bottom: 1px solid rgba(54, 89, 81, .1);
  border-radius: 0;
  font-size: 0.94rem;
  font-weight: 800;
  line-height: 1.15;
  text-align: left;
}

.tool-section-toggle:hover,
.tool-section-toggle:focus-visible {
  background: #f7f8f4;
  color: var(--brand-dark);
}

.tool-section-icon {
  display: none;
}

.tool-section-icon::before {
  content: "+";
}

.tool-section.is-open .tool-section-icon::before {
  content: "-";
}

.tool-section-body {
  padding: 11px;
}

.tool-section-body[hidden] {
  display: none;
}

.tool-section-body > label:first-child {
  margin-top: 0;
}

.tool-panel label {
  font-size: 0.82rem;
  margin: 7px 0 4px;
}

.tool-panel input,
.tool-panel select,
.tool-panel textarea,
.tool-panel button {
  min-height: 38px;
}

.canvas-panel {
  overflow: hidden;
  border-radius: 8px;
  box-shadow: 0 18px 34px rgba(31, 41, 38, .075);
}

.canvas-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
  padding: 11px 14px;
}

.canvas-toolbar span {
  min-width: 0;
  overflow-wrap: anywhere;
}

#canvas-area-label {
  flex: 1 1 160px;
  text-align: right;
}

#canvas-product-label {
  flex: 0 0 auto;
}

.canvas-wrap {
  width: 100%;
  background: #e8e5df;
  overflow: hidden;
  line-height: 0;
}

.canvas-wrap .canvas-container {
  display: block;
  max-width: 100%;
  margin: 0 auto;
}

.canvas-wrap canvas {
  display: block;
  max-width: 100%;
}

.field-note {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
  margin: 6px 0 0;
}

.upload-list {
  display: grid;
  gap: 6px;
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
}

.upload-list li {
  overflow-wrap: anywhere;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.35;
  padding: 7px 8px;
  border-radius: 6px;
}

.motif-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  max-height: 91px;
  margin-top: 8px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;
  scrollbar-width: thin;
}

.motif-button,
.secondary-button,
.button-row button {
  background: var(--surface-soft);
  color: var(--brand);
}

.motif-button:hover,
.secondary-button:hover,
.button-row button:hover {
  background: #edf1ed;
  color: var(--brand-dark);
}

.motif-button {
  font-size: 0.82rem;
  line-height: 1.2;
  min-height: 38px;
  overflow-wrap: anywhere;
  padding: 7px 8px;
}

.inline-grid {
  display: grid;
  grid-template-columns: 1fr 74px;
  gap: 0 8px;
}

.inline-grid label:nth-of-type(1),
.inline-grid select {
  grid-column: 1 / -1;
}

.inline-grid input[type="color"] {
  min-height: 42px;
  padding: 4px;
}

.inline-grid input[type="range"] {
  padding-left: 0;
  padding-right: 0;
}

.brush-mode-toggle {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 10px;
  padding: 4px;
  border: 1px solid rgba(54, 89, 81, .12);
  background: #f9f7f2;
  border-radius: 8px;
}

.brush-mode-toggle label {
  margin: 0;
}

.brush-mode-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.brush-mode-toggle span {
  display: grid;
  place-items: center;
  min-height: 34px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
  text-align: center;
}

.brush-mode-toggle input:checked + span {
  border-color: rgba(54, 89, 81, .2);
  background: #fff;
  color: var(--brand-dark);
  box-shadow: 0 6px 14px rgba(31, 41, 38, .06);
}

.brush-active-line {
  align-items: center;
  margin: 0 0 10px;
  padding: 9px 10px;
  border: 1px solid rgba(54, 89, 81, .12);
  background: #f9f7f2;
  border-radius: 8px;
  font-weight: 800;
}

.brush-grid {
  grid-template-columns: 1fr;
  gap: 4px;
  margin-top: 4px;
}

.brush-grid label,
.brush-grid input,
.brush-grid select {
  grid-column: 1 / -1;
}

.brush-grid input[type="color"] {
  width: 100%;
}

.brush-presets {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin-top: 10px;
}

.brush-presets button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  background: var(--surface-soft);
  color: var(--brand);
  font-size: 0.82rem;
}

.brush-presets button:hover,
.brush-presets button:focus-visible,
.brush-presets button.is-active {
  background: #edf1ed;
  color: var(--brand-dark);
}

.brush-presets span {
  display: inline-block;
  width: var(--brush-dot);
  height: var(--brush-dot);
  min-width: var(--brush-dot);
  border-radius: 999px;
  background: currentColor;
}

.secondary-button {
  margin-top: 9px;
  width: 100%;
}

.button-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 7px;
}

.button-row .danger-button {
  border-color: var(--danger);
  color: var(--danger);
}

.button-row .danger-button:hover {
  background: #f7eeee;
}

.check-line {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 8px;
  align-items: start;
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 400;
  margin: 18px 0;
}

.check-line input {
  width: 18px;
  min-height: 18px;
  margin: 2px 0 0;
}

.object-mini-toolbar {
  display: none;
}

.summary-card {
  border: 1px solid rgba(54, 89, 81, .14);
  background: linear-gradient(180deg, #fff, var(--surface-soft));
  color: var(--ink);
  margin: 22px 0 0;
  padding: 14px;
  border-radius: 8px;
}

.mobile-step-heading {
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.2;
  margin: 0 0 10px;
}

.summary-card h2 {
  font-family: var(--font-ui);
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.2;
  margin: 0 0 12px;
}

.summary-card dl {
  display: grid;
  gap: 8px;
  margin: 0;
}

.summary-card dl div {
  display: grid;
  grid-template-columns: minmax(82px, auto) 1fr;
  gap: 10px;
  align-items: baseline;
}

.summary-card dt {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.summary-card dd {
  min-width: 0;
  margin: 0;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 700;
  text-align: right;
  overflow-wrap: anywhere;
}

.summary-card p {
  border-top: 1px solid rgba(54, 89, 81, .12);
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.35;
  margin: 12px 0 0;
  padding-top: 10px;
}

.submit-button {
  width: 100%;
  min-height: 48px;
  background: var(--accent);
  border-color: var(--accent);
  transition: background-color .18s ease, border-color .18s ease, transform .18s ease;
}

.submit-button:hover,
.submit-button:focus-visible {
  background: #765b31;
}

.submit-button.is-loading {
  position: relative;
  color: transparent;
}

.submit-button.is-loading:disabled {
  opacity: 1;
}

.submit-button.is-loading::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
  border: 2px solid rgba(255, 255, 255, .42);
  border-top-color: #fff;
  border-radius: 50%;
  animation: editor-spin .8s linear infinite;
}

.form-status {
  min-height: 22px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.form-status.is-error {
  color: var(--danger);
}

.form-status.is-success {
  color: var(--brand);
}

.submit-confirmation {
  border: 1px solid rgba(54, 89, 81, .18);
  background: #f2f7f3;
  color: var(--brand-dark);
  margin-top: 12px;
  padding: 12px;
  border-radius: 8px;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .22s ease, transform .22s ease;
}

.submit-confirmation.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.submit-confirmation strong {
  display: block;
  font-size: 0.98rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 4px;
}

.submit-confirmation p {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.4;
  margin: 0;
}

.request-panel.is-confirmed > :not(.submit-confirmation) {
  display: none !important;
}

.request-panel.is-confirmed .submit-confirmation {
  display: block;
  min-height: 210px;
  margin-top: 0;
  padding: 18px;
}

.request-panel.is-confirmed .submit-confirmation strong {
  font-size: 1.08rem;
}

.honeypot {
  position: absolute;
  left: -9999px;
  opacity: 0;
}

.editor-footer {
  border-top: 1px solid rgba(31, 41, 38, .12);
  background: var(--ink);
  color: #fff;
  font-size: 0.95rem;
  line-height: 1.5;
  padding: 24px clamp(18px, 4vw, 48px);
  text-align: center;
}

.editor-footer p {
  margin: 5px 0;
}

.editor-footer a {
  color: #fff;
}

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

@keyframes editor-step-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes tool-panel-in {
  from {
    opacity: 0;
    transform: translateX(-8px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@media (max-width: 1180px) {
  .editor-grid {
    grid-template-columns: minmax(270px, 306px) minmax(0, 1fr);
  }

  .editor-grid.is-design-phase {
    grid-template-columns: minmax(0, 1fr);
  }

  .editor-grid.is-request-phase {
    grid-template-columns: minmax(0, 1fr) minmax(290px, 330px);
  }

  .request-panel {
    grid-column: 1 / -1;
  }

  .editor-grid.is-request-phase .request-panel {
    grid-column: 2;
  }
}

@media (max-width: 820px) {
  body {
    font-size: 15.5px;
  }

  .editor-header {
    align-items: center;
    flex-direction: row;
    gap: 10px;
    padding: 7px 10px;
  }

  .editor-nav {
    display: none;
  }

  .editor-logo img {
    max-width: 92px;
  }

  .editor-shell {
    padding: 10px 8px calc(104px + env(safe-area-inset-bottom));
  }

  body.is-design-phase .editor-shell {
    padding-bottom: calc(176px + env(safe-area-inset-bottom));
  }

  .editor-intro {
    gap: 10px;
    margin-bottom: 12px;
  }

  .workflow-switch {
    display: grid;
    margin: 0;
  }

  .workflow-option {
    min-height: 42px;
    padding-left: 8px;
    padding-right: 8px;
    font-size: 0.82rem;
  }

  .intro-cta {
    display: none;
  }

  .eyebrow {
    font-size: 0.76rem;
  }

  h1 {
    font-size: 2.55rem;
  }

  .mobile-stepper {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    margin: 0 0 12px;
  }

  body.is-design-phase .mobile-stepper {
    display: none;
  }

  .mobile-stepper-button {
    display: grid;
    place-items: center;
    gap: 4px;
    min-height: 58px;
    border-color: rgba(54, 89, 81, .16);
    background: rgba(255, 255, 255, .76);
    color: var(--muted);
    padding: 7px 4px;
    font-size: 0.78rem;
    line-height: 1.1;
    transition: background-color .18s ease, border-color .18s ease, color .18s ease, transform .18s ease;
  }

  .mobile-stepper-button span {
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    background: #edf1ed;
    color: var(--brand);
    border-radius: 50%;
    font-size: 0.76rem;
    font-weight: 900;
  }

  .mobile-stepper-button.is-active {
    border-color: rgba(54, 89, 81, .45);
    background: #fff;
    color: var(--ink);
    transform: translateY(-1px);
  }

  .mobile-stepper-button.is-active span {
    background: var(--brand);
    color: #fff;
  }

  .editor-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .editor-grid.is-design-phase,
  .editor-grid.is-request-phase {
    grid-template-columns: 1fr;
  }

  .editor-grid.is-request-phase .request-panel,
  .editor-grid.is-request-phase .canvas-panel {
    grid-column: auto;
  }

  .canvas-panel {
    order: -1;
    grid-column: auto;
    border-radius: 8px;
    box-shadow: 0 10px 22px rgba(31, 41, 38, .07);
  }

  .mobile-form-status {
    order: -1;
    display: block;
    min-height: 20px;
    margin: -2px 2px 0;
    color: var(--muted);
    font-size: 0.88rem;
    font-weight: 700;
  }

  .mobile-form-status.is-error {
    color: var(--danger);
  }

  .mobile-form-status.is-success {
    color: var(--brand);
  }

  .canvas-toolbar {
    padding: 9px 12px;
  }

  .canvas-wrap .canvas-container,
  .canvas-wrap canvas {
    touch-action: none;
  }

  .object-mini-toolbar.is-visible {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: calc(74px + env(safe-area-inset-bottom));
    z-index: 26;
    display: flex;
    gap: 7px;
    align-items: center;
    overflow-x: auto;
    border: 1px solid rgba(54, 89, 81, .18);
    background: rgba(255, 255, 255, .97);
    box-shadow: 0 -10px 26px rgba(31, 41, 38, .12);
    padding: 8px;
    border-radius: 8px;
    scrollbar-width: thin;
  }

  .object-mini-toolbar button {
    flex: 0 0 auto;
    min-height: 42px;
    border-color: rgba(54, 89, 81, .22);
    background: var(--surface-soft);
    color: var(--brand);
    padding: 8px 10px;
    border-radius: 7px;
    font-size: 0.82rem;
    white-space: nowrap;
  }

  .object-mini-toolbar button:hover,
  .object-mini-toolbar button:focus-visible {
    background: #edf1ed;
    color: var(--brand-dark);
  }

  .tool-panel,
  .request-panel {
    box-shadow: 0 8px 20px rgba(31, 41, 38, .05);
    height: auto;
    max-height: none;
    overflow: visible;
  }

  .tool-panel {
    position: fixed;
    left: 8px;
    right: 8px;
    bottom: calc(74px + env(safe-area-inset-bottom));
    z-index: 24;
    width: auto;
    max-height: min(62vh, 460px);
    display: block;
    padding: 8px;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 -12px 30px rgba(31, 41, 38, .16);
    overflow: visible;
  }

  .toolbox-grip {
    display: none;
  }

  .tool-rail {
    display: flex;
    gap: 7px;
    overflow-x: auto;
    border-radius: 8px;
    padding: 7px;
    scrollbar-width: none;
  }

  .tool-rail::-webkit-scrollbar {
    display: none;
  }

  .tool-rail-button {
    flex: 0 0 44px;
    width: 44px;
    min-height: 44px;
  }

  .tool-rail-button.is-active::after {
    right: auto;
    bottom: -7px;
    width: 22px;
    height: 3px;
  }

  .tool-rail-svg {
    width: 21px;
    height: 21px;
  }

  .tool-drawer {
    max-height: min(360px, 48vh);
    margin-top: 8px;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
  }

  .tool-section {
    border-radius: 8px;
    animation-name: editor-step-in;
  }

  .tool-panel input,
  .tool-panel select,
  .tool-panel textarea,
  .tool-panel button {
    min-height: 44px;
  }

  .tool-section-toggle {
    padding: 10px 11px;
  }

  .tool-panel.is-panel-hidden,
  .request-panel.is-panel-hidden {
    display: none;
  }

  .editor-grid.is-design-phase .studio-phase-actions {
    display: none;
  }

  .editor-grid.is-request-phase .studio-phase-actions {
    position: static;
    order: -1;
    justify-content: flex-start;
    margin: -2px 0 0;
    pointer-events: auto;
  }

  .editor-grid.is-request-phase .studio-phase-actions button {
    width: 100%;
    min-width: 0;
    box-shadow: 0 8px 18px rgba(31, 41, 38, .08);
  }

  .tool-panel.is-panel-active,
  .request-panel.is-panel-active {
    animation: editor-step-in .22s ease both;
  }

  [data-mobile-step].is-step-hidden {
    display: none !important;
  }

  .tool-panel [data-mobile-step],
  .request-panel [data-mobile-step] {
    margin-top: 0;
  }

  .tool-panel [data-mobile-step="2"]:not(.is-step-hidden) + [data-mobile-step="2"]:not(.is-step-hidden),
  .request-panel [data-mobile-step="3"]:not(.is-step-hidden) + [data-mobile-step="3"]:not(.is-step-hidden) {
    margin-top: 20px;
  }

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

  .file-picker,
  .motif-button {
    min-height: 44px;
  }

  .motif-grid {
    max-height: 103px;
    gap: 7px;
  }

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

  .button-row .danger-button {
    grid-column: 1 / -1;
  }

  .summary-card {
    margin-top: 0;
  }

  .mobile-step-heading:not(.is-step-hidden) {
    display: block;
  }

  .editor-grid.is-submitted .mobile-sticky-cta {
    display: none;
  }

  .editor-grid.is-submitted .object-mini-toolbar {
    display: none;
  }

  .editor-grid.is-design-phase .object-mini-toolbar.is-visible {
    display: none;
  }

  .mobile-sticky-cta {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 25;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-top: 1px solid rgba(31, 41, 38, .12);
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 -12px 28px rgba(31, 41, 38, .11);
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  }

  .mobile-sticky-cta-text {
    flex: 1 1 0;
    min-width: 0;
    max-width: calc(100% - 140px);
  }

  .mobile-sticky-cta-text span,
  .mobile-sticky-cta-text strong {
    display: block;
    line-height: 1.2;
  }

  .mobile-sticky-cta-text span {
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 800;
    text-transform: uppercase;
  }

  .mobile-sticky-cta-text strong {
    color: var(--ink);
    font-size: 0.96rem;
    font-weight: 800;
    overflow-wrap: anywhere;
  }

  .mobile-sticky-cta button {
    flex: 0 0 auto;
    min-width: 116px;
    min-height: 46px;
    background: var(--brand);
    border-color: var(--brand);
    border-radius: 7px;
  }

  .editor-intro {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 520px) {
  body {
    font-size: 15px;
  }

  h1 {
    font-size: 2rem;
    line-height: 1.12;
  }

  .editor-logo img {
    max-width: 86px;
  }

  .tool-panel h2,
  .request-panel h2 {
    font-size: 1.12rem;
  }

  #canvas-area-label {
    display: none;
  }

  .canvas-toolbar {
    justify-content: flex-start;
    gap: 8px;
  }

  .editor-nav a:not(.editor-nav-cta) {
    display: none;
  }

  .editor-nav,
  .editor-nav .editor-nav-cta,
  .intro-cta {
    font-size: 0.94rem;
    width: 100%;
  }

  .editor-nav .editor-nav-cta,
  .intro-cta {
    text-align: center;
  }

  .request-panel {
    padding: 13px;
  }

  .tool-panel {
    padding: 7px;
  }

  .inline-grid {
    grid-template-columns: 1fr;
  }

  .summary-card dl div {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .summary-card dd {
    text-align: left;
  }

  .mobile-stepper-button {
    min-height: 52px;
    font-size: 0.68rem;
    padding-left: 2px;
    padding-right: 2px;
  }

  .mobile-sticky-cta {
    padding-left: 10px;
    padding-right: 10px;
  }

  .mobile-sticky-cta button {
    min-width: 104px;
  }
}
