/* Centre layout gives language, logo and filters separate columns at every width. */
.branded-header { color: var(--header-ink); background: var(--header-surface, var(--header-background)); border-bottom-color: var(--header-divider); backdrop-filter: blur(var(--header-blur, 18px)); -webkit-backdrop-filter: blur(var(--header-blur, 18px)); display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 6px 10px; }
.branded-header .header-brand { min-width: 0; color: inherit; }
.branded-header .brand-logo--small { width: var(--header-logo-size); height: var(--header-logo-size); }
.branded-header .pixel-heart--small { width: var(--header-logo-size); height: calc(var(--header-logo-size) * .89); margin: 0; }
.branded-header .header-tools { display: flex; align-items: center; justify-content: flex-end; gap: 7px; min-width: 0; }
.branded-header .header-tools .icon-button { margin: 0; flex: none; color: inherit; }
.branded-header .admin-entry-link { color: inherit; font-size: .75rem; padding: 4px; }
.branded-header--center { grid-template-columns: minmax(0,1fr) minmax(0,1fr) minmax(0,1fr); }
.branded-header--center .header-brand { grid-column: 2; grid-row: 1; justify-self: center; justify-content: center; flex-direction: column; gap: 2px; max-width: 100%; }
.branded-header--center .header-brand__name { font-size: .64rem; line-height: 1.15; text-align: center; -webkit-line-clamp: 1; }
.branded-header--center .header-tools { display: contents; }
.branded-header--center .header-tools .language-switch { grid-column: 1; grid-row: 1; justify-self: start; }
.branded-header--center .header-tools .icon-button { grid-column: 3; grid-row: 1; justify-self: end; }
.branded-header--center .header-tools .admin-entry-link { grid-column: 3; grid-row: 2; justify-self: end; }
.app-body .page-main { padding-top: calc(max(74px, var(--header-logo-size) + 40px) + env(safe-area-inset-top)); }
.app-body:has(.branded-header--center .admin-entry-link) .page-main { padding-top: calc(max(102px, var(--header-logo-size) + 68px) + env(safe-area-inset-top)); }
.branded-header--right .header-brand { grid-column: 2; grid-row: 1; justify-self: end; }
.branded-header--right .header-tools { grid-column: 1; grid-row: 1; justify-content: flex-start; }
.branded-header--right { grid-template-columns: auto minmax(0,1fr); }
.branded-header--guest { position: fixed; top: 0; width: 100%; max-width: none; left: 0; right: 0; transform: none; padding-right: max(16px, env(safe-area-inset-right, 0px), calc((100vw - 1050px)/2)); padding-left: max(16px, env(safe-area-inset-left, 0px), calc((100vw - 1050px)/2)); }
/* Keep both the page and the editor's preview banner below the fixed header.
   JavaScript measures the actual header, including uploaded fonts and wrapping;
   this conservative fallback also works before scripts load or without JS. */
.guest-body--header { --home-header-height: calc(max(74px, var(--header-logo-size) + 40px, var(--logo-header-size) * 1.2 + 31px) + env(safe-area-inset-top, 0px)); padding-top: var(--home-header-height); }
.language-switch { display: inline-flex; flex: none; border: 1px solid currentColor; border-radius: 999px; padding: 2px; font-size: .7rem; line-height: 1; gap: 2px; }
.language-switch a { min-width: 30px; min-height: 32px; padding: 9px 6px; display: grid; place-items: center; border-radius: 999px; color: inherit; font-weight: 800; }
.language-switch a[aria-current="true"] { background: var(--header-ink); color: var(--header-background); }
.admin-header .language-switch a[aria-current="true"] { background: #fff; color: var(--ink); }
.guest-language-bar { display: flex; justify-content: flex-end; max-width: 1050px; margin: auto; padding: 12px 22px 0; }
.guest-language-bar:empty { display: none; }
.landing.landing--ordered { display: flex; flex-direction: column; align-items: stretch; justify-content: center; min-height: calc(100svh - 40px); gap: 28px; }
.guest-body--header .landing.landing--ordered { min-height: calc(100svh - var(--home-header-height)); }
.landing--ordered .home-part { min-width: 0; }
.home-part--preview { padding: 10px 0 16px; }
.landing.landing--stacked { max-width: 730px; }
.home-part--text .landing__copy:last-child { margin-bottom: 0; }
.home-order-fields { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.translation-fields { padding: 16px; border: 1px dashed var(--line); border-radius: 15px; background: color-mix(in srgb, var(--paper) 55%, white); }
.translation-fields summary { cursor: pointer; font-weight: 850; }
.translation-fields[open] summary { margin-bottom: 16px; }
.translation-fields .form-stack { gap: 16px; }
.header-settings-hint { font-size: .82rem; color: var(--muted); }
@media (min-width: 900px) {
    .landing.landing--default-order { display: grid; grid-template-columns: 1.15fr .85fr; grid-template-rows: auto auto auto; align-content: center; column-gap: 52px; }
    .landing--default-order .home-part--logo { grid-column: 1; grid-row: 1; }
    .landing--default-order .home-part--text { grid-column: 1; grid-row: 2; }
    .landing--default-order .home-part--actions { grid-column: 1; grid-row: 3; }
    .landing--default-order .home-part--preview { grid-column: 2; grid-row: 1 / 4; align-self: center; }
}
@media (max-width: 380px) {
    .branded-header { padding-left: 10px; padding-right: 10px; column-gap: 6px; }
    .branded-header .header-tools { gap: 3px; }
    .branded-header .language-switch a { min-width: 26px; padding-left: 4px; padding-right: 4px; }
    .branded-header .header-tools .icon-button { width: 36px; }
    .branded-header .header-brand__name { font-size: .78rem; }
}

/* Prevent intrinsic select widths and long custom brand names from widening narrow pages. */
.home-order-fields > *, .home-order-fields select, .settings-color-grid > * { min-width: 0; }
.home-order-fields select { max-width: 100%; text-overflow: ellipsis; }
.settings-color-grid label { overflow-wrap: anywhere; }
.admin-header { flex-wrap: wrap; }
.admin-header .brand { min-width: 0; max-width: 100%; }
.admin-header .brand > span:last-child { overflow-wrap: anywhere; }
@media (max-width: 380px) {
    .home-order-fields { grid-template-columns: minmax(0, 1fr); }
}

/* A separate public preview logo keeps the mock phone aligned with the site brand. */
.phone-preview__top { gap: 8px; }
.phone-preview__brand { display: flex; flex: 1 1 0; min-width: 0; align-items: center; }
.phone-preview__logo { display: block; width: auto; height: auto; max-width: min(100%, 200px); max-height: 28px; object-fit: contain; object-position: left center; }
.phone-preview__top .preview-label, .phone-preview__top .mini-logo { flex: none; }
.phone-preview__title { min-width: 0; overflow-wrap: anywhere; }
.brand-asset-preview--phone-logo { width: 140px; height: 60px; padding: 8px; }
@media (min-width: 600px) { .phone-preview__logo { max-height: 32px; } }
