.bp-main { --max-width: 1360px; padding-top: 54px; }
.bp-intro { max-width: 860px; margin-bottom: 36px; }
.bp-intro h1 { max-width: 860px; font-size: clamp(38px, 4.6vw, 62px); line-height: 1.03; }
.bp-intro > p:last-child { max-width: 690px; font-size: 18px; }
.bp-workspace { display: grid; grid-template-columns: minmax(330px, 400px) minmax(0, 1fr); align-items: start; gap: 24px; }
.bp-toolbox { display: grid; gap: 18px; min-width: 0; }
.bp-preview { min-width: 0; }
.bp-panel, .bp-preview { padding: 20px; background: var(--paper); border: 1px solid var(--paper-line); border-radius: 22px; box-shadow: 0 8px 24px rgb(40 64 96 / 5%); }
.bp-panel-heading { display: flex; gap: 9px; align-items: center; margin-bottom: 14px; }
.bp-panel-heading h2 { margin: 0; font-size: 17px; line-height: 1.3; letter-spacing: -.035em; }
.bp-step { display: grid; width: 24px; height: 24px; flex: 0 0 auto; place-items: center; background: var(--page); color: var(--blue-deep); border-radius: 8px; font-size: 12px; font-weight: 750; }
.bp-hint { margin: 0 0 12px; color: var(--muted); font-size: 12px; line-height: 1.6; }

.bp-designs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.bp-design { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; padding: 8px 4px 9px; border: 1px solid var(--paper-line); border-radius: 14px; background: var(--page); cursor: pointer; transition: border-color .15s, background .15s; }
.bp-design:hover { border-color: var(--blue); }
.bp-design input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.bp-design:has(input:checked) { border-color: var(--blue); background: color-mix(in srgb, var(--blue) 10%, var(--paper)); outline: 2px solid var(--blue); outline-offset: 1px; }
.bp-design:has(input:focus-visible) { outline: 3px solid rgb(10 132 255 / 64%); outline-offset: 3px; }
.bp-design-art { display: block; width: 100%; height: 78px; }
.bp-design-art svg { display: block; width: 100%; height: 100%; filter: drop-shadow(0 2px 3px rgb(30 45 70 / 16%)); }
.bp-design-name { max-width: 100%; color: var(--ink); font-size: 11px; font-weight: 650; line-height: 1.3; text-align: center; overflow-wrap: anywhere; }

.bp-fields { display: grid; gap: 12px; margin-bottom: 18px; }
.bp-field, .bp-sheet-controls label { display: grid; gap: 5px; color: var(--muted); font-size: 12px; font-weight: 650; }
.bp-field { grid-template-columns: 1fr auto; }
.bp-field input { grid-column: 1 / -1; }
.bp-optional { justify-self: end; font-weight: 500; opacity: .8; }
.bp-field input, .bp-sheet-controls select { min-width: 0; width: 100%; min-height: 42px; padding: 10px 11px; color: var(--ink); background: var(--paper); border: 1px solid var(--paper-line); border-radius: 10px; font-size: 14px; }
.bp-field input::placeholder { color: var(--muted); opacity: .75; }
.bp-fieldset { min-width: 0; margin: 0 0 16px; padding: 0; border: 0; }
.bp-fieldset:last-child { margin-bottom: 0; }
.bp-fieldset legend { margin-bottom: 6px; padding: 0; color: var(--ink); font-size: 13px; font-weight: 700; }
.bp-rows { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.bp-row { display: flex; align-items: center; justify-content: space-between; gap: 6px; min-width: 0; padding: 5px 5px 5px 7px; background: var(--page); border: 1px solid var(--paper-line); border-radius: 12px; }
.bp-row-value { display: grid; min-width: 36px; height: 30px; padding: 0 7px; place-items: center; color: #fff; background: #126ccb; border: 1px solid #126ccb; border-radius: 999px; font-size: 13px; font-weight: 800; }
.bp-row.is-empty .bp-row-value { color: var(--muted); background: transparent; border-color: var(--paper-line); }
.bp-stepper { display: flex; align-items: center; gap: 2px; }
.bp-step-button { display: grid; width: 30px; height: 30px; padding: 0; place-items: center; color: var(--ink); background: var(--paper); border: 1px solid var(--paper-line); border-radius: 9px; font-size: 17px; line-height: 1; cursor: pointer; }
.bp-step-button:hover:not(:disabled) { border-color: var(--blue); }
.bp-step-button:disabled { opacity: .35; cursor: default; }
.bp-row-count { width: 30px; height: 30px; padding: 0; color: var(--ink); background: transparent; border: 0; border-radius: 6px; font-size: 14px; font-weight: 750; text-align: center; -moz-appearance: textfield; appearance: textfield; }
.bp-row-count::-webkit-outer-spin-button, .bp-row-count::-webkit-inner-spin-button { margin: 0; -webkit-appearance: none; }
.bp-row.is-empty .bp-row-count { color: var(--muted); }
.bp-swatch input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.bp-swatch input:focus-visible + span { outline: 3px solid rgb(10 132 255 / 64%); outline-offset: 3px; }
.bp-palettes { display: flex; flex-wrap: wrap; gap: 11px; }
.bp-swatch { position: relative; cursor: pointer; }
.bp-swatch span { display: block; width: 28px; height: 28px; border: 2px solid var(--paper); border-radius: 50%; background: var(--swatch); box-shadow: 0 0 0 1px var(--paper-line); }
.bp-swatch[data-palette="original"] span { background: conic-gradient(#c98b5b 0 60deg, #f283a1 0 120deg, #86c795 0 180deg, #73a3ea 0 240deg, #f4c443 0 300deg, #ab92e8 0); }
.bp-swatch input:checked + span { box-shadow: 0 0 0 2px var(--ink); }

.bp-toolbar { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 12px 18px; margin-bottom: 4px; }
.bp-toolbar .bp-panel-heading { margin-bottom: 8px; }
.bp-sheet-controls { display: flex; flex-wrap: wrap; align-items: end; gap: 10px 12px; }
.bp-sheet-controls select { min-height: 40px; padding: 8px 10px; font-size: 13px; }
.bp-sheet-controls .bp-check { display: flex; align-items: center; gap: 8px; min-height: 40px; color: var(--ink); cursor: pointer; }
.bp-check input { width: 18px; height: 18px; margin: 0; accent-color: #126ccb; }
.bp-summary { min-height: 18px; margin: 8px 0 12px; color: var(--muted); font-size: 12px; }
.bp-sheet-frame { padding: 24px; overflow: hidden; border: 1px solid var(--paper-line); border-radius: 16px; background: var(--page); }
#bp-sheet { display: flex; justify-content: center; }
.bp-paper { box-sizing: border-box; flex: 0 0 auto; background: #fff; border-radius: 3px; box-shadow: 0 1px 2px rgb(20 35 60 / 12%), 0 16px 40px rgb(29 53 91 / 14%); }
:root[data-theme="dark"] .bp-paper { box-shadow: 0 0 0 1px rgb(255 255 255 / 8%), 0 22px 50px rgb(0 0 0 / 45%); }
.bp-export { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; margin-top: 20px; }
.bp-export-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.bp-pager { display: inline-flex; align-items: center; gap: 2px; padding: 4px; background: var(--page); border: 1px solid var(--paper-line); border-radius: 999px; }
.bp-pager-button { display: grid; width: 38px; height: 38px; padding: 0; place-items: center; color: var(--ink); background: var(--paper); border: 1px solid var(--paper-line); border-radius: 50%; font-size: 22px; line-height: 1; cursor: pointer; }
.bp-pager-button:hover:not(:disabled) { border-color: var(--blue); }
.bp-pager-button:disabled { opacity: .35; cursor: default; }
.bp-pager-label { min-width: 96px; padding: 0 8px; color: var(--ink); font-size: 13px; font-weight: 700; text-align: center; white-space: nowrap; }
.bp-save-note { margin: 0; color: var(--muted); font-size: 11px; }
.bp-print-tip { margin: 14px 0 0; }
.bp-status { min-height: 20px; margin: 6px 0 0; color: var(--muted); font-size: 12px; }

/* The sheet is laid out in millimetres; the preview scales it with zoom. */
.bp-page { display: flex; flex-direction: column; box-sizing: border-box; color: #677487; background: #fff; font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif; }
.bp-page > * { flex: 0 0 auto; box-sizing: border-box; }
.bp-sheet-header { display: flex; align-items: center; justify-content: space-between; gap: 6mm; border-bottom: .3mm solid #e3e8ef; }
.bp-sheet-heading { display: flex; align-items: center; gap: 3.5mm; min-width: 0; }
.bp-sheet-mascot { display: block; flex: 0 0 13mm; width: 13mm; height: 11.7mm; }
.bp-sheet-mascot svg { display: block; width: 100%; height: 100%; }
.bp-sheet-copy { min-width: 0; }
.bp-sheet-kicker { margin: 0 0 .8mm; color: #7a8596; font-size: 7pt; font-weight: 700; letter-spacing: .12em; line-height: 1.2; text-transform: uppercase; overflow-wrap: anywhere; }
.bp-sheet-title { display: flex; align-items: center; flex-wrap: wrap; gap: 1mm 3mm; min-width: 0; }
.bp-sheet-title h2 { margin: 0; color: #1c2738; font-size: 16pt; font-weight: 750; letter-spacing: -.02em; line-height: 1.1; overflow-wrap: anywhere; }
.bp-sheet-child { padding: .6mm 2.6mm; color: #4d5a6d; border: .3mm solid #dfe5ed; border-radius: 99px; font-size: 8pt; font-weight: 650; line-height: 1.3; overflow-wrap: anywhere; }
.bp-sheet-brand { display: flex; align-items: center; gap: 2.5mm; flex: 0 0 auto; color: #68768c; font-size: 9pt; font-weight: 700; text-decoration: none; }
.bp-sheet-qr { display: block; width: 15mm; height: 15mm; }
.bp-grid { display: grid; justify-content: center; align-content: start; }
.bp-sticker { min-width: 0; min-height: 0; }
.bp-sticker svg { display: block; width: 100%; height: 100%; }
.bp-page-footer { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 4mm; border-top: .3mm solid #e3e8ef; font-size: 7pt; line-height: 1.2; }
.bp-page-footer > :last-child { grid-column: 3; text-align: right; }
.bp-page-number { grid-column: 2; color: #4d5a6d; font-weight: 650; }
.bp-print-pages { display: none; }

.bp-guide { margin-top: 48px; }
.bp-guide h2 { margin: 0 0 18px; font-size: clamp(25px, 3vw, 34px); line-height: 1.15; letter-spacing: -.045em; }
.bp-guide-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.bp-guide-grid article { padding: 20px; background: var(--paper); border: 1px solid var(--paper-line); border-radius: 18px; }
.bp-guide-grid h3 { margin: 0 0 6px; color: var(--blue-deep); font-size: 15px; }
.bp-guide-grid p, .bp-guide-note { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.6; }
.bp-guide-note { margin-top: 14px; }
.bp-context { margin-top: 42px; }

@media (min-width: 1101px) and (min-height: 900px) { .bp-toolbox { position: sticky; top: 96px; } }
@media (max-width: 1100px) {
  .bp-workspace { grid-template-columns: minmax(0, 1fr); }
  .bp-toolbox { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
}
@media (max-width: 720px) {
  .bp-main { width: calc(100% - 28px); padding-top: 36px; }
  .bp-intro { margin-bottom: 24px; }
  .bp-intro > p:last-child { font-size: 15px; }
  .bp-toolbox { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .bp-workspace { gap: 12px; }
  .bp-panel, .bp-preview { padding: 16px; border-radius: 20px; }
  .bp-design-art { height: 70px; }
  .bp-toolbar { display: block; }
  .bp-sheet-controls { display: grid; grid-template-columns: 1fr 1fr; }
  .bp-sheet-controls .bp-check { grid-column: 1 / -1; min-height: 32px; }
  .bp-sheet-frame { padding: 10px; border-radius: 12px; }
  .bp-export { justify-content: center; }
  .bp-export-actions { width: 100%; justify-content: center; }
  .bp-export .calendar-print-button { width: 100%; }
  .bp-save-note { width: 100%; text-align: center; }
  .bp-guide { margin-top: 32px; }
  .bp-guide-grid { grid-template-columns: 1fr; }
  .bp-context { margin-top: 25px; }
}
@media (prefers-reduced-motion: reduce) { .bp-design { transition: none; } }
@media print {
  :root, html, body { background: #fff !important; color-scheme: light; margin: 0; padding: 0; min-width: 0; }
  body > :not(.bp-print-pages) { display: none !important; }
  .bp-print-pages { display: block; }
  .bp-page { zoom: 1 !important; break-inside: avoid; break-after: page; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .bp-page:last-child { break-after: auto; }
}
