/* Nib placements. The figure paints its own colours (registered brand palette) - nothing
   here recolours it. If Nib clashes with a surface, move the surface, not the bird. */

.lvxd-nib-wrap {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: flex-end;
    flex: 0 0 auto;
}

.lvxd-nib {
    display: block;
    flex: 0 0 auto;
    line-height: 0;
    pointer-events: none;
}

.lvxd-nib > svg {
    display: block;
    height: 100%;
    width: auto;
}

.lvxd-nib[data-lvxd-nib-skipped],
.lvxd-nib[data-lvxd-nib-error] {
    display: none;
}

/* Only placements that opt into being dismissible take a click - everywhere else he stays inert
   decoration that never eats a click meant for what is behind him. */
.lvxd-nib.is-interactive {
    pointer-events: auto;
    cursor: pointer;
}

/* The settle/wake control. Quiet until you go looking for it: it appears on hover or keyboard
   focus, and stays put once he is settled so there is always a way back. */
.lvxd-nib-toggle {
    position: absolute;
    bottom: -4px;
    right: 0;
    z-index: 2;
    padding: 3px 9px;
    border-radius: 99px;
    border: 1px solid var(--lvxd-sf-border, rgba(0, 0, 0, .1));
    background: var(--lvxd-sf-surface, #fff);
    color: var(--lvxd-sf-text-muted, inherit);
    font-size: 11px;
    font-weight: 600;
    line-height: 1.5;
    cursor: pointer;
    opacity: 0;
    transition: opacity .18s ease;
}

.lvxd-nib-wrap:hover .lvxd-nib-toggle,
.lvxd-nib-toggle:focus-visible,
.lvxd-nib-toggle[aria-pressed="true"] {
    opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
    .lvxd-nib-toggle {
        transition: none;
    }
}

/* Speech card - a plain surface card, nothing Nib-specific about the chrome. Two lines as the
   design uses: the spoken line, then a muted detail line under it. Positioned out of the flow
   so his height never jumps when he speaks. */
.lvxd-nib-bubble-card {
    position: absolute;
    bottom: calc(100% - 14px);
    right: 24px;
    z-index: 1;
    width: 214px;
    padding: 12px 15px;
    border-radius: 14px;
    background: var(--lvxd-sf-surface, #fff);
    border: 1px solid var(--lvxd-sf-border, rgba(0, 0, 0, .1));
    box-shadow: var(--lvxd-sf-shadow-md, 0 12px 32px rgba(0, 0, 0, .08));
    color: var(--lvxd-sf-text, inherit);
    text-align: left;
}

.lvxd-nib-bubble {
    font-size: 13.5px;
    line-height: 1.5;
    opacity: 0;
    transition: opacity .25s ease;
    /* Reserves the line height so the typewriter doesn't reflow the card as it fills. */
    min-height: 1.5em;
}

.lvxd-nib-bubble.is-visible {
    opacity: 1;
}

.lvxd-nib-bubble-detail {
    margin-top: 6px;
    font-size: 12px;
    line-height: 1.5;
    color: var(--lvxd-sf-text-muted, inherit);
}

@media (prefers-reduced-motion: reduce) {
    .lvxd-nib-bubble {
        transition: none;
    }
}

/* Page-load overlay - Nib centred, no absolute positioning. The pulse loader nested inside
   the figure host is the pre-JS fallback and is replaced when he mounts; while it is showing
   it needs the same centring, hence the rule on the host rather than the wrapper. */
.lvxd-page-load-nib {
    align-items: center;
    justify-content: center;
}

.lvxd-page-load-nib .lvxd-nib {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Storefront home hero - per the LivexHub design he stands at the LEFT edge of the product
   panel, overlapping it slightly and bottom-aligned to it, facing right into the panel. The
   panel is already position:relative for its ticker and secure badge, so he anchors to it.
   NOT in the flow below the card - an earlier pass did that and he overlapped the tiles. */
.lvxd-sf-hero-greeter {
    position: absolute;
    /* He overlaps the panel's left edge, as the design shows, but only by a wing - at -86px his
       body sat over the LivexSign tile and hid its stat line. Verified in a browser at 1520px. */
    left: -105px;
    bottom: 6px;
    z-index: 2;
}

@media (max-width: 1180px) {
    /* Below this he would sit on top of the copy column rather than beside the panel. */
    .lvxd-sf-hero-greeter {
        display: none;
    }
}

/* Storefront pricing hero - Nib stands beside the headline rather than over it, so the
   copy keeps the full measure and he is never a background texture. */
.lvxd-sf-pricing-hero-with-nib {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 32px;
    /* The base hero is capped at 660px; Nib needs his own room rather than taking it
       out of the headline's measure. */
    max-width: 840px;
}

.lvxd-sf-pricing-hero-with-nib > .lvxd-sf-pricing-hero-copy {
    flex: 1 1 auto;
    min-width: 0;
}

@media (max-width: 900px) {
    /* Under the 120px floor he would have to shrink, so he leaves instead. */
    .lvxd-sf-pricing-hero-with-nib > .lvxd-nib-wrap {
        display: none;
    }
}

/* Workspace empty state - the one place on Manage plans with room for him. */
.lvxd-workspace-empty-with-nib {
    display: flex;
    align-items: center;
    gap: 24px;
}

.lvxd-workspace-empty-with-nib > .lvxd-workspace-empty-note {
    margin: 0;
}

@media (max-width: 640px) {
    .lvxd-workspace-empty-with-nib > .lvxd-nib-wrap {
        display: none;
    }
}
