/* Scoped to .eb-bd so this never leaks tokens into the merchant's theme.
   Text tokens are tuned for WCAG 2.1 AA (>= 4.5:1) on every surface they sit
   on, including the brass-tinted selected states: --eb-muted, --eb-low and
   --eb-error were darkened (light) / lightened (dark) just enough to clear it. */
.eb-bd {
  --eb-bg: #f4f2ec;
  --eb-surface: #ffffff;
  --eb-surface-2: #ece9e1;
  --eb-ink: #211d18;
  --eb-muted: #655e53;
  --eb-line: #ddd7c9;
  --eb-steel-1: #f2f3f5;
  --eb-steel-2: #c7ccd3;
  --eb-steel-3: #8b929c;
  --eb-steel-4: #565d67;
  --eb-brass: #a97e3f;
  --eb-focus: #2f6f5e;
  --eb-low: #964816;
  --eb-error: #b3432f;

  font-family: "Archivo", ui-sans-serif, system-ui, sans-serif;
  color: var(--eb-ink);
  max-width: 100%;
}
@media (prefers-color-scheme: dark) {
  .eb-bd:not([data-eb-theme="light"]) {
    --eb-bg: #17140f;
    --eb-surface: #211d17;
    --eb-surface-2: #2a2620;
    --eb-ink: #f1ede2;
    --eb-muted: #aba290;
    --eb-line: #3a352b;
    --eb-steel-1: #3a3d42;
    --eb-steel-2: #5a6067;
    --eb-steel-3: #868d97;
    --eb-steel-4: #c2c7cf;
    --eb-brass: #c99a51;
    --eb-focus: #5fae97;
    --eb-low: #e0a15a;
    --eb-error: #d67463;
  }
}
.eb-bd * { box-sizing: border-box; }
/* Themes colour bare h1-h6 themselves (Horizon: `h2 { color: var(--color) }`,
   black inside a section with a background set), which beats inheriting from
   .eb-bd and left the step titles black on the dark panels. Pin them to ink. */
.eb-bd h2 { font-family: "Fraunces", Georgia, serif; text-wrap: balance; color: var(--eb-ink); }

.eb-bd .eb-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
@media (max-width: 760px) { .eb-bd .eb-layout { grid-template-columns: 1fr; } }

.eb-bd .eb-steps { display: flex; flex-direction: column; gap: 16px; }
.eb-bd .eb-panel { background: var(--eb-surface); border: 1px solid var(--eb-line); border-radius: 12px; padding: 16px 18px 18px; }
.eb-bd .eb-panel[hidden] { display: none; }
.eb-bd .eb-step-head { display: flex; align-items: center; gap: 9px; margin-bottom: 10px; }
.eb-bd .eb-step-num { min-width: 22px; height: 22px; padding: 0 6px; box-sizing: border-box; border-radius: 11px; font-variant-numeric: tabular-nums; background: var(--eb-surface-2); color: var(--eb-muted); font-size: 11px; font-weight: 600; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.eb-bd .eb-panel h2 { font-size: 16px; font-weight: 600; margin: 0; }

.eb-bd .eb-field-label { display: block; font-size: 11px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--eb-muted); margin-bottom: 6px; }
.eb-bd input[type="text"], .eb-bd textarea {
  width: 100%; background: var(--eb-surface-2); border: 1px solid var(--eb-line); border-radius: 8px;
  padding: 10px 12px; font-size: 15px; color: var(--eb-ink); font-family: inherit;
}
.eb-bd input[type="text"]:focus-visible, .eb-bd textarea:focus-visible, .eb-bd .eb-quote-card:focus-within { outline: 2px solid var(--eb-focus); outline-offset: 1px; }

/* Step 1's "where does the quote come from" choice: two native radios styled
   as cards (arrow keys move between them), each showing its own flow below. */
.eb-bd .eb-source { border: none; margin: 0 0 14px; padding: 0; min-width: 0; }
.eb-bd .eb-source-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px; }
.eb-bd .eb-source-option {
  display: flex; gap: 10px; align-items: flex-start; min-height: 44px; padding: 11px 13px; cursor: pointer;
  border: 1px solid var(--eb-line); border-radius: 9px; background: var(--eb-surface-2);
}
.eb-bd .eb-source-option:hover { border-color: var(--eb-steel-3); }
.eb-bd .eb-source-option:has(input:checked) { border-color: var(--eb-brass); background: color-mix(in srgb, var(--eb-brass) 10%, var(--eb-surface-2)); }
.eb-bd .eb-source-option:has(input:focus-visible) { outline: 2px solid var(--eb-focus); outline-offset: 1px; }
.eb-bd .eb-source-option input[type="radio"] { margin: 3px 0 0; accent-color: var(--eb-brass); flex-shrink: 0; }
.eb-bd .eb-source-text { display: flex; flex-direction: column; gap: 3px; }
.eb-bd .eb-source-title { font-size: 14px; font-weight: 500; }
.eb-bd .eb-source-hint { font-size: 12px; color: var(--eb-muted); line-height: 1.4; }
.eb-bd .eb-source-flow[hidden] { display: none; }
.eb-bd.eb-source-own [data-eb-char-panel], .eb-bd.eb-source-own [data-eb-quote-panel] { display: none; }
.eb-bd textarea.eb-own-quote { min-height: 84px; resize: vertical; font-family: "Cormorant Garamond", Georgia, serif; font-style: italic; font-size: 17px; }
.eb-bd .eb-own-count { font-size: 11.5px; color: var(--eb-muted); text-align: right; margin-top: 4px; font-variant-numeric: tabular-nums; }
.eb-bd .eb-own-status { font-size: 12px; color: var(--eb-muted); margin: 4px 0 0; }
.eb-bd .eb-own-status:empty { display: none; }
.eb-bd .eb-own-status.eb-own-warn { color: var(--eb-error); }
.eb-bd .eb-own-speaker-label { margin-top: 14px; }
/* Step 8: the optional pet portrait. */
.eb-bd .eb-pet-toggle { display: flex; gap: 10px; align-items: flex-start; min-height: 44px; padding: 10px 0 4px; cursor: pointer; font-size: 14px; font-weight: 500; }
.eb-bd .eb-pet-toggle input[type="checkbox"] { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--eb-brass); flex-shrink: 0; }
.eb-bd .eb-pet-toggle input[type="checkbox"]:focus-visible { outline: 2px solid var(--eb-focus); outline-offset: 2px; }
.eb-bd .eb-pet-toggle:has(input:disabled) { cursor: not-allowed; color: var(--eb-muted); }
.eb-bd .eb-pet-unavailable { font-size: 12.5px; color: var(--eb-muted); margin: 6px 0 0; }
.eb-bd .eb-pet-unavailable:empty { display: none; }
.eb-bd .eb-pet-body { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--eb-line); }
.eb-bd .eb-pet-body[hidden], .eb-bd .eb-pet-images[hidden], .eb-bd .eb-pet-img[hidden], .eb-bd .eb-pet-actions [hidden] { display: none; }
.eb-bd .eb-pet-hint { margin: -2px 0 8px; }
.eb-bd .eb-pet input[type="file"] {
  width: 100%; background: var(--eb-surface-2); border: 1px dashed var(--eb-line); border-radius: 8px;
  padding: 10px 12px; font-size: 13px; color: var(--eb-ink); font-family: inherit;
}
.eb-bd .eb-pet input[type="file"]:focus-visible { outline: 2px solid var(--eb-focus); outline-offset: 1px; }
.eb-bd .eb-pet-images { display: flex; gap: 10px; margin-top: 10px; }
.eb-bd .eb-pet-img { width: 96px; height: 96px; object-fit: cover; border-radius: 8px; border: 1px solid var(--eb-line); }
.eb-bd .eb-pet-art { object-fit: contain; background: #fff; }
.eb-bd .eb-pet-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 6px; }
.eb-bd .eb-pet-actions .eb-chip { min-height: 40px; }
.eb-bd .eb-visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.eb-bd .eb-search-box { position: relative; }
.eb-bd .eb-search-results { margin-top: 8px; border: 1px solid var(--eb-line); border-radius: 9px; overflow: hidden; background: var(--eb-surface-2); }
.eb-bd .eb-search-results:empty, .eb-bd .eb-search-results[hidden] { display: none; }
.eb-bd .eb-result-row { display: flex; flex-direction: column; padding: 9px 12px; cursor: pointer; border-bottom: 1px solid var(--eb-line); }
.eb-bd .eb-result-row:last-child { border-bottom: none; }
.eb-bd .eb-result-row:hover, .eb-bd .eb-result-row:focus-visible { background: color-mix(in srgb, var(--eb-brass) 12%, var(--eb-surface-2)); }
.eb-bd .eb-result-row .eb-rtitle { font-size: 14px; font-weight: 500; }
.eb-bd .eb-result-row .eb-rauthor { font-size: 11.5px; color: var(--eb-muted); }
.eb-bd .eb-result-row .eb-rnote { font-size: 10.5px; color: var(--eb-muted); font-style: italic; margin-top: 2px; }
.eb-bd .eb-result-row.eb-custom-row { font-style: italic; color: var(--eb-muted); }
.eb-bd .eb-current-book { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; padding: 9px 12px; border-radius: 8px; background: color-mix(in srgb, var(--eb-brass) 10%, var(--eb-surface-2)); border: 1px solid var(--eb-brass); }
.eb-bd .eb-current-book[hidden] { display: none; }
.eb-bd .eb-current-book button { background: none; border: none; color: var(--eb-muted); font-size: 11.5px; cursor: pointer; text-decoration: underline; font-family: inherit; }

.eb-bd .eb-ai-note { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--eb-muted); margin: 2px 0 10px; }
.eb-bd .eb-ai-note[hidden] { display: none; }
.eb-bd .eb-ai-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--eb-focus); flex-shrink: 0; }
.eb-bd .eb-ai-dot.eb-pulsing { animation: eb-pulse 1s ease-in-out infinite; }
@keyframes eb-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }
@media (prefers-reduced-motion: reduce) { .eb-bd .eb-ai-dot.eb-pulsing { animation: none; } }

.eb-bd .eb-chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.eb-bd .eb-chip {
  border: 1px solid var(--eb-line); background: var(--eb-surface-2); border-radius: 999px;
  padding: 8px 14px; cursor: pointer; font-size: 13.5px; color: var(--eb-ink); font-family: inherit;
}
.eb-bd .eb-chip.eb-active { border-color: var(--eb-brass); background: color-mix(in srgb, var(--eb-brass) 16%, var(--eb-surface-2)); }
.eb-bd .eb-chip[disabled] { opacity: 0.4; cursor: not-allowed; }

.eb-bd .eb-step-sub { font-size: 12.5px; color: var(--eb-muted); margin: -4px 0 10px; }

/* The occasion arrives by link from the store, so the only trace of it in the
   designer is the popular-pick suggestion under the book search. */
.eb-bd .eb-occasion-suggestion { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; font-size: 12.5px; color: var(--eb-muted); }
.eb-bd .eb-copyright-notice {
  margin-top: 10px; padding: 10px 13px; border-radius: 8px;
  background: var(--eb-surface-2); border: 1px solid var(--eb-line); border-left: 3px solid var(--eb-steel-3);
  font-size: 12.5px; line-height: 1.5; color: var(--eb-muted);
}
.eb-bd .eb-copyright-notice[hidden] { display: none; }
.eb-bd .eb-copyright-notice b { color: var(--eb-ink); font-weight: 600; }
.eb-bd .eb-occasion-suggestion[hidden] { display: none; }
.eb-bd .eb-occasion-suggestion-chip { padding: 5px 12px; font-size: 12px; }

.eb-bd .eb-swatch-btn.eb-occasion-match { border-color: var(--eb-occasion-accent, var(--eb-brass)); }

.eb-bd .eb-quote-list { display: flex; flex-direction: column; gap: 9px; margin-top: 4px; }
.eb-bd .eb-quote-card {
  display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--eb-line); border-radius: 9px;
  padding: 11px 13px; cursor: pointer; background: var(--eb-surface-2);
}
.eb-bd .eb-quote-card:hover { border-color: var(--eb-steel-3); }
.eb-bd .eb-quote-card.eb-active { border-color: var(--eb-brass); background: color-mix(in srgb, var(--eb-brass) 10%, var(--eb-surface-2)); }
.eb-bd .eb-quote-card input[type="radio"] { margin-top: 4px; accent-color: var(--eb-brass); flex-shrink: 0; }
.eb-bd .eb-quote-card .eb-qtext { font-family: "Cormorant Garamond", Georgia, serif; font-style: italic; font-size: 17px; line-height: 1.4; }
.eb-bd .eb-quote-card .eb-qmeta { font-size: 11.5px; color: var(--eb-muted); margin-top: 4px; font-family: "Archivo", sans-serif; font-style: normal; }
.eb-bd .eb-quote-card.eb-custom-card { flex-direction: column; }
.eb-bd .eb-quote-card.eb-custom-card .eb-custom-head { display: flex; gap: 9px; align-items: center; width: 100%; cursor: pointer; }
.eb-bd .eb-quote-card textarea { margin-top: 9px; min-height: 64px; resize: vertical; font-family: "Cormorant Garamond", Georgia, serif; font-style: italic; font-size: 16px; }
.eb-bd .eb-char-count { font-size: 10.5px; color: var(--eb-muted); text-align: right; margin-top: 4px; }

.eb-bd .eb-swatch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 8px; margin-top: 4px; }
.eb-bd .eb-swatch-btn {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 5px 8px;
  border-radius: 10px; border: 1px solid var(--eb-line); background: var(--eb-surface-2); cursor: pointer;
  color: var(--eb-ink); font-family: inherit; font-size: 11px;
}
.eb-bd .eb-swatch-btn svg { width: 22px; height: 22px; }
.eb-bd .eb-swatch-btn svg.eb-swatch-photo { width: 44px; height: 44px; }
/* Not orderable (sold out, or not made in this finish): dimmed, greyed, inert. */
.eb-bd .eb-swatch-btn[disabled] { opacity: 0.55; cursor: not-allowed; }
.eb-bd .eb-swatch-btn[disabled] svg.eb-swatch-photo { filter: grayscale(1); }
.eb-bd .eb-swatch-btn.eb-active { border-color: var(--eb-brass); background: color-mix(in srgb, var(--eb-brass) 14%, var(--eb-surface-2)); }
.eb-bd .eb-swatch-btn .eb-price { color: var(--eb-muted); font-size: 10px; }
.eb-bd .eb-swatch-btn svg.eb-ornament-thumb { width: 64px; height: 16px; }
.eb-bd .eb-style-group + .eb-style-group { margin-top: 16px; }
.eb-bd .eb-style-note { margin: 8px 0 0; }
/* Step 6's size sliders: native ranges (arrow keys and screen readers come
   free), each at least 44px tall to grab on a phone. */
.eb-bd .eb-size-row + .eb-size-row { margin-top: 6px; }
.eb-bd .eb-size-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.eb-bd .eb-size-label { font-size: 13.5px; color: var(--eb-ink); }
.eb-bd .eb-size-value { font-size: 12px; color: var(--eb-muted); font-variant-numeric: tabular-nums; text-align: right; }
.eb-bd .eb-size-range { display: block; width: 100%; min-height: 44px; margin: 0; background: transparent; accent-color: var(--eb-brass); cursor: pointer; }
.eb-bd .eb-size-range:focus-visible, .eb-bd .eb-size-reset:focus-visible { outline: 2px solid var(--eb-focus); outline-offset: 1px; border-radius: 6px; }
.eb-bd .eb-size-clamped { font-size: 12px; color: var(--eb-muted); margin: -6px 0 4px; }
.eb-bd .eb-size-clamped[hidden] { display: none; }
.eb-bd .eb-size-reset {
  min-height: 44px; padding: 0 2px; background: none; border: none; color: var(--eb-muted);
  font-family: inherit; font-size: 12.5px; text-decoration: underline; cursor: pointer;
}
.eb-bd .eb-swatch-btn .eb-stock { font-size: 10px; font-weight: 600; }
.eb-bd .eb-swatch-btn .eb-stock-low { color: var(--eb-low); }
.eb-bd .eb-swatch-btn .eb-stock-out, .eb-bd .eb-swatch-btn .eb-stock-none { color: var(--eb-muted); }

.eb-bd .eb-preview-col { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 14px; }
.eb-bd .eb-preview-panel { background: var(--eb-surface); border: 1px solid var(--eb-line); border-radius: 12px; padding: 18px; display: flex; flex-direction: column; align-items: center; }
.eb-bd .eb-preview-panel .eb-plabel { align-self: flex-start; font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--eb-muted); margin-bottom: 12px; }
.eb-bd .eb-preview-stage { width: 100%; background: radial-gradient(120% 90% at 50% 0%, color-mix(in srgb, var(--eb-steel-3) 18%, transparent), transparent 60%), var(--eb-surface-2); border-radius: 10px; padding: 22px 10px 16px; display: flex; justify-content: center; }
/* A real bookmark is long and narrow (5:1, before its chain and charm), so the
   drawing is fitted to a height that keeps the price and Add to cart in view
   next to it, rather than to the panel's width. */
.eb-bd .eb-bookmark-svg { width: 100%; height: clamp(420px, calc(100vh - 300px), 820px); filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.18)); }

.eb-bd .eb-order-summary { background: var(--eb-surface); border: 1px solid var(--eb-line); border-radius: 12px; padding: 16px 18px; }
.eb-bd .eb-order-row { display: flex; justify-content: space-between; font-size: 13.5px; padding: 5px 0; color: var(--eb-muted); }
.eb-bd .eb-order-row.eb-total { color: var(--eb-ink); font-weight: 600; font-size: 15px; border-top: 1px solid var(--eb-line); margin-top: 5px; padding-top: 10px; }
.eb-bd .eb-order-row .eb-v { font-variant-numeric: tabular-nums; color: var(--eb-ink); }
.eb-bd .eb-add-btn {
  width: 100%; margin-top: 14px; padding: 12px 14px; border-radius: 8px; border: none;
  background: var(--eb-ink); color: var(--eb-bg); font-family: "Archivo", sans-serif; font-weight: 600;
  font-size: 14px; cursor: pointer;
}
.eb-bd .eb-add-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.eb-bd .eb-add-btn:not(:disabled):hover { opacity: 0.92; }
.eb-bd .eb-form-error { font-size: 12px; color: var(--eb-error); margin-top: 8px; text-align: center; }
