/* Study Summary (custom/meridian/study_summary.py). Auto-served by Dash from /assets/.
   Platform greys and accent (#1e40af); outcome colors come inline from
   study_summary_view.ROLE (the Disposition page's palette). */

.ss-summary-page {
    padding: 1rem 1.25rem 2.5rem 1.25rem;
    background: #ffffff;
    color: #212529;
}

/* === Header and controls (one row above the content) ===================== */
.ss-header {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.25rem 1rem;
    margin-bottom: 0.75rem;
}
.ss-title {
    font-size: 1.35rem;
    font-weight: 600;
    margin: 0;
}
.ss-asof {
    font-size: 0.85rem;
    color: #6c757d;
}
.ss-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1.5rem;
    padding: 0.6rem 0.9rem;
    margin-bottom: 1rem;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
}
.ss-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.ss-control-label {
    font-size: 0.8rem;
    font-weight: 500;
    color: #495057;
    margin: 0;
}
.ss-site-dropdown {
    min-width: 180px;
    font-size: 0.85rem;
}
.ss-segmented .btn {
    font-size: 0.8rem;
    padding: 0.15rem 0.6rem;
}

/* === Journey strip ======================================================= */
.ss-journey {
    display: flex;
    align-items: stretch;
    gap: 0.5rem;
    margin-bottom: 1rem;
}
/* The stages are the page's summary: they carry the visual weight (accent edge, tinted
   header, shadow), and nothing else on the page is filled or shadowed. */
.ss-stage {
    flex: 1 1 0;
    min-width: 0;
    background: #ffffff;
    border: 1px solid #c7d2ea;
    border-top: 4px solid #1e40af;
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(30, 64, 175, 0.10), 0 1px 2px rgba(33, 37, 41, 0.06);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.ss-stage-head {
    background: #eef2fb;
    border-bottom: 1px solid #dbe3f4;
    padding: 0.8rem 1rem 0.75rem 1rem;
}
.ss-stage .ss-rows { padding: 0.85rem 1rem 1rem 1rem; }
.ss-stage-title {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #1e40af;
    margin-bottom: 0.3rem;
}
/* Number and label share a baseline; the change sits on its own line, under the number. */
.ss-headline {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: baseline;
    column-gap: 0.5rem;
    row-gap: 0.15rem;
}
.ss-headline-value {
    font-size: 2.4rem;
    font-weight: 700;
    line-height: 1.1;
    color: #212529;
}
.ss-headline-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #343a40;
}
.ss-headline-change {
    grid-column: 1 / -1;
    font-size: 0.75rem;
    color: #6c757d;
    min-height: 1em;
}

/* A bucket: label | value | bar | change */
.ss-rows {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}
.ss-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
        "label value"
        "bar   change";
    column-gap: 0.5rem;
    row-gap: 0.2rem;
    align-items: center;
}
.ss-row-label { grid-area: label; font-size: 0.82rem; color: #343a40; }
.ss-row-value {
    grid-area: value;
    font-size: 0.9rem;
    font-weight: 600;
    text-align: right;
    font-variant-numeric: tabular-nums;
}
.ss-bar {
    grid-area: bar;
    height: 6px;
    background: #f1f3f5;
    border-radius: 3px;
}
.ss-bar-fill {
    height: 100%;
    border-radius: 3px;
    min-width: 0;
}
.ss-row-change {
    grid-area: change;
    font-size: 0.7rem;
    color: #6c757d;
    text-align: right;
    min-width: 3.5rem;
    min-height: 1.1em;      /* a row without a change keeps the same height as the others */
    line-height: 1.1;
}

/* Numbers that open the participant panel */
.ss-headline-value,
.ss-row-value,
.ss-tile-value {
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
    text-align: left;
}
.ss-row-value { text-align: right; }
.ss-headline-value:hover,
.ss-row-value:hover,
.ss-tile-value:hover {
    color: #1e40af;
    text-decoration: underline;
    text-underline-offset: 3px;
}
.ss-headline-value:focus-visible,
.ss-row-value:focus-visible,
.ss-tile-value:focus-visible {
    outline: 2px solid #1e40af;
    outline-offset: 2px;
    border-radius: 3px;
}

/* Between stages: how many carry forward */
.ss-connector {
    flex: 0 0 auto;
    width: 76px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #6c757d;
}
.ss-connector-count { font-size: 1.05rem; font-weight: 700; color: #1e40af; }
.ss-connector-arrow { font-size: 1.4rem; line-height: 1; color: #1e40af; }
.ss-connector-label { font-size: 0.65rem; line-height: 1.2; text-wrap: balance; }

/* === Part B progress ====================================================
   Details the Part B card, so it stays light: no fill, no boxes, a hairline above. It
   must not read as a summary bar (grey, at the top, on the platform's other pages). */
.ss-band {
    margin: 0.25rem 0 1.75rem 0;
    padding-top: 0.75rem;
    border-top: 1px solid #e9ecef;
}
.ss-band-heading {
    font-size: 0.85rem;
    font-weight: 600;
    color: #343a40;
    margin-bottom: 0.5rem;
}
.ss-band-groups {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 2.5rem;
}
.ss-band-title {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6c757d;
    margin-bottom: 0.2rem;
}
.ss-tiles {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1.5rem;
}
.ss-tile { min-width: 84px; }
.ss-tile-value { font-size: 1.15rem; font-weight: 600; color: #212529; }
.ss-tile-label { font-size: 0.8rem; color: #343a40; }
.ss-tile-note,
.ss-tile-change { font-size: 0.7rem; color: #6c757d; min-height: 1em; }

/* === By site ============================================================ */
.ss-section-title { font-size: 1rem; font-weight: 600; margin: 0.5rem 0 0.1rem 0; }
.ss-section-note { font-size: 0.8rem; color: #6c757d; margin-bottom: 0.5rem; }
.ss-sites-grid .ag-row { cursor: pointer; }
.ss-note { font-size: 0.9rem; color: #6c757d; padding: 1rem 0; }

/* === Participant panel ================================================== */
.ss-panel { width: min(480px, 100vw) !important; }
.ss-panel-table { width: 100%; font-size: 0.85rem; border-collapse: collapse; }
.ss-panel-table th {
    text-align: left;
    font-weight: 600;
    color: #495057;
    border-bottom: 1px solid #dee2e6;
    padding: 0.35rem 0.5rem;
}
.ss-panel-table td {
    padding: 0.3rem 0.5rem;
    border-bottom: 1px solid #f1f3f5;
    font-variant-numeric: tabular-nums;
}

/* === Narrower screens: two stages per row, then one ===================== */
@media (max-width: 1199.98px) {
    .ss-journey { flex-wrap: wrap; }
    .ss-stage { flex: 1 1 calc(50% - 0.5rem); }
    .ss-connector { display: none; }
}
@media (max-width: 575.98px) {
    .ss-summary-page { padding: 0.75rem 1rem 2rem 1rem; }
    .ss-stage { flex: 1 1 100%; }
    .ss-controls { gap: 0.5rem 1rem; }
}
