/* ── Frame Builder – scoped to #frame-builder-root ─────────────────────── */

#frame-builder-root {
  max-width: 100%;
  overflow-x: hidden;
  --fb-cream:    #f7f4ef;
  --fb-warm:     #e8e0d4;
  --fb-espresso: #2c1f14;
  --fb-gold:     #c9a96e;
  --fb-gold-lt:  #e4c99a;
  --fb-text:     #3a2e24;
  --fb-muted:    #8a7f74;
  --fb-radius:   10px;
  --fb-serif:    'Cormorant Garamond', Georgia, serif;
  --fb-sans:     'DM Sans', system-ui, -apple-system, sans-serif;

  font-family: var(--fb-sans);
  font-weight: 300;
  color: var(--fb-text);
  background: var(--fb-cream);
  position: relative;
  overflow: hidden;
  margin: 0;
  padding: 0;
}

.fb-page-heading {
  font-family: var(--fb-serif);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--fb-espresso);
  text-align: center;
  padding: 4px 0 2px;
  margin: 0;
  line-height: 1.2;
}

/* ── Layout ──────────────────────────────────────────────────────────────── */
.fb-layout {
  display: grid;
  width: 100%;
  max-width: 100%;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 384px);
  /* Sit tight under the site header; avoid empty cream band above the frame */
  grid-template-rows: minmax(0, 1fr) auto;
  height: calc(100svh - 72px);
  min-height: 420px;
  overflow: hidden;
  margin: 0;
}

@media (max-width: 768px) {
  .fb-layout {
    grid-template-columns: 1fr;
    height: auto;
    overflow: visible;
  }
}

/* ── Preview panel ───────────────────────────────────────────────────────── */
.fb-preview-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  background: var(--fb-cream);
}

@media (max-width: 768px) {
  .fb-preview-panel { overflow: visible; }
}

/* ── Upload strip ────────────────────────────────────────────────────────── */
.fb-upload-strip {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 10px 16px;
  border-top: 1px solid var(--fb-warm);
}

.fb-upload-prompt {
  margin: 0;
  font-family: var(--fb-serif);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--fb-espresso);
  letter-spacing: .01em;
}

.fb-upload-btn {
  flex: 0 0 auto;
  padding: 8px 18px;
  border: none;
  border-radius: var(--fb-radius);
  background: var(--fb-espresso);
  color: #fff;
  font-family: var(--fb-sans);
  font-size: .82rem;
  letter-spacing: .04em;
  cursor: pointer;
}

.fb-upload-btn:hover { background: #3d2e22; }
.fb-upload-strip.drag-over { background: #fff; }

/* ── Frame preview ───────────────────────────────────────────────────────── */
.fb-view-toggle {
  flex: 0 0 auto;
  display: flex;
  align-self: center;
  margin: 12px 0 0;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--fb-warm);
}
.fb-preview-wrap {
  flex: 1 1 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 20px;
  overflow: hidden;
  position: relative;
  min-width: 0;
  min-height: 0;
  max-width: 100%;
}

.fb-preview-wrap img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}

/* Fit the whole frame in the panel — never crop top/bottom */
canvas.fb-custom-preview {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

.fb-preview-wrap img.fb-shadow {
  box-shadow: 0 6px 28px rgba(44,31,20,.13);
}

.fb-preview-wrap .fb-preview-overlay {
  position: absolute;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  transform: translate(-50%, -50%);
  pointer-events: none;
  max-width: 90%;
}
.fb-preview-wrap .fb-preview-overlay[hidden] { display: none; }
.fb-preview-wrap .fb-watermark {
  width: 100%;
  color: var(--fb-espresso);
  opacity: 0.72;
  filter: drop-shadow(0 0 1.5px rgba(247, 244, 239, 0.95));
  pointer-events: none;
  line-height: 0;
}
.fb-preview-wrap .fb-watermark svg {
  display: block;
  width: 100%;
  height: auto;
  margin: 0 auto;
  overflow: visible;
}
.fb-preview-wrap .fb-watermark .fb-wm-strand {
  font-family: var(--fb-sans), Helvetica Neue, Arial, sans-serif;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.06em;
}
.fb-preview-wrap .fb-watermark .fb-wm-framing {
  font-family: var(--fb-sans), Helvetica Neue, Arial, sans-serif;
  font-size: 22px;
  font-weight: 300;
  letter-spacing: 0.16em;
}
/* Keep upload under the logo without shifting the logo off-centre */
.fb-preview-wrap .fb-preview-upload {
  position: absolute;
  top: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: auto;
  text-align: center;
  white-space: nowrap;
}
.fb-preview-wrap .fb-preview-upload-prompt {
  margin: 0;
  font-family: var(--fb-serif);
  font-size: clamp(.95rem, 2.2vw, 1.15rem);
  font-weight: 600;
  color: var(--fb-espresso);
  letter-spacing: .01em;
  text-shadow: 0 0 8px rgba(247, 244, 239, .95), 0 1px 2px rgba(247, 244, 239, .9);
}
.fb-preview-wrap .fb-preview-upload-btn {
  box-shadow: 0 2px 10px rgba(44, 31, 20, .18);
}

@media (max-width: 768px) {
  .fb-preview-wrap {
    flex: 0 0 auto;
    height: 56vw;
    min-height: 200px;
    padding: 12px 14px;
  }
  /* The opening is too small for the logo and the upload control.
     Keep the logo in the frame and use the strip under the preview. */
  .fb-preview-wrap .fb-preview-upload { display: none; }
  .fb-upload-strip {
    background: var(--fb-cream);
    flex-wrap: wrap;
    row-gap: 8px;
    padding: 8px 16px 16px;
  }
}

.fb-error {
  color: #c0392b;
  font-size: .88rem;
  padding: 12px;
}

.fb-ext-size {
  flex: 0 0 auto;
  text-align: center;
  font-size: .72rem;
  color: var(--fb-muted);
  letter-spacing: .04em;
  padding: 4px 14px 8px;
  margin: 0;
  min-height: 1.4em;
}

/* ── Controls panel ──────────────────────────────────────────────────────── */
.fb-controls {
  background: #fff;
  border-left: 1px solid var(--fb-warm);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
  overflow-y: auto;
}

.fb-controls::-webkit-scrollbar { width: 4px; }
.fb-controls::-webkit-scrollbar-thumb { background: var(--fb-warm); border-radius: 2px; }

.fb-section {}

.fb-section-hd {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.fb-section-hd--with-name {
  flex-wrap: wrap;
  gap: 4px 8px;
}

.fb-selected-name-inline {
  flex: 1 1 auto;
  min-width: 0;
  font-size: .8rem;
  color: var(--fb-espresso, #2c1f14);
  font-weight: 500;
  text-align: left;
  order: 1;
  width: 100%;
  margin-top: 2px;
}

.fb-section-hd--with-name .fb-section-title { order: 0; }
.fb-section-hd--with-name .fb-price { order: 2; }

.fb-section-title {
  font-family: var(--fb-serif);
  font-size: .95rem;
  font-weight: 600;
  color: var(--fb-espresso);
  letter-spacing: .03em;
}

.fb-price {
  font-size: .74rem;
  color: var(--fb-gold);
  font-weight: 500;
  min-width: 48px;
  text-align: right;
}

.fb-selected-name {
  font-size: .8rem;
  color: var(--fb-espresso, #2c1f14);
  margin: 2px 0 8px 0;
  line-height: 1.35;
  min-height: 1.2em;
  font-weight: 500;
}

/* ── Corner tile grid ────────────────────────────────────────────────────── */
.fb-corner-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, 180px);
  gap: 12px;
  max-height: none;
  overflow-y: auto;
  scrollbar-gutter: stable;
  padding: 2px;
}

.fb-corner-grid::-webkit-scrollbar { width: 4px; }
.fb-corner-grid::-webkit-scrollbar-thumb { background: var(--fb-warm); border-radius: 2px; }

.fb-corner-tile {
  width: 180px;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0,0,0,.1);
  border: 2px solid transparent;
  transition: border-color .15s, transform .15s, box-shadow .15s;
  background: var(--fb-cream);
  display: flex;
  flex-direction: column;
  align-items: center;
}
.fb-corner-tile:hover { transform: scale(1.05); box-shadow: 0 3px 10px rgba(0,0,0,.15); }
.fb-corner-tile.active { border-color: var(--fb-gold) !important; }
.fb-corner-tile img { width: 180px; height: 180px; object-fit: contain; background: #fff; display: block; }
.fb-corner-canvas { width: 180px; height: 180px; display: block; }

.fb-corner-name {
  font-size: .78rem;
  color: var(--fb-muted);
  text-align: center;
  padding: 3px 4px;
  line-height: 1.2;
  word-break: break-word;
  max-width: 100%;
}

.fb-corner-tile.active .fb-corner-name { color: var(--fb-gold); }
.fb-corner-size {
  font-size: .84rem;
  font-weight: 600;
  color: var(--fb-espresso);
  text-align: center;
  padding: 6px 6px 0;
  line-height: 1.3;
}
.fb-corner-price {
  font-size: .84rem;
  font-weight: 500;
  color: var(--fb-espresso);
  text-align: center;
  padding: 0 6px 8px;
  line-height: 1.2;
}
.fb-corner-tile.is-limited { opacity: .45; }
.fb-spacer-pop {
  position: fixed;
  z-index: 10040;
  width: 250px;
  background: #fff;
  border: 1px solid var(--fb-warm);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,.16);
  padding: 8px 8px 10px;
  pointer-events: none;
}
.fb-spacer-pop[hidden] { display: none; }
.fb-spacer-pop svg,
.fb-spacer-pop .fb-profile-photo { width: 100%; height: auto; display: block; border-radius: 4px; }
.fb-spacer-pop p {
  margin: 4px 0 0;
  text-align: center;
  font-size: .8rem;
  font-weight: 600;
  color: var(--fb-espresso);
}
.fb-moul-price-note {
  margin: 0 0 10px;
  font-size: .78rem;
  color: var(--fb-muted);
}
.fb-modal-overlay--warn { z-index: 10050; }
.fb-modal--warn { width: min(480px, 96vw); }
.fb-modal--warn .fb-modal-hd { gap: 10px; }
.fb-warn-icon {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  color: var(--fb-gold);
  display: flex;
}
.fb-warn-icon svg { width: 28px; height: 28px; }
.fb-warn-copy {
  margin: 0 0 14px;
  font-size: .95rem;
  line-height: 1.45;
  color: var(--fb-espresso);
}
.fb-warn-copy p { margin: 0 0 10px; }
.fb-warn-copy p:last-child { margin-bottom: 0; }
.fb-warn-scene { display: flex; justify-content: center; margin: 0 0 12px; }
.fb-warn-scene[hidden] { display: none; }
.fb-glass-break { width: 148px; height: 104px; }
.fb-glass-shake { transform-origin: 80px 56px; animation: fb-glass-shake .55s ease; }
.fb-cracks path {
  stroke-dasharray: 80;
  stroke-dashoffset: 80;
  animation: fb-crack .7s ease forwards;
}
.fb-cracks path:nth-child(2) { animation-delay: .15s; }
.fb-cracks path:nth-child(3) { animation-delay: .22s; }
.fb-cracks path:nth-child(4) { animation-delay: .3s; }
.fb-cracks path:nth-child(5) { animation-delay: .38s; }
@keyframes fb-crack { to { stroke-dashoffset: 0; } }
@keyframes fb-glass-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-2px) rotate(-0.4deg); }
  40% { transform: translateX(2px) rotate(0.4deg); }
  60% { transform: translateX(-1px); }
  80% { transform: translateX(1px); }
}
.fb-warn-choices { display: flex; flex-direction: column; gap: 8px; }
.fb-warn-choice {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border: 1px solid var(--fb-warm);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  font-family: var(--fb-sans);
  color: var(--fb-espresso);
}
.fb-warn-choice:hover { border-color: var(--fb-gold); }
.fb-warn-choice-icon {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  color: var(--fb-gold);
  display: flex;
}
.fb-warn-choice-icon svg { width: 28px; height: 28px; }
.fb-warn-choice-icon--corner {
  width: 64px;
  height: 64px;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--fb-warm);
  background: #f7f4ef;
}
.fb-warn-choice-icon--corner canvas {
  width: 100%;
  height: 100%;
  display: block;
}
.fb-warn-choice-copy { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.fb-warn-choice-copy strong { font-size: .9rem; font-weight: 500; }
.fb-warn-choice-copy span { font-size: .75rem; line-height: 1.35; color: var(--fb-muted); }

.fb-tile-none {
  width: 180px;
  height: 180px;
  background: repeating-linear-gradient(
    45deg, #e0dbd4 0, #e0dbd4 4px, #f0ece7 4px, #f0ece7 8px
  );
  display: flex;
  align-items: center;
  justify-content: center;
}

.fb-corner-none-lbl {
  font-size: .72rem;
  color: var(--fb-muted);
  letter-spacing: .06em;
  text-transform: uppercase;
}

/* ── Mount single/double toggle ──────────────────────────────────────────── */
.fb-mount-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.fb-mount-toggle {
  display: flex;
  gap: 0;
  margin-bottom: 0;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--fb-warm);
  width: fit-content;
}
.fb-mount-remove {
  padding: 4px 12px;
  font-size: .74rem;
  font-family: var(--fb-sans);
  background: transparent;
  color: var(--fb-espresso);
  border: 1px solid var(--fb-warm);
  border-radius: 6px;
  cursor: pointer;
}
.fb-mount-remove:hover { background: var(--fb-cream); }
.fb-mount-remove[hidden] { display: none; }
.fb-mount-sheet-note {
  margin: 0 0 10px;
  padding: 8px 10px;
  background: #fbf6ec;
  border: 1px solid rgba(201, 169, 110, .75);
  border-radius: 6px;
  font-size: .78rem;
  line-height: 1.4;
  color: var(--fb-espresso);
}
.fb-mount-sheet-note[hidden] { display: none; }

.fb-shape-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.fb-shape-toggle {
  display: flex;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--fb-warm);
}
.fb-shape-toggle .fb-mount-tab + .fb-mount-tab { border-left: 1px solid var(--fb-warm); }

.fb-mount-adjust {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 148px;
  gap: 14px;
  align-items: start;
}
.fb-mount-thumb-wrap {
  width: 148px;
  height: 148px;
  background: #f7f4ef;
  border: 1px solid var(--fb-warm);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.fb-mount-thumb {
  width: 148px;
  height: 148px;
  display: block;
}
@media (max-width: 640px) {
  .fb-mount-adjust { grid-template-columns: 1fr; }
  .fb-mount-thumb-wrap { width: 120px; height: 120px; }
  .fb-mount-thumb-col { flex-direction: row; align-items: center; gap: 12px; }
  .fb-mount-thumb { width: 120px; height: 120px; }
}

.fb-mount-tab {
  padding: 4px 14px;
  font-size: .74rem;
  font-family: var(--fb-sans);
  font-weight: 400;
  background: var(--fb-cream);
  color: var(--fb-muted);
  border: none;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.fb-mount-tab + .fb-mount-tab { border-left: 1px solid var(--fb-warm); }
.fb-mount-tab.active {
  background: var(--fb-espresso);
  color: var(--fb-gold-lt);
}

.fb-mount-cols.is-double {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  align-items: start;
}
.fb-mount-col-title {
  display: block;
  margin: 0 0 8px;
  font-size: .68rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--fb-muted);
}
.fb-mount-cols.is-double .fb-corner-grid {
  max-height: min(46vh, 460px);
}

.fb-section-title--sm {
  font-size: .8rem;
  color: var(--fb-muted);
}

/* ── Mat slider ──────────────────────────────────────────────────────────── */
#fb-mat-slider-wrap { margin-top: 10px; }

.fb-slider-hd {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 6px;
}

.fb-slider-lbl { font-size: .72rem; color: var(--fb-muted); }
.fb-slider-val { font-size: .78rem; font-weight: 500; color: var(--fb-gold); }

.fb-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 2px;
  background: var(--fb-warm);
  outline: none;
  cursor: pointer;
}
.fb-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--fb-gold);
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,.2);
  cursor: pointer;
}
.fb-slider::-moz-range-thumb {
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--fb-gold);
  border: 2px solid #fff;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0,0,0,.2);
}

/* ── Select ──────────────────────────────────────────────────────────────── */
.fb-select {
  width: 100%;
  height: 40px;
  min-height: 40px;
  max-height: 40px;
  box-sizing: border-box;
  font-size: .82rem;
  font-family: var(--fb-sans);
  line-height: 1.2;
  padding: 6px 10px;
  border: 1px solid var(--fb-warm);
  border-radius: 6px;
  background: var(--fb-cream);
  color: var(--fb-text);
  cursor: pointer;
}
.fb-select:focus {
  outline: none;
  border-color: var(--fb-gold);
  box-shadow: 0 0 0 3px rgba(201,169,110,.15);
}
.fb-moul-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 6px;
}
.fb-moul-search,
.fb-moul-filter,
.fb-moul-sort,
.fb-moul-spacer {
  flex: 1 1 160px;
  align-self: center;
  width: auto;
  min-width: 0;
  height: 40px;
  min-height: 40px;
  max-height: 40px;
  margin-bottom: 0;
  font-size: .78rem;
}
.fb-moul-spacer[hidden] { display: none; }
.fb-moul-search {
  flex: 1 1 220px;
  font-family: var(--fb-sans);
  font-size: .82rem;
  padding: 6px 10px;
  border: 1px solid var(--fb-warm);
  border-radius: 6px;
  background: #fff;
  color: var(--fb-text);
  box-sizing: border-box;
}
.fb-moul-search:focus {
  outline: none;
  border-color: var(--fb-gold);
  box-shadow: 0 0 0 3px rgba(201,169,110,.15);
}
@media (max-width: 640px) {
  .fb-moul-tools { flex-direction: column; align-items: stretch; }
  .fb-moul-search,
  .fb-moul-filter,
  .fb-moul-sort,
  .fb-moul-spacer {
    flex: 0 0 auto;
    align-self: stretch;
    width: 100%;
  }
}

/* ── Frame sizes panel ───────────────────────────────────────────────────── */
.fb-sizes-panel {
  padding: 8px 10px;
  background: var(--fb-cream);
  border: 1px solid var(--fb-warm);
  border-radius: var(--fb-radius);
}
.fb-size-line {
  margin: 0;
  font-size: .75rem;
  color: var(--fb-muted);
  letter-spacing: .03em;
  line-height: 1.6;
  min-height: 1.2em;
}

/* ── Component rows ──────────────────────────────────────────────────────── */
.fb-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.fb-option {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 8px 8px 8px 8px;
  background: #fff;
  border: 1px solid var(--fb-warm);
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  font-family: var(--fb-sans);
  color: inherit;
  transition: border-color .15s, box-shadow .15s;
}
.fb-option:hover {
  border-color: var(--fb-gold);
  box-shadow: 0 1px 6px rgba(44, 31, 20, .06);
}
.fb-option[hidden] { display: none; }
.fb-option.is-disabled,
.fb-option:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  box-shadow: none;
  background: #f3f0eb;
}
.fb-canvas-note {
  margin: 0;
  padding: 10px 12px;
  background: #f6f1e8;
  border: 1px solid #c4a574;
  border-radius: 8px;
  color: #2c1f14;
  font-size: 0.86rem;
  line-height: 1.4;
}
.fb-canvas-note[hidden] { display: none; }
.fb-option.is-disabled:hover {
  border-color: var(--fb-warm);
  box-shadow: none;
}
#frame-builder-root.is-canvas-frame #fb-mat-change-btn,
#frame-builder-root.is-canvas-frame #fb-glazing-change-btn,
#frame-builder-root.is-canvas-frame #fb-backing-change-btn,
#frame-builder-root.is-canvas-frame #fb-backing-colour-btn,
#frame-builder-root.is-canvas-frame #fb-print-change-btn,
#frame-builder-root.is-canvas-frame #fb-assembly-change-btn,
#frame-builder-root.is-canvas-frame .fb-upload-strip,
#frame-builder-root.is-canvas-frame .fb-preview-upload,
#frame-builder-root.is-any-canvas .fb-upload-strip,
#frame-builder-root.is-any-canvas .fb-preview-upload,
#frame-builder-root.is-any-canvas #fb-print-change-btn,
#frame-builder-root.is-any-canvas #fb-assembly-change-btn {
  display: none !important;
}
#frame-builder-root.is-tray-canvas #fb-mat-change-btn,
#frame-builder-root.is-tray-canvas #fb-glazing-change-btn,
#frame-builder-root.is-tray-canvas #fb-print-change-btn,
#frame-builder-root.is-tray-canvas #fb-backing-colour-btn,
#frame-builder-root.is-tray-canvas .fb-upload-strip,
#frame-builder-root.is-tray-canvas .fb-preview-upload {
  display: none !important;
}
.fb-option-swatch {
  width: 58px;
  height: 58px;
  flex-shrink: 0;
  border-radius: 7px;
  background: var(--fb-cream) center / cover no-repeat;
  border: 1px solid var(--fb-warm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--fb-serif);
  font-size: 1rem;
  color: var(--fb-espresso);
  overflow: hidden;
}
.fb-option-swatch.has-img { color: transparent; }
.fb-option-swatch-canvas {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}
.fb-option-copy {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.fb-option-kicker {
  font-size: .62rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--fb-muted);
}
.fb-option-sub {
  font-size: .72rem;
  line-height: 1.3;
  color: var(--fb-muted);
  font-weight: 400;
}
.fb-option-sub[hidden] { display: none; }
.fb-choice-price {
  display: block;
  margin-top: 2px;
  font-size: .8rem;
  font-weight: 650;
  color: var(--fb-espresso);
}
.fb-option-name {
  font-size: .88rem;
  font-weight: 500;
  color: var(--fb-espresso);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.fb-option-go {
  width: 7px;
  height: 7px;
  border-right: 1.5px solid var(--fb-gold);
  border-top: 1.5px solid var(--fb-gold);
  transform: rotate(45deg);
  flex-shrink: 0;
  margin-right: 6px;
}
.fb-sr {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

.fb-choice-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.fb-choice {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  padding: 8px 12px 8px 8px;
  border: 1px solid var(--fb-warm);
  border-radius: 8px;
  background: #fff;
  font-family: var(--fb-sans);
  font-size: .9rem;
  color: var(--fb-espresso);
  cursor: pointer;
}
.fb-choice-pic {
  width: 84px;
  height: 64px;
  flex-shrink: 0;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--fb-warm);
  background: #f4f0ea;
}
.fb-choice-pic canvas,
.fb-choice-pic img,
.fb-option-swatch canvas {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}
.fb-choice-label { flex: 1; min-width: 0; line-height: 1.3; display: flex; flex-direction: column; gap: 2px; }
.fb-choice-note { font-size: .75rem; line-height: 1.35; color: var(--fb-muted); font-weight: 400; }
.fb-choice-note--apart { display: block; margin-top: 8px; }
.fb-glaze-title { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-top: 2px; }
.fb-glaze-badge {
  display: inline-block;
  background: #9b1c1c;
  color: #fff;
  font-size: .72rem;
  font-weight: 650;
  padding: 1px 6px;
  border-radius: 3px;
  line-height: 1.3;
}
.fb-glaze-badge--info { background: #1b3a4b; }
.fb-glaze-badge--uv { background: #0d47a1; }
.fb-corner-note {
  font-size: .68rem;
  line-height: 1.3;
  color: var(--fb-muted);
  text-align: center;
  padding: 0 6px 4px;
}
.fb-choice:hover { border-color: var(--fb-gold); }
.fb-choice.is-active {
  border-color: var(--fb-gold);
  background: var(--fb-cream);
  box-shadow: inset 3px 0 0 var(--fb-gold);
}
.fb-choice--plate { cursor: default; align-items: flex-start; }
.fb-fit {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}
.fb-fit button {
  border: 1px solid var(--fb-warm);
  background: #fff;
  border-radius: 999px;
  padding: 3px 8px;
  font-family: var(--fb-sans);
  font-size: .72rem;
  color: var(--fb-espresso);
  cursor: pointer;
}
.fb-fit button.is-active {
  border-color: var(--fb-gold);
  background: var(--fb-cream);
  font-weight: 600;
}
.fb-fit button.fb-standback-btn {
  border: 0;
  border-radius: 4px;
  padding: 6px 12px;
  background: #2e7d32;
  color: #fff;
  font-size: .78rem;
  font-weight: 600;
}
.fb-fit button.fb-standback-btn:hover { background: #256528; }
.fb-fit button.fb-standback-btn--remove { background: #1565c0; }
.fb-fit button.fb-standback-btn--remove:hover { background: #0f4f99; }
.fb-modal--sheet { width: min(520px, 96vw); }

.fb-details-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 2px 2px 0;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--fb-sans);
  font-size: .72rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--fb-muted);
}
.fb-details-toggle:hover { color: var(--fb-espresso); }
.fb-pack { display: flex; flex-direction: column; gap: 8px; padding: 4px 0 8px; }
.fb-photo-sizes { display: flex; flex-direction: column; gap: 6px; padding: 8px 0 10px; }
.fb-photo-sizes[hidden] { display: none; }
.fb-photo-size-row { display: flex; align-items: center; gap: 8px; }
.fb-photo-size-lbl { min-width: 64px; font-size: .82rem; color: var(--fb-text); }
.fb-photo-size-row .fb-num { width: 72px; }
.fb-photo-size-x { color: var(--fb-muted, #8a7f72); }
.fb-photo-opening { font-size: .74rem; color: var(--fb-muted, #8a7f72); white-space: nowrap; }
.fb-photo-sizes .fb-slider-hd { margin-top: 6px; }
.fb-gap-custom { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 8px; padding: 12px 4px 4px; }
.fb-gap-custom .fb-btn-sm { align-self: flex-start; }
.fb-choice:disabled { opacity: .45; cursor: not-allowed; }
.fb-pack[hidden] { display: none; }
.fb-pack-note { margin: 0; font-size: .78rem; line-height: 1.4; color: var(--fb-muted); }
.fb-fit button:disabled { opacity: .45; cursor: not-allowed; }
.fb-details-chevron { font-size: .9rem; line-height: 1; }

/* ── Compact section (two-row) ───────────────────────────────────────────── */
.fb-section--compact {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
/* Top row: title · price · change button */
.fb-compact-hd {
  display: flex;
  align-items: center;
  gap: 6px;
}
.fb-compact-hd .fb-section-title { flex-shrink: 0; margin: 0; }
.fb-compact-hd .fb-price { flex-shrink: 0; margin-left: auto; }
.fb-compact-hd .fb-change-btn { flex-shrink: 0; margin-top: 0; }
/* Selected value row */
.fb-compact-selected {
  font-size: .8rem;
  color: var(--fb-espresso);
  font-style: italic;
  letter-spacing: .02em;
  padding: 3px 10px;
  background: var(--fb-cream);
  border-left: 2px solid var(--fb-gold);
  border-radius: 0 4px 4px 0;
  min-height: 1.6em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Picker wrap (glass / backing / hanging dropdown) ────────────────────── */
.fb-picker-wrap { margin-top: 2px; }

/* ── Change buttons ──────────────────────────────────────────────────────── */
.fb-change-btn {
  display: inline-block;
  margin-top: 4px;
  padding: 5px 14px;
  font-size: .78rem;
  font-family: var(--fb-sans);
  background: var(--fb-cream);
  border: 1px solid var(--fb-warm);
  border-radius: var(--fb-radius);
  cursor: pointer;
  color: var(--fb-espresso);
  letter-spacing: .03em;
}
.fb-change-btn:hover { background: var(--fb-warm); }

/* ── Picker modals ───────────────────────────────────────────────────────── */
.fb-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.48);
  z-index: 9999;
  align-items: center;
  justify-content: center;
}
.fb-modal-overlay.open { display: flex; }
.fb-modal {
  background: #fff;
  border-radius: 10px;
  width: min(820px, 96vw);
  max-height: 82vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 8px 40px rgba(0,0,0,0.22);
}
.fb-modal-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--fb-warm);
  flex-shrink: 0;
}
.fb-modal-title {
  font-family: var(--fb-serif);
  font-size: 1rem;
  font-weight: 600;
  color: var(--fb-espresso);
  letter-spacing: .03em;
}
.fb-modal-close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  color: var(--fb-muted);
  padding: 4px 8px;
  line-height: 1;
  border-radius: 4px;
}
.fb-modal-close:hover { color: var(--fb-espresso); background: var(--fb-cream); }
.fb-modal-body {
  overflow-y: auto;
  padding: 14px 18px;
  flex: 1;
}
.fb-corner-grid--modal {
  grid-template-columns: repeat(auto-fill, 180px);
}
.fb-corner-grid--photos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
}
#fb-moul-modal .fb-modal {
  width: min(1100px, 96vw);
  max-height: 90vh;
}
.fb-mould-row {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  margin: 0;
  padding: 4px;
  border: 2px solid transparent;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  text-align: left;
  font-family: var(--fb-sans);
  box-shadow: 0 1px 3px rgba(44,31,20,.06);
}
.fb-mould-row:hover { border-color: var(--fb-warm); }
.fb-mould-row.active { border-color: var(--fb-gold); }
.fb-grid-caption {
  grid-column: 1 / -1;
  margin: 8px 0 0;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--fb-gold);
}
.fb-grid-caption:first-child { margin-top: 0; }
.fb-mould-row.is-best {
  background: #fbf7ef;
  border-color: rgba(201, 169, 110, .9);
}
.fb-best-flag {
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 1;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--fb-gold);
  color: #fff;
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  line-height: 1.3;
}
.fb-mould-photo {
  display: block;
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  background: #ece7e0;
  border-radius: 4px;
}
.fb-mould-photo img,
.fb-mould-photo canvas {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
  background: #f0eeea;
}
.fb-mould-photo--empty {
  background: repeating-linear-gradient(
    -45deg,
    #ece7e0,
    #ece7e0 8px,
    #e4ddd4 8px,
    #e4ddd4 16px
  );
}
.fb-mould-row .fb-corner-name,
.fb-mould-row .fb-corner-size,
.fb-mould-row .fb-corner-note,
.fb-mould-row .fb-corner-price {
  text-align: left;
  padding-left: 2px;
  padding-right: 2px;
}
.fb-mould-row .fb-corner-name {
  color: var(--fb-espresso);
  font-weight: 600;
  padding-top: 6px;
  font-size: .95rem;
  line-height: 1.3;
}
.fb-mould-row .fb-corner-size {
  padding-top: 2px;
  font-size: .8rem;
  line-height: 1.35;
  color: var(--fb-muted);
  font-weight: 500;
}
.fb-canvas-badge {
  display: block;
  margin: 4px 2px 0;
  padding: 3px 6px;
  border-radius: 4px;
  background: #1b3a4b;
  color: #fff;
  font-size: .68rem;
  font-weight: 650;
  line-height: 1.35;
  text-align: left;
}
/* Canvas depth: standard navy, medium green, deep red, all sizes bronze. */
.fb-canvas-badge--deep { background: #a3302a; }
.fb-canvas-badge--medium { background: #2e5a51; }
.fb-canvas-badge--all { background: #7a5a24; }
.fb-option--locked,
.fb-option--locked:hover {
  cursor: default;
  border-color: var(--fb-warm);
  box-shadow: none;
}
.fb-option--locked[hidden] { display: none; }
.fb-depth-swatch {
  background: #1b3a4b;
  border-color: transparent;
  color: #fff;
  font-family: var(--fb-sans);
  font-size: .74rem;
  font-weight: 650;
  text-align: center;
  line-height: 1.15;
}
#fb-depth-row[data-tone="deep"] .fb-depth-swatch { background: #a3302a; }
#fb-depth-row[data-tone="medium"] .fb-depth-swatch { background: #2e5a51; }
#fb-depth-row[data-tone="all"] .fb-depth-swatch { background: #7a5a24; }
.fb-option-lock {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  margin-right: 4px;
  color: var(--fb-muted);
}
.fb-mould-row .fb-corner-note { font-size: .84rem; }
.fb-mould-row .fb-corner-price { padding-bottom: 4px; font-size: .9rem; line-height: 1.3; }
.fb-mould-row.active .fb-corner-name { color: var(--fb-gold); }
.fb-mould-row.is-limited { opacity: .45; }
.fb-corner-grid--photos .fb-tile-none {
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  box-sizing: border-box;
}
@media (max-width: 640px) {
  .fb-corner-grid--photos,
  .fb-corner-grid--modal { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.fb-modal-done-btn {
  display: block;
  width: 100%;
  margin-top: 14px;
  padding: 10px;
  background: var(--fb-gold);
  color: #fff;
  border: none;
  border-radius: var(--fb-radius);
  font-family: var(--fb-serif);
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: .04em;
}
.fb-modal-done-btn:hover { filter: brightness(1.08); }

/* ── Size inputs ─────────────────────────────────────────────────────────── */
.fb-input-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 1rem;
}

.fb-lbl {
  font-size: .95rem;
  font-weight: 600;
  color: var(--fb-espresso);
}
.fb-unit { font-size: .7rem; color: var(--fb-muted); }

.fb-unit-toggle {
  display: inline-flex;
  align-items: stretch;
  padding: 0;
  background: #fff;
  border: 1.5px solid var(--fb-espresso);
  border-radius: 6px;
  overflow: hidden;
  white-space: nowrap;
}
.fb-unit-opt {
  appearance: none;
  margin: 0;
  padding: 10px 11px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: .9rem;
  font-family: var(--fb-sans);
  font-weight: 600;
  color: var(--fb-muted);
  line-height: 1;
  transition: background .15s, color .15s;
  min-width: 2.25rem;
  text-align: center;
}
.fb-unit-opt + .fb-unit-opt {
  border-left: 1px solid var(--fb-warm);
}
.fb-unit-opt:hover:not(.is-active) {
  color: var(--fb-espresso);
  background: #f7f2ea;
}
.fb-unit-opt.is-active {
  background: var(--fb-espresso);
  color: var(--fb-gold-lt);
  cursor: default;
}

.fb-num {
  width: 52px;
  padding: 4px 6px;
  border: 1px solid var(--fb-warm);
  border-radius: 5px;
  background: var(--fb-cream);
  color: var(--fb-text);
  font-size: .82rem;
  text-align: center;
  font-family: var(--fb-sans);
  box-sizing: border-box;
}
.fb-num:focus { outline: none; border-color: var(--fb-gold); }

#fb-size-row .fb-num {
  width: auto;
  flex: 1 1 72px;
  min-width: 64px;
  padding: 10px 8px;
  border: 1.5px solid var(--fb-espresso);
  border-radius: 6px;
  background: #fff;
  color: var(--fb-espresso);
  font-size: 1.15rem;
  font-weight: 600;
}
#fb-size-row .fb-num:focus { box-shadow: 0 0 0 3px rgba(184, 149, 106, .25); }

.fb-btn-sm {
  padding: 4px 10px;
  background: var(--fb-gold);
  color: #fff;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: .78rem;
  font-family: var(--fb-sans);
  transition: background .15s;
}

#fb-size-apply {
  flex: 1 1 100%;
  width: 100%;
  padding: 10px 16px;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 600;
}
.fb-btn-sm:hover { background: var(--fb-espresso); }

.fb-remove-btn {
  margin-top: 6px;
  padding: 3px 10px;
  font-size: .72rem;
  font-family: var(--fb-sans);
  color: var(--fb-muted);
  background: transparent;
  border: 1px solid var(--fb-warm);
  border-radius: 4px;
  cursor: pointer;
  transition: color .15s, border-color .15s, background .15s;
}
.fb-remove-btn:hover { color: #c0392b; border-color: #e8b4b0; background: #fdf5f4; }
.fb-image-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.fb-image-actions .fb-remove-btn { margin-top: 6px; }
#fb-crop-again:hover { color: var(--fb-espresso); border-color: var(--fb-gold); background: #fff; }

.fb-modal--crop { width: min(720px, 96vw); }
.fb-crop-size {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
}
.fb-crop-size-label {
  font-size: .95rem;
  font-weight: 600;
  color: var(--fb-espresso);
  margin-right: 4px;
}
.fb-crop-size .fb-num {
  width: 88px;
  padding: 8px 8px;
  font-size: .95rem;
}
.fb-crop-unit {
  font-size: .9rem;
  font-weight: 600;
  color: var(--fb-espresso);
}
.fb-crop-hint {
  margin: 0 0 10px;
  font-size: .8rem;
  line-height: 1.4;
  color: var(--fb-muted);
}
.fb-crop-stage {
  display: flex;
  justify-content: center;
  background: #ece7e0;
  border-radius: 8px;
  padding: 8px;
}
.fb-crop-frame {
  position: relative;
  display: inline-block;
  max-width: 100%;
  line-height: 0;
  overflow: hidden;
  touch-action: none;
  user-select: none;
}
.fb-crop-frame img {
  display: block;
  max-width: 100%;
  max-height: 58vh;
  width: auto;
  height: auto;
  pointer-events: none;
}
.fb-crop-box {
  position: absolute;
  box-sizing: border-box;
  border: 1.5px solid #fff;
  box-shadow: 0 0 0 9999px rgba(44, 31, 20, 0.55);
  cursor: move;
  touch-action: none;
}
.fb-crop-box::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(to right, transparent 33.2%, rgba(255,255,255,.7) 33.2%, rgba(255,255,255,.7) calc(33.2% + 1px), transparent calc(33.2% + 1px), transparent 66.5%, rgba(255,255,255,.7) 66.5%, rgba(255,255,255,.7) calc(66.5% + 1px), transparent calc(66.5% + 1px)),
    linear-gradient(to bottom, transparent 33.2%, rgba(255,255,255,.7) 33.2%, rgba(255,255,255,.7) calc(33.2% + 1px), transparent calc(33.2% + 1px), transparent 66.5%, rgba(255,255,255,.7) 66.5%, rgba(255,255,255,.7) calc(66.5% + 1px), transparent calc(66.5% + 1px));
}
.fb-crop-box i {
  position: absolute;
  width: 14px;
  height: 14px;
  background: #fff;
  border: 1px solid var(--fb-espresso);
  border-radius: 2px;
  z-index: 1;
}
.fb-crop-box i[data-handle="nw"] { left: 4px; top: 4px; cursor: nwse-resize; }
.fb-crop-box i[data-handle="ne"] { right: 4px; top: 4px; cursor: nesw-resize; }
.fb-crop-box i[data-handle="sw"] { left: 4px; bottom: 4px; cursor: nesw-resize; }
.fb-crop-box i[data-handle="se"] { right: 4px; bottom: 4px; cursor: nwse-resize; }
.fb-crop-box i[data-handle="n"] { left: 50%; top: 4px; transform: translateX(-50%); cursor: ns-resize; }
.fb-crop-box i[data-handle="s"] { left: 50%; bottom: 4px; transform: translateX(-50%); cursor: ns-resize; }
.fb-crop-box i[data-handle="w"] { left: 4px; top: 50%; transform: translateY(-50%); cursor: ew-resize; }
.fb-crop-box i[data-handle="e"] { right: 4px; top: 50%; transform: translateY(-50%); cursor: ew-resize; }
.fb-crop-readout {
  margin: 8px 0 0;
  font-size: .82rem;
  color: var(--fb-espresso);
  text-align: center;
  line-height: 1.4;
}
.fb-crop-readout.is-block { color: #c0392b; font-weight: 600; }
.fb-crop-readout.is-warn { color: #9a6b12; font-weight: 600; }
.fb-crop-readout.is-ok { color: var(--fb-espresso); }
.fb-crop-readout.is-good { color: #2d7a4a; font-weight: 600; }
.fb-crop-actions { display: flex; gap: 8px; margin-top: 12px; }
.fb-crop-full {
  flex: 1;
  padding: 10px;
  background: #fff;
  color: var(--fb-espresso);
  border: 1px solid var(--fb-warm);
  border-radius: var(--fb-radius);
  font-family: var(--fb-sans);
  font-size: .82rem;
  cursor: pointer;
}
.fb-crop-full:hover { border-color: var(--fb-gold); }
.fb-crop-actions .fb-modal-done-btn { flex: 1.4; margin-top: 0; width: auto; }
.fb-crop-actions .fb-modal-done-btn:disabled,
.fb-crop-full:disabled { opacity: .6; cursor: default; }

/* ── Pricing breakdown (study each time) ──────────────────────────────────── */
.fb-pricing-breakdown {
  margin: 0;
  padding: 4px 2px 2px;
  background: transparent;
  border: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.fb-pricing-breakdown[hidden] { display: none; }

.fb-breakdown-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.82rem;
}
.fb-breakdown-row[hidden] { display: none; }

.fb-breakdown-lbl {
  color: var(--fb-muted);
}

.fb-breakdown-val {
  font-weight: 500;
  color: var(--fb-gold);
  min-width: 56px;
  text-align: right;
}

.fb-price-calc {
  grid-column: 1 / -1;
  background: #fff;
  border-top: 1px solid #e4d8c4;
  color: #44403c;
  font-size: .78rem;
  line-height: 1.35;
}
.fb-calc-toggle {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  width: 100%;
  padding: 6px 14px;
  background: #f7f4ef;
  border: none;
  cursor: pointer;
  font-family: var(--fb-sans);
  font-size: .72rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #8a8178;
}
.fb-calc-toggle:hover { color: var(--fb-espresso); }
.fb-calc-sheet-wrap { display: none; padding: 0 0 8px; overflow-x: auto; }
.fb-price-calc.is-open .fb-calc-sheet-wrap { display: block; }
.fb-calc-sheet {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}
.fb-calc-sheet th,
.fb-calc-sheet td {
  border: 1px solid #e7e0d6;
  padding: 6px 10px;
  text-align: right;
  white-space: nowrap;
}
.fb-calc-sheet th {
  background: #f6f1e8;
  font-weight: 600;
  text-align: center;
  color: #2c1f14;
}
.fb-calc-sheet .is-end {
  background: #f3eee6;
  font-weight: 650;
}
.fb-calc-note {
  margin: 6px 14px 0;
  color: #78716c;
  font-size: .72rem;
}

/* ── Quantity (drives packaging: 1–5 bubble, 6+ standard available) ─────── */
.fb-qty-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
  padding: 0 2px;
}
.fb-qty-lbl {
  font-family: var(--fb-sans);
  font-size: .85rem;
  font-weight: 500;
  color: var(--fb-espresso);
}
.fb-qty-input {
  width: 4.5rem;
  padding: 8px 10px;
  border: 1.5px solid var(--fb-warm);
  border-radius: var(--fb-radius);
  font-family: var(--fb-sans);
  font-size: .95rem;
  text-align: center;
  color: var(--fb-espresso);
  background: #fff;
}

/* ── Total row ───────────────────────────────────────────────────────────── */
.fb-total-row {
  background: var(--fb-espresso);
  color: var(--fb-gold-lt);
  border-radius: var(--fb-radius);
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 4px;
}

.fb-total-lbl {
  font-family: var(--fb-serif);
  font-size: 1.05rem;
  letter-spacing: .04em;
}

.fb-total-amt { font-size: 1.1rem; font-weight: 500; }

/* ── Add to cart button ──────────────────────────────────────────────────── */
.fb-atc-btn {
  width: 100%;
  padding: 12px;
  background: var(--fb-gold);
  color: #fff;
  border: none;
  border-radius: var(--fb-radius);
  font-size: .9rem;
  font-weight: 500;
  font-family: var(--fb-sans);
  letter-spacing: .04em;
  cursor: pointer;
  transition: background .2s;
}
.fb-atc-btn:hover:not(:disabled) { background: var(--fb-espresso); }
.fb-atc-btn:disabled { opacity: .65; cursor: not-allowed; }

.fb-controls .dispatch-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 14px 0 0;
  padding: 10px 12px;
  border: 1px solid #c7e7d1;
  border-radius: 8px;
  background: linear-gradient(90deg, #f0fff4, #f7fbff);
  color: #1f2d1f;
  font-size: 13px;
  line-height: 1.4;
  box-shadow: 0 2px 6px #1e783c14;
}
.fb-controls .dispatch-note__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #2e7d32;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  flex: 0 0 18px;
  margin-top: 2px;
  box-shadow: 0 0 0 2px #e8f5e9;
}
.fb-controls .dispatch-note__text strong {
  display: block;
  font-weight: 600;
  margin-bottom: 2px;
}

.fb-volume {
  width: 100%;
  margin: 10px 0 0;
  border-collapse: collapse;
  font-size: .75rem;
  color: var(--fb-text);
}
.fb-volume caption {
  caption-side: top;
  text-align: left;
  font-family: var(--fb-serif);
  font-size: .95rem;
  font-weight: 600;
  color: var(--fb-espresso);
  margin-bottom: 4px;
}
.fb-volume th,
.fb-volume td {
  padding: 5px 6px;
  text-align: left;
  border-bottom: 1px solid var(--fb-warm);
}
.fb-volume th {
  font-size: .62rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--fb-muted);
  font-weight: 500;
}
.fb-volume td:last-child,
.fb-volume th:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.fb-volume tbody tr.is-active {
  background: #f8f1e4;
  font-weight: 600;
  color: var(--fb-espresso);
}
.fb-volume tbody tr.is-active td {
  border-bottom-color: var(--fb-gold);
}
.fb-volume-note {
  margin: 4px 0 0;
  font-size: .78rem;
  color: var(--fb-muted);
  text-align: right;
  line-height: 1.3;
}
.fb-volume-note[hidden] { display: none; }

.fb-pallet-note {
  margin: 8px 0 0;
  padding: 8px 10px;
  background: #f8f1e4;
  border: 1px solid var(--fb-gold);
  border-radius: 6px;
  color: var(--fb-espresso);
  font-size: .78rem;
  line-height: 1.35;
  text-align: center;
}
.fb-pallet-note[hidden] { display: none; }

.fb-print {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
}
.fb-print[hidden],
.fb-assembly[hidden] { display: none; }
.fb-print-list,
.fb-assembly {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.fb-print-opt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border: 1.5px solid var(--fb-warm);
  border-radius: 6px;
  background: #fff;
  color: var(--fb-espresso);
  font-family: var(--fb-sans);
  font-size: .78rem;
  line-height: 1.3;
  text-align: left;
  cursor: pointer;
}
.fb-print-opt.is-active {
  border-color: var(--fb-gold);
  background: #f8f1e4;
}
.fb-print-opt.is-disabled,
.fb-print-opt:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  background: #f3f0eb;
}
.fb-print-opt strong { display: block; font-weight: 600; }
.fb-print-opt small {
  display: block;
  margin-top: 2px;
  color: #6b5e52;
  font-size: .72rem;
  font-weight: 400;
}
.fb-print-price { font-weight: 600; white-space: nowrap; }

.fb-atc-msg {
  font-size: .78rem;
  text-align: center;
  min-height: 1.2em;
  margin: 2px 0 0;
}
.fb-atc-msg.success { color: #2d7a4a; }
.fb-atc-msg.warn { color: #9a6b12; }
.fb-atc-msg.error { color: #c0392b; }

/* ── Loader ──────────────────────────────────────────────────────────────── */
.fb-loader {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(247,244,239,.65);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  z-index: 100;
}
.fb-loader.active { display: flex; }

.fb-spin-ring {
  width: 40px;
  height: 40px;
  border: 3px solid var(--fb-warm);
  border-top-color: var(--fb-gold);
  border-radius: 50%;
  animation: fb-spin .75s linear infinite;
}

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

/* ── Advanced borders expandable ─────────────────────────────────────────── */
.fb-advanced-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-top: 10px;
  padding: 5px 0;
  background: none;
  border: none;
  border-top: 1px dashed var(--fb-warm);
  cursor: pointer;
  font-size: .72rem;
  font-family: var(--fb-sans);
  color: var(--fb-muted);
  text-align: left;
}
.fb-advanced-toggle:hover { color: var(--fb-gold); }

.fb-chevron { transition: transform .2s; flex-shrink: 0; }

.fb-advanced-body {
  display: none;
  padding-top: 8px;
}
.fb-advanced-body.open { display: block; }

.fb-border-grid {
  display: grid;
  grid-template-columns: auto 52px auto 52px;
  align-items: center;
  gap: 5px 8px;
}
/* Advanced borders as a plus: Top above, Bottom below, Left and Right either side of a mount diagram. */
.fb-border-grid.fb-border-plus {
  grid-template-columns: 1fr auto 1fr;
  grid-template-areas: ". top ." "left mid right" ". bottom .";
  justify-items: center;
  gap: 6px 10px;
}
.fb-border-cell { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.fb-border-cell .fb-lbl { margin: 0; white-space: nowrap; }
.fb-border-cell .fb-num { width: 64px; text-align: center; }
.fb-border-cell--top { grid-area: top; }
.fb-border-cell--bottom { grid-area: bottom; }
.fb-border-cell--left { grid-area: left; justify-self: end; }
.fb-border-cell--right { grid-area: right; justify-self: start; }
.fb-border-diagram {
  grid-area: mid;
  width: 64px;
  height: 52px;
  border: 1px solid var(--fb-warm);
  background: #fff;
  padding: 9px;
  box-sizing: border-box;
}
.fb-border-diagram span { display: block; width: 100%; height: 100%; background: #e4ddd2; }

/* Frame size and image size under the mount preview. */
.fb-mount-thumb-col { display: flex; flex-direction: column; gap: 6px; }
.fb-mount-sizes { margin: 0; display: flex; flex-direction: column; gap: 2px; font-size: 12px; line-height: 1.35; color: #444; }
.fb-mount-sizes b { font-weight: 600; color: #222; margin-right: 4px; }


/* ── Advanced sections ───────────────────────────────────────────────────── */
.fb-adv-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 0 12px;
  border-top: 1px solid rgba(0,0,0,0.06);
}
.fb-adv-section:first-child { border-top: none; padding-top: 4px; }
.fb-adv-title {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fb-ink, #1a1a1a);
}
.fb-glass-adv-sizes {
  opacity: 0.85;
  font-size: 0.72rem !important;
}

/* Multi photo mounts: the 40 mm border and 25 mm gap are fixed, and there is no single picture to upload or print. */
#frame-builder-root.is-multi-photo .fb-mount-adjust-main,
#frame-builder-root.is-multi-photo #fb-print-change-btn,
#frame-builder-root.is-multi-photo .fb-upload-strip,
#frame-builder-root.is-multi-photo .fb-preview-upload {
  display: none !important;
}
