/**
 * Workspace identity in the header.
 *
 * Built on the theme's own variables so it follows a palette change, and sized
 * against --bs-app-header-height so the brand keeps the height the theme's
 * layout arithmetic assumes.
 */

.app-header .brand.workspace-brand {
    width: auto;
    min-width: 0;
}

.workspace-brand-link {
    display: flex;
    align-items: center;
    gap: .625rem;
    min-width: 0;
    padding: 0 .25rem;

    /* The theme sets .brand-logo to width:100%, which collapses the name to
       whatever the brand box happened to be and truncates it early. */
    width: auto;
    color: inherit;
}

.workspace-brand-link:hover .workspace-brand-name { text-decoration: underline; }

.workspace-brand-logo,
.workspace-brand-monogram {
    flex: 0 0 auto;
    width: 2rem;
    height: 2rem;
    border-radius: .375rem;
    object-fit: contain;
}

/* The theme's header is white, so anything tinted with white — as the old
   switcher's text-white was — is invisible on it. Painted with the theme's own
   accent instead, which stays legible whichever palette is in use. */
.workspace-brand-monogram {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bs-primary, #1f6bff);
    color: #fff;
    font-size: .75rem;
    font-weight: 600;
    letter-spacing: .02em;
}

.workspace-brand-logo { background: #fff; padding: 2px; }

.workspace-brand-names {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.2;
}

/* Truncated rather than wrapped: the header is a fixed height, and
   "Henry Van Eck Foundation" on two lines pushes everything out of it. */
.workspace-brand-name {
    font-size: .875rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 15rem;
}

.workspace-brand-product {
    font-size: .6875rem;
    font-weight: 400;
    opacity: .6;
    white-space: nowrap;
}

.workspace-brand-plan {
    text-transform: uppercase;
    letter-spacing: .04em;
    padding-left: .25rem;
}

.workspace-brand-caret { opacity: .6; font-size: .75rem; }

/* The theme hides the brand outright below this width, which is where knowing
   the workspace matters most — the switcher was hidden at the same breakpoint,
   so a phone showed no workspace identity anywhere on the page. */
@media (max-width: 767.98px) {
    .app-header .brand.workspace-brand { display: flex; }

    /* Against the viewport rather than a fixed cap: the rest of the header
       (queue, status, admin, account) is roughly constant, so what is left for
       the name scales with the screen. */
    .workspace-brand-name { max-width: min(10rem, 40vw); }

    /* Two lines of small text in a 60px bar is a squeeze; the workspace is the
       half worth keeping. */
    .workspace-brand-product { display: none; }
}

/* ------------------------------------------------------------ onboarding -- */

.onboarding {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 2rem;
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem 1.5rem 4rem;
}

.onboarding-rail { min-width: 0; }

.onboarding-step {
    display: flex;
    gap: .75rem;
    width: 100%;
    text-align: left;
    background: none;
    border: 0;
    border-left: 2px solid var(--bs-border-color, rgba(0, 0, 0, .12));
    padding: .625rem .75rem;
    color: inherit;
}

.onboarding-step.is-current {
    border-left-color: var(--bs-primary, #1f6bff);
    background: rgba(31, 107, 255, .06);
}

.onboarding-step-mark {
    flex: 0 0 auto;
    width: 1.25rem;
    text-align: center;
    opacity: .5;
    padding-top: .125rem;
}

.onboarding-step.is-done .onboarding-step-mark { opacity: 1; color: var(--bs-success, #198754); }

.onboarding-step-label { display: block; font-weight: 600; font-size: .875rem; }

.onboarding-step-detail {
    display: block;
    font-size: .75rem;
    opacity: .65;
    overflow: hidden;
    text-overflow: ellipsis;
}

.onboarding-panel { min-width: 0; max-width: 40rem; }

.onboarding-chat {
    border: 1px solid var(--bs-border-color, rgba(0, 0, 0, .12));
    border-radius: .5rem;
    padding: 1rem;
    min-height: 9rem;
    max-height: 22rem;
    overflow-y: auto;
}

.onboarding-bubble {
    max-width: 85%;
    padding: .5rem .75rem;
    border-radius: .75rem;
    margin-bottom: .5rem;
    font-size: .875rem;
}

.onboarding-bubble.is-visitor {
    margin-left: auto;
    background: var(--bs-primary, #1f6bff);
    color: #fff;
}

.onboarding-bubble.is-assistant {
    background: rgba(0, 0, 0, .05);
}

@media (max-width: 767.98px) {
    .onboarding {
        grid-template-columns: minmax(0, 1fr);
        gap: 1.25rem;
        padding: 1.25rem 1rem 3rem;
    }
}
