/*
 * Buy Transfers wizard (ui/html/shop/buy-transfers-wizard.html).
 *
 * Everything is scoped under .btw so the legacy page (buy-transfers.html) and
 * the rest of the storefront are untouched. ui/css/app.css still carries
 * global rules for the shared hooks (.card-formula, .card-artwork,
 * .card-quantity, .btn-continue, .confirm-card-*, .missing-card-*); the
 * "legacy reset" blocks below neutralise those inside the wizard.
 *
 * Visibility is driven by inline style="display:none" set from
 * ui/js/buy-transfers-wizard.js, never by a hidden class, so display values
 * declared here are what an element returns to when the script reveals it.
 */

.btw {
    --btw-navy: #002F6C;
    --btw-navy-deep: #00244F;
    --btw-steel: #EEF1F5;
    --btw-line: #D5DBE5;
    --btw-ink: #1B1F27;
    --btw-muted: #5B6472;
    --btw-green: #1F8A4C;
    --btw-green-wash: #F3FAF5;
    --btw-heat: #D9480F;
    --btw-alert: #A32B22;
    --btw-radius: 10px;
    --btw-action-col: 168px;
    --btw-display: 'Anton', 'Arial Narrow', Impact, sans-serif;

    position: relative;
    max-width: 1320px;
    margin: 0 auto;
    padding: 28px 20px 72px;
    color: var(--btw-ink);
    text-align: left;
}

.btw *,
.btw *::before,
.btw *::after {
    box-sizing: border-box;
}

.btw h1,
.btw h2,
.btw h3,
.btw h4,
.btw h5 {
    color: var(--btw-ink);
    letter-spacing: 0;
    text-transform: none;
}

.btw a {
    color: var(--btw-navy);
}

.btw :focus-visible {
    outline: 3px solid var(--btw-navy);
    outline-offset: 2px;
    border-radius: 4px;
}

.btw fieldset {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

/* ---- buttons ---------------------------------------------------------- */

.btw .btw-btn-primary {
    background: var(--btw-navy);
    border: 1px solid var(--btw-navy);
    color: #fff;
    font-weight: 600;
    padding: 12px 18px;
    border-radius: 8px;
    transition: background-color .15s ease;
}

.btw .btw-btn-primary:hover,
.btw .btw-btn-primary:focus-visible {
    background: var(--btw-navy-deep);
    border-color: var(--btw-navy-deep);
    color: #fff;
}

.btw .btw-btn-primary:disabled {
    background: #B9C2D0;
    border-color: #B9C2D0;
    color: #fff;
    opacity: 1;
    cursor: not-allowed;
}

.btw .btw-btn-block {
    display: block;
    width: 100%;
}

.btw .btw-btn-quiet {
    background: #fff;
    border: 1px solid var(--btw-navy);
    color: var(--btw-navy);
    font-weight: 600;
    white-space: nowrap;
}

.btw .btw-btn-quiet:hover {
    background: var(--btw-navy);
    color: #fff;
}

/* legacy reset: app.css pins .btn-continue to the card's top-right corner */
.btw .btn-continue {
    position: static;
    width: 100%;
    height: auto;
    line-height: 1.4;
    padding: 9px 12px;
    background: var(--btw-green);
    border: 1px solid var(--btw-green);
    border-radius: 6px;
    color: #fff;
    font-size: .875rem;
    font-weight: 600;
}

.btw .btn-continue:hover {
    background: #17703D;
    border-color: #17703D;
}

/* ---- head: title + steps --------------------------------------------- */

.btw-head {
    margin-bottom: 20px;
}

.btw-head-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px 32px;
    flex-wrap: wrap;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--btw-line);
}

.btw .btw-title {
    margin: 0;
    font-family: var(--btw-display);
    font-size: 2rem;
    font-weight: 400;
    line-height: 1.1;
    color: var(--btw-navy);
}

.btw-steps {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}

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

.btw-steps li + li::before {
    content: "";
    width: 28px;
    height: 2px;
    margin-right: 6px;
    background: var(--btw-line);
}

.btw-steps li.complete + li::before {
    background: var(--btw-green);
}

.btw-steps button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px 6px 6px;
    background: none;
    border: 0;
    border-radius: 999px;
    color: var(--btw-muted);
    font-size: .9375rem;
    cursor: pointer;
}

.btw-steps button:hover {
    background: var(--btw-steel);
}

.btw-steps button strong {
    font-weight: 600;
}

.btw-step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: 2px solid var(--btw-line);
    border-radius: 50%;
    background: #fff;
    color: var(--btw-muted);
    font-size: .8125rem;
    font-weight: 700;
    line-height: 1;
}

.btw-steps li.complete .btw-step-num {
    border-color: var(--btw-green);
    background: var(--btw-green);
    color: #fff;
}

.btw-steps li.active button {
    color: var(--btw-ink);
}

.btw-steps li.active .btw-step-num {
    border-color: var(--btw-navy);
    background: var(--btw-navy);
    color: #fff;
}

.btw-progress {
    display: none;
    height: 4px;
    background: var(--btw-steel);
}

.btw-progress span {
    display: block;
    width: 25%;
    height: 100%;
    background: var(--btw-navy);
    transition: width .2s ease;
}

.btw[data-btw-step="artwork"] .btw-progress span { width: 50%; }
.btw[data-btw-step="quantity"] .btw-progress span { width: 75%; }
.btw[data-btw-step="review"] .btw-progress span { width: 100%; }

/* ---- notices ---------------------------------------------------------- */

.btw-guest-notice,
.btw .btw-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px 20px;
    flex-wrap: wrap;
    margin-bottom: 16px;
    padding: 12px 16px;
    border-left: 4px solid var(--btw-navy);
    border-radius: 0 8px 8px 0;
    background: var(--btw-steel);
    font-size: .9375rem;
}

.btw-guest-notice p,
.btw .btw-banner p {
    flex: 1 1 320px;
    margin: 0;
}

/* ---- layout ----------------------------------------------------------- */

.btw-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 312px;
    gap: 32px;
    align-items: start;
}

.btw-form {
    min-width: 0;
}

.btw-step-head {
    margin-bottom: 20px;
}

.btw .btw-step-head h2 {
    margin: 0 0 6px;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.25;
}

.btw-step-head p {
    max-width: 70ch;
    margin: 0;
    color: var(--btw-muted);
}

.btw-sub-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px 16px;
    flex-wrap: wrap;
}

.btw .btw-sub-head h3 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 700;
}

.btw-count {
    color: var(--btw-muted);
    font-size: .875rem;
}

.btw-sub-hint {
    margin: 4px 0 14px;
    color: var(--btw-muted);
    font-size: .9375rem;
}

.btw-strong-note {
    color: var(--btw-alert);
}

/* ---- selectable cards: legacy reset + shared states ------------------- */

.btw .card.card-formula,
.btw .card.card-artwork-source,
.btw .card.card-artwork,
.btw .card.card-quantity {
    position: relative;
    border: 1px solid var(--btw-line);
    border-radius: var(--btw-radius);
    background: #fff;
    color: var(--btw-ink);
    cursor: pointer;
    transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}

.btw .card.card-formula:hover,
.btw .card.card-artwork-source:hover,
.btw .card.card-artwork:hover,
.btw .card.card-quantity:hover {
    border-color: var(--btw-navy);
}

.btw .card.card-formula.selected,
.btw .card.card-artwork-source.selected,
.btw .card.card-artwork.selected,
.btw .card.card-quantity.selected {
    border-color: var(--btw-green);
    background: var(--btw-green-wash);
    box-shadow: inset 4px 0 0 var(--btw-green);
    color: var(--btw-ink);
}

.btw .card-formula > .card-header,
.btw .card-artwork-source > .card-header,
.btw .card-artwork > .card-header,
.btw .card-quantity > .card-header {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 0;
    background: none;
    border: 0;
    border-radius: 0;
    text-align: center;
}

.btw .card-formula > .card-header h5,
.btw .card-artwork-source > .card-header h5,
.btw .card-artwork > .card-header h5,
.btw .card-quantity > .card-header h5 {
    margin: 0;
    padding: 9px 10px;
    border: 1px solid var(--btw-navy);
    border-radius: 6px;
    color: var(--btw-navy);
    font-size: .875rem;
    font-weight: 600;
    line-height: 1.4;
}

.btw .card.selected > .card-header h5 {
    padding-left: 0;
    padding-right: 0;
    border-color: transparent;
    color: var(--btw-green);
}

.btw .card.selected > .card-header h5 em {
    margin-right: 4px;
}

/* ---- step 1: formula comparison -------------------------------------- */

.btw-formula-legend {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 176px 168px var(--btw-action-col);
    column-gap: 24px;
    padding: 0 21px 8px;
    color: var(--btw-muted);
    font-size: .8125rem;
    font-weight: 600;
}

.btw-formulas {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btw .card.card-formula {
    display: grid;
    grid-template-columns: minmax(0, 1fr) var(--btw-action-col);
    column-gap: 24px;
    align-items: center;
    padding: 18px 20px;
}

.btw .card-formula > .card-header {
    order: 2;
}

.btw .card-formula > .card-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 176px 168px;
    column-gap: 24px;
    align-items: center;
    padding: 0;
}

.btw .btw-formula-name .card-title {
    margin: 0 0 2px;
    font-size: 1.0625rem;
    font-weight: 700;
    line-height: 1.3;
}

.btw .btw-formula-name .card-text {
    margin: 0;
    color: var(--btw-muted);
    font-size: .875rem;
    line-height: 1.4;
}

.btw-formula-more {
    margin: 6px 0 0;
    font-size: .8125rem;
}

.btw-tag {
    display: inline-block;
    margin-top: 6px;
    padding: 2px 10px;
    border-radius: 999px;
    background: var(--btw-steel);
    color: var(--btw-muted);
    font-size: .75rem;
    font-weight: 600;
}

.btw-meters {
    display: grid;
    /* one column in the comparison row, two when the card stacks and has the width */
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 6px 18px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.btw-meters li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.btw-meter-label {
    color: var(--btw-muted);
    font-size: .8125rem;
    white-space: nowrap;
}

.btw-meter {
    display: inline-flex;
    gap: 3px;
}

.btw-meter i {
    width: 11px;
    height: 6px;
    border-radius: 1px;
    background: #D9DEE7;
}

.btw-meter i.on {
    background: var(--btw-navy);
}

.btw-press {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-left: 12px;
    border-left: 3px solid var(--btw-heat);
}

.btw-press-temp {
    font-family: var(--btw-display);
    font-size: 2rem;
    line-height: 1;
    color: var(--btw-ink);
    white-space: nowrap;
}

.btw-press-temp small {
    margin-left: 2px;
    font-size: .875rem;
    color: var(--btw-heat);
}

.btw-press-meta {
    color: var(--btw-muted);
    font-size: .8125rem;
    line-height: 1.35;
}

/* legacy reset: app.css paints a full-card "Coming Soon" / "Unavailable" overlay */
.btw .card-formula-disabled::before,
.btw .card-formula-disabled.card-formula-unavailable::before {
    content: none;
    display: none;
}

.btw .card.card-formula.card-formula-disabled,
.btw .card.card-formula.card-formula-disabled:hover {
    border-color: var(--btw-line);
    background: #F8F9FB;
    cursor: not-allowed;
}

.btw .card-formula-disabled > .card-header {
    visibility: hidden;
}

.btw .card-formula-disabled .btw-meters,
.btw .card-formula-disabled .btw-press,
.btw .card-formula-disabled .card-title,
.btw .card-formula-disabled .card-text {
    opacity: .55;
}

.btw .card-formula-unavailable .btw-tag {
    display: none;
}

.btw .card-formula-unavailable .btw-formula-name::after {
    content: "Unavailable";
    display: inline-block;
    margin-top: 6px;
    padding: 2px 10px;
    border-radius: 999px;
    background: var(--btw-steel);
    color: var(--btw-muted);
    font-size: .75rem;
    font-weight: 600;
}

.btw-empty {
    margin: 0;
    padding: 24px;
    border: 1px dashed var(--btw-line);
    border-radius: var(--btw-radius);
    color: var(--btw-muted);
    text-align: center;
}

/* ---- step 2: artwork source ------------------------------------------ */

.btw-sources {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 28px;
}

.btw .card.card-artwork-source {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 150px;
    column-gap: 16px;
    align-items: center;
    padding: 16px 18px;
}

.btw .card-artwork-source > .card-header {
    order: 2;
}

.btw .card-artwork-source > .card-body {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    column-gap: 12px;
    align-items: center;
    padding: 0;
}

.btw .btw-source-icon {
    grid-row: 1 / span 2;
    margin: 0;
    text-align: center;
}

.btw .card-artwork-source .lg-icon {
    font-size: 1.75rem;
    color: var(--btw-navy);
}

.btw .card-artwork-source .card-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.3;
}

.btw-source-hint {
    margin: 0;
    color: var(--btw-muted);
    font-size: .8125rem;
}

.btw .browse-source {
    padding-top: 4px;
}

.btw-search {
    margin-bottom: 16px;
}

/* ---- step 2: art library grid ---------------------------------------- */

.btw-art-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(208px, 1fr));
    gap: 14px;
}

.btw-art-item {
    min-width: 0;
}

.btw .card.card-artwork,
.btw .card.confirm-card-artwork {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.btw .card.card-artwork.selected {
    box-shadow: 0 0 0 2px var(--btw-green);
}

.btw .card-artwork > .card-body,
.btw .confirm-card-artwork > .card-body {
    order: 1;
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    padding: 0 0 10px;
}

.btw .card-artwork .artwork-preview,
.btw .confirm-card-artwork .artwork-preview {
    order: -1;
    position: relative;
    margin: 0 0 10px;
    border-bottom: 1px solid var(--btw-line);
}

.btw .artwork-preview .zoom {
    width: 36px;
    height: 36px;
    line-height: 36px;
    border-radius: 8px 0 0 0;
    background: rgba(255, 255, 255, .92);
    font-size: 1rem;
}

.btw .card-artwork .card-title,
.btw .confirm-card-artwork .card-title {
    margin: 0 !important;
    padding: 0 12px;
    font-size: .9375rem;
    font-weight: 700;
    line-height: 1.35;
    text-align: left !important;
}

.btw .card-artwork .card-body p,
.btw .confirm-card-artwork .card-body p {
    padding: 0 12px;
    color: var(--btw-muted);
    font-size: .8125rem;
    line-height: 1.45;
    text-align: left !important;
}

.btw .card-artwork .card-body p.artwork-size-slug,
.btw .confirm-card-artwork .card-body p.artwork-size-slug {
    color: var(--btw-ink);
    font-size: .875rem;
    font-weight: 600;
}

/* legacy reset: the swatch strip was absolutely positioned 190px down the card */
.btw .card-artwork .card-artwork-palette,
.btw .confirm-card-artwork .card-artwork-palette {
    order: 2;
    position: static;
    padding: 0 12px 8px;
    text-align: left;
}

.btw .card-artwork > .card-header {
    order: 3;
    padding: 0 10px 10px;
}

.btw .card-artwork > .card-header h5 {
    padding: 7px 8px;
    font-size: .8125rem;
}

.btw .card-artwork-disabled {
    display: flex;
    /* the reason sits over the (square) preview, clear of the faded details below it */
    align-items: flex-start;
    justify-content: center;
    padding: calc(50% - 1.35em) 16px 0;
    background: rgba(255, 255, 255, .88);
    color: var(--btw-alert);
    font-size: .9375rem;
    font-weight: 600;
    line-height: 1.35;
}

.btw .card-artwork-disabled br {
    display: none;
}

.btw .art-library-load-more {
    margin-top: 16px;
}

/* ---- step 2: upload --------------------------------------------------- */

.btw .dropzone-artwork {
    position: relative;
    min-height: 168px;
    max-height: 240px;
    border: 2px dashed #9AA7BB;
    border-radius: var(--btw-radius);
    background: var(--btw-steel);
    background-image: none;
    transition: border-color .15s ease, background-color .15s ease;
}

.btw .dropzone-artwork::before {
    content: "Drop your artwork here, or click to browse";
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    color: var(--btw-navy);
    font-size: 1.0625rem;
    font-weight: 600;
    text-align: center;
    pointer-events: none;
}

.btw .dropzone-artwork:hover,
.btw .dropzone-artwork.dz-drag-hover {
    border-color: var(--btw-navy);
    background: #E3E9F2;
}

.btw .dropzone-artwork.dz-started::before {
    content: none;
}

.btw-upload {
    display: flex;
    flex-direction: column;
}

.btw-upload-side {
    order: -1;
}

.btw .heat-transfer-preview {
    margin-bottom: 8px;
}

.btw-upload-reset {
    min-height: 8px;
    margin-bottom: 8px;
    text-align: right;
}

.btw-field {
    display: grid;
    grid-template-columns: 170px minmax(0, 1fr);
    gap: 8px 20px;
    padding: 16px 0;
    border-top: 1px solid var(--btw-line);
}

.btw-field-label {
    margin: 0;
    padding-top: 6px;
    font-weight: 700;
}

.btw-field-label small {
    display: block;
    color: var(--btw-alert);
    font-size: .75rem;
    font-weight: 600;
}

.btw-field-label small.btw-plain {
    color: var(--btw-muted);
}

.btw-field-body > p:last-child {
    margin-bottom: 0;
}

.btw-size-inputs {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btw-size-inputs .input-group {
    flex: 1 1 0;
    max-width: 220px;
}

.btw-size-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 10px;
}

.btw .info-block > .btw-btn-primary {
    margin-top: 8px;
}

/* ---- step 3: price ladder -------------------------------------------- */

.btw-ladder {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.btw .card.card-quantity {
    display: grid;
    grid-template-columns: minmax(0, 1fr) var(--btw-action-col);
    column-gap: 24px;
    align-items: center;
    padding: 12px 20px;
}

.btw .card-quantity > .card-header {
    order: 2;
}

.btw .card-quantity > .card-body {
    display: grid;
    grid-template-columns: 160px minmax(0, 1fr);
    column-gap: 20px;
    align-items: center;
    padding: 0;
}

.btw .card-quantity .card-title,
.btw .confirm-card-quantity .card-title {
    margin: 0;
    font-family: var(--btw-display);
    font-size: 1.875rem;
    font-weight: 400;
    line-height: 1;
    text-align: left !important;
}

.btw .form-control.quantity-input {
    margin: 0;
    font-size: 1rem;
    text-align: left;
}

.btw .table.quantity-price-table {
    width: 100%;
    margin: 0;
    table-layout: fixed;
    background: none;
}

.btw .table.quantity-price-table tr > td,
.btw .table.quantity-price-table tr > td:not(:last-child) {
    padding: 0 12px;
    border: 0;
    background: none;
    box-shadow: none;
    text-align: left !important;
    font-variant-numeric: tabular-nums;
}

.btw .quantity-price-table td > span:first-child {
    display: block;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.3;
}

.btw .quantity-price-table span.total-price {
    color: var(--btw-navy);
    font-size: 1.125rem !important;
    font-weight: 700 !important;
}

.btw .quantity-price-table span.slug {
    color: var(--btw-muted);
    font-size: .75rem;
    font-weight: 400;
}

/* ---- step 4: review --------------------------------------------------- */

.btw-refs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 16px;
    margin-bottom: 20px;
}

.btw-ref a {
    display: inline-block;
    margin-top: 4px;
    font-size: .8125rem;
}

.btw-confirm {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    align-items: start;
    margin-bottom: 20px;
}

.btw-confirm-col {
    min-width: 0;
}

.btw .card.confirm-card-formula,
.btw .card.confirm-card-artwork,
.btw .card.confirm-card-quantity {
    position: relative;
    border: 1px solid var(--btw-line);
    border-radius: var(--btw-radius);
    background: #fff;
    color: var(--btw-ink);
}

.btw .confirm-card-formula > .card-header,
.btw .confirm-card-artwork > .card-header,
.btw .confirm-card-quantity > .card-header {
    order: 0;
    padding: 10px 14px;
    background: var(--btw-green-wash);
    border: 0;
    border-bottom: 1px solid var(--btw-line);
}

.btw .confirm-card-artwork > .card-header {
    order: -2;
}

.btw .confirm-card-formula > .card-header h5,
.btw .confirm-card-artwork > .card-header h5,
.btw .confirm-card-quantity > .card-header h5 {
    margin: 0;
    color: var(--btw-green);
    font-size: .8125rem;
    font-weight: 700;
    text-align: left !important;
}

.btw .confirm-card-formula > .card-body,
.btw .confirm-card-quantity > .card-body {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 14px;
}

.btw .confirm-card-formula .btw-formula-more {
    display: none;
}

.btw .confirm-card-quantity .table.quantity-price-table tr > td {
    padding: 0 12px 0 0;
}

.btw .card.missing-card-formula,
.btw .card.missing-card-artwork,
.btw .card.missing-card-quantity {
    border: 1px dashed #D08A84;
    border-radius: var(--btw-radius);
    background: #FFF8F7;
    color: var(--btw-alert);
    cursor: pointer;
}

.btw .missing-card-formula > .card-header,
.btw .missing-card-artwork > .card-header,
.btw .missing-card-quantity > .card-header {
    padding: 10px 14px;
    background: none;
    border: 0;
}

.btw .missing-card-formula > .card-header h5,
.btw .missing-card-artwork > .card-header h5,
.btw .missing-card-quantity > .card-header h5 {
    color: var(--btw-alert);
    font-size: .875rem;
    font-weight: 700;
}

.btw p.not-chosen {
    margin: 0;
    color: var(--btw-alert);
    font-size: 2rem;
    line-height: 1;
    text-align: center;
}

.btw-panel {
    margin-bottom: 20px;
    padding: 16px 18px;
    border: 1px solid var(--btw-line);
    border-radius: var(--btw-radius);
}

.btw .btw-panel h3 {
    margin: 0 0 8px;
    font-size: 1.0625rem;
    font-weight: 700;
}

/* ---- rail: "Your transfer" ------------------------------------------- */

.btw-rail {
    position: sticky;
    /* clears the storefront's fixed header (64px) */
    top: 84px;
    padding: 20px;
    border-radius: 12px;
    background: var(--btw-steel);
}

.btw .btw-rail-title {
    margin: 0 0 12px;
    font-size: 1.0625rem;
    font-weight: 700;
}

.btw-rail-list {
    margin: 0 0 16px;
    padding: 0;
    list-style: none;
}

.btw-rail-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 2px 12px;
    padding: 10px 0;
    border-top: 1px solid var(--btw-line);
}

.btw-rail-label {
    grid-column: 1 / -1;
    color: var(--btw-muted);
    font-size: .75rem;
    font-weight: 600;
}

.btw-rail-value {
    color: var(--btw-muted);
    font-size: .9375rem;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.btw-rail-row.is-set .btw-rail-value {
    color: var(--btw-ink);
    font-weight: 600;
}

.btw-rail-value small {
    display: block;
    color: var(--btw-muted);
    font-size: .8125rem;
    font-weight: 400;
}

.btw-rail-edit {
    align-self: start;
    padding: 0;
    background: none;
    border: 0;
    color: var(--btw-navy);
    font-size: .8125rem;
    text-decoration: underline;
    cursor: pointer;
}

.btw-rail-price {
    margin-bottom: 16px;
    padding-top: 12px;
    border-top: 2px solid var(--btw-ink);
}

.btw-rail-total {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

.btw-rail-total-label {
    font-weight: 700;
}

.btw-rail-total-value {
    font-family: var(--btw-display);
    font-size: 1.875rem;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.btw-rail-breakdown {
    margin: 4px 0 0;
    color: var(--btw-muted);
    font-size: .8125rem;
    text-align: right;
}

.btw-rail-hint {
    margin: 10px 0 0;
    color: var(--btw-muted);
    font-size: .8125rem;
    text-align: center;
}

.btw-rail-hint:empty {
    display: none;
}

/* ---- mobile action bar ------------------------------------------------ */

.btw-bar {
    display: none;
}

/* ---- busy state ------------------------------------------------------- */

.btw-busy {
    position: fixed;
    top: 16px;
    left: 50%;
    z-index: 1080;
    transform: translateX(-50%);
    pointer-events: none;
}

.btw-busy-box {
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: min(92vw, 520px);
    padding: 10px 16px;
    border-radius: 999px;
    background: var(--btw-ink);
    color: #fff;
    font-size: .9375rem;
    box-shadow: 0 6px 20px rgba(27, 31, 39, .25);
}

.btw-busy-spinner {
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, .35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: btw-spin .7s linear infinite;
}

.btw-busy.is-blocking,
.btw-busy.is-error {
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: none;
    background: rgba(255, 255, 255, .78);
    pointer-events: auto;
}

.btw-busy.is-error .btw-busy-box {
    display: block;
    padding: 20px 24px;
    border-radius: var(--btw-radius);
    background: #fff;
    border: 1px solid #D08A84;
    color: var(--btw-alert);
}

.btw-busy.is-error .btw-busy-spinner {
    display: none;
}

.btw-busy-message {
    max-width: 440px;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.btw-busy-message a {
    color: var(--btw-navy);
    text-decoration: underline;
}

.btw-busy-message + .btn {
    margin-top: 14px;
}

@keyframes btw-spin {
    to { transform: rotate(360deg); }
}

/* ---- narrower screens ------------------------------------------------- */

@media (max-width: 1199.98px) {
    .btw-formula-legend {
        display: none;
    }

    .btw .card-formula > .card-body {
        grid-template-columns: minmax(0, 1fr) 168px;
        row-gap: 12px;
    }

    .btw .card-formula .btw-formula-name {
        grid-column: 1 / -1;
    }
}

@media (max-width: 991.98px) {
    .btw {
        padding: 20px 16px 104px;
    }

    .btw-layout {
        grid-template-columns: minmax(0, 1fr);
        gap: 24px;
    }

    .btw-rail {
        position: static;
    }

    .btw-rail [data-btw-primary],
    .btw-rail .btw-rail-hint {
        display: none;
    }

    .btw-progress {
        display: block;
    }

    .btw-head-inner {
        border-bottom: 0;
        padding-bottom: 12px;
    }

    .btw-bar {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1030;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
        background: #fff;
        border-top: 1px solid var(--btw-line);
        box-shadow: 0 -4px 16px rgba(27, 31, 39, .08);
    }

    .btw-bar-summary {
        display: flex;
        flex-direction: column;
        min-width: 0;
    }

    .btw-bar-step {
        color: var(--btw-muted);
        font-size: .8125rem;
    }

    .btw-bar-total {
        font-weight: 700;
        font-variant-numeric: tabular-nums;
    }

    .btw-bar .btw-btn-primary {
        flex: 0 0 auto;
        min-height: 44px;
    }
}

@media (max-width: 767.98px) {
    .btw .btw-title {
        font-size: 1.625rem;
    }

    .btw-steps {
        width: 100%;
        justify-content: space-between;
        gap: 0;
    }

    .btw-steps li + li::before {
        width: 12px;
        margin-right: 2px;
    }

    .btw-steps button {
        padding: 6px;
    }

    .btw-steps li:not(.active) button strong {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
    }

    .btw .card.card-formula,
    .btw .card.card-quantity,
    .btw .card.card-artwork-source {
        grid-template-columns: minmax(0, 1fr);
        row-gap: 14px;
        padding: 16px;
    }

    .btw .card-formula > .card-body {
        grid-template-columns: minmax(0, 1fr);
    }

    .btw-sources,
    .btw-refs,
    .btw-confirm {
        grid-template-columns: minmax(0, 1fr);
    }

    .btw .card-quantity > .card-body {
        grid-template-columns: 76px minmax(0, 1fr);
        column-gap: 10px;
    }

    /* prices size to their content on a phone so a total never breaks mid-number */
    .btw .table.quantity-price-table {
        table-layout: auto;
    }

    .btw .table.quantity-price-table tr > td,
    .btw .table.quantity-price-table tr > td:not(:last-child) {
        padding: 0 6px;
        white-space: nowrap;
    }

    .btw .quantity-price-table span.total-price {
        font-size: 1rem !important;
    }

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

    .btw-field {
        grid-template-columns: minmax(0, 1fr);
        gap: 6px;
    }

    .btw-field-label {
        padding-top: 0;
    }

    .btw-field-label small {
        display: inline;
        margin-left: 6px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .btw *,
    .btw *::before,
    .btw *::after {
        transition: none !important;
    }

    .btw-busy-spinner {
        animation-duration: 2.4s;
    }
}
