/* WINDEV Dealer Portal v1.6.10 — branding manager layout + crop UX refinement */
.brand-mark-image{padding:0;overflow:hidden;background:#fff;border-color:rgba(216,182,52,.45)}
.brand-mark-img{display:block;width:100%;height:100%;object-fit:cover;border-radius:inherit}
.public-brand-logo{display:block;max-width:152px;max-height:38px;width:auto;height:auto;object-fit:contain}
.auth-brand-logo{display:flex;justify-content:center;align-items:center;min-height:68px;margin:0 auto 1.1rem;padding:.35rem 1rem}
.auth-brand-logo img{display:block;max-width:min(300px,82vw);max-height:82px;width:auto;height:auto;object-fit:contain}
.setup-brand-logo{margin-bottom:.65rem}

/* Branding page shell */
.settings-branding-card>.premium-card-head{align-items:center;gap:1rem}
.settings-branding-card>.premium-card-head>div:first-child{min-width:0}
.settings-branding-card>.premium-card-head h2{margin-bottom:.22rem}
.settings-branding-card>.premium-card-head p{max-width:860px;margin-bottom:0;line-height:1.55}
.settings-branding-card>.premium-card-body{padding-top:1.15rem}
.brand-guidance{display:flex;align-items:flex-start;gap:.8rem;margin-bottom:1.15rem;padding:.9rem 1rem;border-radius:.85rem}
.brand-guidance>i{flex:0 0 auto;color:var(--ha-primary,#d8b634);margin-top:.16rem}.brand-guidance div{display:grid;gap:.14rem;min-width:0}.brand-guidance strong{font-weight:750}.brand-guidance span{font-size:.875rem;color:var(--ha-text-muted,#aab4bf);line-height:1.48}

/* The cards deliberately use a bounded preview box. Do not use aspect-ratio on the grid item: a wide 3:1 preview + min-height can overflow its grid track. */
.brand-asset-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:1rem}
.brand-asset-card{display:grid;grid-template-columns:190px minmax(0,1fr);grid-template-rows:auto 1fr auto;grid-template-areas:"preview copy" "preview copy" "preview actions";align-items:start;column-gap:1.15rem;row-gap:.8rem;padding:1rem;border:1px solid var(--ha-border,rgba(255,255,255,.105));border-radius:1rem;background:linear-gradient(180deg,color-mix(in srgb,var(--ha-surface-soft,#111820) 94%,transparent),var(--ha-surface-soft,#111820));min-width:0;min-height:216px;overflow:hidden}
.brand-preview{grid-area:preview;display:grid;place-items:center;width:100%;height:164px;min-width:0;min-height:0;max-width:100%;align-self:start;overflow:hidden;border:1px dashed var(--ha-border-strong,rgba(255,255,255,.17));border-radius:.85rem;background:var(--ha-input,#0f151c);box-shadow:inset 0 0 0 1px rgba(255,255,255,.012)}
.brand-preview.is-square,.brand-preview.is-wide{aspect-ratio:auto;min-height:0;align-self:start}
.brand-preview img{display:block;width:100%;height:100%;max-width:100%;max-height:100%;object-fit:contain;padding:.65rem}
.brand-preview-empty{display:grid;place-items:center;text-align:center;align-content:center;gap:.5rem;width:100%;height:100%;color:var(--ha-text-subtle,#87929e);padding:.75rem;line-height:1.35}.brand-preview-empty i{font-size:1.65rem;color:var(--ha-primary,#d8b634)}.brand-preview-empty span{font-size:.8rem}
.brand-asset-copy{grid-area:copy;display:flex;flex-direction:column;min-width:0;padding-top:.05rem}.brand-asset-copy h3{font-size:1rem;line-height:1.25;margin:.16rem 0 .32rem}.brand-asset-copy p{font-size:.86rem;line-height:1.5;color:var(--ha-text-muted,#aab4bf);margin:0 0 .7rem}.brand-asset-meta{display:flex;flex-wrap:wrap;gap:.45rem .85rem;margin-top:auto;color:var(--ha-text-subtle,#87929e);font-size:.76rem;line-height:1.4}.brand-asset-meta span{display:inline-flex;align-items:center;gap:.35rem;min-width:0}.brand-asset-meta i{opacity:.9}
.brand-asset-actions{grid-area:actions;display:flex;align-items:flex-end;gap:.55rem;width:100%;min-width:0;padding-top:.8rem;border-top:1px solid var(--ha-border,rgba(255,255,255,.105))}
.brand-upload-form{display:grid;grid-template-columns:max-content max-content;grid-template-rows:auto auto;align-items:center;gap:.45rem .5rem;min-width:0;max-width:100%}.brand-file-state{grid-column:1/-1;grid-row:1;display:block;min-width:0;max-width:100%;overflow-wrap:anywhere;font-size:.75rem;line-height:1.35;color:var(--ha-text-subtle,#87929e)}.brand-upload-form>.btn{grid-row:2;white-space:nowrap}.brand-remove-form{display:flex;align-items:flex-end;margin-left:auto}.brand-remove-form .btn{white-space:nowrap}
.brand-asset-actions .btn:disabled{opacity:.52;filter:saturate(.7)}

/* Crop editor */
.brand-crop-stage{display:grid;place-items:center;border:1px solid var(--ha-border,rgba(255,255,255,.105));border-radius:1rem;background:#0b0e11;padding:.75rem;overflow:auto}.brand-crop-stage canvas{display:block;max-width:100%;height:auto;border-radius:.65rem;box-shadow:0 8px 30px rgba(0,0,0,.2)}

/* Light theme is intentionally soft-neutral, not stark white. */
[data-bs-theme="light"] .brand-asset-card{background:linear-gradient(180deg,#fbfcfd,#f6f8fb);border-color:#d9dee5}
[data-bs-theme="light"] .brand-preview{background:#fff;border-color:#c8d0d9;box-shadow:inset 0 0 0 1px rgba(35,39,47,.02)}
[data-bs-theme="light"] .brand-asset-copy p,[data-bs-theme="light"] .brand-guidance span{color:#586572}
[data-bs-theme="light"] .brand-asset-meta,[data-bs-theme="light"] .brand-file-state{color:#66717d}
[data-bs-theme="light"] .brand-asset-actions{border-top-color:#d9dee5}

/* Two-up cards only when each card has enough real content width. */
@media(max-width:1399.98px){.brand-asset-grid{grid-template-columns:1fr}.brand-asset-card{grid-template-columns:210px minmax(0,1fr)}}
@media(max-width:767.98px){.brand-asset-card{grid-template-columns:1fr;grid-template-rows:auto auto auto;grid-template-areas:"preview" "copy" "actions";min-height:0}.brand-preview{width:100%;height:156px;justify-self:stretch}.brand-preview.is-square{max-width:210px;justify-self:center}.brand-asset-actions{align-items:stretch;flex-wrap:wrap}.brand-upload-form{width:100%;grid-template-columns:1fr 1fr}.brand-upload-form>.btn{width:100%}.brand-remove-form{width:100%;margin-left:0}.brand-remove-form .btn{width:100%}}
@media(max-width:575.98px){.settings-branding-card>.premium-card-head{align-items:flex-start}.settings-branding-card>.premium-card-head>.status-pill{margin-left:0}.brand-asset-card{padding:.85rem}.brand-preview{height:142px}.brand-preview.is-square{max-width:180px}.brand-upload-form{display:flex;flex-direction:column;align-items:stretch;width:100%}.brand-file-state{order:-1;width:100%}.brand-upload-form>.btn{width:100%;white-space:normal}.brand-guidance{padding:.8rem .85rem}.auth-brand-logo img{max-width:78vw;max-height:72px}}
@media(prefers-reduced-motion:reduce){.brand-asset-card,.brand-preview{transition:none!important}}

/* v1.6.11 notification settings */
.notification-settings-card .premium-card-body{overflow:visible}.notification-channel-toggle{display:flex;gap:.75rem;align-items:flex-start;padding:.85rem 1rem;border:1px solid var(--app-border);border-radius:.85rem;background:var(--app-soft);cursor:pointer}.notification-channel-toggle span{display:grid;gap:.15rem}.notification-channel-toggle small{color:var(--app-muted);font-weight:400}.notification-recipient-card{border:1px solid var(--app-border);border-radius:.9rem;background:var(--app-soft);overflow:hidden}.notification-recipient-card>summary{list-style:none;cursor:pointer;padding:.9rem 1rem;display:flex;align-items:center;justify-content:space-between;gap:1rem}.notification-recipient-card>summary::-webkit-details-marker{display:none}.notification-recipient-card>summary>span:first-child{display:grid;gap:.15rem}.notification-recipient-card>summary small{color:var(--app-muted)}.notification-recipient-card[open]>summary{border-bottom:1px solid var(--app-border);background:var(--app-raised)}.notification-choice-grid{display:grid;grid-template-columns:1fr 1fr;gap:1rem}.notification-choice-grid fieldset{border:1px solid var(--app-border);border-radius:.8rem;padding:1rem}.notification-choice-grid legend{font-size:.72rem;text-transform:uppercase;letter-spacing:.14em;color:var(--app-muted);font-weight:700;float:none;width:auto;padding:0 .3rem}.notification-choice-grid .form-check{margin:.45rem 0}@media(max-width:767.98px){.notification-choice-grid{grid-template-columns:1fr}}
