.rs-container {
    background-color: #cbd4ef;
    min-height: 100vh;
    padding: 12px 16px;
    display: flex;
    justify-content: center;
}

.rs-dashboard {
    background: #ffffff;
    border: 2px solid #000;
    border-radius: 16px;
    padding: 14px 18px 18px;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
}

.rs-project-bar {
    margin: 0 auto 8px;
    max-width: 480px;
    text-align: center;
}

.rs-manage-questions-link {
    display: inline-block;
    margin-top: 10px;
    font-size: 0.95rem;
    font-weight: 700;
    color: #0a7c3d;
    text-decoration: none;
}
.rs-manage-questions-link:hover {
    text-decoration: underline;
    color: #065f2e;
}

.rs-public-project-select {
    display: block;
    width: 100%;
    margin: 0;
    padding: 8px 12px;
    font-size: 16px;
    border: 3px solid #263F3B;
    border-radius: 6px;
    background: #F5F2EB;
    color: #263F3B;
    box-sizing: border-box;
}

.rs-public-intro {
    margin: 0 0 12px;
    font-size: 0.92rem;
    color: #444;
    line-height: 1.4;
}

.rs-project-bar .project-selector-row {
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
    display: block;
    max-width: none;
}

.rs-project-bar select,
.rs-project-bar .project-selector-row select {
    display: block;
    width: 100%;
    margin: 0;
    padding: 8px 12px;
    min-height: 40px;
    line-height: 1.3;
    font-size: 16px;
    border: 3px solid #263F3B;
    border-radius: 6px;
    background: #F5F2EB;
    color: #263F3B;
    box-sizing: border-box;
}

.rs-compact-card {
    background: #fff;
    border: 2px solid #000;
    border-radius: 12px;
    padding: 10px 14px;
    margin: 0 auto 10px;
    max-width: 1100px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

.rs-section-label {
    margin: 0 0 8px;
    font-size: 1rem;
    font-weight: 600;
}

.rs-add-question-row {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.rs-question-textarea {
    flex: 1;
    min-width: 0;
    min-height: 40px;
    padding: 8px 10px;
    border: 2px solid #E6F4F1;
    border-radius: 6px;
    font-size: 13px;
    font-family: inherit;
    resize: vertical;
    box-sizing: border-box;
    line-height: 1.35;
}

.rs-search-btn {
    flex-shrink: 0;
    padding: 8px 14px;
    font-size: 13px;
    white-space: nowrap;
    margin-top: 1px;
}

.rs-preview-area {
    margin-top: 6px;
    min-height: 0;
}

.rs-save-confirm {
    color: #2e7d32;
    font-weight: 600;
    font-size: 0.9rem;
    margin: 4px 0 0;
}

.rs-empty-note {
    color: #555;
    line-height: 1.4;
    font-size: 0.92rem;
    margin: 0;
}

.rs-questions-card {
    background: #aeb8d4;
    padding: 14px 16px 16px;
}

.rs-questions-card .rs-empty-note {
    color: #2a3348;
}

.rs-questions-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.rs-question-item {
    border: 2px solid #000;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.14);
}

.rs-question-row {
    display: flex;
    align-items: stretch;
    min-height: 38px;
}

.rs-question-num {
    flex: 0 0 auto;
    padding: 10px 6px 10px 10px;
    font-weight: 700;
    color: #333;
    font-size: 16px;
    line-height: 1.4;
    align-self: flex-start;
}

.rs-question-display {
    flex: 1;
    width: 100%;
    margin: 0;
    padding: 10px 10px;
    border: none;
    border-radius: 0;
    font-size: 16px;
    font-family: inherit;
    line-height: 1.4;
    resize: none;
    min-height: 44px;
    max-height: 88px;
    overflow-y: auto;
    box-sizing: border-box;
    background: #fafafa;
    color: #222;
}

.rs-expand-btn {
    flex: 0 0 40px;
    width: 40px;
    border: none;
    border-left: 1px solid #E6F4F1;
    background: #E6F4F1;
    color: #263F3B;
    font-size: 1.35rem;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    padding: 0;
}

.rs-expand-btn:hover {
    background: #d4ebe6;
}

.rs-question-panel {
    padding: 12px 12px 14px;
    background: #f8f9fa;
    border-top: 1px solid #E6F4F1;
}

.rs-question-meta {
    font-size: 0.82em;
    color: #666;
    margin-bottom: 10px;
}

.rs-brief-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.rs-refresh-brief-btn,
.rs-copy-brief-btn {
    display: inline-block;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 7px 16px;
    border: 2px solid #263F3B;
    border-radius: 6px;
    background: #263F3B;
    color: #fff;
    cursor: pointer;
}

.rs-refresh-brief-btn:hover,
.rs-copy-brief-btn:hover {
    background: #1a2b28;
}

.rs-refresh-brief-btn:disabled {
    opacity: 0.65;
    cursor: wait;
}

.rs-delete-question-btn {
    display: inline-block;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 7px 14px;
    border: 2px solid #a33;
    border-radius: 6px;
    background: #fff;
    color: #a33;
    cursor: pointer;
}

.rs-delete-question-btn:hover {
    background: #fff5f5;
}

.rs-delete-question-btn-row {
    flex: 0 0 auto;
    align-self: stretch;
    padding: 0 10px;
    font-size: 0.78rem;
    border: none;
    border-left: 1px solid #e8d0d0;
    border-radius: 0;
    background: #fff8f8;
}

.rs-delete-question-btn-row:hover {
    background: #ffecec;
}

.rs-copy-feedback {
    color: #2e7d32;
    font-size: 0.85rem;
    font-weight: 600;
}

.rs-source-warning {
    background: #fdecea;
    border: 1px solid #e57373;
    border-left: 4px solid #c62828;
    border-radius: 6px;
    padding: 10px 12px;
    margin-bottom: 14px;
    font-size: 0.9rem;
    line-height: 1.45;
    color: #5d1f1f;
    white-space: pre-wrap;
}

.rs-myth-box {
    background: #fff4e5;
    border: 1px solid #e6b566;
    border-left: 4px solid #c6761a;
    border-radius: 6px;
    padding: 10px 12px;
    margin-bottom: 14px;
}

.rs-myth-label {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: #8a4b08;
    margin-bottom: 6px;
}

.rs-myth-text {
    font-size: 0.95rem;
    line-height: 1.45;
    color: #3d2208;
    white-space: pre-wrap;
}

.rs-panel-heading {
    margin: 0 0 6px;
    font-size: 0.95rem;
}

.rs-summary-box,
.rs-answer-box {
    background: #f0f7ff;
    padding: 12px 14px;
    border-radius: 6px;
    margin-bottom: 14px;
    line-height: 1.5;
    white-space: pre-wrap;
    font-size: 0.95rem;
    border: 1px solid #c5daf5;
}

.rs-panel-sub {
    font-weight: normal;
    font-size: 0.78rem;
    color: #666;
}

.rs-source-studies {
    margin: 8px 0 12px;
    padding-left: 6px;
    font-size: 0.92em;
    color: #333;
}

.rs-source-study-row {
    display: flex;
    align-items: baseline;
    gap: 14px;
    margin-bottom: 7px;
    line-height: 1.45;
}

.rs-study-num {
    flex: 0 0 auto;
    font-weight: normal;
    color: #555;
    text-align: right;
    min-width: 1.6em;
}

.rs-answer-box .rs-study-cite-link {
    color: #1a5fb4;
    font-weight: 600;
    text-decoration: none;
}

.rs-answer-box .rs-study-cite-link:hover {
    text-decoration: underline;
}

.rs-source-note {
    font-size: 0.9rem;
    color: #444;
    font-style: italic;
    margin: 0 0 14px;
    padding: 0 2px;
}

.rs-literature-hint {
    font-size: 0.88rem;
    color: #555;
    font-style: italic;
    margin: 0 0 12px;
}

.results-table th, .results-table td {
    text-align: left;
    padding: 6px;
    vertical-align: top;
}

.rs-studies-table,
.rs-studies-table th,
.rs-studies-table td {
    font-family: Tahoma, Geneva, sans-serif;
    font-size: 10pt;
}

.rs-results-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
}

.rs-results-table th,
.rs-results-table td {
    border-bottom: 1px solid #e5e5e5;
}

.rs-col-save { width: 62px; }
.rs-col-num { width: 40px; }
.rs-col-date { width: 88px; }
.rs-col-source { width: 82px; }
.rs-col-title { width: 34%; }
.rs-col-conclusion { width: 34%; }
.rs-col-actions {
    width: 150px;
    text-align: right;
    vertical-align: top;
}

.rs-actions-head {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.rs-actions-label {
    font-weight: 600;
}

.rs-add-all-btn,
.rs-add-selected-btn {
    padding: 2px 6px;
    font-size: 9pt;
    font-family: Tahoma, Geneva, sans-serif;
    cursor: pointer;
    border-radius: 4px;
    white-space: nowrap;
}

.rs-add-all-btn {
    border: 1px solid #aaa;
    background: #f0f0f0;
}

.rs-add-selected-btn {
    padding: 4px 8px;
    font-size: 8.5pt;
}

.rs-action-cell {
    text-align: right;
    white-space: nowrap;
}

.rs-in-project {
    color: #2e7d32;
    font-weight: 600;
    font-size: 9pt;
}

.rs-in-queue {
    color: #1565c0;
    font-weight: 600;
    font-size: 9pt;
}

.rs-add-help {
    font-size: 9pt;
    color: #666;
}

.rs-title-cell a {
    font-weight: 500;
    line-height: 1.35;
    color: #0066cc;
    text-decoration: none;
}

.rs-title-cell a:hover {
    text-decoration: underline;
}

.rs-conclusion-cell {
    font-size: 0.92em;
    color: #444;
    line-height: 1.3;
}

.rs-more-link {
    font-size: 0.85em;
    color: #0066cc;
    margin-left: 6px;
    text-decoration: none;
}

.rs-pagination-controls {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    flex-wrap: wrap;
    margin: 10px 0 4px;
}

.rs-pagination-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.rs-page-btn {
    padding: 4px 10px;
    font-size: 9pt;
    font-family: Tahoma, Geneva, sans-serif;
    cursor: pointer;
    border: 1px solid #aaa;
    border-radius: 4px;
    background: #f0f0f0;
}

.rs-page-btn:disabled {
    opacity: 0.45;
    cursor: default;
}

.rs-page-info {
    font-size: 9pt;
    color: #444;
}

.rs-page-goto {
    font-size: 9pt;
    color: #444;
}

.rs-goto-input {
    width: 48px;
    padding: 3px 4px;
    text-align: center;
    font-size: 9pt;
    margin: 0 4px;
}

.rs-add-result-area {
    margin-bottom: 12px;
}

.rs-add-result {
    background: #e8f5e9;
    border: 1px solid #a5d6a7;
    border-radius: 6px;
    padding: 12px 14px;
    font-size: 10pt;
}

.rs-add-result-info {
    background: #f5f5f5;
    border-color: #ccc;
}

.rs-add-result-hint {
    margin: 8px 0 6px;
    color: #444;
    font-size: 9pt;
}

.rs-add-result-list {
    margin: 0 0 10px 18px;
    padding: 0;
    max-height: 220px;
    overflow-y: auto;
}

.rs-add-result-list li {
    margin-bottom: 4px;
    line-height: 1.35;
}

.rs-add-result-warn {
    color: #b45309;
    font-size: 8.5pt;
}

.rs-add-result-dismiss {
    padding: 4px 10px;
    font-size: 9pt;
    cursor: pointer;
    border: 1px solid #aaa;
    border-radius: 4px;
    background: #fff;
}

.rs-error {
    color: #b00020;
    font-size: 0.92rem;
}

/*
 * Grok wait overlay — layout lives in crossword.css (.grok-wait-overlay).
 * Do NOT set align-items:center here without overflow-y:auto; that clips the
 * crossword so users cannot scroll while waiting for Ask Grok.
 */
#grokProcessingOverlay.grok-wait-overlay {
    /* crossword.css already: fixed, flex-start, overflow-y:auto */
    z-index: 99999;
}

/* Legacy class kept for any old markup; prefer .grok-wait-card */
.grok-overlay-card {
    max-width: 1000px;
    width: 96vw;
    text-align: center;
    padding: 28px 20px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.12);
}

/* Video wait only — do not force a tall stage when crossword is active
   (centering a tall puzzle clips the top row, e.g. U of UPDRSIII).
   Clip frame sizing lives in crossword.css (adapts to each video’s aspect ratio). */
#stickman-stage:not(.cw-stage-active) {
    margin-bottom: 12px;
    width: 100%;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

#stickman-stage .stickman-svg {
    background: #f8f9fa;
    border: 3px solid #4f654d;
    border-radius: 10px;
}

/* Fixed black box removed — see crossword.css .wait-clip-video */

#stickman-message {
    margin: 0 0 6px;
    font-size: 1.05rem;
    color: #263F3B;
    font-weight: 600;
}

#stickman-label {
    margin: 0;
    font-size: 0.85rem;
    color: #6b7c78;
    font-style: italic;
}