/* FAMMI questionnaire — Phase 1 RWD (desktop dual-column, mobile wizard) */

.fammi-layout {
    box-sizing: border-box;
    max-width: 100%;
}

.fammi-layout *,
.fammi-layout *::before,
.fammi-layout *::after {
    box-sizing: border-box;
}

/* --- Mobile top bar (progress + chapter toggle) --- */
.fammi-mobile-bar {
    position: sticky;
    top: 0;
    z-index: 20;
    background: #fff;
    border-bottom: 1px solid #dee2e6;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.75rem;
}

.fammi-progress-text {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: #2d6a4f;
    margin-bottom: 0.35rem;
    word-break: break-word;
}

.fammi-progress-track {
    height: 6px;
    background: #e9ecef;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.fammi-progress-fill {
    height: 100%;
    background: #40916c;
    border-radius: 3px;
    transition: width 0.2s ease;
}

.fammi-nav-toggle {
    width: 100%;
}

/* --- Column layout --- */
.fammi-columns {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
    gap: 0;
}

.fammi-nav {
    background-color: #e9ecef;
    padding: 10px;
    word-wrap: break-word;
}

.fammi-nav h4 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
}

.fammi-nav h3 {
    font-size: 0.95rem;
    margin-top: 0.75rem;
    margin-bottom: 0.25rem;
}

.fammi-nav .topic {
    text-indent: 12px;
    font-size: 0.88rem;
    line-height: 1.35;
    margin-bottom: 0.15rem;
}

.fammi-nav .topic a {
    text-decoration: none;
    color: #1b4332;
}

.fammi-nav .topic a.fammi-nav-active {
    font-weight: 700;
    color: #d00000;
}

.fammi-content {
    background-color: #f8f9fa;
    padding: 10px 12px;
    flex: 1;
    min-width: 0;
}

.fammi-topic-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.fammi-topic-actions .fammi-save-hint {
    flex: 1 1 100%;
    font-size: 0.85rem;
    margin: 0;
}

@media (min-width: 576px) {
    .fammi-topic-actions .fammi-save-hint {
        flex: 1 1 auto;
        text-align: right;
    }
}

/* --- Weighting removed in Phase 2 (elastic slider) --- */

.fammi-topic-panel h2 {
    font-size: 1.15rem;
    clear: both;
}

.fammi-topic-panel h3 {
    font-size: 1.05rem;
    margin-bottom: 0.75rem;
}

/* --- Per-option dual column scoring --- */
.fammi-scoring {
    width: 100%;
    margin-top: 0.5rem;
    font-size: 0.95rem;
}

.fammi-scoring-header {
    display: none;
    font-weight: 700;
    border-bottom: 2px solid #333;
    padding-bottom: 0.35rem;
    margin-bottom: 0.5rem;
}

@media (min-width: 576px) {
    .fammi-scoring-header {
        display: grid;
        grid-template-columns: 38% 62%;
        gap: 0.5rem;
    }
}

.fammi-option-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.35rem;
    padding: 0.65rem 0;
    border-bottom: 1px solid #ced4da;
}

@media (min-width: 576px) {
    .fammi-option-row {
        grid-template-columns: 38% 62%;
        gap: 0.75rem;
        align-items: start;
    }
}

.fammi-option-choice label {
    font-weight: normal;
    margin-left: 0.25rem;
    word-break: break-word;
}

.fammi-option-score {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
}

.fammi-option-score label {
    font-size: 0.82rem;
    margin: 0;
    flex: 1 1 100%;
}

@media (min-width: 576px) {
    .fammi-option-score label {
        flex: 0 1 auto;
        font-size: 0.88rem;
    }
}

/* --- Phase 2: elastic escore sliders --- */
.fammi-scoring-tip {
    font-size: 0.85rem;
    color: #495057;
    background: #e8f5e9;
    border-left: 4px solid #40916c;
    padding: 0.5rem 0.65rem;
    margin-bottom: 0.75rem;
}

.fammi-slider-wrap {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    flex: 1 1 100%;
    min-width: 0;
}

.fammi-escore-slider {
    flex: 1 1 8rem;
    min-width: 6rem;
    max-width: 100%;
    accent-color: #2d6a4f;
}

.fammi-escore-slider.fammi-slider-overshoot {
    accent-color: #e85d04;
}

.fammi-escore-value {
    font-weight: 700;
    min-width: 2.5rem;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.fammi-escore-hint {
    font-size: 0.75rem;
    color: #e85d04;
    font-weight: 600;
}

.fammi-escore-hint-active {
    display: inline;
}

.fammi-slider-scale {
    display: flex;
    justify-content: space-between;
    width: 100%;
    font-size: 0.7rem;
    color: #6c757d;
    padding: 0 0.1rem;
}

.fammi-slider-scale span:nth-child(2),
.fammi-slider-scale span:nth-child(4) {
    color: #40916c;
    font-weight: 600;
}

.fammi-option-score {
    flex-direction: column;
    align-items: stretch;
}

@media (min-width: 576px) {
    .fammi-option-score {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
    }
}

.fammi-topic-nav-buttons {
    margin-top: 1rem;
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
}

/* --- Desktop: side nav + content --- */
@media (min-width: 992px) {
    .fammi-nav {
        flex: 0 0 25%;
        max-width: 25%;
    }

    .fammi-content {
        flex: 0 0 75%;
        max-width: 75%;
    }

    .fammi-nav,
    .fammi-content {
        font-size: 1rem;
    }

    .fammi-scoring {
        font-size: 1rem;
    }
}

/* --- Mobile: collapsible nav, full-width content --- */
@media (max-width: 991.98px) {
    .fammi-nav {
        flex: 0 0 100%;
        max-width: 100%;
        display: none;
        max-height: 45vh;
        overflow-y: auto;
        border-bottom: 2px solid #adb5bd;
    }

    .fammi-nav.fammi-nav-open {
        display: block;
    }

    .fammi-content {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

/* Legacy class hooks (kept for JS selectors) */
.column.left,
.column.right {
    float: none;
    width: auto;
    padding: 0;
}

#fammi_div.row {
    margin-left: 0;
    margin-right: 0;
}
