/*
 * White label (branding per tenant): the settings card with its preview and the legal line under public cards.
 * Tokens only: the primary colour of a tenant arrives as --octo-c-accent / --octo-c-accent-text from the page head (BrandCss), the preview
 * gets its two colours as --osn-brand-surface and --osn-brand-surface-text. Loaded on every page next to the page stylesheet.
 */
.osn-brand-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: start; }
.osn-brand-form { min-width: 0; }
.osn-brand-color { display: flex; align-items: center; gap: 8px; }
.osn-brand-color .octo-input { min-width: 0; }
/* the core sets every .octo-input to width 100% !important, so the colour swatch is no .octo-input */
.osn-brand-color .osn-brand-swatch { flex: none; box-sizing: border-box; width: 48px; height: 40px; padding: 2px; cursor: pointer; border: 1px solid var(--octo-c-input-border); border-radius: 6px; background: var(--octo-c-input); }

:root .octo-content .osn-brand-color .octo-btn { flex: none; }
/* a logo is uploaded: the picture as it will be shown (the dark one on the dark surface of the sidebar), then the two actions */
.osn-brand-logo { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.osn-brand-logo-preview { display: flex; align-items: center; justify-content: center; box-sizing: border-box; min-width: 120px; height: 56px; padding: 8px 12px; border: 1px solid var(--octo-c-border); border-radius: 6px; background: var(--octo-c-card); }
.osn-brand-logo-preview.is-dark { background: var(--octo-c-sidebar); border-color: var(--octo-c-sidebar); }
.osn-brand-logo-preview img { display: block; max-width: 160px; max-height: 40px; width: auto; height: auto; }
.osn-brand-logo-none { font-size: var(--osn-fs-hint); color: var(--octo-c-muted); }
.osn-brand-logo-preview.is-dark .osn-brand-logo-none { color: var(--octo-c-sidebar-text); }
:root .octo-content .osn-brand-logo .octo-btn { flex: none; width: auto; }
.osn-brand-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 12px; grid-column: 1 / -1; margin-top: 8px; }
.osn-brand-error { color: var(--osn-btn-danger-text); }

.osn-brand-preview { display: grid; gap: 12px; min-width: 0; }
.osn-brand-scheme { display: grid; gap: 8px; padding: 12px; border: 1px solid var(--octo-c-border); border-radius: 8px; background: var(--octo-c-page); color: var(--octo-c-text); }
.osn-brand-scheme-title { margin: 0; font-size: var(--osn-fs-hint); color: var(--octo-c-muted); }
.osn-brand-sidebar { padding: 10px 12px; border-radius: 6px; border: 1px solid var(--octo-c-border); background: var(--octo-c-card); }
.osn-brand-sidebar img { display: block; max-width: 100%; max-height: 34px; width: auto; height: auto; }
.osn-brand-card { display: grid; gap: 6px; padding: 12px; border: 1px solid var(--octo-c-border); border-radius: 6px; background: var(--octo-c-card); font-size: var(--osn-fs-text); }
.osn-brand-card span:not(.osn-brand-button) { color: var(--octo-c-muted); font-size: var(--osn-fs-hint); }
:root .osn-brand-scheme .osn-brand-button { justify-self: end; padding: 7px 14px; border-radius: 6px; font-size: var(--osn-fs-button); font-weight: 600; background: var(--osn-brand-surface, var(--octo-c-accent)); color: var(--osn-brand-surface-text, var(--octo-c-accent-text)); }
:root .osn-brand-scheme .osn-brand-mail, :root .osn-brand-scheme .osn-brand-mail span { color: var(--osn-brand-mail-text, #ffffff); }
.osn-brand-mail { padding: 10px 14px; border-radius: 6px 6px 0 0; font-size: var(--osn-fs-sub); font-weight: 600; text-align: center; background: var(--osn-brand-mail-bg, #003450); color: var(--osn-brand-mail-text, #ffffff); }

/* legal links and the "Powered by" line under a public card */
.osn-brand-footer { margin: 16px 0 0; text-align: center; font-size: var(--osn-fs-hint); color: var(--octo-c-muted); }
.osn-brand-footer a { color: var(--octo-c-link); text-decoration: underline; }
/* the sign-in page has a dark surface around the card */
.octo-login .osn-brand-footer, .octo-login .osn-brand-footer a { color: var(--octo-c-on-dark); }

/* the reseller page: the customer list next to the card */
.osn-reseller-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }

@media (max-width: 900px) {
    .osn-brand-layout { grid-template-columns: minmax(0, 1fr); }
}
