.dnhs-csm-results-wrap {
    max-width: 1100px;
    margin: 0 auto;
    font-size: 15px;
    line-height: 1.5;
    color: #1d2327;
}

.dnhs-csm-results-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1em;
    margin-bottom: 0.25em;
}

.dnhs-csm-results-title h1 {
    font-size: 1.5em;
    margin: 0 0 0.15em;
}

.dnhs-csm-results-school {
    font-weight: 700;
    color: #2271b1;
    margin: 0 0 0.15em;
    font-size: 1.1em;
}

.dnhs-csm-results-meta {
    margin: 0;
    color: #50575e;
    font-size: 0.9em;
}

.dnhs-csm-results-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.75em;
}

.dnhs-csm-results-filters label {
    display: flex;
    flex-direction: column;
    font-weight: 600;
    font-size: 12px;
    color: #50575e;
}

.dnhs-csm-generated {
    text-align: right;
    color: #787c82;
    font-size: 0.85em;
    margin: 0 0 1em;
}

/* Stat cards */

.dnhs-csm-stat-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1em;
    margin-bottom: 1.5em;
}

.dnhs-csm-stat-card {
    background: #fff;
    border: 1px solid #dcdcde;
    border-radius: 8px;
    padding: 1.25em;
    text-align: center;
}

.dnhs-csm-stat-icon {
    font-size: 1.8em;
    margin-bottom: 0.2em;
}

.dnhs-csm-stat-label {
    text-transform: uppercase;
    letter-spacing: 0.03em;
    font-size: 0.75em;
    font-weight: 700;
    color: #787c82;
    margin-bottom: 0.35em;
}

.dnhs-csm-stat-value {
    font-size: 1.7em;
    font-weight: 700;
}

.dnhs-csm-stat-sub {
    font-size: 0.85em;
    color: #50575e;
    margin-top: 0.2em;
}

.dnhs-csm-stars {
    position: relative;
    display: inline-block;
    font-size: 1.1em;
    color: #e0e0e0;
    letter-spacing: 2px;
    margin: 0.15em 0;
}

.dnhs-csm-stars::before {
    content: '\2605\2605\2605\2605\2605';
    position: absolute;
    top: 0;
    left: 0;
    width: var(--dnhs-csm-rating, 0%);
    overflow: hidden;
    white-space: nowrap;
    color: #fbbc04;
}

.dnhs-csm-rating-outstanding { color: #1e8e3e; }
.dnhs-csm-rating-very-satisfactory { color: #34a853; }
.dnhs-csm-rating-satisfactory { color: #a58a04; }
.dnhs-csm-rating-fair { color: #f29900; }
.dnhs-csm-rating-poor { color: #d93025; }

/* Cards + layout grid */

.dnhs-csm-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5em;
}

.dnhs-csm-card {
    background: #fff;
    border: 1px solid #dcdcde;
    border-radius: 8px;
    padding: 1.25em 1.5em;
    margin-bottom: 1.5em;
}

.dnhs-csm-card h2 {
    font-size: 1.05em;
    margin: 0 0 0.75em;
}

.dnhs-csm-chart-empty {
    color: #787c82;
    font-style: italic;
}

/* Trend / SQD bar chart primitives (shared with the SVG line chart) */

.dnhs-csm-chart {
    width: 100%;
    height: auto;
    max-height: 220px;
}

.dnhs-csm-chart-grid {
    stroke: #f0f0f1;
    stroke-width: 1;
}

.dnhs-csm-chart-threshold {
    stroke: #c3c4c7;
    stroke-width: 1;
    stroke-dasharray: 4 3;
}

.dnhs-csm-chart-threshold-label {
    fill: #787c82;
    font-size: 9px;
}

.dnhs-csm-chart-axis-label {
    fill: #50575e;
    font-size: 10px;
}

.dnhs-csm-bar-track {
    background: #f0f0f1;
    border-radius: 3px;
    height: 14px;
    overflow: hidden;
}

.dnhs-csm-bar-fill {
    background: #2271b1;
    height: 100%;
}

.dnhs-csm-bar-total {
    text-align: right;
    font-weight: 600;
    margin: 0.5em 0 0;
}

/* Mini bar lists (services, etc.) */

.dnhs-csm-mini-bars {
    margin-bottom: 0.5em;
}

.dnhs-csm-mini-bar-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 2fr auto;
    align-items: center;
    gap: 0.75em;
    padding: 0.3em 0;
}

.dnhs-csm-mini-bar-label {
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dnhs-csm-mini-bar-count {
    font-weight: 600;
    font-size: 13px;
    text-align: right;
    white-space: nowrap;
}

/* Donut chart */

.dnhs-csm-donut-wrap {
    display: flex;
    align-items: center;
    gap: 1.5em;
    flex-wrap: wrap;
}

.dnhs-csm-donut-chart {
    width: 140px;
    flex-shrink: 0;
}

.dnhs-csm-donut {
    width: 100%;
    height: auto;
}

.dnhs-csm-donut-center-label {
    font-size: 15px;
    font-weight: 700;
    fill: #1d2327;
}

.dnhs-csm-donut-center-sublabel {
    font-size: 7px;
    fill: #787c82;
}

.dnhs-csm-donut-legend {
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: 0.9em;
    flex: 1;
    min-width: 180px;
}

.dnhs-csm-donut-legend li {
    margin-bottom: 0.4em;
}

.dnhs-csm-legend-swatch {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 2px;
    margin-right: 0.4em;
}

/* Rings */

.dnhs-csm-rings {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 1em;
    text-align: center;
}

.dnhs-csm-ring-block {
    width: 110px;
}

.dnhs-csm-ring {
    width: 100%;
    height: auto;
}

.dnhs-csm-ring-text {
    font-size: 18px;
    font-weight: 700;
    fill: #1d2327;
}

.dnhs-csm-ring-label {
    font-weight: 600;
    margin-top: 0.3em;
    font-size: 0.9em;
}

.dnhs-csm-ring-sub {
    font-size: 0.8em;
    color: #787c82;
}

/* SQD summary bars + detail table */

.dnhs-csm-sqd-list {
    margin-bottom: 1em;
}

.dnhs-csm-sqd-row {
    display: grid;
    grid-template-columns: 2fr 3fr 1fr;
    align-items: center;
    gap: 1em;
    padding: 0.5em 0;
    border-bottom: 1px solid #f0f0f1;
}

.dnhs-csm-sqd-row:last-child {
    border-bottom: none;
}

.dnhs-csm-sqd-score {
    text-align: right;
    white-space: nowrap;
    font-weight: 600;
}

.dnhs-csm-sqd-details summary {
    cursor: pointer;
    font-weight: 600;
    color: #2271b1;
    padding: 0.5em 0;
}

.dnhs-csm-table-wrap {
    overflow-x: auto;
}

.dnhs-csm-sqd-detail-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 720px;
    font-size: 0.85em;
}

.dnhs-csm-sqd-detail-table th,
.dnhs-csm-sqd-detail-table td {
    border: 1px solid #dcdcde;
    padding: 0.5em;
    text-align: center;
}

.dnhs-csm-sqd-detail-table th:first-child,
.dnhs-csm-sqd-detail-table td:first-child {
    text-align: left;
}

.dnhs-csm-sqd-detail-table tfoot th {
    background: #f6f7f7;
}

/* Word cloud */

.dnhs-csm-tag-cloud {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.5em 0.9em;
    padding: 0.5em 0;
}

.dnhs-csm-tag {
    font-weight: 700;
    line-height: 1;
}

.dnhs-csm-word-cloud-note {
    font-size: 0.8em;
    color: #787c82;
    margin: 0.5em 0 0;
}

/* Sentiment */

.dnhs-csm-sentiment-note {
    margin: -0.5em 0 0.75em;
    color: #787c82;
    font-size: 0.85em;
}

.dnhs-csm-sentiment-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75em;
    text-align: center;
}

.dnhs-csm-sentiment-card {
    border: 1px solid #dcdcde;
    border-radius: 6px;
    padding: 0.75em 0.5em;
}

.dnhs-csm-sentiment-icon {
    font-size: 1.6em;
}

.dnhs-csm-sentiment-pct {
    font-size: 1.3em;
    font-weight: 700;
}

.dnhs-csm-sentiment-positive .dnhs-csm-sentiment-pct { color: #1e8e3e; }
.dnhs-csm-sentiment-neutral .dnhs-csm-sentiment-pct { color: #a58a04; }
.dnhs-csm-sentiment-negative .dnhs-csm-sentiment-pct { color: #d93025; }

.dnhs-csm-sentiment-label {
    font-size: 0.85em;
    color: #50575e;
}

.dnhs-csm-sentiment-count {
    font-size: 0.8em;
    color: #787c82;
}

/* CTA + footer */

.dnhs-csm-cta {
    text-align: center;
    margin: 1.5em 0;
}

.dnhs-csm-cta a.button {
    display: inline-block;
    padding: 0.85em 2.5em;
    font-size: 1.1em;
    font-weight: 600;
    color: #fff;
    background: #2271b1;
    border: 1px solid #135e96;
    border-radius: 4px;
    text-decoration: none;
}

.dnhs-csm-cta a.button:hover,
.dnhs-csm-cta a.button:focus {
    background: #135e96;
    color: #fff;
}

.dnhs-csm-footnote {
    text-align: center;
    color: #787c82;
    font-size: 0.8em;
}

@media print {
    .dnhs-csm-results-filters,
    .dnhs-csm-cta {
        display: none;
    }
}

@media (max-width: 782px) {
    .dnhs-csm-stat-cards {
        grid-template-columns: 1fr 1fr;
    }

    .dnhs-csm-columns {
        grid-template-columns: 1fr;
    }

    .dnhs-csm-sqd-row {
        grid-template-columns: 1fr;
        text-align: left;
    }

    .dnhs-csm-mini-bar-row {
        grid-template-columns: 1fr;
    }

    .dnhs-csm-sentiment-cards {
        grid-template-columns: 1fr;
    }
}
