:root {
  --cyo-ink: #12375f;
  --cyo-muted: #536b7d;
  --cyo-line: #d8e5ed;
  --cyo-paper: #ffffff;
  --cyo-soft: #eef8ff;
  --cyo-sea: #147e9d;
  --cyo-orange: #f45a17;
  --cyo-green: #2f7d5f;
  --cyo-lilac: #f5edff;
  --cyo-shadow: 0 18px 44px rgba(18, 55, 95, 0.13);
}

body {
  background:
    linear-gradient(180deg, #f8fdff 0%, #fff8f0 34%, #eef8ff 68%, #ffffff 100%);
}

.topbar-title {
  font-size: clamp(1.3rem, 2.8vw, 1.55rem) !important;
  white-space: nowrap;
}

.flow-intro {
  max-width: 760px;
}

.flow-stepper {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 20px 0 0;
  max-width: 560px;
}

.flow-step {
  position: relative;
  min-height: 58px;
  border: 1px solid var(--cyo-line);
  border-radius: 8px;
  padding: 9px 10px;
  display: grid;
  align-content: center;
  gap: 3px;
  background: rgba(255, 255, 255, 0.8);
  color: var(--cyo-muted);
  text-decoration: none;
}

.flow-step strong {
  color: var(--cyo-ink);
  font-size: 0.9rem;
  line-height: 1.08;
}

.flow-step span {
  font-size: 0.74rem;
  font-weight: 850;
  line-height: 1.05;
  text-transform: uppercase;
}

.flow-step[aria-current="step"] {
  border-color: var(--cyo-orange);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(244, 90, 23, 0.13);
}

.flow-step:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 50%;
  right: -11px;
  z-index: 2;
  width: 0;
  height: 0;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 8px solid var(--cyo-sea);
  transform: translateY(-50%);
}

.flow-step:hover,
.flow-step:focus-visible {
  border-color: var(--cyo-sea);
  outline: 3px solid rgba(20, 126, 157, 0.18);
  outline-offset: 2px;
}

.flow-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.button.button--secondary {
  border-color: var(--cyo-line);
  color: var(--cyo-sea);
  background: var(--cyo-paper);
}

.selected-panel,
.mockup-panel,
.panel,
.preview-panel {
  box-shadow: var(--cyo-shadow);
}

.centre,
.group {
  min-height: 0 !important;
}

.selected-image-wrap,
.mockup-stage,
.preview-stage {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.78), rgba(238, 248, 255, 0.9)),
    repeating-linear-gradient(45deg, rgba(47, 125, 95, 0.08) 0 10px, transparent 10px 20px);
}

.category-tile,
.product-tile,
.preview-card,
.image-tile {
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.category-tile:hover,
.product-option:hover .product-tile,
.image-option:hover .image-tile {
  transform: translateY(-2px);
}

.product-grid {
  align-items: stretch;
}

.product-option {
  min-width: 0;
}

.product-tile {
  height: 100%;
  justify-content: space-between;
}

.product-tile img {
  flex: 0 0 auto;
}

.designer {
  grid-template-columns: minmax(0, 0.95fr) minmax(440px, 0.8fr);
  margin-top: 14px;
}

.preview-panel {
  padding: 12px;
}

.preview-stage {
  min-height: min(46vh, 380px);
}

.preview-card {
  width: min(520px, 100%);
  gap: 14px;
  padding: clamp(14px, 3vw, 26px);
}

.preview-text {
  border-style: dashed;
  border-color: rgba(20, 126, 157, 0.32);
  background: #fbfeff;
}

.preview-text:focus-visible {
  border-style: solid;
}

.preview-image-button {
  position: relative;
  width: min(100%, 390px);
  overflow: hidden;
}

.preview-image-button::after {
  content: "Select an image";
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  min-width: min(58%, 160px);
  border: 2px solid rgba(255, 255, 255, 0.76);
  border-radius: 8px;
  padding: 8px 12px;
  color: #fff;
  background: rgba(18, 55, 95, 0.68);
  box-shadow: 0 10px 22px rgba(18, 55, 95, 0.2);
  font-size: clamp(0.82rem, 1.6vw, 1rem);
  font-weight: 900;
  text-align: center;
  transform: translate(-50%, -50%);
  transition: background 0.15s ease, transform 0.15s ease;
}

.preview-image-button .preview-image {
  opacity: 0.68;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.preview-image-button:hover::after,
.preview-image-button:focus-visible::after {
  background: rgba(20, 126, 157, 0.78);
  transform: translate(-50%, -50%) scale(1.03);
}

.preview-image-button:hover .preview-image,
.preview-image-button:focus-visible .preview-image {
  opacity: 0.58;
  transform: scale(1.01);
}

.controls {
  position: sticky;
  top: 16px;
}

.image-modal {
  backdrop-filter: blur(4px);
}

.image-modal__panel {
  gap: 16px;
}

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

.image-grid--modal .image-tile {
  min-height: 136px;
}

.image-grid--modal .image-tile img {
  height: 96px;
}

@media (max-width: 920px) {
  .centre,
  .group {
    grid-template-columns: 1fr !important;
    align-items: stretch !important;
  }

  .centre > div,
  .group > div {
    max-width: 760px;
  }

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

  .controls {
    position: static;
  }
}

@media (max-width: 620px) {
  main {
    padding-top: 18px !important;
  }

  #centre-heading {
    font-size: clamp(1.55rem, 6.7vw, 2.35rem);
    line-height: 1;
  }

  .topbar-title {
    font-size: clamp(1.25rem, 4.8vw, 1.45rem) !important;
    line-height: 1.12;
  }

  .topbar-links {
    width: 100% !important;
    margin-left: 0 !important;
    justify-content: flex-start !important;
  }

  .topbar-links a:not(.ww-home-link) {
    display: none !important;
  }

  .group,
  .centre {
    gap: 0 !important;
  }

  .selected-panel,
  .mockup-panel {
    margin-top: 12px;
  }

  .flow-stepper {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
    max-width: 100%;
    margin-top: 14px;
  }

  .flow-step:not(:last-child)::after {
    top: 50%;
    right: -8px;
    bottom: auto;
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
    border-left: 7px solid var(--cyo-sea);
    border-right: 0;
    transform: translateY(-50%);
  }

  .flow-step {
    min-height: 46px;
    padding: 7px 6px;
    gap: 2px;
  }

  .flow-step span {
    font-size: 0.61rem;
  }

  .flow-step strong {
    font-size: clamp(0.72rem, 3.1vw, 0.84rem);
  }

}
