/* The resizer tool: header, sidebar and the artboard of ad frames */

body.app {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  height: 100vh;
  overflow: hidden;
}

.app-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  padding: 10px 20px;
  border-top: 3px solid var(--brand); /* thin brand band across the top */
  border-bottom: 1px solid var(--hairline);
}

.header-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
}

.campaign {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--ink-soft);
}

.campaign input {
  width: 220px;
  height: 40px;
  padding: 0 10px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  font: 14px var(--font-mono);
  color: var(--ink);
  background: var(--paper);
}

.campaign input:hover {
  border-color: var(--ink-soft);
}

.campaign select {
  height: 40px;
  padding: 0 8px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  background: var(--paper);
  font: 14px var(--font-sans);
  color: var(--ink);
}

/* ---------- Guided workflow ---------- */

/* Step bar above the previews; it stays in view while the previews scroll */
.stepper {
  position: sticky;
  top: -24px; /* the artboard's top padding */
  z-index: 5;
  margin: -24px -32px 16px;
  padding: 12px 32px;
  border-bottom: 1px solid var(--hairline);
  background: var(--paper);
}

.stepper ol {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.step {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  padding: 0 12px 0 6px;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  background: var(--paper);
  font: 14px var(--font-sans);
  color: var(--ink-soft);
  cursor: pointer;
}

.step:hover {
  border-color: var(--brand-strong);
  color: var(--ink);
}

.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--artboard);
  font: 500 11px var(--font-mono);
  color: var(--ink-soft);
}

.step.is-done {
  border-color: var(--brand-tint);
  background: var(--brand-tint);
  color: var(--brand-deep);
}

.step.is-done .step-number,
.step.is-current .step-number {
  background: var(--brand-strong);
  color: var(--paper);
}

.step.is-current {
  border-color: var(--brand-strong);
  box-shadow: 0 0 0 2px var(--brand-tint);
  color: var(--ink);
  font-weight: 500;
}

.optional {
  font-size: 11px;
  font-weight: 400;
  color: var(--ink-soft);
}

/* "Next" prompt under the step bar */
.next-step {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
  margin-bottom: 20px;
  padding: 14px 18px;
  border: 1px solid var(--hairline);
  border-left: 3px solid var(--brand);
  border-radius: 0 8px 8px 0;
  background: var(--paper);
}

.next-step-text {
  flex: 1 1 320px;
}

.next-step-title {
  font-size: 16px;
}

.next-step-text p {
  margin-top: 4px;
  font-size: 14px;
  color: var(--ink-soft);
}

.next-step-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Before anything is uploaded, the prompt is a big welcome and drop target */
.next-step.is-large {
  flex-direction: column;
  align-items: center;
  padding: 48px 24px;
  border: 2px dashed #9fc9c2;
  border-radius: 12px;
  background: #f7fbfa;
  text-align: center;
}

.next-step.is-large .next-step-text {
  flex: none;
  max-width: 460px;
}

.next-step.is-large .next-step-title {
  font-size: 22px;
}

.next-step.is-finished {
  border-left-color: var(--brand-strong);
  background: var(--brand-tint);
}

/* Accordion sidebar: every step is a row with its number and title; only the
   open step shows its contents. */
.accordion {
  display: grid;
  margin-top: -12px;
  border-top: 1px solid var(--hairline);
}

.step-panel {
  border-bottom: 1px solid var(--hairline);
}

.step-panel .step-heading {
  margin: 0;
  font-size: 15px;
}

.step-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 48px;
  padding: 10px 0;
  border: 0;
  background: none;
  font: 500 15px var(--font-sans);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.step-toggle:hover .step-title {
  color: var(--brand-strong);
}

.step-title {
  flex: 1;
}

.step-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--artboard);
  font: 500 12px var(--font-mono);
  color: var(--ink-soft);
}

.step-panel.is-done .step-badge {
  background: var(--brand-tint);
  color: var(--brand-deep);
}

.step-panel.is-current .step-badge {
  background: var(--brand-strong);
  color: var(--paper);
}

.step-panel.is-open .step-title {
  color: var(--brand-strong);
}

/* A small arrow: pointing down when closed, up when open */
.chevron {
  flex: none;
  width: 8px;
  height: 8px;
  margin: 0 4px 4px 0;
  border-right: 2px solid var(--ink-soft);
  border-bottom: 2px solid var(--ink-soft);
  transform: rotate(45deg);
  transition: transform 0.15s;
}

.step-panel.is-open .chevron {
  margin-bottom: -4px;
  transform: rotate(-135deg);
}

.step-body {
  padding: 4px 0 20px;
}

.step-footer {
  margin-top: 18px;
}

/* Check sizes section */
.check-summary {
  margin: 0 0 10px;
  font-size: 14px;
}

.auto-adjust {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 16px 0 20px;
  padding: 12px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: #fbfdfc;
}

.auto-adjust .setting-note {
  flex-basis: 100%;
  margin: 0;
}

.auto-adjust-message {
  flex-basis: 100%;
  margin: 0;
  font-size: 13px;
  color: var(--brand-strong);
}

.auto-adjust-message:empty {
  display: none;
}

/* Download section */
.download-all {
  width: 100%;
  margin-bottom: 12px;
}

/* "Unlock with Pro" on locked sizes */
.unlock-link {
  justify-self: start;
  margin-top: 4px;
  font-size: 13px;
  font-weight: 500;
  color: var(--brand-strong);
}

/* Font, weight and alignment for the selected text line in Adjust */
.editor-text-style {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 8px;
  margin-top: 10px;
}

.editor-text-style .setting-note {
  grid-column: 1 / -1;
  margin: 0;
}

/* "Show me" briefly highlights the size that needs attention */
.tile.is-flashing {
  border-color: var(--caution);
  box-shadow: 0 0 0 3px rgba(154, 91, 0, 0.25);
}

@media (prefers-reduced-motion: no-preference) {
  .tile.is-flashing {
    animation: flash 0.8s ease-in-out 2;
  }
}

@keyframes flash {
  50% { box-shadow: 0 0 0 6px rgba(154, 91, 0, 0.12); }
}

/* Design bar at the top of the sidebar */
.design-bar {
  padding-bottom: 20px;
  border-bottom: 1px solid var(--hairline);
}

.design-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.design-head h2 {
  margin-bottom: 8px;
}

.save-state {
  font-size: 12px;
  color: var(--ink-soft);
}

.save-state.is-error {
  color: var(--caution);
}

.design-name {
  width: 100%;
  height: 36px;
  margin-bottom: 10px;
  padding: 0 10px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  font: 500 14px var(--font-sans);
  color: var(--ink);
}

.design-name:hover {
  border-color: var(--ink-soft);
}

.design-bar .source-actions {
  margin-top: 0;
}

/* Recent image thumbnails */
.recent {
  margin-top: 14px;
}

.recent h3 {
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-soft);
}

.recent-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(44px, 1fr));
  gap: 6px;
}

.recent-thumb {
  aspect-ratio: 1;
  padding: 0;
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  background: repeating-conic-gradient(var(--artboard) 0 25%, var(--paper) 0 50%) 0 0 / 10px 10px;
  cursor: pointer;
  overflow: hidden;
}

.recent-thumb:hover {
  border-color: var(--ink);
}

.recent-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* The Open… window */
.designs-dialog .setting-note {
  margin-top: 6px;
}

.design-list {
  display: grid;
  gap: 0;
  max-height: 50vh;
  margin: 12px 0 0;
  padding: 0;
  overflow-y: auto;
  list-style: none;
}

.design-item {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--hairline);
}

.design-thumb {
  display: block;
  width: 72px;
  height: 72px;
  object-fit: cover;
  border: 1px solid var(--hairline);
  background: var(--artboard);
}

.design-info {
  display: grid;
  gap: 2px;
  align-content: start;
}

.design-label {
  font-size: 15px;
  font-weight: 500;
}

.design-updated {
  font-size: 12px;
  color: var(--ink-soft);
}

.design-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
}

.design-confirm {
  font-size: 13px;
  color: var(--caution);
}

.btn.danger {
  border-color: var(--caution);
  color: var(--caution);
}

.designs-message {
  min-height: 1.4em;
  margin-top: 10px;
  font-size: 13px;
}

.design-files {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.design-files label:focus-within {
  outline: 2px solid var(--crop);
  outline-offset: 2px;
}

/* Export progress and results, above the grid */
.export-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-bottom: 16px;
  padding: 10px 14px;
  border: 1px solid var(--hairline);
  border-left: 3px solid var(--brand);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--paper);
  font-size: 14px;
  line-height: 1.45;
}

.export-status.is-error {
  border-left-color: var(--caution);
  color: var(--caution);
}

.export-status span {
  flex: 1 1 320px;
}

.export-status progress {
  flex: 1 1 200px;
  height: 6px;
  accent-color: var(--ink);
}

.drive-tip {
  max-width: 240px;
  font-size: 12px;
}

.drive-tip a {
  color: var(--ink);
}

.campaign input::placeholder {
  color: #6b8286;
}

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

/* Sidebar */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 32px;
  padding: 20px;
  overflow-y: auto;
  border-right: 1px solid var(--hairline);
}

.panel h2 {
  margin-bottom: 12px;
  font-size: 15px;
}

.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 32px 16px;
  border: 1.5px dashed #9fc9c2;
  border-radius: 8px;
  background: #f7fbfa;
  text-align: center;
}

.dropzone.is-dragging {
  border-color: var(--crop);
  background: var(--brand-tint);
}

.dropzone .hint {
  margin-bottom: 8px;
  font-size: 13px;
  color: var(--ink-soft);
}

/* Keyboard focus lands on the hidden file input, so show it on the button */
.dropzone label:focus-within {
  outline: 2px solid var(--crop);
  outline-offset: 2px;
}

.status {
  min-height: 1.5em;
  margin-top: 12px;
  font-size: 14px;
}

/* The general message line under the Design bar takes no space when empty */
.sidebar > .status {
  min-height: 0;
  margin: -20px 0 0;
}

.sidebar > .status:empty {
  margin-top: -32px;
}

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

/* Numbers on text and image boxes in the Adjust window */
.text-area-number {
  position: absolute;
  top: 0;
  left: 0;
  padding: 0 4px;
  border-radius: 3px;
  background: var(--brand-strong);
  color: var(--paper);
  font: 500 11px/16px var(--font-mono);
}

/* Resize handles on the selected box */
.handle {
  position: absolute;
  width: 10px;
  height: 10px;
  border: 1.5px solid var(--crop);
  background: var(--paper);
  transform: translate(-50%, -50%);
}

.handle-nw { left: 0; top: 0; cursor: nwse-resize; }
.handle-n { left: 50%; top: 0; cursor: ns-resize; }
.handle-ne { left: 100%; top: 0; cursor: nesw-resize; }
.handle-e { left: 100%; top: 50%; cursor: ew-resize; }
.handle-se { left: 100%; top: 100%; cursor: nwse-resize; }
.handle-s { left: 50%; top: 100%; cursor: ns-resize; }
.handle-sw { left: 0; top: 100%; cursor: nesw-resize; }
.handle-w { left: 0; top: 50%; cursor: ew-resize; }

/* "Remove" and "Back to automatic" links on text lines and images */
.area-remove {
  margin-left: auto;
  padding: 4px 0;
  border: 0;
  background: none;
  color: var(--ink-soft);
  font: 13px var(--font-sans);
  text-decoration: underline;
  cursor: pointer;
}

.area-remove:hover {
  color: var(--ink);
}

/* Text panel: one block of controls per text line */
.text-lines {
  display: grid;
  gap: 12px;
  margin: 0 0 12px;
  padding: 0;
  list-style: none;
}

.text-line {
  padding: 10px 0 12px;
  border-top: 1px solid var(--hairline);
}

.text-line-head {
  display: flex;
  align-items: baseline;
  margin-bottom: 6px;
}

.text-line-name {
  font-size: 14px;
  font-weight: 500;
}

.text-line textarea {
  display: block;
  width: 100%;
  padding: 6px 8px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  font: 14px/1.4 var(--font-sans);
  color: var(--ink);
  resize: vertical;
}

.text-line textarea:hover,
.text-line select:hover,
.text-line input:hover {
  border-color: var(--ink-soft);
}

.text-line-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px 10px;
  margin-top: 8px;
}

.text-field {
  display: grid;
  gap: 2px;
  font-size: 12px;
  color: var(--ink-soft);
}

.text-field select,
.text-field input {
  width: 100%;
  height: 32px;
  padding: 0 6px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  background: var(--paper);
  font: 13px var(--font-sans);
  color: var(--ink);
}

.text-field input[type="color"] {
  padding: 2px;
  cursor: pointer;
}

/* The font menu gets the full width */
.text-field:first-child {
  grid-column: 1 / -1;
}

.text-position {
  margin: 16px 0 4px;
}

.position-options {
  display: flex;
  gap: 16px;
}

.tile.has-text-overflow .frame {
  outline: 2px solid var(--caution);
}

/* Text line boxes in the Adjust window */
.line-box-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.line-box {
  position: absolute;
  border: 1.5px dashed rgba(255, 255, 255, 0.9);
  outline: 1px dashed rgba(14, 42, 47, 0.6);
  pointer-events: auto;
  cursor: move;
}

.line-box.is-selected {
  border: 2px solid var(--crop);
  outline: 1px solid rgba(255, 255, 255, 0.85);
  background: rgba(10, 158, 142, 0.1);
}

.line-box:focus-visible {
  outline: 2px solid var(--crop);
  outline-offset: 3px;
}

/* Number tags sit just left of each box, so they never cover text */
.line-box .text-area-number {
  top: -2px;
  left: auto;
  right: calc(100% + 4px);
}

.line-box .handle {
  display: none;
}

.line-box.is-selected .handle {
  display: block;
}

/* "Image 1" labels sit inside the top-left of image boxes */
.image-box .image-number {
  top: 0;
  right: auto;
  left: 0;
}

/* Images panel in the sidebar */
.image-layers {
  display: grid;
  gap: 12px;
  margin: 0 0 12px;
  padding: 0;
  list-style: none;
}

.image-layer {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--hairline);
}

/* Checkerboard behind thumbnails, so transparent areas are visible */
.image-layer-thumb {
  width: 56px;
  height: 56px;
  object-fit: contain;
  border: 1px solid var(--hairline);
  background: repeating-conic-gradient(var(--artboard) 0 25%, var(--paper) 0 50%) 0 0 / 12px 12px;
}

.image-layer-info {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.image-layer-file {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image-layer-size {
  font-size: 12px;
  color: var(--ink-soft);
}

.image-tip {
  margin: 0 0 12px;
  padding: 8px 10px;
  border-left: 3px solid var(--brand);
  border-radius: 0;
  background: var(--artboard);
  font-size: 13px;
  line-height: 1.45;
}

.image-tip strong {
  font-weight: 500;
}

.image-layer-note {
  margin: 4px 0 0;
  font-size: 12px;
  line-height: 1.4;
  color: var(--caution);
}

.pinned-note {
  margin: 6px 0 0;
  font-size: 12px;
  line-height: 1.4;
  color: var(--brand-strong);
}

.pinned-note .area-remove {
  margin-left: 2px;
  padding: 0;
  font-size: 12px;
}

.editor-applied {
  min-height: 0;
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--ink-soft);
}

.editor-applied:empty {
  display: none;
}

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

.editor-text-size {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  font-size: 14px;
}

.editor-text-size output {
  min-width: 56px;
  text-align: center;
  font-size: 13px;
}

.tag-text-adjusted {
  display: none;
  border-color: var(--brand-strong);
  color: var(--brand-strong);
}

.tile.is-text-adjusted .tag-text-adjusted {
  display: inline-flex;
}

/* Uploaded image with its focal point */
.source-frame {
  display: flex;
  justify-content: center;
  padding: 12px;
  background: var(--artboard);
}

.source-stage {
  position: relative;
  line-height: 0;
  cursor: crosshair;
  touch-action: none;
  user-select: none;
}

.source-stage img {
  display: block;
  max-width: 100%;
  max-height: 320px;
  width: auto;
  height: auto;
}

.focal-marker {
  position: absolute;
  width: 20px;
  height: 20px;
  border: 2px solid var(--crop);
  border-radius: 50%;
  /* White ring keeps the marker visible on dark and busy images */
  box-shadow: 0 0 0 2px var(--paper), inset 0 0 0 2px var(--paper);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.focal-marker::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 4px;
  height: 4px;
  background: var(--crop);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.source-hint {
  margin-top: 10px;
  font-size: 13px;
  color: var(--ink-soft);
}

.source-facts {
  display: grid;
  gap: 4px;
  margin: 14px 0 0;
  font-size: 14px;
}

.source-facts div {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 8px;
}

.source-facts dt {
  color: var(--ink-soft);
}

.source-facts dd {
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.source-facts dd.mono {
  font-size: 13px;
}

.source-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.source-actions label:focus-within {
  outline: 2px solid var(--crop);
  outline-offset: 2px;
}

/* Settings */
.setting {
  margin: 0 0 20px;
  padding: 0;
  border: 0;
}

.setting legend {
  padding: 0;
  font-size: 14px;
  font-weight: 500;
}

.setting-note {
  margin: 2px 0 8px;
  font-size: 13px;
  color: var(--ink-soft);
}

.choice {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  font-size: 14px;
  cursor: pointer;
}

.choice input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--ink);
}

.swatch {
  width: 16px;
  height: 16px;
  margin-left: 2px;
  border: 1px solid var(--hairline);
  background: var(--paper);
}

.colour-input {
  width: 64px;
  height: 28px;
  margin: 0 0 4px 24px;
  padding: 2px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  background: var(--paper);
  cursor: pointer;
}

.panel-note,
.dev-note {
  font-size: 14px;
  color: var(--ink-soft);
}

.dev-note {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px dashed var(--hairline);
}

/* Artboard */
.artboard {
  padding: 24px 32px 48px;
  overflow-y: auto;
  background: var(--artboard);
}

.artboard:focus {
  outline: none;
}

.artboard-intro {
  font-size: 15px;
  color: var(--ink-soft);
}

.platform-group {
  margin-top: 28px;
}

.platform-group h2 {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--hairline);
  font-size: 17px;
}

.count {
  font-size: 13px;
  font-weight: 400;
  color: var(--ink-soft);
}

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.tile {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--paper);
  border: 1px solid var(--hairline);
  border-radius: 8px;
  transition: box-shadow 0.15s, border-color 0.15s;
}

/* A gentle lift on hover, the only place tiles get a shadow */
.tile:hover {
  border-color: #b7d3ce;
  box-shadow: var(--shadow-hover);
}

.tile-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 196px;
  padding: 16px;
  border-bottom: 1px solid var(--hairline);
}

/* Empty frame at the placement's true proportions */
.frame {
  position: relative;
  background: var(--artboard);
  outline: 1px solid var(--hairline);
}

.preview {
  display: block;
  width: 100%;
  height: 100%;
}

/* Safe zones: shaded bands over the preview, shown only when switched on */
.safe-zone {
  position: absolute;
  inset: 0;
  display: none;
  overflow: hidden;
  pointer-events: none;
}

.show-safe-zones .safe-zone {
  display: block;
}

.safe-area {
  position: absolute;
  border: 1px dashed var(--paper);
  box-shadow: 0 0 0 4000px rgba(14, 42, 47, 0.45);
}

/* Resolution and text warnings */
.tile.is-low .frame,
.tile.is-too-small .frame {
  outline: 2px solid var(--caution);
}

.tile-warning {
  display: grid;
  gap: 4px;
  margin: 4px 0 0;
  font-size: 13px;
  line-height: 1.4;
  color: var(--caution);
}

.warning-line {
  display: flex;
  align-items: flex-start;
  gap: 6px;
}

.tile-warning svg,
.resolution-summary svg {
  flex: none;
  width: 14px;
  height: 14px;
  margin-top: 2px;
}

.tile-warning strong {
  font-weight: 500;
}

.warning-label {
  padding: 0 5px;
  border-radius: var(--radius);
  background: var(--caution);
  color: var(--paper);
  font-weight: 500;
}

.resolution-summary {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 8px;
  font-size: 15px;
  color: var(--caution);
}

/* Adjust button and label */
.btn-small {
  min-height: 32px;
  padding: 0 12px;
  font-size: 14px;
}

.tile-actions {
  display: none;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.has-image .tile-actions {
  display: flex;
}

.tag-adjusted {
  display: none;
  border-color: var(--brand-strong);
  color: var(--brand-strong);
}

.tile.is-adjusted .tag-adjusted {
  display: inline-flex;
}

.tile.is-locked .frame {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-soft);
}

.tile.is-locked .frame svg {
  width: 16px;
  height: 16px;
}

.tile-meta {
  display: grid;
  gap: 4px;
  padding: 10px 12px 12px;
}

.tile-name {
  font-size: 14px;
  line-height: 1.35;
}

.tile-details {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
}

.tile-size {
  font-size: 13px;
  color: var(--ink-soft);
}

.load-error {
  margin-top: 16px;
  color: var(--caution);
}

/* Adjust window */
.editor {
  width: min(720px, calc(100vw - 32px));
  max-width: none;
  padding: 0;
  border: 1px solid var(--hairline);
  border-radius: 10px;
  color: var(--ink);
  background: var(--paper);
  box-shadow: 0 20px 50px rgba(14, 42, 47, 0.25);
}

.editor::backdrop {
  background: rgba(14, 42, 47, 0.55);
}

.editor-body {
  padding: 20px 24px 24px;
}

.editor-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
}

.editor-header h2 {
  font-size: 18px;
}

.editor-header .mono {
  font-size: 14px;
  color: var(--ink-soft);
}

.editor-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 16px;
  padding: 24px;
  overflow: hidden;
  background: var(--artboard);
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.editor-stage.is-dragging {
  cursor: grabbing;
}

.editor-frame {
  position: relative;
  outline: 1px solid var(--hairline);
}

.editor-frame canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.editor-hint {
  margin-top: 10px;
  font-size: 13px;
  color: var(--ink-soft);
}

.editor-warning {
  margin-top: 8px;
}

.editor-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  font-size: 14px;
}

.editor-controls input[type="range"] {
  flex: 1;
  accent-color: var(--ink);
}

.editor-controls output {
  min-width: 48px;
  text-align: right;
  font-size: 13px;
}

.editor-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 20px;
}

/* Narrow screens: stack the sidebar above the artboard */
@media (max-width: 800px) {
  body.app {
    display: block;
    height: auto;
    overflow: visible;
  }

  .app-header {
    padding: 10px 16px;
  }

  .campaign input {
    width: 160px;
  }

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

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--hairline);
    padding: 16px;
  }

  .artboard {
    padding: 20px 16px 40px;
  }

  .stepper {
    top: 0;
    margin: -20px -16px 16px;
    padding: 10px 16px;
  }
}

/* The permission window */
.ai-dialog {
  width: min(520px, calc(100vw - 32px));
}

.ai-preview {
  display: block;
  max-width: 100%;
  max-height: 220px;
  margin: 14px 0 12px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  object-fit: contain;
}

.ai-what {
  margin-bottom: 8px;
  font-size: 14px;
}

.ai-code {
  max-width: 280px;
  margin-top: 14px;
}

.ai-error {
  margin-top: 8px;
  font-size: 13px;
  color: var(--caution);
}

.ai-error:empty {
  display: none;
}

/* Background type: Photo, Colour or Gradient */
.background-kind {
  display: flex;
  margin: 0 0 12px;
  padding: 3px;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  background: var(--paper);
}

.background-kind label {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  border-radius: 999px;
  font-size: 14px;
  cursor: pointer;
}

.background-kind input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.background-kind label:has(input:checked) {
  background: var(--brand-strong);
  color: var(--paper);
  font-weight: 500;
}

.background-kind label:has(input:focus-visible) {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.designed-background {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px 10px;
  margin-bottom: 12px;
}

.designed-background .bg-style-field,
.designed-background .setting-note {
  grid-column: 1 / -1;
}

/* A colour or gradient background has no focal point, zoom or spare space to fill. */
body.has-designed-background .focal-marker,
body.has-designed-background #reset-focal,
body.has-designed-background #stage-hint,
body.has-designed-background .photo-only,
body.has-designed-background .editor-controls,
body.has-designed-background #editor-reset {
  display: none;
}

.designed-background .text-field:first-child {
  grid-column: auto;
}

/* Logo slot, above the added images */
.logo-slot {
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--hairline);
}

.logo-slot h3,
.images-heading {
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 500;
}

.logo-slot .image-layer {
  margin-bottom: 10px;
}

/* Coloured words and buttons on text lines */
.word-colours {
  margin-top: 8px;
}

.word-colours-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: var(--ink-soft);
}

.word-accent input[type="color"] {
  width: 32px;
  height: 24px;
  padding: 1px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-small);
  background: var(--paper);
  cursor: pointer;
}

.word-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}

.word-chip {
  padding: 2px 8px;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  background: var(--paper);
  font: 12px var(--font-sans);
  color: var(--ink);
  cursor: pointer;
}

.word-chip[aria-pressed="true"] {
  border-color: var(--brand-strong);
  background: var(--brand-tint);
  font-weight: 500;
}

.button-style {
  margin-top: 8px;
  font-size: 13px;
}

.button-options {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px 10px;
  margin-top: 6px;
}

.button-options .text-field:first-child {
  grid-column: auto;
}

/* The Adjust window's design grid (never in downloads) */
.editor-grid-toggle {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 8px;
  margin: 10px 0 8px;
  font-size: 14px;
}

.editor-grid-toggle .setting-note {
  margin: 0;
}

.editor-grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.grid-line {
  position: absolute;
  border: 0 solid rgba(236, 64, 150, 0.45);
}

.grid-line.is-across {
  top: 0;
  bottom: 0;
  border-left-width: 1px;
}

.grid-line.is-down {
  left: 0;
  right: 0;
  border-top-width: 1px;
}

.grid-line.is-margin {
  border-color: rgba(236, 64, 150, 0.8);
}

.grid-line.is-centre {
  border-color: rgba(236, 64, 150, 0.7);
  border-style: dashed;
}

/* Design every size with AI (ai-design.js) */
canvas.ai-preview {
  width: 220px;
  height: 220px;
}

.tag-ai {
  border-color: var(--brand-strong);
  color: var(--brand-strong);
}

.tag-ai:empty {
  display: none;
}

.tag-ai.is-busy {
  border-style: dashed;
}

.tag-ai.is-check {
  border-color: var(--caution);
  color: var(--caution);
}

.auto-adjust-message.is-error {
  color: var(--caution);
}

/* Start screen: Generate with AI or Build and resize */
.start-dialog {
  width: min(640px, calc(100vw - 32px));
}

.start-choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 16px;
}

.start-choice {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.start-choice:hover {
  border-color: var(--brand-strong);
  background: var(--brand-tint);
}

.start-choice-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 17px;
  font-weight: 600;
}

.start-choice-text {
  font-size: 14px;
  color: var(--ink-soft);
}

.start-choice-note {
  margin-top: auto;
  font-size: 13px;
  color: var(--brand-strong);
}

@media (max-width: 560px) {
  .start-choices {
    grid-template-columns: 1fr;
  }
}

/* Reference ad (ai-reference.js) */
.reference-message {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--brand-strong);
}

.reference-message:empty {
  display: none;
}

.reference-message.is-error {
  color: var(--caution);
}

.reference-choice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 12px 0;
  font-size: 14px;
}

.reference-choice input {
  margin-top: 3px;
}

.reference-summary {
  display: block;
  margin-top: 2px;
  color: var(--ink-soft);
}

.reference-swatch {
  display: inline-block;
  width: 28px;
  height: 14px;
  margin-left: 4px;
  vertical-align: -2px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-small);
}

/* Brand kits (brand-kit.js) */
.brand-dialog {
  width: min(640px, calc(100vw - 32px));
}

.brand-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px;
  margin: 14px 0 6px;
}

.brand-kit-choice {
  flex: 1 1 220px;
}

.brand-kit-body > .text-field {
  margin-top: 8px;
}

.brand-row {
  padding: 14px 0;
  border-bottom: 1px solid var(--hairline);
}

.brand-row h3 {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 500;
}

.brand-row .setting-note {
  margin: 6px 0 0;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo img {
  max-width: 140px;
  max-height: 48px;
  padding: 4px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-small);
  background: repeating-conic-gradient(#f0f3f2 0% 25%, #ffffff 0% 50%) 0 0 / 12px 12px; /* shows transparency */
}

.brand-colours {
  display: grid;
  gap: 6px;
  margin: 0 0 8px;
  padding: 0;
  list-style: none;
}

.brand-colour {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.brand-colour input[type="color"] {
  width: 36px;
  height: 30px;
  padding: 2px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-small);
  background: var(--paper);
}

.brand-hex {
  width: 5.5em;
  font-size: 13px;
}

.brand-colour select,
.brand-colour-name {
  min-height: 30px;
  padding: 2px 6px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-small);
  font: 13px var(--font-sans);
}

.brand-colour-name {
  flex: 1 1 120px;
}

.brand-colour .area-remove {
  margin-left: 0;
}

.brand-font {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 8px;
  margin-bottom: 8px;
}

.brand-font .text-field:first-child {
  grid-column: auto; /* beside its Weight menu, not above it */
}

.brand-logo .area-remove {
  margin-left: 0;
}

.brand-font .brand-named {
  grid-column: 1 / -1;
  margin: 0;
}

.brand-row textarea {
  width: 100%;
  padding: 8px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  font: 14px/1.5 var(--font-sans);
  resize: vertical;
}

#brand-guidelines-label.is-disabled {
  opacity: 0.55;
  pointer-events: none;
}

#brand-kit-open .tag-pro {
  margin-left: 4px;
}

/* AI Ad Generator (ad-generator.js) */
.gen-dialog {
  width: min(760px, calc(100vw - 32px));
}

.gen-dialog .text-field {
  margin-top: 10px;
}

.gen-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
}

.gen-label {
  width: 4rem;
  font-size: 14px;
  font-weight: 500;
}

.gen-pick {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.gen-thumb {
  max-width: 96px;
  max-height: 64px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-small);
}

.gen-logo-thumb {
  padding: 3px;
  background: repeating-conic-gradient(#f0f3f2 0% 25%, #ffffff 0% 50%) 0 0 / 12px 12px;
}

.gen-recent {
  margin: 8px 0 0 calc(4rem + 12px);
}

.gen-styles {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 14px 0 0;
  padding: 0;
  border: 0;
}

.gen-styles legend {
  margin-bottom: 6px;
  padding: 0;
  font-size: 14px;
  font-weight: 500;
}

.gen-styles label {
  position: relative;
  padding: 6px 12px;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  font-size: 14px;
  cursor: pointer;
}

.gen-styles input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.gen-styles label:has(input:checked) {
  border-color: var(--brand-strong);
  background: var(--brand-tint);
  color: var(--brand-deep);
  font-weight: 500;
}

.gen-styles label:has(input:focus-visible) {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

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

.gen-two .text-field:first-child {
  grid-column: auto;
}

.gen-status {
  margin: 4px 0 12px;
  font-size: 14px;
  color: var(--brand-strong);
}

.gen-status:empty {
  display: none;
}

.gen-concepts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.concept {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
}

.concept.is-waiting,
.concept.is-failed {
  justify-content: center;
  aspect-ratio: 1;
  padding: 12px;
  border: 1px dashed var(--hairline);
  border-radius: var(--radius);
  background: var(--artboard);
}

.concept-wait {
  margin: 0;
  font-size: 13px;
  color: var(--ink-soft);
  text-align: center;
}

.concept.is-failed .concept-wait {
  color: var(--caution);
}

.concept-preview {
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
}

.concept figcaption {
  display: grid;
  gap: 2px;
  font-size: 13px;
  color: var(--ink-soft);
}

.concept figcaption strong {
  font-size: 15px;
  color: var(--ink);
}

.concept .btn {
  margin-top: auto;
}

@media (max-width: 640px) {
  .gen-concepts,
  .gen-two {
    grid-template-columns: 1fr;
  }
}

/* Start screen: reference ad status, and the pointer to the AI Ad Generator */
.start-message {
  margin-top: 12px;
}

.start-generator {
  margin: 14px 0 0;
}

.start-choice:has(input:focus-visible) {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* Download step: Preview in feed and Make test versions */
.download-extras {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 4px;
}

/* A/B Test Builder dialog (ab-test.js) */
.ab-kinds {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 16px;
  margin: 14px 0 0;
  padding: 0;
  border: 0;
}

.ab-kinds legend {
  margin-bottom: 6px;
  font-weight: 500;
}

.ab-options {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--hairline);
}

.ab-options .btn {
  justify-self: start;
}

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

.ab-choice {
  align-items: center;
}

.ab-angle {
  margin-left: auto;
  padding-left: 10px;
  font-size: 12px;
  color: var(--ink-soft);
}

.ab-own {
  width: 100%;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  font: 14px var(--font-sans);
}

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

.ab-swatch {
  width: 18px;
  height: 18px;
  margin-left: auto;
  border: 1px solid var(--hairline);
  border-radius: 50%;
}

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

.ab-photo {
  position: relative;
  display: block;
  cursor: pointer;
}

.ab-photo img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border: 2px solid transparent;
  border-radius: var(--radius);
}

.ab-photo input {
  position: absolute;
  top: 6px;
  left: 6px;
}

.ab-photo input:checked + img {
  border-color: var(--brand);
}

.ab-result {
  margin-top: 14px;
  padding: 14px;
  border-radius: var(--radius);
  background: var(--brand-tint);
}

.ab-result h3 {
  margin: 0 0 8px;
  font-size: 15px;
}

.ab-created {
  margin: 0 0 8px;
  padding-left: 18px;
  font-size: 14px;
}

/* =====================================================================
   Studio redesign (2026): one clear progress bar in the header, a guided
   sidebar where the open step is a card, and a calm grey workspace.
   These rules come last so they take priority over the older ones above.
   ===================================================================== */

body.app {
  background: var(--surface);
}

/* Header: logo | progress | download */
.app-header {
  display: grid;
  grid-template-columns: minmax(200px, 1fr) auto minmax(200px, 1fr);
  align-items: center;
  gap: 16px;
  min-height: 64px;
  padding: 0 20px;
  border-top: 0;
  border-bottom: 1px solid var(--hairline);
  background: var(--paper);
}

.app-header .header-actions {
  justify-content: flex-end;
}

/* The steps: numbered dots joined by a line, like a checkout */
.app-header .stepper {
  position: static;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
}

.stepper ol {
  flex-wrap: nowrap;
  gap: 0;
}

.stepper li {
  display: flex;
  align-items: center;
}

.stepper li + li::before {
  content: "";
  width: 28px;
  height: 2px;
  margin: 0 6px;
  border-radius: 2px;
  background: var(--hairline-strong);
}

.stepper li:has(.is-done) + li::before {
  background: var(--brand);
}

.step {
  gap: 8px;
  min-height: 36px;
  padding: 0 10px 0 4px;
  border: 0;
  border-radius: 999px;
  background: none;
  font: 500 14px var(--font-sans);
  color: var(--ink-muted);
  white-space: nowrap;
}

.step:hover {
  background: var(--surface);
  color: var(--ink);
}

.step-number {
  width: 24px;
  height: 24px;
  border: 1.5px solid var(--hairline-strong);
  background: var(--paper);
  font: 600 12px var(--font-sans);
  color: var(--ink-muted);
}

.step.is-done {
  border: 0;
  background: none;
  color: var(--ink);
}

.step.is-done .step-number {
  border-color: var(--brand);
  background: var(--brand);
  color: var(--paper);
}

.step.is-current {
  border: 0;
  box-shadow: none;
  background: var(--surface-2);
  color: var(--ink);
  font-weight: 650;
}

.step.is-current .step-number {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper);
}

.step .optional {
  display: none;
}

/* Workspace */
.app-body {
  grid-template-columns: 360px minmax(0, 1fr);
}

.sidebar {
  gap: 20px;
  padding: 20px;
  border-right: 1px solid var(--hairline);
  background: var(--paper);
}

/* The design's name, like a document title, with its file actions under it */
.design-bar {
  padding-bottom: 16px;
  border-bottom: 1px solid var(--hairline);
}

.design-head h2 {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-muted);
}

.design-name {
  width: 100%;
  height: 40px;
  margin: 2px 0 10px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: var(--surface);
  font: 650 17px var(--font-sans);
  color: var(--ink);
}

.design-name:hover {
  border-color: var(--hairline);
}

.design-bar .source-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.design-bar .btn-small {
  min-height: 30px;
  padding: 0 10px;
  border-color: var(--hairline);
  box-shadow: none;
  font-size: 13px;
}

/* The general message line: in the normal flow, never over the steps */
.sidebar > .status,
.sidebar > .status:empty {
  min-height: 0;
  margin: 0;
}

.sidebar > .status:not(:empty) {
  padding: 10px 12px;
  border-radius: var(--radius);
  background: var(--surface);
  font-size: 13px;
}

.sidebar > .status.is-error:not(:empty) {
  background: #fff6e8;
}

/* Steps in the sidebar: closed ones are compact rows, the open one a card */
.accordion {
  gap: 8px;
  margin-top: 0;
  border-top: 0;
}

.step-panel {
  border: 1px solid var(--hairline);
  border-radius: 14px;
  background: var(--paper);
  transition: box-shadow 0.2s, border-color 0.2s;
}

.step-panel.is-open {
  border-color: var(--hairline-strong);
  box-shadow: var(--shadow-md);
}

.step-toggle {
  gap: 12px;
  min-height: 52px;
  padding: 10px 14px;
  font: 600 15px var(--font-sans);
}

.step-toggle:hover .step-title,
.step-panel.is-open .step-title {
  color: var(--ink);
}

.step-badge {
  width: 26px;
  height: 26px;
  border: 1.5px solid var(--hairline-strong);
  background: var(--paper);
  font: 650 12px var(--font-sans);
  color: var(--ink-muted);
}

.step-panel.is-done .step-badge {
  border-color: var(--brand);
  background: var(--brand);
  color: var(--paper);
}

.step-panel.is-current .step-badge {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper);
}

.step-panel:not(.is-open):not(.is-current):not(.is-done) .step-title {
  color: var(--ink-soft);
  font-weight: 500;
}

.step-body {
  padding: 4px 16px 18px;
}

.step-footer .btn,
.step-continue {
  width: 100%;
  min-height: 42px;
}

.chevron {
  width: 7px;
  height: 7px;
  border-width: 1.5px;
  border-color: var(--ink-muted);
}

/* Fields */
.text-field {
  gap: 5px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-soft);
}

.text-field select,
.text-field input,
.text-line textarea {
  height: 38px;
  padding: 0 10px;
  border: 1px solid var(--hairline-strong);
  border-radius: 8px;
  font-size: 14px;
  color: var(--ink);
}

.text-line textarea {
  height: auto;
  padding: 8px 10px;
}

.text-field input[type="color"] {
  padding: 3px;
}

.setting-note {
  color: var(--ink-muted);
}

.choice {
  color: var(--ink);
}

/* Photo / Colour / Gradient */
.background-kind {
  padding: 4px;
  border: 0;
  border-radius: 10px;
  background: var(--surface-2);
}

.background-kind label {
  min-height: 34px;
  border-radius: 7px;
  font-weight: 500;
  color: var(--ink-soft);
}

.background-kind label:has(input:checked) {
  background: var(--paper);
  color: var(--ink);
  box-shadow: var(--shadow-sm), 0 0 0 1px var(--hairline);
}

/* Upload area */
.dropzone {
  gap: 6px;
  padding: 28px 16px;
  border: 1.5px dashed var(--hairline-strong);
  border-radius: 14px;
  background: var(--surface);
}

.dropzone p:first-child {
  font-weight: 600;
}

.dropzone.is-dragging {
  border-color: var(--brand);
  background: var(--brand-tint);
}

/* Download step settings */
.download-settings {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
}

.download-settings .campaign {
  display: grid;
}

.download-settings .campaign input {
  width: 100%;
  height: 38px;
  font-family: var(--font-mono);
}

/* The artboard of sizes */
.artboard {
  padding: 28px 36px 64px;
  background: var(--surface);
}

.next-step {
  gap: 16px 24px;
  margin-bottom: 28px;
  padding: 20px 24px;
  border: 1px solid var(--hairline);
  border-radius: 16px;
  background: var(--paper);
  box-shadow: var(--shadow-sm);
}

.next-step-title {
  font-size: 17px;
  font-weight: 650;
}

.next-step-text p {
  font-size: 15px;
}

.next-step.is-large {
  padding: 56px 24px;
  border: 1.5px dashed var(--hairline-strong);
  border-radius: 20px;
  background: var(--paper);
  box-shadow: none;
}

.next-step.is-large .next-step-title {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.next-step.is-finished {
  border-color: #bfe6df;
  background: var(--brand-tint);
}

.artboard-intro {
  color: var(--ink-muted);
}

.platform-group {
  margin-top: 36px;
}

.platform-group h2 {
  padding-bottom: 0;
  border-bottom: 0;
  font-size: 19px;
  letter-spacing: -0.015em;
}

.tiles {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
}

.tile {
  border-color: var(--hairline);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
}

.tile:hover {
  border-color: var(--hairline-strong);
}

.tile-stage {
  height: 210px;
  border-bottom: 1px solid var(--hairline);
  background:
    radial-gradient(circle at 1px 1px, rgba(11, 18, 21, 0.07) 1px, transparent 0) 0 0 / 16px 16px,
    var(--artboard);
}

.frame {
  outline: 0;
  box-shadow: 0 1px 2px rgba(11, 18, 21, 0.12), 0 6px 16px rgba(11, 18, 21, 0.08);
}

/* Pop-up windows */
.editor {
  border: 0;
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
}

.editor::backdrop {
  background: rgba(11, 18, 21, 0.45);
  backdrop-filter: blur(4px);
}

.editor-body {
  padding: 28px 32px 28px;
}

.editor-header h2 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.015em;
}

.editor-actions {
  margin-top: 24px;
}

/* Medium screens: the step names hide, the numbers stay */
@media (max-width: 1280px) {
  .app-header {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .stepper ol {
    justify-content: center;
  }

  .step-text {
    display: none;
  }
}

@media (max-width: 800px) {
  .app-header {
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 10px 16px;
  }

  .app-header .stepper {
    grid-column: 1 / -1;
    grid-row: 2;
    overflow-x: auto;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--hairline);
  }

  .artboard {
    padding: 20px 16px 48px;
  }
}
