/* Brand page (brandpage.js). App tokens only. Prefix bp-. */
.bp { max-width: 1180px; }
.bp h1, .bp h2, .bp h3 { font-family: var(--display); }
.bp-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 28px; }
.bp-top h1 { margin: 0 0 8px; font-stretch: 114%; font-weight: 900; font-size: clamp(32px, 4vw, 52px); line-height: 1; letter-spacing: -.045em; }
.bp-top p { margin: 0; max-width: 58ch; color: var(--text-2); font-size: 16px; line-height: 1.5; }
.bp-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 36px; align-items: start; }
.bp-main { display: grid; gap: 40px; min-width: 0; }
.bp-h2 { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.bp-h2 h2 { margin: 0; font-stretch: 110%; font-weight: 800; font-size: 21px; letter-spacing: -.03em; }
.bp-h2 span { color: var(--muted); font-size: 13px; }
.bp-kick { font-family: var(--mono); font-size: 10.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }

/* the phone preview (sized by --w) */
.bp-ph { position: relative; width: var(--w); flex: none; aspect-ratio: 9 / 16; font-size: calc(var(--w) / 16); border-radius: calc(var(--w) * .13); overflow: hidden; background: #000; border: 1px solid var(--line-3); }
.bp-ph.big { box-shadow: var(--shadow-float); }
.bp-frame { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.bp-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.28), transparent 30%, transparent 50%, rgba(0,0,0,.55)); }
.bp-bar { position: absolute; left: 0; right: 0; bottom: 0; height: .55em; background: var(--sec); }
.bp-logo { position: absolute; top: 5%; right: 6%; width: 24%; max-height: 13%; object-fit: contain; }
.bp-logo.ghost { aspect-ratio: 1; border: 1px dashed rgba(255,255,255,.45); border-radius: .5em; }
.bp-cap { position: absolute; left: 5%; right: 5%; top: 62%; text-align: center; font-family: var(--ff); font-weight: var(--fw); font-size: 1.55em; line-height: 1.08; text-transform: uppercase; color: #fff; text-shadow: 0 .06em .3em rgba(0,0,0,.6); }
.bp-cap .b { color: var(--acc); }
.look-clean .a { opacity: .7; } .look-clean .b { color: #fff; }
.look-bold-pop { font-size: 2.05em; }
.look-karaoke { font-size: 1.35em; }
.look-minimal { text-transform: none; font-size: 1.05em; font-weight: 400; }
.look-minimal .b { color: #fff; }
.look-boxed span { background: rgba(8,8,6,.82); padding: .05em .28em; border-radius: .2em; box-decoration-break: clone; }
.look-boxed .b { color: var(--acc); }
.look-outline { -webkit-text-stroke: .1em #000; paint-order: stroke fill; text-shadow: none; }
.look-spotlight { font-size: 2.7em; } .look-spotlight .a { display: none; }
.look-highlighter .b { background: var(--acc); color: #10130a; padding: 0 .2em; border-radius: .18em; text-shadow: none; }
.bp-endcard { position: absolute; left: 6%; bottom: 5%; display: flex; align-items: center; gap: .5em; font-size: .62em; color: #fff; background: rgba(0,0,0,.6); padding: .5em .8em; border-radius: .6em; }
.bp-endcard img { height: 1.8em; } .bp-endcard i { width: 1.6em; height: 1.6em; border: 1px dashed rgba(255,255,255,.5); border-radius: .3em; }

/* side */
.bp-side { position: sticky; top: 88px; }
.bp-prev { display: grid; justify-items: center; gap: 14px; padding: 22px 18px 20px; border: 1px solid var(--line); border-radius: 22px; background: var(--surface); }
.bp-prev .bp-kick { justify-self: start; }
.bp-prev-facts { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.bp-prev-facts span { display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; border-radius: 999px; border: 1px solid var(--line-2); font-size: 12px; color: var(--text-2); }
.bp-prev-facts i { width: 10px; height: 10px; border-radius: 50%; }
.bp-prev .hint { text-align: center; margin: 0; }

/* template cards */
.bp-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.bp-cards.one { grid-template-columns: minmax(250px, 340px); margin-top: 14px; }
.bp-card { display: flex; flex-wrap: wrap; gap: 14px; padding: 14px; border-radius: 18px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; transition: border-color .15s, background-color .15s, transform .18s var(--ease-out); }
.bp-card:hover { border-color: var(--line-3); transform: translateY(-2px); }
.bp-card:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; }
.bp-card.on { border-color: var(--accent); background: linear-gradient(0deg, var(--accent-soft), var(--accent-soft)), var(--surface); }
.bp-card.kit { border-style: dashed; }
.bp-card-b { min-width: 0; display: grid; gap: 8px; align-content: start; flex: 1; }
.bp-card-b b { font-family: var(--display); font-weight: 700; font-size: 16px; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bp-badges { display: flex; gap: 5px; flex-wrap: wrap; }
.bp-facts { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.bp-facts i { width: 16px; height: 16px; border-radius: 50%; border: 1px solid var(--line-3); flex: none; }
.bp-facts span { margin-left: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bp-card-act { flex: 1 0 100%; display: flex; flex-wrap: wrap; gap: 2px; margin: 0 -6px -4px; padding-top: 8px; border-top: 1px solid var(--line); }
.bp-card.kit { align-content: start; }
.bp-note { margin: 0; font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.bp-empty { display: grid; justify-items: center; gap: 8px; text-align: center; padding: 34px 20px 30px; border: 1px dashed var(--line-2); border-radius: 20px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.bp-empty b { color: var(--text); font-size: 17px; font-family: var(--display); font-weight: 700; }
.bp-empty > span:not(.bp-empty-art) { max-width: 46ch; }
.bp-empty-art { color: var(--text-2); margin-bottom: 4px; }
.bp-empty .btn { margin-top: 10px; }

/* editor */
.bp-editor { display: grid; gap: 0; border: 1px solid var(--line); border-radius: 22px; background: var(--surface); }
.bp-ed-h { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 22px 24px 18px; border-bottom: 1px solid var(--line); }
.bp-ed-h h2 { margin: 4px 0 0; font-stretch: 110%; font-weight: 800; font-size: 24px; letter-spacing: -.035em; }
.bp-sec { padding: 22px 24px; border-bottom: 1px solid var(--line); display: grid; gap: 12px; }
.bp-sec-h { display: flex; align-items: center; gap: 12px; }
.bp-sec-h h3 { margin: 0; font-size: 17px; font-weight: 700; letter-spacing: -.02em; }
.bp-n { width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--accent-line); color: var(--accent-text); display: grid; place-items: center; font-family: var(--mono); font-size: 12px; }
.bp-lbl { font-size: 13px; font-weight: 600; }
.bp-logo-row { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.bp-logo-slot { width: 160px; height: 110px; flex: none; border-radius: 16px; border: 1px dashed var(--line-3); background: var(--bg-2); display: grid; place-items: center; overflow: hidden; padding: 10px; box-sizing: border-box; }
.bp-logo-slot img { max-width: 100%; max-height: 100%; object-fit: contain; }
.bp-logo-empty { display: grid; justify-items: center; align-content: center; gap: 3px; text-align: center; color: var(--muted); }
.bp-logo-empty svg { color: var(--text-2); margin-bottom: 4px; }
.bp-logo-empty b { color: var(--text); font-size: 13.5px; }
.bp-logo-empty small { font-size: 11.5px; }
.bp-logo-act { display: grid; gap: 8px; justify-items: start; min-width: 0; flex: 1 1 200px; }
.bp-colors { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.bp-color { display: grid; gap: 10px; padding: 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--bg-2); align-content: start; }
.bp-color-h { display: grid; gap: 2px; }
.bp-color-h .hint { font-size: 12px; }
.bp-color-c { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.bp-color input[type=color] { width: 44px; height: 44px; padding: 0; border: 1px solid var(--line-2); border-radius: 10px; background: none; cursor: pointer; }
.bp-hex { width: 104px; height: 44px; font-family: var(--mono); font-size: 13px; text-transform: uppercase; }
.bp-house { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-2); }
.bp-sw { display: flex; gap: 6px; flex-wrap: wrap; }
.bp-sw button { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--bg-2); box-shadow: 0 0 0 1px var(--line-3); cursor: pointer; padding: 0; }
.bp-sw button:hover { box-shadow: 0 0 0 2px var(--text); }
.bp-fonts { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.bp-font { display: grid; gap: 4px; justify-items: center; padding: 14px 6px 10px; border-radius: 12px; border: 1px solid var(--line-2); background: none; color: var(--text); cursor: pointer; }
.bp-font span { font-size: 30px; line-height: 1; }
.bp-font small { font-size: 11px; color: var(--muted); text-align: center; }
.bp-font:hover { border-color: var(--line-3); }
.bp-font.on { border-color: var(--accent); background: var(--accent-soft); }
.bp-looks { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; }
.bp-look { display: grid; gap: 6px; padding: 6px; border-radius: 12px; border: 1px solid var(--line-2); background: none; color: var(--text); cursor: pointer; text-align: center; }
.bp-look-i { display: block; aspect-ratio: 9 / 16; border-radius: 8px; overflow: hidden; background: #111; }
.bp-look img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bp-look b { font-size: 12.5px; padding-bottom: 2px; }
.bp-look:hover { border-color: var(--line-3); }
.bp-look.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; background: var(--accent-soft); }
.bp-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 4px 0; }
.bp-row p { margin: 2px 0 0; max-width: 56ch; }
.bp-editor .tpl-err { padding: 12px 24px 0; }
.bp-save { position: sticky; bottom: 0; z-index: 5; display: flex; align-items: center; gap: 10px; justify-content: flex-end; padding: 14px 24px; border-radius: 0 0 22px 22px; background: var(--glass); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line); }
.bp-save-s { margin-right: auto; font-size: 13px; color: var(--muted); }
.bp-save.dirty .bp-save-s { color: var(--warn); }
.bp-groups .bp-grp { display: grid; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.bp-grp-r { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--line); }
.bp-grp-r:first-child { border-top: 0; }
.bp-grp-r.on { background: var(--accent-soft); }
.bp-grp-r span { display: grid; }
.bp-grp-r small { color: var(--muted); font-size: 12.5px; }

@media (max-width: 1040px) {
  .bp-grid { grid-template-columns: 1fr; gap: 24px; }
  .bp-side { position: static; order: -1; }
  .bp-prev { grid-template-columns: auto 1fr; align-items: center; justify-items: start; gap: 16px 20px; padding: 16px; }
  .bp-prev .bp-kick { grid-column: 1 / -1; }
  #bpPhone .bp-ph { --w: 132px !important; }
  .bp-prev-facts { justify-content: flex-start; align-self: center; }
  .bp-prev .hint { grid-column: 1 / -1; text-align: left; }
}
@media (max-width: 640px) {
  .bp-top .btn { width: 100%; }
  .bp-cards { grid-template-columns: 1fr; }
  .bp-cards.one { grid-template-columns: 1fr; }
  .bp-ed-h, .bp-sec { padding-left: 16px; padding-right: 16px; }
  .bp-colors { grid-template-columns: 1fr; }
  .bp-fonts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .bp-logo-slot { width: 100%; height: 120px; }
  .bp-save { padding: 12px 16px; bottom: calc(62px + env(safe-area-inset-bottom)); position: fixed; left: 0; right: 0; border-radius: 0; z-index: 30; }
  .bp-editor { margin-bottom: 70px; }
}
