.size-options {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.25rem;
  margin: 0.25rem 0 0.55rem;
}

.studio {
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  margin-left: auto;
  margin-right: auto;
  max-width: 1120px;
}

.controls {
  padding: 1.1rem;
}

.dropzone {
  min-height: 210px;
}

.dropzone.has-photo {
  align-items: center;
  flex-direction: row;
  justify-content: space-between;
  min-height: 64px;
  padding: 0.65rem 0.8rem;
}

.dropzone.has-photo .drop-icon,
.dropzone.has-photo small {
  display: none;
}

.dropzone.has-photo strong {
  font-size: 0.82rem;
}

.dropzone.has-photo .button {
  padding: 0.6rem 0.75rem;
}

.preview-panel {
  align-self: start;
  position: sticky;
  top: 90px;
}

.canvas-wrap {
  aspect-ratio: auto;
  height: min(48vh, 470px);
  min-height: 300px;
  padding: 1rem;
}

.canvas-wrap canvas {
  aspect-ratio: var(--preview-ratio, 4 / 3);
  height: 100%;
  max-width: 100%;
  object-fit: contain;
  width: auto;
}

.size-options span {
  color: #7f8d87;
  display: grid;
  font: 400 0.55rem var(--mono);
  gap: 0.08rem;
  text-align: center;
}

.size-options b {
  color: #b2bcb7;
  font: 500 0.6rem var(--mono);
}

.size-options small {
  font-size: 0.48rem;
}

.size-options span.active {
  color: var(--yellow);
  font-weight: 500;
}

.module-note {
  color: #aeb8b3;
  font-size: 0.72rem;
  line-height: 1.55;
  margin: 1rem 0 0;
}

.shape-picker {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.4rem;
  margin-top: 1rem;
}

.shape-picker button {
  background: transparent;
  border: 1px solid #62716b;
  color: #aeb8b3;
  cursor: pointer;
  font: 500 0.64rem var(--mono);
  padding: 0.65rem 0.35rem;
}

.shape-picker button.active {
  background: var(--yellow);
  border-color: var(--yellow);
  color: var(--ink);
}

.shape-note {
  color: #8f9b96;
  font-size: 0.65rem;
  line-height: 1.45;
  margin: 0.55rem 0 0;
}

.crop-controls {
  border: 1px solid #52605b;
  margin: 1.75rem 0 0;
  padding: 1.2rem;
  position: relative;
}

.crop-controls:disabled {
  opacity: 0.42;
}

.crop-controls legend {
  font-size: 0.9rem;
  font-weight: 700;
  padding: 0 0.35rem;
}

.crop-controls > button {
  background: transparent;
  border: 0;
  color: var(--yellow);
  cursor: pointer;
  font: 500 0.65rem var(--mono);
  position: absolute;
  right: 1rem;
  top: 1rem;
}

.crop-controls label {
  display: flex;
  font-size: 0.68rem;
  justify-content: space-between;
  margin-top: 0.7rem;
}

.crop-controls input[type="range"] {
  margin: 0.3rem 0 0;
}

.crop-controls output {
  color: var(--yellow);
  font-family: var(--mono);
}

.crop-controls p {
  color: #9da9a4;
  font-size: 0.66rem;
  line-height: 1.45;
  margin: 0.8rem 0 0;
}

.recipe {
  grid-template-columns: repeat(4, 1fr);
}

.shopping-list {
  background: #fffaf1;
  color: var(--ink);
  margin-top: 2rem;
  padding: clamp(1.5rem, 4vw, 3rem);
}

.cart-action {
  align-items: center;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 2rem;
  justify-content: space-between;
  margin-top: 2rem;
  padding-top: 1.5rem;
}

.cart-action small {
  color: #767c78;
  display: block;
  font: 400 0.62rem var(--mono);
}

.cart-action strong {
  display: block;
  font-size: 1.05rem;
  margin-top: 0.25rem;
}

.cart-action p {
  color: #767c78;
  font-size: 0.75rem;
  margin: 0.25rem 0 0;
}

.cart-button {
  background: var(--coral);
  color: white;
  min-width: 180px;
}

.cart-button:disabled {
  cursor: not-allowed;
  filter: grayscale(0.8);
  opacity: 0.45;
}

.mock-cart {
  background: #22312c;
  border: 1px solid #52605b;
  margin: 2rem auto 0;
  max-width: 1120px;
  padding: clamp(1.5rem, 4vw, 3rem);
}

.cart-title-row {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.cart-title-row h3 {
  color: white;
  font-size: clamp(1.6rem, 3vw, 2.5rem);
  letter-spacing: -0.04em;
  margin: 0.2rem 0 0;
}

.cart-count {
  background: var(--yellow);
  color: var(--ink);
  display: grid;
  font: 500 0.8rem var(--mono);
  height: 34px;
  place-items: center;
  width: 34px;
}

.cart-empty {
  border-block: 1px solid #52605b;
  margin-top: 1.5rem;
  padding: 2rem 0;
}

.cart-empty p {
  color: white;
  margin: 0;
}

.cart-empty span,
.cart-footer p {
  color: #9da9a4;
  font-size: 0.75rem;
}

.cart-item {
  align-items: center;
  border-block: 1px solid #52605b;
  display: grid;
  gap: 1.5rem;
  grid-template-columns: 130px 1fr auto;
  margin-top: 1.5rem;
  padding: 1.5rem 0;
}

.cart-item[hidden],
.cart-empty[hidden] {
  display: none;
}

.cart-thumb {
  background: var(--cream);
  padding: 8px;
}

.cart-thumb canvas {
  display: block;
  image-rendering: pixelated;
  width: 100%;
}

.cart-item-copy > span,
.cart-price small {
  color: #9da9a4;
  font: 400 0.62rem var(--mono);
}

.cart-item-copy h4 {
  color: white;
  font-size: 1.2rem;
  margin: 0.25rem 0 0.75rem;
}

.cart-item-copy dl {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 0;
}

.cart-item-copy dl div {
  border-right: 1px solid #52605b;
  padding-right: 1rem;
}

.cart-item-copy dt {
  color: #8f9c96;
  font-size: 0.62rem;
}

.cart-item-copy dd {
  color: white;
  font: 400 0.7rem var(--mono);
  margin: 0.15rem 0 0;
}

.cart-item-copy button {
  background: transparent;
  border: 0;
  color: var(--coral);
  cursor: pointer;
  font-size: 0.7rem;
  margin-top: 0.8rem;
  padding: 0;
}

.cart-price {
  text-align: right;
}

.cart-price strong {
  color: white;
  display: block;
  font-size: 0.9rem;
  margin-top: 0.25rem;
}

.cart-footer {
  align-items: center;
  display: flex;
  justify-content: space-between;
  padding-top: 1.5rem;
}

.checkout-button {
  background: #52605b;
  color: #aeb8b3;
  cursor: not-allowed;
}

.shopping-heading {
  align-items: end;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  padding-bottom: 1.5rem;
}

.shopping-heading h3 {
  font-size: clamp(1.8rem, 3vw, 3rem);
  letter-spacing: -0.045em;
  line-height: 1;
  margin: 0.3rem 0 0;
}

.shopping-heading > p {
  color: #66706b;
  font-size: 0.82rem;
  margin: 0;
  text-align: right;
}

.shopping-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-bottom: 1px solid var(--line);
}

.shopping-summary div {
  border-right: 1px solid var(--line);
  padding: 1.5rem 1.5rem 1.5rem 0;
}

.shopping-summary div + div {
  padding-left: 1.5rem;
}

.shopping-summary div:last-child {
  border-right: 0;
}

.shopping-summary small {
  color: #767c78;
  display: block;
  font: 400 0.65rem var(--mono);
  margin-bottom: 0.35rem;
}

.shopping-summary strong {
  font-size: 1.15rem;
}

.color-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0 2rem;
  padding-top: 1rem;
}

.color-row {
  align-items: center;
  border-bottom: 1px solid #ded6c8;
  display: flex;
  justify-content: space-between;
  min-height: 62px;
  gap: 1rem;
}

.color-name {
  align-items: center;
  display: grid;
  grid-template-columns: 22px 1fr;
  column-gap: 0.65rem;
}

.color-name i {
  border: 1px solid rgba(23, 35, 31, 0.25);
  display: block;
  grid-row: 1 / 3;
  height: 22px;
  width: 22px;
}

.color-name b {
  font-size: 0.85rem;
}

.color-name small {
  color: #7c817e;
  font: 400 0.6rem var(--mono);
}

.color-row > strong {
  font: 500 0.75rem var(--mono);
  white-space: nowrap;
}

.empty-list {
  color: #7c817e;
  grid-column: 1 / -1;
  margin: 1rem 0 0;
}

@media (max-width: 520px) {
  .recipe {
    grid-template-columns: repeat(2, 1fr);
  }

  .recipe div {
    border-bottom: 1px solid #52605b;
  }

  .size-options span {
    font-size: 0.42rem;
  }

  .shopping-heading {
    align-items: start;
    flex-direction: column;
  }

  .shopping-heading > p {
    text-align: left;
  }

  .shopping-summary,
  .color-list {
    grid-template-columns: 1fr;
  }

  .shopping-summary div,
  .shopping-summary div + div {
    border-bottom: 1px solid var(--line);
    border-right: 0;
    padding: 1rem 0;
  }

  .cart-action,
  .cart-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .cart-item {
    align-items: start;
    grid-template-columns: 90px 1fr;
  }

  .cart-price {
    grid-column: 2;
    text-align: left;
  }
}

@media (max-width: 850px) {
  .studio {
    grid-template-columns: 1fr;
  }

  .canvas-wrap {
    height: min(55vh, 480px);
  }

  .preview-panel {
    position: static;
  }
}
