.ecw-step-card {
  display: grid;
  align-content: start;
  gap: 16px;
  flex: 0 0 auto;
  margin-inline: -6px;
  padding-top: 8px;
  padding-inline: 6px;
}

.ecw-step-card.is-name {
  flex: 0 0 auto;
  min-height: 0;
}

.ecw-step-head strong {
  color: var(--ecw-ink);
  font-size: 20px;
  font-weight: 400;
  overflow-wrap: anywhere;
}

.ecw-step-head span {
  max-width: 190px;
  color: var(--ecw-muted);
  font-size: 13px;
  font-weight: 300;
  line-height: 1.2;
  text-align: right;
}

.ecw-field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.ecw-step-card label,
.ecw-file {
  position: relative;
  display: grid;
  gap: 7px;
  color: var(--ecw-muted);
  font-size: 14px;
  font-weight: 300;
}

.ecw-step-card label.is-muted {
  opacity: 0.5;
}

.ecw-field-label {
  display: block;
  margin-bottom: -8px;
  color: var(--ecw-muted);
  font-size: 14px;
  font-weight: 300;
}

.ecw-required {
  color: var(--ecw-accent);
  font-weight: 400;
}

.ecw-step-card label.has-error input,
.ecw-step-card label.has-error select,
.ecw-step-card label.has-error textarea {
  border-color: var(--ecw-accent-dark);
}

.ecw-field-error {
  display: block;
  color: var(--ecw-accent-dark);
  font-size: 12.5px;
  font-weight: 400;
  line-height: 1.25;
}

.ecw-terms-field.has-error span {
  color: var(--ecw-accent-dark);
}

.ecw-terms-field.has-error input[type="checkbox"] {
  outline: 2px solid var(--ecw-accent-dark);
  outline-offset: 1px;
}

.ecw-root input,
.ecw-root select,
.ecw-root textarea {
  width: 100%;
  min-height: 46px;
  padding: 0 15px;
  border: 1px solid rgba(43, 18, 43, 0.28);
  border-radius: var(--ecw-control-radius);
  background: rgba(247, 245, 239, 0.74);
  color: var(--ecw-ink);
  outline: none;
}

.ecw-root select {
  font: inherit;
  font-size: 16px;
  cursor: pointer;
}

.ecw-root input:disabled {
  cursor: not-allowed;
  opacity: 0.56;
}

.ecw-root input:focus,
.ecw-root select:focus,
.ecw-root textarea:focus {
  border-color: var(--ecw-accent);
}

.ecw-root textarea {
  min-height: 88px;
  padding-top: 12px;
  resize: vertical;
}

.ecw-help-copy {
  margin-bottom: 0;
  color: var(--ecw-muted);
  font-size: 15px;
  font-weight: 300;
  line-height: 1.35;
}

.ecw-help-copy.is-highlight {
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(43, 18, 43, 0.06);
  color: var(--ecw-ink);
  font-weight: 400;
}

.ecw-root input[type="color"] {
  padding: 5px 6px;
  cursor: pointer;
}

.ecw-root input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}

.ecw-root input[type="color"]::-webkit-color-swatch {
  border: 1px solid rgba(43, 18, 43, 0.25);
  border-radius: 12px;
}

.ecw-chip-grid,
.ecw-swatch-grid,
.ecw-choice-grid,
.ecw-quantity-presets {
  display: grid;
  gap: 10px;
}

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

.ecw-product-card span,
.ecw-choice span {
  color: inherit;
  font-size: 15px;
  font-weight: 300;
  line-height: 1.25;
  opacity: 0.82;
}

.ecw-choice {
  display: grid;
  gap: 4px;
  min-height: 76px;
  padding: 13px;
  border-radius: var(--ecw-control-radius);
  text-align: left;
}

.ecw-choice strong {
  font-size: 19px;
  font-weight: 400;
}

.ecw-chip-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.ecw-quantity-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ecw-step-card.is-details :is(.ecw-help-copy, .ecw-field-label) {
  color: var(--ecw-ink);
  font-size: 14px;
  line-height: 1.3;
}

.ecw-field-label + .ecw-quantity-presets {
  margin-top: 6px;
}

.ecw-quantity-presets .ecw-chip {
  min-height: 28px;
  padding: 0 12px;
  font-size: 13px;
}

.ecw-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  padding: 0 12px;
  text-align: center;
  overflow-wrap: anywhere;
}

.ecw-chip-dim {
  font-size: 11px;
  opacity: 0.7;
  font-variant-numeric: tabular-nums;
}

.ecw-default-colours {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}

.ecw-default-colour {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 16px;
  flex: 0 0 auto;
}

.ecw-default-colour strong {
  font-size: 16px;
  font-weight: 400;
}

.ecw-default-swatch {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid rgba(43, 18, 43, 0.25);
  flex: 0 0 auto;
}

.ecw-default-swatch.is-light {
  border-color: rgba(43, 18, 43, 0.4);
}

.ecw-message-field textarea {
  width: 100%;
  resize: vertical;
  min-height: 64px;
}

/* Beats the generic .ecw-step-card label grid rule so the checkbox and the
   copy share one row. */
.ecw-step-card label.ecw-terms-field,
.ecw-terms-field {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  margin: 14px 0 4px;
  font-size: 14px;
  line-height: 1.4;
}

.ecw-root .ecw-terms-field input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-height: 0;
  margin: 0;
  flex: 0 0 auto;
}

.ecw-terms-field a {
  text-decoration: underline;
}

/* Errors sit on the field's top edge (the terms error in the margin above the
   checkbox), so showing or clearing one never moves the rest of the form. */
.ecw-details-fields .ecw-field-error,
.ecw-terms-field .ecw-field-error {
  position: absolute;
  max-width: calc(100% - 28px);
  overflow: hidden;
  font-size: 10.5px;
  line-height: 12px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.ecw-details-fields .ecw-field-error {
  top: -6px;
  right: 14px;
  padding: 0 5px;
  background: var(--ecw-panel-cream);
}

.ecw-terms-field .ecw-field-error {
  bottom: 100%;
  left: 0;
}

.ecw-option-stack {
  display: grid;
  justify-items: start;
  gap: 12px;
}

.ecw-option {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  width: var(--ecw-option-width);
  max-width: 100%;
  min-height: 34px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: var(--ecw-ink);
  color: #ffffff;
  text-align: center;
  cursor: pointer;
  transition:
    filter 150ms ease,
    box-shadow 150ms ease;
}

.ecw-option strong,
.ecw-option .ecw-chip-label {
  font-family: "SeasonSans", "Avenir Next", Arial, sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.1;
}

.ecw-option:hover {
  filter: brightness(1.1);
}

.ecw-option:focus-visible {
  outline: 2px solid var(--ecw-ink);
  outline-offset: 3px;
}

.ecw-option.is-active {
  box-shadow:
    0 0 0 3px var(--ecw-panel-cream),
    0 0 0 5px var(--ecw-ink);
}

.ecw-product-card.is-classic {
  background: var(--ecw-hot);
}

.ecw-product-card.is-frio {
  background: var(--ecw-cold);
}

.ecw-option.is-tone-1 {
  background: var(--ecw-ink);
}

.ecw-option.is-tone-2 {
  background: var(--ecw-plum-70);
}

.ecw-option.is-tone-3 {
  background: var(--ecw-plum-50);
}

.ecw-option.is-tone-4 {
  background: var(--ecw-plum-30);
  color: var(--ecw-ink);
}

.ecw-position-stack {
  grid-template-columns: var(--ecw-option-width);
  justify-items: stretch;
}

.ecw-position-option {
  flex-direction: column;
  gap: 2px;
  width: var(--ecw-option-width);
  padding: 6px 10px;
}

.ecw-position-option .ecw-chip-dim {
  font-size: 11px;
  line-height: 1.15;
  opacity: 0.85;
  white-space: nowrap;
}

.ecw-guidelines-button.ecw-secondary {
  justify-self: start;
  width: var(--ecw-option-width);
  max-width: 100%;
  min-height: 34px;
  padding: 0 10px;
  font-size: 14px;
  white-space: nowrap;
}

.ecw-step-lede {
  margin-bottom: 0;
  color: var(--ecw-ink);
  font-size: 18px;
  font-weight: 400;
  line-height: 1.3;
}

.ecw-starter-fields {
  display: grid;
  gap: 12px;
  max-width: 380px;
}

.ecw-root .ecw-starter-fields input {
  border-radius: 0;
}

.ecw-hex-field {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 360px;
}

.ecw-root .ecw-hex-field input[type="color"] {
  flex: 0 0 auto;
  align-self: stretch;
  width: auto;
  aspect-ratio: 1;
  padding: 4px;
  border-radius: 50%;
}

.ecw-root .ecw-hex-field input[type="color"]::-webkit-color-swatch {
  border-radius: 50%;
}

.ecw-root .ecw-hex-field input:not([type="color"]) {
  border-radius: 999px;
}

.ecw-root input[type="color"].is-unset {
  background-image:
    radial-gradient(circle closest-side, #ffffff, rgba(255, 255, 255, 0)),
    conic-gradient(
      from 270deg,
      #ff0000,
      #ffff00,
      #00ff00,
      #00ffff,
      #0000ff,
      #ff00ff,
      #ff0000
    ),
    none;
  background-origin: content-box;
  background-clip: content-box, content-box, padding-box;
}

.ecw-root input[type="color"].is-unset::-webkit-color-swatch {
  opacity: 0;
}

.ecw-root input[type="color"].is-unset::-moz-color-swatch {
  opacity: 0;
}

.ecw-perfect-cup {
  display: grid;
  gap: 10px;
}

.ecw-perfect-cup-lead {
  margin-bottom: 0;
  color: var(--ecw-ink);
  font-size: 18px;
  font-weight: 400;
}

.ecw-perfect-cup-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ecw-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--ecw-ink);
  color: var(--ecw-page);
  font-size: 13px;
  line-height: 1;
}

.ecw-print-size-sentence {
  margin-bottom: 0;
  color: var(--ecw-ink);
  font-size: 17px;
  font-weight: 300;
  line-height: 1.4;
}

.ecw-print-size-sentence strong {
  display: block;
  font-weight: 400;
  white-space: nowrap;
}

.ecw-details-fields {
  display: grid;
  gap: 10px;
}

.ecw-details-fields .ecw-label-text,
.ecw-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.ecw-root .ecw-details-fields input,
.ecw-root .ecw-details-fields select {
  min-height: 40px;
}

.ecw-root .ecw-details-fields :is(input, select, textarea) {
  border-radius: 0;
}

/* iOS Safari keeps its rounded native select unless the arrow is drawn here. */
.ecw-root .ecw-details-fields select {
  padding-right: 36px;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%232b122b' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-position: right 14px center;
  background-repeat: no-repeat;
  background-size: 12px 8px;
}
