/* Hide the sidebar (and its collapse toggle) on the Summary and Chat tabs,
   where none of the sidebar filters apply. Toggled by the body classes that
   scripts.js sets from the server's custom messages. */
body.on-summary .bslib-sidebar-layout > .sidebar,
body.on-summary .bslib-sidebar-layout > .collapse-toggle,
body.on-chat .bslib-sidebar-layout > .sidebar,
body.on-chat .bslib-sidebar-layout > .collapse-toggle {
    display: none !important;
}
body.on-summary .bslib-sidebar-layout,
body.on-chat .bslib-sidebar-layout {
    grid-template-columns: 1fr !important;
}

/* Sidebar filters */
.sidebar .shiny-input-container > label.control-label,
.sidebar .shiny-input-container > .control-label {
    font-weight: 600;
    margin-bottom: 0.4rem;
    display: block;
}
.sidebar .shiny-input-container { margin-bottom: 0.25rem; }

.filter-group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.2rem;
}
.filter-toggle-links { font-size: 0.75rem; }
.filter-toggle-links a { color: #6c757d; text-decoration: none; }
.filter-toggle-links a:hover { color: #343a40; text-decoration: underline; }

/* inset box-shadow overlays the selected row without overriding the
   score-color background-color set inline by Shiny's DataGrid. */
shiny-data-frame tr[aria-selected="true"] > td {
    box-shadow: inset 0 0 0 9999px rgba(255, 255, 255, 0.45);
    font-weight: 600;
}

/* Score legend */
.score-legend-strip {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.6rem;
    padding: 0.25rem 0 0.4rem;
    font-size: 0.8rem;
}
.score-legend-label {
    color: #555;
    font-weight: 600;
}
.score-legend {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.7rem;
}
.score-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}
.score-chip {
    display: inline-block;
    min-width: 1.4rem;
    text-align: center;
    padding: 0.05rem 0.4rem;
    border-radius: 0.25rem;
    font-weight: 600;
    font-size: 0.75rem;
    cursor: help; /* chips carry a tooltip with the score definition */
}
.score-chip-label {
    color: #333;
}

/* Expert assessment forms on the Findings and Summary tabs */
.assessment-block {
    border-top: 1px solid #e9ecef;
    margin-top: 0.75rem;
    padding-top: 0.6rem;
    font-size: 0.85rem;
}
.assessment-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}
.assessment-toggle { font-size: 0.78rem; }
.assessment-body { padding-top: 0.7rem; }
.assessment-block .shiny-input-container { margin-bottom: 0.5rem; }
.assessment-block .control-label {
    font-weight: 600;
    font-size: 0.8rem;
    color: #555;
}
.assessment-block .radio-inline,
.assessment-block .checkbox label { font-size: 0.8rem; }
.assessment-status {
    font-size: 0.75rem;
    color: #6c757d;
}

/* Reset Shiny's default input wrapper margins so the toolbar stays compact. */
.dist-toolbar { gap: 1rem; }
.dist-toolbar .shiny-input-container,
.dist-toolbar .form-group {
    margin: 0;
    padding: 0;
    width: auto;
}
.dist-toolbar .form-switch {
    margin: 0;
    padding: 0;
    font-size: 0.85rem;
    font-weight: 400;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}
.dist-toolbar .form-switch .form-check-input {
    margin: 0;
    float: none;
}
.dist-toolbar .form-switch label {
    margin: 0;
    white-space: nowrap;
}
