:root {
  font-family: system-ui, Arial, sans-serif;
  color: #17212b;
  background: #f6f7f9
}

* {
  box-sizing: border-box
}

body {
  margin: 0
}

header {
  background: #17212b;
  color: white;
  padding: 18px 28px
}

header h1 {
  margin: 0;
  font-size: 1.4rem
}

header p {
  color: #c7d0da;
  margin: 5px 0
}

main {
  display: grid;
  grid-template-columns: minmax(280px, 380px) minmax(0, 1fr);
  gap: 20px;
  padding: 20px;
  max-width: 1500px;
  margin: auto
}

.controls,
.preview {
  background: white;
  border: 1px solid #e1e5ea;
  border-radius: 12px;
  padding: 20px;
  min-width: 0
}

h2 {
  font-size: 1.05rem;
  margin: 16px 0
}

label {
  display: block;
  margin: 12px 0;
  font-weight: 600
}

select {
  display: block;
  width: 100%;
  padding: 10px;
  border: 1px solid #cbd2d9;
  border-radius: 6px;
  margin-top: 5px;
  background: white
}

.buttons {
  display: flex;
  gap: 8px;
  margin-top: 16px
}

button:not(.swatch) {
  border: 1px solid #aebbc7;
  border-radius: 6px;
  padding: 9px 14px;
  background: #f5f6f8;
  cursor: pointer
}

.panel-row {
  border-bottom: 1px solid #edf0f2;
  padding: 8px 0
}

.swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 7px
}

.swatch {
  width: 27px;
  height: 27px;
  border: 1px solid #9ca3af;
  border-radius: 5px;
  cursor: pointer
}

.swatch.chosen {
  outline: 3px solid #1769aa;
  outline-offset: 1px
}

.option-row {
  font-size: .86rem;
  font-weight: 400
}

.option-row input {
  margin-right: 7px
}

#svg-container {
  min-height: 200px;
  border: 1px dashed #cbd2d9;
  border-radius: 10px;
  display: grid;
  place-items: center;
  padding: 12px;
  overflow: auto
}

#svg-container svg {
  max-width: 100%;
  display: block
}

.muted,
footer {
  color: #677583;
  font-size: .85rem
}

pre {
  background: #f5f7fa;
  border-radius: 7px;
  padding: 12px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: .78rem
}

footer {
  padding: 12px 24px;
  border-top: 1px solid #e1e5ea
}

@media(max-width:800px) {
  main {
    grid-template-columns: 1fr
  }
}

@media print {

  header,
  footer,
  .controls,
  .buttons {
    display: none
  }

  main {
    display: block;
    padding: 0
  }

  .preview {
    border: none
  }

  #svg-container {
    border: none
  }
}

input[type=number],
textarea {
  display: block;
  width: 100%;
  padding: 10px;
  border: 1px solid #cbd2d9;
  border-radius: 6px;
  margin-top: 6px;
  font: inherit
}

textarea {
  resize: vertical
}

input:focus-visible,
textarea:focus-visible,
button:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 3px solid #1769aa;
  outline-offset: 2px
}

[hidden] {
  display: none !important
}

.swatch {
  position: relative
}

.swatch:focus-visible {
  z-index: 10
}

.swatch[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  z-index: 100;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%);
  background: #18212b;
  color: white;
  padding: 6px 9px;
  border-radius: 5px;
  white-space: normal;
  min-width: max-content;
  max-width: 260px;
  pointer-events: none;
  font: 12px/1.35 system-ui;
  box-shadow: 0 3px 12px #0003;
  visibility: hidden;
  opacity: 0;
  display: none
}

.swatch:hover::after,
.swatch:focus-visible::after {
  visibility: visible;
  opacity: 1;
  display: block
}

@media(max-width:700px) {
  .swatch[data-tip]::after {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: 16px;
    width: auto;
    min-width: 0;
    max-width: none;
    transform: none
  }
}

.customer-summary {
  background: #f8fafc;
  border: 1px solid #dbe2ea;
  border-radius: 10px;
  padding: 16px
}

.customer-summary h3 {
  margin: 0 0 8px;
  font-size: 1.05rem
}

.customer-summary dl {
  display: grid;
  grid-template-columns: 135px minmax(0, 1fr);
  gap: 8px 12px;
  margin: 0
}

.customer-summary dt {
  color: #596b7a;
  font-weight: 600
}

.customer-summary dd {
  margin: 0;
  overflow-wrap: anywhere
}

.selection-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px
}

.selection-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #d7dfe8;
  border-radius: 5px;
  padding: 3px 7px;
  background: white;
  font-size: .82rem
}

.chip-color {
  width: 13px;
  height: 13px;
  border: 1px solid #aaa;
  border-radius: 3px;
  display: inline-block
}

.note {
  font-size: .78rem;
  color: #677583;
  margin: 8px 0
}

details {
  border: 1px solid #e1e5ea;
  border-radius: 8px;
  padding: 12px;
  margin-top: 16px
}

details>summary {
  cursor: pointer;
  font-weight: 700
}

details #options {
  margin-top: 10px
}

.validation-error {
  color: #b42318;
  font-weight: 600;
  font-size: .82rem
}

#hang-loop-custom-wrap {
  font-size: .88rem;
  line-height: 1.4
}

@media print {

  #options-collapse,
  #svg-file,
  .note {
    display: none !important
  }

  .customer-summary {
    break-inside: avoid
  }

  #svg-container {
    max-height: none
  }
}

/* v3: full-width configuration + three-column workspace */
main {
  max-width: 1800px;
  grid-template-columns: minmax(245px, 0.92fr) minmax(0, 2fr) minmax(245px, 0.92fr);
  align-items: start;
  gap: 18px
}

.card {
  background: #fff;
  border: 1px solid #e1e5ea;
  border-radius: 12px;
  padding: 20px;
  min-width: 0
}

.configuration {
  grid-column: 1/-1
}

.configuration h2 {
  margin-top: 0
}

.config-fields {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px 18px
}

.config-fields label {
  margin: 0;
  min-width: 0
}

.configuration .buttons {
  margin-top: 16px
}

.controls,
.preview,
.extras {
  min-width: 0
}

.extras h2:first-child,
.controls h2:first-child,
.preview h2:first-child {
  margin-top: 0
}

#svg-container svg {
  width: 100%;
  height: auto;
  max-height: 65vh
}

@media(max-width:1150px) {
  main {
    grid-template-columns: minmax(230px, 0.9fr) minmax(0, 1.5fr)
  }

  .configuration {
    grid-column: 1/-1
  }

  .controls {
    grid-column: 1;
    grid-row: 2
  }

  .preview {
    grid-column: 2;
    grid-row: 2
  }

  .extras {
    grid-column: 1/-1;
    grid-row: 3;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 24px;
    align-items: start
  }

  .extras>h2,
  .extras>#parts {
    grid-column: 1
  }

  .extras>#raked-section,
  .extras>#hang-loop-custom-wrap,
  .extras>label,
  .extras>textarea {
    grid-column: 2
  }

  .extras>h2:nth-of-type(2),
  .extras>h2:nth-of-type(3) {
    grid-column: 2
  }

  .config-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr))
  }
}

@media(max-width:700px) {
  main {
    display: flex;
    flex-direction: column;
    padding: 12px;
    gap: 12px
  }

  .configuration,
  .controls,
  .preview,
  .extras {
    width: 100%;
    padding: 16px
  }

  .configuration {
    order: 0
  }

  .preview {
    order: 1
  }

  .controls {
    order: 2
  }

  .extras {
    order: 3;
    display: block
  }

  .config-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px
  }

  .config-fields label {
    font-size: .88rem
  }

  #svg-container {
    padding: 5px;
    min-height: 170px
  }

  #svg-container svg {
    max-height: none
  }

  .customer-summary dl {
    grid-template-columns: 100px minmax(0, 1fr)
  }

  .buttons {
    flex-wrap: wrap
  }

  .swatch {
    width: 34px;
    height: 34px
  }
}

@media(max-width:390px) {
  .config-fields {
    grid-template-columns: 1fr
  }

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

  .customer-summary dd {
    margin-bottom: 8px
  }
}

@media print {
  main {
    display: block;
    max-width: none;
    padding: 0
  }

  .configuration,
  .controls,
  .extras {
    display: none !important
  }

  .preview {
    display: block;
    border: 0;
    padding: 0
  }

  #svg-container svg {
    max-height: none
  }
}

/* v4: reduce left controls share by 20%, transfer that share to center preview. */
@media(min-width:1151px) {
  main {
    grid-template-columns: minmax(190px, 0.736fr) minmax(0, 2.184fr) minmax(245px, 0.92fr)
  }
}

/* Scoped Bootstrap-style hover lift for dynamically generated panel fabric swatches. */
.swatches {
  overflow: visible
}

.swatches>.swatch:not(:disabled):not([aria-disabled="true"]):not(.unavailable) {
  transition: transform .2s ease, box-shadow .2s ease
}

.swatches>.swatch:not(:disabled):not([aria-disabled="true"]):not(.unavailable):is(:hover, :focus-visible) {
  transform: translateY(-.25rem);
  box-shadow: 0 .5rem 1rem rgb(0 0 0 / .15);
  z-index: 1
}

@media(prefers-reduced-motion:reduce) {
  .swatches>.swatch:not(:disabled):not([aria-disabled="true"]):not(.unavailable) {
    transition: none
  }
}

/* v5: non-blocking accessible toast notifications */
.toast-region {
  position: fixed;
  z-index: 9999;
  right: 16px;
  top: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(390px, calc(100vw - 32px));
  pointer-events: none
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px 14px;
  border: 1px solid #d6dde5;
  border-left: 5px solid #bf3b32;
  border-radius: 10px;
  background: #fff;
  color: #17212b;
  box-shadow: 0 8px 24px #0002;
  animation: toast-in .18s ease-out
}

.toast-success {
  border-left-color: #248044
}

.toast-warning {
  border-left-color: #b7791f
}

.toast-info {
  border-left-color: #2b6ba0
}

.toast-body {
  flex: 1;
  min-width: 0
}

.toast-body strong {
  display: block;
  font-size: .9rem
}

.toast-body p {
  margin: 5px 0 0;
  font-size: .85rem;
  line-height: 1.4;
  overflow-wrap: anywhere
}

.toast-close {
  border: 0 !important;
  background: transparent !important;
  font-size: 1.4rem;
  line-height: 1;
  padding: 0 4px !important;
  cursor: pointer
}

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

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

@media(max-width:700px) {
  .toast-region {
    top: 10px;
    left: 50%;
    right: auto;
    transform: translateX(-50%)
  }
}

@media(prefers-reduced-motion:reduce) {
  .toast {
    animation: none
  }
}

@media print {
  .toast-region {
    display: none !important
  }
}

/* Print colors: preserve chip SVG fills without depending on background graphics. */
.chip-color {
  display: inline-block;
  flex: none;
  width: 16px;
  height: 16px;
  vertical-align: middle;
  overflow: visible
}

@media print {

  html,
  body,
  .customer-summary,
  .selection-chip,
  .chip-color,
  .chip-color rect {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .selection-chip {
    break-inside: avoid
  }
}

/* v7: Customer matches the rest of the form controls across breakpoints. */
#customer {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  padding: 10px;
  border: 1px solid #cbd2d9;
  border-radius: 6px;
  margin-top: 6px;
  background: #fff;
  color: #17212b;
  font: inherit;
  line-height: normal;
  appearance: none
}

#customer:focus-visible {
  outline: 3px solid #1769aa;
  outline-offset: 2px
}

/* v8: centered 85% separators in on-screen and printed summaries */
.customer-summary dl .summary-divider {
  grid-column: 1/-1;
  width: 85%;
  height: 0;
  border-top: 1px solid #dce3eb;
  justify-self: center;
  margin: 3px 0;
}

@media print {
  .customer-summary dl .summary-divider {
    border-top-color: #c4cbd4;
    break-after: avoid;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact
  }
}

/* v8: every toast expires after 10 seconds; pause while hovered/focused */
.toast {
  position: relative;
  overflow: hidden;
  padding-bottom: 18px
}

.toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 4px;
  width: 100%;
  background: #bf3b32;
  transform-origin: left center;
  animation: toast-countdown 10s linear forwards;
  pointer-events: none
}

.toast-success .toast-progress {
  background: #248044
}

.toast-warning .toast-progress {
  background: #b7791f
}

.toast-info .toast-progress {
  background: #2b6ba0
}

@keyframes toast-countdown {
  from {
    transform: scaleX(1)
  }

  to {
    transform: scaleX(0)
  }
}

@media(prefers-reduced-motion:reduce) {
  .toast-progress {
    animation: toast-countdown 10s linear forwards
  }
}

/* v9: compact summary rows; preserve the existing font sizes. */
.customer-summary dl {
  row-gap: 5px
}

.customer-summary dl .summary-divider {
  margin: 1px 0
}

.customer-summary {
  padding: 13px 16px
}

.preview-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-bottom: 20px;  /* Abajo */
}

.preview-heading-row h2 {
  margin: 0
}

.view-badge {
  display: inline-flex;
  align-items: center;
  border: 1px solid #bfd0e1;
  background: #eaf2fa;
  color: #244b70;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .045em;
  white-space: nowrap
}

.customer-summary dl .summary-extras-row {
  grid-column: 1/-1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  text-align: center;
  min-width: 0
}

.summary-extra-cell {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px
}

.summary-extra-label {
  font-weight: 600;
  color: #596b7a
}

.summary-extra-value {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere
}

.summary-extra-value .selection-chips {
  justify-content: center
}

.summary-extra-value .selection-chip {
  max-width: 100%;
  white-space: normal;
  text-align: left
}

@media(max-width:390px) {
  .customer-summary dl .summary-extras-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px
  }

  .summary-extra-value .selection-chip {
    padding: 3px 4px
  }
}

@media print {
  .view-badge {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact
  }

  .customer-summary dl .summary-extras-row {
    break-inside: avoid
  }
}

/* v10: Bootstrap 6 Alpha-inspired visual system; framework-free and scoped to this configurator. */
:root {
  --ww-body-bg: #f8fafc;
  --ww-surface: #fff;
  --ww-surface-subtle: #f1f5f9;
  --ww-text: #1f2937;
  --ww-muted: #64748b;
  --ww-brand: #1769aa;
  --ww-brand-hover: #11598f;
  --ww-brand-active: #0c4774;
  --ww-border: #cbd5e1;
  --ww-border-strong: #94a3b8;
  --ww-focus: rgb(23 105 170 / .25);
  --ww-danger: #b42318;
  --ww-warning: #b7791f;
  --ww-success: #248044;
  --ww-radius: .5rem;
  --ww-radius-sm: .375rem;
  --ww-shadow-sm: 0 .125rem .25rem rgb(15 23 42 / .075);
  --ww-shadow: 0 .5rem 1rem rgb(15 23 42 / .08);
  --ww-control-height: calc(1.5em + .75rem + 2px);
  --ww-transition: color .2s ease, background-color .2s ease, border-color .2s ease, box-shadow .2s ease;
}

body {
  background: var(--ww-body-bg);
  color: var(--ww-text);
  line-height: 1.5
}

header {
  background: linear-gradient(135deg, #132c46, #17212b);
  padding: 1.25rem clamp(1rem, 3vw, 1.75rem);
  box-shadow: var(--ww-shadow-sm)
}

header h1 {
  font-weight: 650;
  letter-spacing: -.01em
}

header p {
  color: #d7e3ef
}

main {
  padding: clamp(.75rem, 2vw, 1.5rem);
  gap: 1.25rem
}

.card,
.controls,
.preview {
  border-color: #dbe3ec;
  border-radius: var(--ww-radius);
  box-shadow: var(--ww-shadow-sm)
}

.card {
  background: var(--ww-surface)
}

h2 {
  color: #172b3e;
  font-weight: 650;
  letter-spacing: -.01em
}

label {
  color: #334155;
  font-size: .9rem;
  font-weight: 600
}

.muted,
footer {
  color: var(--ww-muted)
}

.note {
  color: var(--ww-muted)
}

/* Native controls remain native for reliable keyboard and mobile picker behavior. */
select,
input[type=text],
input[type=number],
textarea {
  width: 100%;
  min-width: 0;
  min-height: var(--ww-control-height);
  padding: .375rem .75rem;
  border: 1px solid var(--ww-border);
  border-radius: var(--ww-radius-sm);
  background-color: var(--ww-surface);
  color: var(--ww-text);
  box-shadow: inset 0 1px 1px rgb(15 23 42 / .025);
  font: inherit;
  line-height: 1.5;
  transition: var(--ww-transition);
}

#customer {
  min-height: var(--ww-control-height);
  padding: .375rem .75rem;
  border-color: var(--ww-border);
  border-radius: var(--ww-radius-sm);
  box-shadow: inset 0 1px 1px rgb(15 23 42 / .025);
  line-height: 1.5;
  transition: var(--ww-transition)
}

select {
  appearance: none;
  padding-right: 2.5rem;
  background-image: linear-gradient(45deg, transparent 50%, #475569 50%), linear-gradient(135deg, #475569 50%, transparent 50%);
  background-position: calc(100% - 1.05rem) calc(50% - .1rem), calc(100% - .75rem) calc(50% - .1rem);
  background-size: .3rem .3rem, .3rem .3rem;
  background-repeat: no-repeat
}

select:hover:not(:disabled),
input[type=text]:hover:not(:disabled),
input[type=number]:hover:not(:disabled),
textarea:hover:not(:disabled) {
  border-color: var(--ww-border-strong)
}

select:focus-visible,
input[type=text]:focus-visible,
input[type=number]:focus-visible,
textarea:focus-visible,
button:focus-visible,
summary:focus-visible {
  outline: 0;
  border-color: var(--ww-brand);
  box-shadow: 0 0 0 .25rem var(--ww-focus)
}

select:disabled,
input:disabled,
textarea:disabled {
  opacity: 1;
  color: #64748b;
  background: #e9eef4;
  border-color: #d4dde7;
  cursor: not-allowed
}

input[readonly],
textarea[readonly] {
  background: var(--ww-surface-subtle);
  color: #475569
}

select option {
  color: var(--ww-text);
  background: var(--ww-surface)
}

button:not(.swatch),
.toast-action {
  min-height: var(--ww-control-height);
  border: 1px solid #c7d2de;
  border-radius: var(--ww-radius-sm);
  padding: .375rem .75rem;
  background: #fff;
  color: #24415d;
  font: inherit;
  font-weight: 600;
  line-height: 1.5;
  box-shadow: var(--ww-shadow-sm);
  transition: var(--ww-transition);
  cursor: pointer;
}

button:not(.swatch):hover:not(:disabled),
.toast-action:hover:not(:disabled) {
  border-color: #9fb1c3;
  background: #f8fafc;
  color: #173d5d;
  box-shadow: 0 .25rem .5rem rgb(15 23 42 / .09)
}

button:not(.swatch):active:not(:disabled),
.toast-action:active:not(:disabled) {
  background: #e8eef5;
  box-shadow: inset 0 1px 2px rgb(15 23 42 / .12)
}

button:not(.swatch):disabled,
.toast-action:disabled {
  opacity: .65;
  box-shadow: none;
  cursor: not-allowed
}

.buttons {
  gap: .5rem
}

.buttons #print,
.toast-action {
  border-color: var(--ww-brand);
  background: var(--ww-brand);
  color: #fff
}

.buttons #print:hover:not(:disabled),
.toast-action:hover:not(:disabled) {
  border-color: var(--ww-brand-hover);
  background: var(--ww-brand-hover);
  color: #fff
}

.buttons #print:active:not(:disabled),
.toast-action:active:not(:disabled) {
  border-color: var(--ww-brand-active);
  background: var(--ww-brand-active)
}

.panel-row {
  border-bottom-color: #e5ebf1;
  padding: .75rem 0
}

.panel-row strong {
  color: #334155;
  font-size: .9rem
}

.swatches {
  gap: .375rem;
  margin-top: .5rem
}

.swatch {
  border-color: #94a3b8;
  border-radius: var(--ww-radius-sm);
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / .25)
}

.swatch.chosen {
  outline-color: var(--ww-brand)
}

.option-row {
  display: flex;
  align-items: flex-start;
  gap: .5rem;
  padding: .55rem .25rem;
  margin: 0;
  border-radius: var(--ww-radius-sm);
  color: #334155;
  transition: background-color .2s ease
}

.option-row:hover {
  background: #f4f8fc
}

.option-row input[type=checkbox] {
  width: 1rem;
  height: 1rem;
  min-height: 1rem;
  margin: .2rem 0 0;
  accent-color: var(--ww-brand);
  flex: none
}

details {
  border-color: #dbe3ec;
  border-radius: var(--ww-radius-sm);
  background: #fff;
  box-shadow: var(--ww-shadow-sm)
}

details>summary {
  padding: .125rem;
  color: #24415d
}

details[open]>summary {
  margin-bottom: .5rem
}

details #options {
  margin: .25rem 0 0
}

.customer-summary {
  border-color: #dbe3ec;
  background: linear-gradient(180deg, #fff, #f8fafc);
  border-radius: var(--ww-radius-sm);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .8)
}

.selection-chip {
  border-color: #d4dee8;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 1px 2px rgb(15 23 42 / .04)
}

.view-badge {
  border-color: #b8d0e5;
  background: #eef6fd;
  color: #1d527d
}

pre {
  border: 1px solid #dbe3ec;
  background: #f8fafc;
  border-radius: var(--ww-radius-sm)
}

.toast {
  border-color: #dbe3ec;
  border-left-width: .3rem;
  border-radius: var(--ww-radius);
  box-shadow: 0 .75rem 1.5rem rgb(15 23 42 / .14)
}

.toast-close {
  box-shadow: none !important;
  color: #475569
}

.toast-close:hover {
  color: #172b3e;
  background: #edf2f7 !important;
  border-radius: var(--ww-radius-sm)
}

.swatch[data-tip]::after {
  border: 1px solid rgb(255 255 255 / .16);
  border-radius: var(--ww-radius-sm);
  box-shadow: 0 .5rem 1rem rgb(15 23 42 / .25)
}

.validation-error {
  color: var(--ww-danger)
}

@media(max-width:700px) {
  header {
    padding: 1rem
  }

  header h1 {
    font-size: 1.2rem
  }

  .configuration,
  .controls,
  .preview,
  .extras {
    padding: 1rem
  }

  .buttons {
    width: 100%
  }

  .buttons button {
    flex: 1
  }

  .option-row {
    padding: .625rem .25rem
  }

  .swatches {
    gap: .45rem
  }
}

@media(prefers-reduced-motion:reduce) {

  select,
  input[type=text],
  input[type=number],
  textarea,
  button:not(.swatch),
  .toast-action,
  .option-row {
    transition: none
  }
}

/* v11: accessible Bootstrap-inspired select menus, view control, switch, and catalog progress. */
.internal-select,
.select-widget-native,
.raked-native {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  border: 0 !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  overflow: hidden !important;
  white-space: nowrap !important;
  opacity: 0 !important;
  pointer-events: none !important
}

.select-widget {
  position: relative;
  margin-top: 5px;
  width: 100%;
  min-width: 0
}

.select-widget.is-open {
  z-index: 60
}

.select-widget-toggle {
  position: relative;
  width: 100%;
  min-height: var(--ww-control-height);
  padding: .375rem 2.5rem .375rem .75rem;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap
}

.select-widget-toggle::after {
  content: '';
  position: absolute;
  right: .9rem;
  top: 50%;
  width: .42rem;
  height: .42rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-65%) rotate(45deg);
  transition: transform .2s ease
}

.select-widget-toggle[aria-expanded="true"]::after {
  transform: translateY(-35%) rotate(225deg)
}

.select-widget-toggle.is-placeholder {
  color: var(--ww-muted)
}

.select-widget-menu {
  position: absolute;
  z-index: 50;
  left: 0;
  right: 0;
  max-height: min(16rem, calc(100vh - 2rem));
  padding: .35rem;
  margin-top: .35rem;
  overflow-y: auto;
  border: 1px solid #d5e0ea;
  border-radius: var(--ww-radius);
  background: #fff;
  box-shadow: 0 1rem 2rem rgb(15 23 42 / .18);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-.35rem);
  pointer-events: none;
  transition: opacity .16s ease, transform .16s ease, visibility 0s linear .16s
}

.select-widget[data-side="above"] .select-widget-menu {
  top: auto;
  bottom: 100%;
  margin: 0 0 .35rem;
  transform: translateY(.35rem)
}

.select-widget.is-open .select-widget-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
  transition-delay: 0s
}

.select-widget .select-widget-option {
  display: block;
  width: 100%;
  min-height: 2.25rem;
  padding: .45rem .6rem;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #334155;
  text-align: left;
  box-shadow: none;
  font-weight: 500;
  line-height: 1.4;
  white-space: normal;
  overflow-wrap: anywhere
}

.select-widget .select-widget-option:hover,
.select-widget .select-widget-option.is-active {
  background: #eaf3fb;
  color: #145182;
  box-shadow: none
}

.select-widget .select-widget-option.is-selected {
  background: #dcecf9;
  color: #0f4f80;
  font-weight: 700
}

.select-widget .select-widget-option.is-selected::after {
  content: '✓';
  float: right;
  font-weight: 800
}

.catalog-spinner {
  display: inline-block;
  width: .85rem;
  height: .85rem;
  margin-left: .35rem;
  border: .14rem solid #bdd3e6;
  border-top-color: var(--ww-brand);
  border-radius: 50%;
  vertical-align: -.08rem;
  animation: catalog-spin .75s linear infinite
}

@keyframes catalog-spin {
  to {
    transform: rotate(1turn)
  }
}

.raked-switch-control {
  display: flex;
  align-items: center;
  gap: .65rem
}

.raked-switch-control>span:first-child {
  min-width: 0
}

.raked-switch-control #raked-switch {
  position: relative;
  flex: none;
  min-height: 1.5rem;
  width: 2.65rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: #94a3b8;
  box-shadow: inset 0 1px 2px rgb(15 23 42 / .22);
  transition: background-color .2s ease, box-shadow .2s ease
}

.raked-switch-control #raked-switch>span {
  position: absolute;
  top: .2rem;
  left: .2rem;
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 .08rem .2rem rgb(15 23 42 / .28);
  transition: transform .2s ease
}

.raked-switch-control #raked-switch[aria-checked="true"] {
  background: var(--ww-brand)
}

.raked-switch-control #raked-switch[aria-checked="true"]>span {
  transform: translateX(1.15rem)
}

.raked-switch-control #raked-switch:disabled {
  opacity: .62;
  cursor: not-allowed
}

.switch-state {
  font-size: .85rem;
  color: var(--ww-muted);
  font-weight: 600
}

.view-badge {
  appearance: none;
  cursor: pointer;
  transition: var(--ww-transition)
}

.view-badge:hover {
  border-color: #82b8df;
  background: #dfeffb;
  color: #123f63;
  box-shadow: var(--ww-shadow-sm)
}

.view-badge:active {
  background: #cfe4f5;
  transform: translateY(1px)
}

@media(max-width:700px) {
  .select-widget-menu {
    max-height: min(14rem, calc(100vh - 1rem));
    border-radius: var(--ww-radius-sm)
  }

  .select-widget-option {
    min-height: 2.6rem;
    padding: .6rem .7rem
  }

  .raked-switch-control {
    padding: .2rem 0
  }
}

@media(prefers-reduced-motion:reduce) {

  .select-widget-menu,
  .select-widget-toggle::after,
  .raked-switch-control #raked-switch,
  .raked-switch-control #raked-switch>span,
  .view-badge {
    transition: none
  }

  .catalog-spinner {
    animation: none
  }
}

@media print {
  .select-widget {
    display: none !important
  }

  .raked-switch-control #raked-switch,
  .switch-state,
  .view-badge {
    display: none !important
  }
}

/* v10: final Bootstrap-inspired action controls. Scoped exclusions retain select rows and switch tracks. */
button:not(.swatch):not(.select-widget-toggle):not(.select-widget-option):not(#raked-switch):not(.toast-close) {
  border-radius: 9999px
}

.action-button,
.view-badge {
  min-height: 2.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  font-weight: 650;
  line-height: 1.2;
  transition: background-color .2s ease, border-color .2s ease, color .2s ease, box-shadow .2s ease, transform .2s ease
}

.button-icon {
  width: 1rem;
  height: 1rem;
  flex: none;
  fill: currentColor
}

.button-spinner {
  width: .85rem;
  height: .85rem;
  flex: none;
  border: .14rem solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: button-spin .65s linear infinite
}

@keyframes button-spin {
  to {
    transform: rotate(1turn)
  }
}

.action-secondary {
  border-color: #6c757d !important;
  background: transparent !important;
  color: #6c757d
}

.action-secondary:hover:not(:disabled),
.action-secondary:focus-visible {
  border-color: #565e64 !important;
  background: #6c757d !important;
  color: #fff !important;
  box-shadow: 0 .25rem .5rem rgb(15 23 42 / .12)
}

.action-danger {
  border-color: #dc3545 !important;
  background: #dc3545 !important;
  color: #fff
}

.action-danger:hover:not(:disabled),
.action-danger:focus-visible {
  border-color: #bb2d3b !important;
  background: #bb2d3b !important;
  color: #fff !important;
  box-shadow: 0 .25rem .5rem rgb(220 53 69 / .24)
}

.action-button.is-busy {
  cursor: progress
}

.view-badge {
  border-color: #0d6efd !important;
  background: #0d6efd !important;
  color: #fff !important
}

.view-badge:hover,
.view-badge:focus-visible {
  border-color: #0b5ed7 !important;
  background: #0b5ed7 !important;
  color: #fff !important;
  box-shadow: 0 .25rem .5rem rgb(13 110 253 / .25)
}

.view-badge:active {
  background: #0a58ca !important;
  transform: translateY(1px)
}

.raked-switch-control #raked-switch[aria-checked="true"] {
  background: #dc3545
}

.raked-switch-control #raked-switch[aria-checked="true"]:focus-visible {
  outline-color: #dc3545
}

/* .toast previously set border-color after these semantic classes; restate the left edge after that cascade. */
.toast.toast-error {
  border-left-color: #bf3b32
}

.toast.toast-success {
  border-left-color: #248044
}

.toast.toast-warning {
  border-left-color: #b7791f
}

.toast.toast-info {
  border-left-color: #2b6ba0
}

#options.list-group {
  display: block;
  overflow: hidden;
  border: 1px solid #d7e0e9;
  border-radius: var(--ww-radius-sm);
  background: #fff
}

.option-row.list-group-item {
  display: flex;
  align-items: flex-start;
  gap: .65rem;
  padding: .7rem .8rem;
  margin: 0;
  border: 0;
  border-bottom: 1px solid #e4eaf0;
  border-radius: 0;
  background: transparent;
  cursor: pointer
}

.option-row.list-group-item:last-child {
  border-bottom: 0
}

.option-row.list-group-item:hover {
  background: #f4f8fc
}

.option-row.list-group-item:has(input:checked) {
  background: #edf5ff;
  color: #0b4b7a
}

.option-row.list-group-item:focus-within {
  position: relative;
  z-index: 1;
  box-shadow: inset 0 0 0 2px #86b7fe
}

.option-row.list-group-item span {
  min-width: 0;
  overflow-wrap: anywhere
}

.option-row input[type=checkbox] {
  appearance: none;
  display: grid;
  place-content: center;
  width: 1.1rem;
  height: 1.1rem;
  margin: .15rem 0 0;
  border: 1px solid #7890a5;
  border-radius: .25rem;
  background: #fff;
  accent-color: auto;
  flex: none
}

.option-row input[type=checkbox]::before {
  content: '';
  width: .56rem;
  height: .32rem;
  border: solid #fff;
  border-width: 0 0 .14rem .14rem;
  transform: rotate(-45deg) scale(0);
  transform-origin: center;
  transition: transform .12s ease
}

.option-row input[type=checkbox]:checked {
  border-color: #0d6efd;
  background: #0d6efd
}

.option-row input[type=checkbox]:checked::before {
  transform: rotate(-45deg) scale(1)
}

.option-row input[type=checkbox]:focus-visible {
  outline: 3px solid #86b7fe;
  outline-offset: 2px
}

.option-row input[type=checkbox]:disabled {
  opacity: .55;
  cursor: not-allowed
}

.option-row.list-group-item:has(input:disabled) {
  cursor: not-allowed;
  color: #6c757d;
  background: #f8f9fa
}

@media(prefers-reduced-motion:reduce) {

  .action-button,
  .view-badge,
  .option-row input[type=checkbox],
  .option-row input[type=checkbox]::before {
    transition: none
  }

  .button-spinner {
    animation: none
  }
}

@media print {

  .action-button,
  .view-badge {
    display: none !important
  }
}