﻿/* ===== Survey results (Results tab) ===== */

.survey-results-header {
    flex: 1 1 100%; /* fill the flex row of .header-section */
    width: 100%;
    min-width: 0;
}

.survey-results-request {
    margin: 2px 0 12px;
    padding-left: 10px;
    border-left: 3px solid rgba(0, 0, 0, 0.12);
    color: rgba(0, 0, 0, 0.65); /* muted: it's context, not results */
}

.survey-results-request-label {
    font-size: 0.8em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 2px;
}

.survey-results-request-text.clamped {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.survey-results-request-toggle {
    cursor: pointer;
    margin-top: 2px;
}

.survey-results-count {
    margin-bottom: 4px;
}

.survey-results-empty {
    margin: 20px 0;
}

/* --- Summary bars --- */
.survey-summary {
    max-width: 600px; /* keeps bars close to their labels on wide screens */
    margin-bottom: 20px;
}

.survey-summary-category {
    font-weight: 600;
    font-size: 1.1em;
    margin: 14px 0 4px;
}

.survey-summary-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 160px 56px; /* label | bar | count */
    align-items: center;
    gap: 10px;
    padding: 3px 0;
}

.survey-summary-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.survey-summary-bar {
    height: 10px;
    border-radius: 5px;
    background: rgba(0, 0, 0, 0.08); /* the empty part of the bar */
    overflow: hidden;
}

    .survey-summary-bar > span {
        display: block;
        height: 100%;
        border-radius: 5px;
        background: #1497b8; /* swap in a site color variable if you have one */
    }

.survey-summary-count {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* --- Raw data --- */
.survey-raw-header {
    margin-bottom: 10px;
}

.survey-raw-question {
    background: white;
    border-top: 1px solid rgba(0, 0, 0, 0.12);
    padding: 4px 10px;
}

    .survey-raw-question.alt {
        background: ghostwhite;
    }

.survey-raw-title {
    margin-bottom: 2px;
}

.survey-raw-answer,
.survey-raw-comment {
    margin-right: 10px;
}

.survey-raw-photo-link {
    cursor: pointer;
    text-decoration: underline;
}

@media (max-width: 480px) { /* phones: narrower bar */
    .survey-summary-row {
        grid-template-columns: minmax(0, 1fr) 80px 52px;
    }
}
