/* Build-a-box. Original code. */
build-a-box { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 28px; max-width: 1200px; margin: 24px auto; padding: 0 16px; align-items: start; }
.bab-head { grid-column: 1 / -1; }
.bab-head h1 { margin: 0; font-size: 32px; letter-spacing: -.02em; }
.bab-head p { margin: 4px 0 0; color: var(--muted); }
.bab-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; }
.bab-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 8px; transition: border-color .2s, box-shadow .2s; }
.bab-card.in-box { border-color: var(--text); box-shadow: 0 0 0 1px var(--text); }
.bab-art { aspect-ratio: 1; border-radius: 8px; background: #f1ede8; display: grid; place-items: center; position: relative; }
.bab-art svg { width: 60%; height: 60%; }
.bab-badge { position: absolute; top: 8px; left: 8px; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; background: #fff; padding: 2px 6px; border-radius: 4px; }
.bab-card h3 { font-size: 14px; margin: 0; font-weight: 600; }
.bab-card .price { font-size: 13px; color: var(--muted); }
.bab-stepper { display: grid; grid-template-columns: 38px 1fr 38px; align-items: center; background: var(--text); color: #fff; border-radius: 8px; overflow: hidden; }
.bab-stepper button { background: none; border: 0; color: #fff; height: 38px; cursor: pointer; font-size: 18px; }
.bab-stepper span { text-align: center; font-size: 13px; }
.bab-card .btn { padding: 9px; font-size: 13px; }

.bab-box { position: sticky; top: 64px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 16px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; min-width: 0; }
.bab-slots > * { min-width: 0; }
.bab-box h2 { font-size: 16px; margin: 0; display: flex; justify-content: space-between; }
.bab-meter { position: relative; height: 8px; background: var(--border); border-radius: 4px; }
.bab-meter .fill { position: absolute; inset: 0 auto 0 0; background: var(--accent); border-radius: 4px; transition: width .5s cubic-bezier(.2,.7,.2,1); }
.bab-meter .mark { position: absolute; top: -4px; width: 16px; height: 16px; margin-left: -8px; border-radius: 50%; background: #fff; border: 2px solid var(--border); font-size: 0; transition: border-color .3s, background .3s; }
.bab-meter .mark.hit { border-color: var(--accent); background: var(--accent); }
.bab-marks { position: relative; height: 16px; font-size: 10px; color: var(--muted); }
.bab-marks span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.bab-msg { font-size: 13px; background: #eef4f1; color: #1f4a3d; padding: 8px 10px; border-radius: 8px; }
.bab-slots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.bab-slot { aspect-ratio: 1; border: 1.5px dashed var(--border); border-radius: 10px; display: grid; place-items: center; position: relative; font-size: 11px; color: var(--muted); background: var(--bg); }
.bab-slot.filled { border-style: solid; background: #f1ede8; animation: bab-pop .35s cubic-bezier(.3,1.5,.5,1); }
.bab-slot svg { width: 56%; height: 56%; }
.bab-slot .x { position: absolute; top: 2px; right: 2px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: #fff; cursor: pointer; font-size: 12px; box-shadow: 0 1px 3px rgba(0,0,0,.15); }
.bab-slot.gift { border-color: #c9a227; background: #fbf6e6; text-align: center; padding: 4px; }
.bab-slot.gift.unlocked { border-style: solid; animation: bab-pop .5s cubic-bezier(.3,1.5,.5,1); }
@keyframes bab-pop { 0% { transform: scale(.7); } 100% { transform: none; } }
.bab-ready { display: flex; gap: 6px; flex-wrap: wrap; }
.bab-ready button { border: 1px solid var(--border); background: #fff; border-radius: 999px; padding: 6px 10px; font-size: 12px; cursor: pointer; }
.bab-tools { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; }
.bab-tools button { border: 0; background: none; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; letter-spacing: .06em; text-transform: uppercase; }
.bab-tools [data-clear] { color: var(--muted); }
.bab-wrap { display: grid; gap: 6px; font-size: 13px; }
.bab-wrap em { font-style: normal; color: var(--muted); }
.bab-wrap textarea { font: inherit; padding: 8px; border: 1px solid var(--border); border-radius: 8px; resize: vertical; }
.bab-note { margin: -6px 0 0; font-size: 12px; color: var(--muted); text-align: center; }
.bab-done { border: 1px solid #a9d3b8; background: #eef7f1; border-radius: 10px; padding: 12px; font-size: 13px; }
.bab-done p { margin: 4px 0 0; }
.bab-done button { border: 0; background: none; padding: 0; cursor: pointer; text-decoration: underline; font: inherit; }
.bab-toast { position: fixed; left: 50%; bottom: 24px; z-index: 60; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  display: flex; gap: 14px; align-items: center; background: #111; color: #fff; border-radius: 999px; padding: 10px 18px; font-size: 13px; transition: opacity .25s, transform .25s; }
.bab-toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.bab-toast button { border: 0; background: none; color: #fff; cursor: pointer; text-decoration: underline; letter-spacing: .08em; text-transform: uppercase; font-size: 11px; }
@media (max-width: 899px) { .bab-toast { bottom: 76px; } }
.bab-totals { display: grid; gap: 4px; font-size: 14px; }
.bab-totals div { display: flex; justify-content: space-between; }
.bab-totals .save { color: var(--accent); }
.bab-totals .total { font-weight: 700; font-size: 18px; }
.bab-totals s { color: var(--muted); font-weight: 400; margin-right: 6px; font-size: 14px; }
.bab-status { font-size: 13px; min-height: 1.2em; color: var(--accent); }

.bab-qv { border: 0; border-radius: 14px; padding: 0; width: min(520px, calc(100% - 32px)); }
.bab-qv::backdrop { background: rgba(0,0,0,.35); }
.bab-qv-inner { display: grid; grid-template-columns: 180px 1fr; gap: 16px; padding: 18px; }
.bab-qv .opts { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0 16px; }
.bab-qv .opts button { border: 1px solid var(--border); background: #fff; border-radius: 8px; padding: 8px 12px; cursor: pointer; }
.bab-qv .opts button[aria-pressed=true] { background: var(--text); color: #fff; }

.bab-mini { display: none; }
@media (max-width: 899px) {
  build-a-box { grid-template-columns: 1fr; }
  .bab-box { position: static; }
  .bab-mini { display: flex; position: fixed; left: 8px; right: 8px; bottom: 8px; z-index: 40; background: var(--text); color: #fff; border-radius: 12px; padding: 10px 14px; justify-content: space-between; align-items: center; font-size: 14px; box-shadow: 0 8px 24px rgba(0,0,0,.25); }
  .bab-mini a { color: #fff; font-weight: 600; }
  .bab-qv-inner { grid-template-columns: 1fr; }
}
