/* ==========================================================================
   /calculator/banner-creator/ — banner creator, restored 2026-10-11.
   Same page language as /calculator/signature/ (email-signature.css) and
   /calculators/hours/: the theme tokens, a 6% accent tint for surfaces, radii
   22/16/10, the contact-form field recipe, the shared .btn and the
   portfolio.css orbit. Mobile First, every rule scoped under .bc-page.

   Breakpoints: 768px (tablet), 1100px (editor and preview side by side,
   preview sticky), 1200px (orbit shown).
   ========================================================================== */

.bc-page {
  --bc-surface: color-mix(in srgb, var(--color-accent) 6%, var(--color-surface));
  --bc-error: #B3261E;
  --bc-h1: var(--h1-page);
  --bc-h2: clamp(1.375rem, 1.9vw, 1.75rem);
  --bc-h3: clamp(1.125rem, 1.6vw, 1.25rem);
  color: var(--color-text-primary);
  padding-block: var(--space-6) var(--space-12);
  overflow-x: clip;
}
.bc-container { max-width: 1600px; margin-inline: auto; padding-inline: var(--space-4); }
.bc-inner { max-width: 1200px; margin-inline: auto; }
.bc-page [hidden] { display: none !important; }

/* ---------- Intro ---------- */
.bc-intro { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-3); padding-block: var(--space-3) var(--space-6); }
.bc-breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); font-size: var(--text-xs); color: var(--color-text-secondary); }
.bc-breadcrumb a { display: inline-flex; align-items: center; min-height: 44px; margin-block: -12px; color: var(--color-text-secondary); transition: color 180ms ease; }
.bc-breadcrumb a:hover { color: var(--color-accent); }
.bc-breadcrumb [aria-current] { color: var(--color-text-primary); font-weight: var(--font-bold); }
.bc-title { margin: 0; font-size: var(--bc-h1); font-weight: var(--font-black); line-height: var(--leading-h1-page); letter-spacing: -0.01em; }
.bc-subtitle { margin: 0; font-size: var(--text-body-lg); font-weight: var(--font-bold); line-height: var(--leading-ui); color: var(--color-accent); }
.bc-lead { display: flex; flex-direction: column; gap: var(--space-2); max-width: 68ch; }
.bc-lead p { margin: 0; font-size: var(--text-body); line-height: var(--leading-lead); color: var(--color-text-secondary); }
.bc-lead .bc-lead__first { font-weight: var(--font-bold); color: var(--color-text-primary); }
.bc-page .portfolio-hero__graphic { display: none; position: absolute; inset: auto; top: 0; left: 20px; width: 180px; height: 180px; }
.bc-page .portfolio-hero__orbit { inset: 0; width: auto; height: auto; }

/* ---------- No-JS ---------- */
.bc-needs-js { margin: 0 0 var(--space-6); padding: var(--space-4) var(--space-5); border: 1px solid var(--color-border); border-radius: var(--radius-stat); background: var(--bc-surface); font-size: var(--text-md); }
.bc-js .bc-needs-js { display: none; }
html:not(.bc-js) .bc-workspace { display: none; }

/* ---------- Workspace ---------- */
.bc-workspace { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-6); align-items: start; }
.bc-card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-card); padding: var(--space-5); }
.bc-card__title { margin: 0 0 var(--space-4); font-size: var(--bc-h3); font-weight: var(--font-bold); line-height: var(--leading-heading); }

/* Tabs */
.bc-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-bottom: var(--space-5); padding: 6px; border-radius: var(--radius-stat); background: var(--bc-surface); }
.bc-tab { min-height: 44px; padding: 8px 10px; border: 0; border-radius: var(--radius-button); background: transparent; font: inherit; font-size: var(--text-sm); font-weight: var(--font-bold); color: var(--color-text-secondary); cursor: pointer; transition: background-color 160ms ease, color 160ms ease; }
.bc-tab:hover { color: var(--color-text-primary); }
.bc-tab[aria-selected="true"] { background: var(--color-surface); color: var(--color-accent); box-shadow: 0 1px 3px rgba(17, 17, 17, .08); }
.bc-tab:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
.bc-panel { display: flex; flex-direction: column; gap: var(--space-4); }
.bc-panel:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 6px; border-radius: 4px; }
.bc-group { display: flex; flex-direction: column; gap: var(--space-4); }

/* Fields: same recipe as .es-field / .hr-field / .contact-form__field */
.bc-field { display: flex; flex-direction: column; gap: var(--space-2); min-width: 0; }
.bc-field > label,
.bc-fieldset legend { font-size: var(--text-ui); font-weight: var(--font-bold); color: var(--color-text-primary); }
.bc-field input[type="text"],
.bc-field input[type="number"],
.bc-field select,
.bc-field textarea { width: 100%; min-height: 3.25rem; padding-inline: 0.875rem; border-radius: var(--radius-button); border: 1px solid var(--color-border); background: var(--color-surface); font: inherit; font-size: var(--text-ui); color: var(--color-text-primary); transition: border-color 160ms ease-out; }
.bc-field input[type="number"] { text-align: right; font-variant-numeric: tabular-nums; }
.bc-field textarea { min-height: 0; padding-block: 0.75rem; line-height: 1.5; resize: vertical; }
.bc-field input:hover,
.bc-field select:hover,
.bc-field textarea:hover { border-color: var(--color-text-secondary); }
.bc-field input:focus-visible,
.bc-field select:focus-visible,
.bc-field textarea:focus-visible { border-color: var(--color-accent); outline: 2px solid color-mix(in srgb, var(--color-accent) 30%, transparent); outline-offset: 1px; }
.bc-field input[aria-invalid="true"] { border-color: var(--bc-error); }
.bc-field__error { margin: 0; font-size: var(--text-sm); color: var(--bc-error); }
.bc-field__error:empty { display: none; }
.bc-hint { margin: 0; font-size: var(--text-xs); line-height: 1.55; color: var(--color-text-secondary); }
.bc-grid-2 { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-4); }
.bc-fieldset { display: flex; flex-direction: column; gap: var(--space-3); margin: 0; padding: 0; border: 0; min-width: 0; }
.bc-fieldset legend { padding: 0; margin-bottom: var(--space-2); }

.bc-select { position: relative; }
.bc-select select { appearance: none; -webkit-appearance: none; padding-inline-end: 2.5rem; cursor: pointer; }
.bc-select__chevron { position: absolute; inset-inline-end: 0.875rem; top: 50%; transform: translateY(-50%); color: var(--color-text-secondary); pointer-events: none; }

/* Checkboxes (native, accent-coloured, 44px targets) */
.bc-checks { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-5); }
.bc-check { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-size: var(--text-ui); cursor: pointer; }
.bc-check input { width: 20px; height: 20px; margin: 0; accent-color: var(--color-accent); cursor: pointer; flex: none; }

/* Colour pickers */
.bc-color { display: flex; align-items: center; gap: var(--space-3); min-height: 3.25rem; padding-inline: 8px 0.875rem; border: 1px solid var(--color-border); border-radius: var(--radius-button); background: var(--color-surface); }
.bc-color input[type="color"] { width: 40px; height: 40px; padding: 0; border: 0; border-radius: 8px; background: none; cursor: pointer; }
.bc-color input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.bc-color input[type="color"]::-webkit-color-swatch { border: 1px solid rgba(17, 17, 17, .12); border-radius: 8px; }
.bc-color input[type="color"]:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
.bc-color output { font-size: var(--text-sm); font-variant-numeric: tabular-nums; color: var(--color-text-secondary); }

/* Range */
.bc-range { width: 100%; min-height: 44px; margin: 0; accent-color: var(--color-accent); cursor: pointer; }
.bc-field output { font-variant-numeric: tabular-nums; }

/* File input */
.bc-file { width: 100%; padding: 10px 0; font: inherit; font-size: var(--text-sm); color: var(--color-text-secondary); }
.bc-file::file-selector-button { margin-inline-end: var(--space-3); min-height: 40px; padding: 0 16px; border: 1px solid var(--color-border); border-radius: var(--radius-button); background: var(--bc-surface); font: inherit; font-weight: var(--font-bold); color: var(--color-text-primary); cursor: pointer; }

/* Option cards: size presets */
.bc-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); }
.bc-option { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: var(--space-3) var(--space-2); border: 1px solid var(--color-border); border-radius: var(--radius-stat); background: var(--color-surface); cursor: pointer; transition: border-color 160ms ease, background-color 160ms ease; }
.bc-option:hover { border-color: var(--color-text-secondary); }
.bc-option input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.bc-option:has(input:checked) { border-color: var(--color-accent); background: var(--bc-surface); box-shadow: inset 0 0 0 1px var(--color-accent); }
.bc-option:has(input:focus-visible) { outline: 2px solid var(--color-accent); outline-offset: 2px; }
.bc-option__label { font-size: var(--text-sm); font-weight: var(--font-bold); text-align: center; font-variant-numeric: tabular-nums; }
.bc-option__sub { font-size: var(--text-xs); color: var(--color-text-secondary); text-align: center; }
.bc-option__stage { display: flex; align-items: center; justify-content: center; width: 100%; height: 44px; }
.bc-option__art { display: block; width: calc(var(--w) / 970 * 100%); height: max(6px, calc(var(--h) / 600 * 44px)); min-width: 8px; border-radius: 2px; background: color-mix(in srgb, var(--color-accent) 70%, var(--color-surface)); }

/* Add buttons and the settings of the selected element */
.bc-add { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); align-items: start; }
.bc-add__logo { grid-column: 1 / -1; }
.bc-settings { padding: var(--space-4); border: 1px solid var(--color-border); border-radius: var(--radius-stat); background: var(--bc-surface); }
.bc-settings legend { padding-inline: var(--space-2); }
.bc-settings__body { display: flex; flex-direction: column; gap: var(--space-4); }
.bc-btn--danger { color: var(--bc-error); border-color: color-mix(in srgb, var(--bc-error) 40%, var(--color-border)); }
.bc-btn--danger:hover { background: color-mix(in srgb, var(--bc-error) 8%, var(--color-surface)); color: var(--bc-error); }

/* Elements list */
.bc-layers__title { margin: 0 0 var(--space-3); font-size: var(--text-ui); font-weight: var(--font-bold); }
.bc-layers__list { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; list-style: none; }
.bc-layer { display: flex; align-items: center; gap: 4px; border: 1px solid var(--color-border); border-radius: var(--radius-stat); background: var(--color-surface); }
.bc-layer.is-selected { border-color: var(--color-accent); background: var(--bc-surface); box-shadow: inset 0 0 0 1px var(--color-accent); }
.bc-layer--empty { padding: var(--space-3) var(--space-4); font-size: var(--text-sm); color: var(--color-text-secondary); border-style: dashed; }
.bc-layer__pick { flex: 1 1 auto; min-width: 0; min-height: 44px; padding: 0 var(--space-4); border: 0; border-radius: var(--radius-stat); background: transparent; font: inherit; font-size: var(--text-sm); font-weight: var(--font-bold); text-align: start; color: var(--color-text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.bc-layer__btn { flex: none; width: 44px; height: 44px; border: 0; border-radius: var(--radius-stat); background: transparent; font: inherit; font-size: 1.125rem; color: var(--color-text-secondary); cursor: pointer; }
.bc-layer__btn:hover { background: var(--bc-surface); color: var(--color-text-primary); }
.bc-layer__pick:focus-visible,
.bc-layer__btn:focus-visible { outline: 2px solid var(--color-accent); outline-offset: -2px; }

/* Template cards */
.bc-options--templates { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.bc-template { display: flex; flex-direction: column; align-items: center; gap: var(--space-2); padding: var(--space-3) var(--space-2); border: 1px solid var(--color-border); border-radius: var(--radius-stat); background: var(--color-surface); font: inherit; color: var(--color-text-primary); cursor: pointer; transition: border-color 160ms ease, background-color 160ms ease; }
.bc-template:hover { border-color: var(--color-accent); background: var(--bc-surface); }
.bc-template:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
.bc-template__art { display: flex; flex-direction: column; justify-content: center; gap: 5px; width: 100%; height: 58px; padding: 0 12px; border-radius: 6px; background: var(--bc-tpl); }
.bc-template__art span { display: block; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, .8); }
.bc-template__art span:nth-child(1) { width: 62%; }
.bc-template__art span:nth-child(2) { width: 80%; opacity: .7; }
.bc-template__art span:nth-child(3) { width: 34%; height: 10px; background: rgba(17, 17, 17, .55); }

/* ---------- Preview ---------- */
.bc-preview { display: flex; flex-direction: column; gap: var(--space-4); min-width: 0; }
.bc-preview .bc-card__title { margin-bottom: 0; }
.bc-meta { margin: 0; font-size: var(--text-sm); color: var(--color-text-secondary); font-variant-numeric: tabular-nums; }
.bc-meta:empty { display: none; }
/* The checkerboard shows which parts of the picture are transparent. */
.bc-stage { display: flex; align-items: center; justify-content: center; padding: var(--space-3); border: 1px solid var(--color-border); border-radius: var(--radius-stat); overflow: hidden; background-color: #ffffff; background-image: conic-gradient(#e9ecf3 25%, transparent 0 50%, #e9ecf3 0 75%, transparent 0); background-size: 16px 16px; }
.bc-canvas { display: block; max-width: 100%; max-height: 70vh; width: auto; height: auto; touch-action: none; }
.bc-canvas:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 4px; }

.bc-actions { display: flex; flex-direction: column; gap: var(--space-3); }
.bc-btn { width: 100%; height: auto; min-height: 54px; padding-block: 12px; white-space: normal; text-align: center; }
.bc-status { margin: 0; min-height: 1.5em; font-size: var(--text-sm); font-weight: var(--font-bold); line-height: 1.5; color: var(--color-accent); }
.bc-status.is-error { color: var(--bc-error); }

/* ---------- How-to and design card ---------- */
.bc-howto { margin-top: var(--space-10); }
.bc-section-title { margin: 0 0 var(--space-4); font-size: var(--bc-h2); font-weight: var(--font-bold); line-height: var(--leading-heading); }
.bc-steps { display: grid; gap: var(--space-3); margin: 0; padding: 0; list-style: none; counter-reset: bc-step; }
.bc-steps li { position: relative; padding: var(--space-4); padding-inline-start: 3.5rem; border-radius: var(--radius-stat); background: var(--bc-surface); font-size: var(--text-md); line-height: var(--leading-ui); counter-increment: bc-step; }
.bc-steps li::before { content: counter(bc-step); position: absolute; inset-inline-start: var(--space-4); top: var(--space-4); display: grid; place-items: center; width: 1.75rem; height: 1.75rem; border-radius: 50%; background: var(--color-accent); color: #ffffff; font-size: var(--text-sm); font-weight: var(--font-bold); line-height: 1; }
.bc-design { display: flex; flex-direction: column; gap: var(--space-4); margin-top: var(--space-8); }
.bc-design .bc-section-title { margin-bottom: var(--space-2); font-size: var(--bc-h3); }
.bc-design__text { margin: 0; font-size: var(--text-md); line-height: var(--leading-ui); color: var(--color-text-secondary); }

/* ---------- Tablet, >=768px ---------- */
@media (min-width: 768px) {
  .bc-page { padding-block: var(--space-8) var(--space-13); }
  .bc-intro { padding-block: var(--space-5) var(--space-6); }
  .bc-card { padding: var(--space-7); }
  .bc-tabs { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .bc-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bc-options { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .bc-options--templates { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .bc-add { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bc-actions { flex-direction: row; }
  .bc-actions .bc-btn { flex: 1 1 0; }
  .bc-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bc-design { flex-direction: row; align-items: center; justify-content: space-between; }
  .bc-design__btn { width: auto; flex: none; padding-inline: var(--space-6); }
}

/* ---------- Editor and preview side by side, >=1100px ---------- */
@media (min-width: 1100px) {
  .bc-workspace { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); }
  /* A tall banner can make the card taller than the screen: it then scrolls inside itself, so the buttons stay reachable. */
  .bc-preview { position: sticky; top: calc(var(--header-h-desktop) + var(--space-4)); max-height: calc(100vh - var(--header-h-desktop) - var(--space-8)); overflow-y: auto; }
  .bc-canvas { max-height: 46vh; }
  .bc-actions { flex-direction: column; }
  .bc-steps { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (min-width: 1200px) {
  .bc-page .portfolio-hero__graphic { display: block; }
  .bc-title, .bc-lead { max-width: min(68ch, calc(100% - 220px)); }
}

@media (prefers-reduced-motion: reduce) {
  .bc-tab, .bc-option, .bc-template, .bc-field input, .bc-field select, .bc-field textarea { transition: none; }
}
