/* ---------------------------------------------------------------------------
   Square progress row + collapsible chrome bars (AI Efficiency Advisor)
   --------------------------------------------------------------------------- */

.aiea-steps {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.aiea-steps__toolbar {
    display: flex;
    align-items: flex-start;
    gap: 0.35rem;
}

.aiea-steps__row {
    display: flex;
    flex: 1 1 auto;
    min-width: 0;
    align-items: flex-start;
    gap: 0.25rem;
    overflow-x: auto;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.1rem;
}

.aiea-steps__refresh {
    flex: 0 0 auto;
    align-self: flex-start;
    min-height: 1.55rem;
    padding: 0.2rem 0.55rem;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #fff;
    color: #0f172a;
    font-family: inherit;
    font-size: 0.62rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0.01em;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.aiea-steps__refresh:hover:not(:disabled) {
    background: #f8fafc;
    border-color: #94a3b8;
}

.aiea-steps__refresh:focus-visible {
    outline: 2px solid var(--adv-accent, #2563eb);
    outline-offset: 2px;
}

.aiea-steps__refresh:disabled {
    opacity: 0.55;
    cursor: default;
}

.aiea-steps.is-locked .aiea-steps__refresh {
    opacity: 0.6;
    cursor: default;
}

.aiea-step {
    appearance: none;
    display: flex;
    flex: 1 1 0;
    min-width: 2.15rem;
    max-width: 5.5rem;
    flex-direction: column;
    align-items: center;
    padding: 0;
    border: 0;
    background: transparent;
    color: #64748b;
    font-family: inherit;
    cursor: pointer;
    text-align: center;
}

.aiea-step__box {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-width: 1.9rem;
    height: 1.55rem;
    border: 1px solid #fca5a5;
    border-radius: 5px;
    background: #fee2e2;
    color: #b91c1c;
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1;
    transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

/* Full-width slot below the square row — label is centered under the active square. */
.aiea-steps__label-slot {
    position: relative;
    min-height: 2.05rem;
    margin-top: 0.12rem;
    overflow: visible;
    --aiea-label-left: 50%;
}

.aiea-steps__active-label {
    position: absolute;
    left: var(--aiea-label-left, 0);
    top: 0;
    display: block;
    min-width: 0;
    max-width: min(100%, 22rem);
    padding: 0 0.35rem;
    box-sizing: border-box;
    font-size: 0.8125rem;
    font-weight: 700;
    line-height: 1.35;
    letter-spacing: 0.01em;
    color: var(--adv-surface-text, #0f172a);
    text-align: center;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    hyphens: auto;
}

.aiea-steps__active-label[hidden] {
    display: none;
}

.aiea-step.is-pending:hover .aiea-step__box,
.aiea-step.is-pending:focus-visible .aiea-step__box {
    border-color: #ef4444;
    background: #fecaca;
    color: #991b1b;
}

.aiea-step.is-done:hover .aiea-step__box,
.aiea-step.is-done:focus-visible .aiea-step__box {
    border-color: #4ade80;
    background: #bbf7d0;
    color: #166534;
}

.aiea-step.is-current:hover .aiea-step__box,
.aiea-step.is-current:focus-visible .aiea-step__box {
    border-color: var(--adv-accent, #2563eb);
    background: var(--adv-accent, #2563eb);
    color: #fff;
}

.aiea-step:focus-visible {
    outline: 2px solid var(--adv-accent, #2563eb);
    outline-offset: 2px;
    border-radius: 6px;
}

.aiea-step.is-done .aiea-step__box {
    background: #dcfce7;
    border-color: #86efac;
    color: #15803d;
}

.aiea-step.is-pending .aiea-step__box {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #b91c1c;
}

.aiea-step.is-current .aiea-step__box {
    background: var(--adv-accent, #2563eb);
    border-color: var(--adv-accent, #2563eb);
    color: #fff;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.18);
}

.aiea-steps__hint {
    margin: 0;
    font-size: 0.6rem;
    line-height: 1.3;
    color: #94a3b8;
}

.aiea-steps.is-locked .aiea-step {
    cursor: default;
    opacity: 0.6;
}

@media (max-width: 560px) {
    .aiea-steps__refresh {
        padding: 0.2rem 0.45rem;
        font-size: 0.58rem;
    }

    .aiea-step {
        min-width: 1.95rem;
    }

    .aiea-steps__label-slot {
        min-height: 2.35rem;
    }

    .aiea-steps__active-label {
        max-width: calc(100% - 0.75rem);
        font-size: 0.75rem;
    }
}

/* ---- Fold / unfold handles -------------------------------------------- */

.aiea-bar-toggle {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: 1.5px solid #93c5fd;
    border-radius: 8px;
    background: var(--advisor-blue-light, #dbeafe);
    color: var(--adv-accent, #2563eb);
    cursor: pointer;
    font-family: inherit;
    box-shadow: 0 1px 3px rgba(37, 99, 235, 0.14);
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.aiea-bar-toggle:hover {
    color: #1d4ed8;
    border-color: var(--adv-accent, #2563eb);
    background: #bfdbfe;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.22);
}

.aiea-bar-toggle:focus-visible {
    outline: 2px solid var(--adv-accent, #2563eb);
    outline-offset: 2px;
}

.aiea-bar-toggle[aria-expanded="false"] {
    background: var(--adv-accent, #2563eb);
    border-color: var(--adv-accent, #2563eb);
    color: #fff;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
}

.aiea-bar-toggle[aria-expanded="false"]:hover {
    background: #1d4ed8;
    border-color: #1d4ed8;
    color: #fff;
}

.aiea-bar-toggle svg {
    width: 1rem;
    height: 1rem;
    transition: transform 0.2s ease;
}

.aiea-bar-toggle[aria-expanded="false"] svg {
    transform: rotate(180deg);
}

/* On the dark panel header the handle stays readable but clearly tappable. */
.aiea-bar-toggle--top {
    align-self: center;
    border-color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.aiea-bar-toggle--top:hover {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.8);
    background: rgba(255, 255, 255, 0.24);
}

.aiea-bar-toggle--top[aria-expanded="false"] {
    background: var(--adv-accent, #2563eb);
    border-color: #93c5fd;
    color: #fff;
    box-shadow: 0 2px 10px rgba(37, 99, 235, 0.45);
}

.aiea-bar-toggle--progress {
    margin-left: auto;
    align-self: center;
}

/* Slim strip that stays above the bottom bar so it can be unfolded again. */
.advisor-fab__footer-shell,
.advisor-footer-shell {
    display: flex;
    flex-direction: column;
    flex: 0 0 auto;
    background: #fff;
    border-top: 1px solid #e2e8f0;
}

.advisor-fab__footer-shell[hidden],
.advisor-footer-shell[hidden] {
    display: none;
}

.aiea-bar-handle {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0.1rem 0.85rem 0.1rem 0;
}

.is-bar-footer-collapsed .aiea-bar-handle {
    padding: 0.25rem 0.85rem 0.25rem 0;
    background: linear-gradient(to bottom, #f8fafc, #eff6ff);
}

.advisor-fab__footer-shell .advisor-fab__footer,
.advisor-footer-shell .advisor-footer-nav {
    border-top: 0;
}

/* Answer-option strip — collapsible like nav footer */
.advisor-choice-shell {
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    background: #fff;
    border-top: 1px solid #e2e8f0;
}

.advisor-choice-shell[hidden] {
    display: none !important;
}

.advisor-choice-shell .advisor-choice-bar {
    border-top: 0;
}

.is-choice-bar-collapsed .advisor-choice-bar {
    display: none !important;
}

.is-choice-bar-collapsed .advisor-choice-shell .aiea-bar-handle {
    padding: 0.25rem 0.85rem 0.25rem 0;
    background: linear-gradient(to bottom, #f8fafc, #eff6ff);
}

/* ---- Collapsed states -------------------------------------------------- */

/* Top bar: compact row keeps logo + title + close + fold handle; actions row hides. */
.is-bar-top-collapsed .advisor-fab__panel-header,
.is-bar-top-collapsed .advisor-topbar {
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
}

.is-bar-top-collapsed .advisor-fab__header-row--actions,
.is-bar-top-collapsed .advisor-topbar__brand,
.is-bar-top-collapsed .advisor-topbar__actions > *:not(.aiea-bar-toggle) {
    display: none !important;
}

.is-bar-top-collapsed .advisor-fab__subtitle,
.is-bar-top-collapsed .advisor-fab__header-tagline {
    display: none !important;
}

/* Account strip: body folds away, pill handle stays. */
.is-bar-auth-collapsed .advisor-fab__auth-shell .advisor-auth-strip-host,
.is-bar-auth-collapsed .advisor-fab__auth-shell .advisor-auth-bar {
    display: none !important;
}

.is-bar-auth-collapsed .advisor-fab__auth-shell .aiea-bar-handle--auth {
    padding: 0.25rem 0.85rem 0.25rem 0;
    background: linear-gradient(to bottom, #f8fafc, #eff6ff);
}

/* Progress: the tab strip stays as the handle row, its body folds away. */
.is-bar-progress-collapsed .advisor-fab__progress-body,
.is-bar-progress-collapsed .advisor-fab__privacy-panel,
.is-bar-progress-collapsed .advisor-progress-section > .aiea-steps,
.is-bar-progress-collapsed .advisor-progress-row,
.is-bar-progress-collapsed .advisor-privacy-panel {
    display: none !important;
}

.advisor-fab--privacy-view.is-bar-progress-collapsed .advisor-fab__privacy-panel,
.advisor-app--privacy-view.is-bar-progress-collapsed .advisor-privacy-panel {
    display: block !important;
}

.is-bar-progress-collapsed .advisor-fab__progress {
    padding-bottom: 0;
}

.is-bar-progress-collapsed .advisor-fab__tabs,
.is-bar-progress-collapsed .advisor-tabs {
    margin-bottom: 0;
    border-bottom: 0;
}

/* Bottom bar: only the pill handle stays. */
.is-bar-footer-collapsed .advisor-fab__footer,
.is-bar-footer-collapsed .advisor-footer-nav,
.is-bar-footer-collapsed .advisor-footer-hint {
    display: none !important;
}

/* ---- Embed shell (advisorApp) variants --------------------------------- */

.advisor-progress-section .aiea-steps {
    padding: 0.15rem 0 0.2rem;
}

.advisor-topbar .aiea-bar-toggle--top {
    border-color: rgba(255, 255, 255, 0.25);
}
