.pbn-page { padding-bottom: 72px; }
.pbn-tool { display: grid; grid-template-columns: minmax(330px, 0.78fr) minmax(0, 1.55fr); align-items: stretch; gap: 18px; }
.pbn-controls, .pbn-preview, .pbn-copy-grid > *, .pbn-steps, .pbn-photo-tips, .pbn-faq { border: 2px solid var(--line); background: var(--paper); box-shadow: 7px 7px 0 rgba(21,21,21,.12); }
.pbn-controls { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.pbn-controls h1 { margin: -3px 0 0; max-width: 9ch; font-size: clamp(2.45rem, 4.6vw, 4.55rem); line-height: .91; letter-spacing: -.055em; }
.pbn-lede { margin: 0; max-width: 42ch; color: var(--muted); line-height: 1.5; }
.pbn-drop { min-height: 78px; padding: 13px; display: grid; align-content: center; gap: 2px; border: 2px dashed var(--line); background: #fff; cursor: pointer; transition: transform .16s ease, background .16s ease; }
.pbn-drop:hover, .pbn-drop.dragover { background: #fff4d2; transform: translateY(-1px); }
.pbn-drop strong { font-size: 1.05rem; }
.pbn-drop span { color: var(--muted); font-size: .78rem; }
.pbn-drop input { position: absolute; inline-size: 1px; block-size: 1px; opacity: 0; pointer-events: none; }
.pbn-control { margin: 0; padding: 10px; border: 1px solid var(--line); }
.pbn-control legend { padding: 0 6px; color: var(--teal); font-family: "Courier New", monospace; font-size: .7rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.pbn-choice-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.pbn-choice-row.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.pbn-choice-row button { min-height: 39px; padding: 7px 5px; border: 1px solid var(--line); background: #fff; color: var(--ink); font: inherit; font-size: .78rem; font-weight: 900; cursor: pointer; }
.pbn-choice-row button:hover { background: var(--mint); }
.pbn-choice-row button[aria-pressed="true"] { background: var(--yellow); box-shadow: inset 0 -3px 0 var(--accent); }
.pbn-control .helper-text { margin: 7px 0 0; color: var(--muted); font-size: .72rem; line-height: 1.35; }
.pbn-controls .download-btn { min-height: 49px; }
.pbn-progress { display: grid; gap: 6px; color: var(--muted); font-size: .76rem; line-height: 1.35; }
.pbn-progress > div { height: 7px; overflow: hidden; border: 1px solid var(--line); background: #fff; }
.pbn-progress i { display: block; width: 0; height: 100%; background: var(--accent); transition: width .25s ease; }
.output-style { margin-top: auto; }
.output-style button { font-size: .69rem; line-height: 1.15; }

.pbn-preview { min-height: 760px; padding: 12px; display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto; gap: 10px; }
.pbn-preview-head { min-height: 46px; display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.pbn-preview-head p { margin: 0; }
#pbnPreviewStatus { color: var(--muted); font-size: .8rem; }
.pbn-stage { position: relative; min-height: 560px; display: grid; place-items: center; overflow: auto; border: 1px solid rgba(21,21,21,.16); background-color: #f3f5f1; background-image: linear-gradient(45deg, rgba(21,21,21,.035) 25%, transparent 25%), linear-gradient(-45deg, rgba(21,21,21,.035) 25%, transparent 25%), linear-gradient(45deg, transparent 75%, rgba(21,21,21,.035) 75%), linear-gradient(-45deg, transparent 75%, rgba(21,21,21,.035) 75%); background-size: 24px 24px; background-position: 0 0, 0 12px, 12px -12px, -12px 0; }
.pbn-empty { position: absolute; z-index: 2; max-width: 340px; padding: 20px; display: grid; gap: 6px; text-align: center; background: rgba(255,250,242,.94); border: 1px solid var(--line); }
.pbn-empty[hidden] { display: none; }
.pbn-empty span { color: var(--muted); font-size: .82rem; line-height: 1.45; }
#output-pane { width: 100%; min-height: 100%; display: grid; place-items: center; padding: 18px; }
#svgContainer { width: 100%; display: grid; place-items: center; }
#svgContainer svg { display: block; max-width: 100%; max-height: 590px; width: auto; height: auto; background: #fff; box-shadow: 0 10px 28px rgba(21,21,21,.13); }
.palette { min-height: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 5px; }
.palette:empty { display: none; }
.palette .color { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid rgba(21,21,21,.55); color: #fff; font-family: "Courier New", monospace; font-size: .68rem; font-weight: 900; text-shadow: 0 1px 2px #000, 0 0 2px #000; }
.pbn-downloads { display: grid; grid-template-columns: 1.25fr .72fr .85fr .9fr; gap: 8px; }
.pbn-downloads button { min-height: 45px; }
.pbn-downloads button:disabled { cursor: not-allowed; opacity: .42; }
.pbn-copy-grid { margin-top: 24px; display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.pbn-copy-grid > *, .pbn-steps, .pbn-photo-tips, .pbn-faq { padding: clamp(24px, 4vw, 42px); }
.pbn-copy-grid h2, .pbn-steps h2, .pbn-photo-tips h2, .pbn-faq h2 { margin: 7px 0 10px; font-size: clamp(1.8rem, 3.5vw, 2.8rem); line-height: 1; letter-spacing: -.035em; }
.pbn-copy-grid p, .pbn-photo-tips p, .pbn-faq p { line-height: 1.65; }
.pbn-steps, .pbn-photo-tips, .pbn-faq { margin-top: 18px; }
.pbn-steps ol { margin: 18px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; list-style: none; counter-reset: pbn-step; }
.pbn-steps li { min-height: 145px; padding: 15px; border: 1px solid var(--line); background: #fff; counter-increment: pbn-step; }
.pbn-steps li::before { content: "0" counter(pbn-step); display: block; margin-bottom: 14px; color: var(--accent); font-family: "Courier New", monospace; font-size: .72rem; font-weight: 900; }
.pbn-steps strong, .pbn-steps span { display: block; }
.pbn-steps span { margin-top: 7px; color: var(--muted); font-size: .88rem; line-height: 1.5; }
.pbn-photo-tips > div { margin-top: 16px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.pbn-photo-tips article { padding: 17px; border: 1px solid var(--line); background: #fff; }
.pbn-photo-tips h3 { margin: 0; font-size: 1.12rem; }
.pbn-photo-tips p { margin-bottom: 0; color: var(--muted); }
.pbn-faq details { border-top: 1px solid var(--line); }
.pbn-faq summary { padding: 13px 0; font-weight: 900; cursor: pointer; }
.pbn-faq details p { margin: -3px 0 15px; color: var(--muted); }
.pbn-page .related-tools { margin-top: 18px; padding: 24px; display: grid; grid-template-columns: .7fr 1.3fr; gap: 20px; border: 2px solid var(--line); background: var(--yellow); box-shadow: var(--shadow); }
.pbn-page .related-tools h2 { margin: 7px 0 0; font-size: clamp(1.8rem, 3.5vw, 2.8rem); line-height: 1; }
.pbn-page .related-links { display: grid; gap: 7px; }
.pbn-page .related-links a { padding: 11px 13px; display: flex; justify-content: space-between; gap: 12px; border: 1px solid var(--line); background: #fff; text-decoration: none; font-weight: 800; }
.pbn-page .related-links span { color: var(--muted); font-size: .8rem; font-weight: 400; }

@media (max-width: 980px) {
  .pbn-tool, .pbn-copy-grid, .pbn-page .related-tools { grid-template-columns: 1fr; }
  .pbn-controls h1 { max-width: none; }
  .pbn-preview { min-height: 650px; }
  .pbn-steps ol { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .pbn-controls, .pbn-preview { box-shadow: 4px 4px 0 rgba(21,21,21,.12); }
  .pbn-choice-row, .pbn-choice-row.three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pbn-preview-head { flex-direction: column; }
  .pbn-stage { min-height: 430px; }
  .pbn-downloads, .pbn-steps ol, .pbn-photo-tips > div { grid-template-columns: 1fr; }
  .pbn-page .related-links a { flex-direction: column; }
}
@media print {
  @page { margin: 12mm; }
  body { background: #fff !important; }
  .topbar, .breadcrumbs, .pbn-controls, .pbn-copy-grid, .pbn-steps, .pbn-photo-tips, .pbn-faq, .pbn-page .related-tools, footer, .pbn-preview-head .trust-row, .pbn-downloads { display: none !important; }
  .shell, .pbn-page { width: auto !important; max-width: none !important; margin: 0 !important; padding: 0 !important; }
  .pbn-tool { display: block; }
  .pbn-preview { min-height: 0; padding: 0; border: 0; box-shadow: none; }
  .pbn-preview-head { display: block; margin-bottom: 8mm; }
  .pbn-stage { min-height: 0; overflow: visible; border: 0; background: #fff; }
  #output-pane { min-height: 0; padding: 0; }
  #svgContainer svg { max-width: 100%; max-height: 225mm; box-shadow: none; }
  .palette { margin-top: 7mm; break-inside: avoid; }
}
