.sbh-fa-app {
    display: grid;
    gap: 8px;
}

.sbh-fa-eyebrow {
    margin: 0 0 7px !important;
    color: var(--sbho-primary);
    font-size: 12px !important;
    font-weight: 750;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.sbh-fa-create-panel[hidden],
.sbh-fa-notice[hidden],
.sbh-fa-builder[hidden],
.sbh-fa-tab-panel[hidden],
.sbh-fa-strategy-empty[hidden],
.sbh-fa-strategy-form[hidden] {
    display: none !important;
}

.sbh-fa-main-header,
.sbh-fa-header-actions,
.sbh-fa-builder-top,
.sbh-fa-stage-heading,
.sbh-fa-stage-card__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.sbh-fa-header-actions {
    flex: 0 0 auto;
}

.sbh-fa-credit-balance {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 0 13px;
    border: 1px solid var(--sbho-border);
    border-radius: 999px;
    background: var(--sbho-surface);
    color: var(--sbho-text);
    font-size: 13px;
    font-weight: 700;
}

.sbh-fa-panel {
    padding: 24px;
    border: 1px solid var(--sbho-border);
    border-radius: var(--sbho-radius);
    background: var(--sbho-bg);
}

.sbh-fa-close,
.sbh-fa-back,
.sbh-fa-remove-stage {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--sbho-border);
    border-radius: var(--sbho-button-radius);
    background: var(--sbho-surface);
    color: var(--sbho-text);
    cursor: pointer;
}

.sbh-fa-close,
.sbh-fa-remove-stage {
    width: 40px;
    height: 40px;
    padding: 0;
}

.sbh-fa-back {
    align-self: flex-start;
    gap: 7px;
    padding: 9px 12px;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
}

.sbh-fa-close:hover,
.sbh-fa-close:focus-visible,
.sbh-fa-back:hover,
.sbh-fa-back:focus-visible,
.sbh-fa-remove-stage:hover,
.sbh-fa-remove-stage:focus-visible {
    border-color: var(--sbho-primary);
    color: var(--sbho-primary);
}

.sbh-fa-form textarea,
.sbh-fa-strategy-form textarea,
.sbh-fa-stage-card textarea,
.sbh-fa-stage-card input {
    width: 100%;
    padding: 12px 13px;
    border: 1px solid var(--sbho-border);
    border-radius: 8px;
    background: #fff;
    box-sizing: border-box;
    color: var(--sbho-text);
    font: inherit;
    resize: vertical;
}

.sbh-fa-form textarea:focus,
.sbh-fa-strategy-form textarea:focus,
.sbh-fa-stage-card textarea:focus,
.sbh-fa-stage-card input:focus {
    outline: 2px solid color-mix(in srgb, var(--sbho-primary) 22%, transparent);
    border-color: var(--sbho-primary);
}

.sbh-fa-form-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-top: 22px;
    padding-top: 20px;
    border-top: 1px solid var(--sbho-border);
}

.sbh-fa-form-actions p {
    max-width: 620px;
    margin: 0;
    color: var(--sbho-muted);
    font-size: 13px;
}

.sbh-fa-form-actions > div {
    display: flex;
    gap: 10px;
    flex: 0 0 auto;
}

.sbh-fa-loading {
    padding: 38px 20px;
    text-align: center;
    color: var(--sbho-muted);
}

.sbh-fa-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    margin-right: 9px;
    border: 2px solid var(--sbho-border);
    border-top-color: var(--sbho-primary);
    border-radius: 50%;
    vertical-align: -4px;
    animation: sbh-fa-spin .8s linear infinite;
}

.sbh-fa-project-card {
    display: flex;
    flex-direction: column;
    min-height: 235px;
}

.sbh-fa-project-card small {
    display: block;
    margin-top: auto;
    color: var(--sbho-muted);
}

.sbh-fa-project-actions {
    display: flex;
    align-items: center;
    margin-top: 16px;
    padding-top: 15px;
    border-top: 1px solid var(--sbho-border);
}

.sbh-fa-builder {
    display: grid;
    gap: 18px;
}

.sbh-fa-builder-top {
    justify-content: flex-start;
    padding: 20px 0 4px;
}

.sbh-fa-builder-top > div:last-child {
    min-width: 0;
}

.sbh-fa-builder-top h3 {
    margin: 0;
    font-size: clamp(24px, 4vw, 34px);
}

.sbh-fa-builder-top p:last-child {
    margin: 7px 0 0;
    color: var(--sbho-muted);
}

.sbh-fa-tabs {
    display: flex;
    gap: 8px;
    padding: 7px;
    border: 1px solid var(--sbho-border);
    border-radius: var(--sbho-radius);
    background: var(--sbho-surface);
    overflow-x: auto;
}

.sbh-fa-tabs button {
    flex: 1 0 auto;
    padding: 11px 15px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--sbho-muted);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.sbh-fa-tabs button.is-active {
    background: var(--sbho-primary);
    color: #fff;
}

.sbh-fa-strategy-head {
    align-items: flex-start;
}

.sbh-fa-strategy-empty {
    max-width: 720px;
    margin: 12px auto;
    padding: 48px 28px;
    border: 1px dashed var(--sbho-border);
    border-radius: var(--sbho-radius);
    background: var(--sbho-bg);
    text-align: center;
}

.sbh-fa-strategy-empty > .dashicons {
    width: 44px;
    height: 44px;
    color: var(--sbho-primary);
    font-size: 44px;
}

.sbh-fa-strategy-empty h4 {
    margin: 16px 0 8px;
    font-size: 22px;
}

.sbh-fa-strategy-empty p {
    color: var(--sbho-muted);
}

.sbh-fa-strategy-empty .sbh-fa-cost {
    margin-top: 20px;
    color: var(--sbho-text);
}

.sbh-fa-strategy-grid,
.sbh-fa-stage-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.sbh-fa-strategy-grid p,
.sbh-fa-stage-grid p {
    margin: 0;
}

.sbh-fa-strategy-grid label,
.sbh-fa-stage-grid label {
    display: block;
    margin-bottom: 7px;
    font-size: 13px;
    font-weight: 700;
}

.sbh-fa-wide {
    grid-column: 1 / -1;
}

.sbh-fa-stage-heading {
    margin-top: 28px;
    padding-top: 23px;
    border-top: 1px solid var(--sbho-border);
}

.sbh-fa-stage-heading h4,
.sbh-fa-stage-heading p {
    margin: 0;
}

.sbh-fa-stage-heading p {
    margin-top: 5px;
    color: var(--sbho-muted);
    font-size: 13px;
}

.sbh-fa-stages {
    display: grid;
    gap: 15px;
    margin-top: 16px;
}

.sbh-fa-stage-card {
    padding: 20px;
    border: 1px solid var(--sbho-border);
    border-radius: var(--sbho-radius);
    background: var(--sbho-bg);
}

.sbh-fa-stage-card__head {
    margin-bottom: 15px;
}

.sbh-fa-stage-card h5 {
    margin: 0;
    font-size: 17px;
}

.sbh-fa-remove-stage {
    color: var(--sbho-muted);
}

.sbh-fa-remove-stage[hidden] {
    visibility: hidden;
}

.sbh-fa-notice {
    margin: 0 0 14px;
}

@keyframes sbh-fa-spin {
    to { transform: rotate(360deg); }
}

@media (max-width: 850px) {
    .sbh-fa-main-header,
    .sbh-fa-header-actions,
    .sbh-fa-stage-heading,
    .sbh-fa-strategy-head {
        align-items: stretch;
        flex-direction: column;
    }

    .sbh-fa-header-actions .sbho-button,
    .sbh-fa-strategy-head .sbho-button {
        width: 100%;
    }

    .sbh-fa-credit-balance {
        justify-content: center;
    }
}

@media (max-width: 760px) {
    .sbh-fa-form-actions,
    .sbh-fa-project-actions,
    .sbh-fa-builder-top {
        align-items: stretch;
        flex-direction: column;
    }

    .sbh-fa-form-actions > div,
    .sbh-fa-strategy-grid,
    .sbh-fa-stage-grid {
        display: grid;
        grid-template-columns: 1fr;
    }

    .sbh-fa-wide {
        grid-column: auto;
    }

    .sbh-fa-form-actions .sbho-button,
    .sbh-fa-project-actions .sbho-button,
    .sbh-fa-back {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .sbh-fa-spinner {
        animation: none;
    }
}
