/* Chart Critic — extends Chart Builder styles */

.cc-page .cc-wrap {
    max-width: 1100px;
}

.cc-scenario-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin-bottom: 1rem;
}

/* High-contrast buttons (WCAG-friendly on white / coloured backgrounds) */
.cc-page .cb-btn-secondary {
    background: #fff;
    border: 2px solid #8b0000;
    color: #8b0000;
}

.cc-page .cb-btn-secondary:hover,
.cc-page .cb-btn-secondary:focus-visible {
    background: #8b0000;
    color: #fff;
    outline: 3px solid #1a1a1a;
    outline-offset: 2px;
}

.cc-btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.6rem 1.1rem;
    border: 2px solid #8b0000;
    border-radius: 8px;
    background: #8b0000;
    color: #fff;
    font-family: inherit;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
}

.cc-btn-primary:hover,
.cc-btn-primary:focus-visible {
    background: #6d0000;
    border-color: #6d0000;
    color: #fff;
    outline: 3px solid #1a1a1a;
    outline-offset: 2px;
}

.cc-scenario-btn {
    padding: 0.5rem 0.85rem;
    border: 2px solid #8b0000;
    background: #fff;
    color: #8b0000;
    border-radius: 999px;
    font-family: inherit;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.cc-scenario-btn:hover,
.cc-scenario-btn:focus-visible {
    background: #8b0000;
    color: #fff;
    outline: 3px solid #1a1a1a;
    outline-offset: 2px;
}

.cc-scenario-btn.active {
    background: #8b0000;
    color: #fff;
}

.cc-scenario-btn.cc-done {
    border-color: #1b5e20;
    color: #1b5e20;
}

.cc-scenario-btn.cc-done:hover,
.cc-scenario-btn.cc-done:focus-visible {
    background: #1b5e20;
    color: #fff;
}

.cc-scenario-btn.cc-done.active {
    background: #1b5e20;
    color: #fff;
}

.cc-scenario-intro {
    text-align: center;
    color: #444;
    max-width: 720px;
    margin: 0 auto 1.25rem;
    line-height: 1.5;
    font-size: 1rem;
}

.cc-chart-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.cc-chart-header h2 {
    margin: 0;
}

.cc-btn-view-toggle {
    padding: 0.45rem 0.85rem;
    border: 2px solid #1b5e20;
    border-radius: 8px;
    background: #1b5e20;
    color: #fff;
    font-family: inherit;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
}

.cc-btn-view-toggle:hover,
.cc-btn-view-toggle:focus-visible {
    background: #145218;
    border-color: #145218;
    color: #fff;
    outline: 3px solid #1a1a1a;
    outline-offset: 2px;
}

.cc-btn-view-toggle.cc-showing-corrected {
    background: #fff;
    color: #1b5e20;
}

.cc-btn-view-toggle.cc-showing-corrected:hover,
.cc-btn-view-toggle.cc-showing-corrected:focus-visible {
    background: #1b5e20;
    color: #fff;
}

.cc-view-badge {
    margin: 0 0 0.5rem;
    padding: 0.4rem 0.65rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 700;
}

.cc-view-badge.cc-badge-flawed {
    background: #fff5f5;
    color: #8b0000;
    border: 2px solid #c90c0f;
}

.cc-view-badge.cc-badge-corrected {
    background: #eef5ee;
    color: #1b5e20;
    border: 2px solid #2e7d32;
}

.cc-table-note,
.cc-criticise-intro,
.cc-fix-intro {
    font-size: 0.95rem;
    color: #1d1d1b;
    margin: 0 0 0.75rem;
}

.cc-table-wrap {
    overflow-x: auto;
}

.cc-data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.cc-data-table th,
.cc-data-table td {
    border: 2px solid #ddd;
    padding: 0.55rem 0.65rem;
    text-align: left;
    vertical-align: middle;
}

.cc-data-table th {
    background: #f5f5f5;
    font-weight: 700;
    color: #c90c0f;
}

.cc-data-table tbody tr:nth-child(even) {
    background: #fafafa;
}

.cc-tally-cell {
    min-width: 120px;
}

.cc-tally-marks-inline {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.4rem 0.6rem;
    align-items: flex-end;
}

.cc-tally-marks-inline .cb-tally-group {
    height: 1.65rem;
}

.cc-tally-marks-inline .cb-tally-v {
    height: 1.35rem;
}

.cc-freq-cell {
    font-weight: 700;
    font-size: 1.05rem;
    text-align: center;
    width: 5rem;
}

.cc-mismatch-hint {
    display: none;
}

.cc-chart-stage {
    min-height: 260px;
}

/* Inconsistent pictogram icon sizes */
.cc-picto-icon-size-sm {
    width: 1.25rem !important;
    height: 1.25rem !important;
}

.cc-picto-icon-size-sm i {
    font-size: 1.15rem !important;
}

.cc-picto-icon-size-lg {
    width: 2.35rem !important;
    height: 2.35rem !important;
}

.cc-picto-icon-size-lg i {
    font-size: 2.2rem !important;
}

.cc-picto-icon-size-xl {
    width: 2.85rem !important;
    height: 2.85rem !important;
}

.cc-picto-icon-size-xl i {
    font-size: 2.65rem !important;
}

.cc-flaw-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.cc-flaw-option {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.65rem 0.85rem;
    border: 2px solid #ddd;
    border-radius: 10px;
    background: #fafafa;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

.cc-flaw-option:hover {
    border-color: #c90c0f;
    background: #fff;
}

.cc-flaw-option input {
    margin-top: 0.15rem;
    accent-color: #c90c0f;
    flex-shrink: 0;
    cursor: pointer;
}

.cc-flaw-option span {
    line-height: 1.45;
}

.cc-flaw-option.cc-correct-pick {
    border-color: #1b5e20;
    background: #eef5ee;
    color: #1d1d1b;
}

.cc-flaw-option.cc-wrong-pick {
    border-color: #8b0000;
    background: #fff0f0;
    color: #1d1d1b;
}

.cc-flaw-option.cc-missed {
    border-color: #b8860b;
    background: #fff8e6;
    color: #1d1d1b;
}

.cc-fix-list {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    margin-bottom: 1rem;
}

.cc-fix-item {
    padding: 0.85rem 1rem;
    border: 2px solid #ddd;
    border-radius: 10px;
    background: #fafafa;
}

.cc-fix-item.cc-fix-done {
    border-color: #1b5e20;
    background: #eef5ee;
}

.cc-fix-item.cc-fix-wrong {
    border-color: #8b0000;
    background: #fff0f0;
}

.cc-fix-label {
    display: block;
    font-weight: 700;
    color: #8b0000;
    margin-bottom: 0.35rem;
    font-size: 0.9rem;
}

.cc-fix-prompt {
    margin: 0 0 0.5rem;
    line-height: 1.45;
    color: #1d1d1b;
}

.cc-fix-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.cc-fix-input {
    flex: 1;
    min-width: 180px;
    padding: 0.55rem 0.65rem;
    border: 2px solid #666;
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
    color: #1d1d1b;
    background: #fff;
}

.cc-fix-input:focus {
    border-color: #8b0000;
    outline: 3px solid #1a1a1a;
    outline-offset: 2px;
}

.cc-btn-check-fix {
    padding: 0.55rem 1rem;
    border: 2px solid #8b0000;
    border-radius: 6px;
    background: #8b0000;
    color: #fff;
    font-family: inherit;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    white-space: nowrap;
}

.cc-btn-check-fix:hover,
.cc-btn-check-fix:focus-visible {
    background: #6d0000;
    border-color: #6d0000;
    color: #fff;
    outline: 3px solid #1a1a1a;
    outline-offset: 2px;
}

.cc-fix-feedback {
    margin-top: 0.45rem;
    font-size: 0.9rem;
    min-height: 1.2rem;
    font-weight: 600;
}

.cc-fix-feedback.ok {
    color: #1b5e20;
}

.cc-fix-feedback.err {
    color: #8b0000;
}

.cc-fix-feedback.hint {
    color: #444;
    font-weight: 500;
}

.cc-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.cc-feedback {
    padding: 1rem 1.15rem;
    border-radius: 10px;
    line-height: 1.55;
}

.cc-feedback.cc-feedback-ok {
    background: #eef5ee;
    border: 2px solid #1b5e20;
    color: #1d1d1b;
}

.cc-feedback.cc-feedback-partial {
    background: #fff8e6;
    border: 2px solid #b8860b;
    color: #1d1d1b;
}

.cc-feedback.cc-feedback-reveal {
    background: #f0f0f0;
    border: 2px solid #444;
    color: #1d1d1b;
}

.cc-feedback h3 {
    margin: 0 0 0.5rem;
    font-size: 1.05rem;
    color: #1d1d1b;
}

.cc-feedback ul {
    margin: 0.5rem 0 0;
    padding-left: 1.25rem;
}

.cc-feedback li {
    margin-bottom: 0.35rem;
}

.cc-feedback li strong {
    color: #c90c0f;
}

.cc-score {
    font-weight: 700;
    font-size: 1.05rem;
    margin-bottom: 0.5rem;
}

@media (max-width: 960px) {
    .cc-grid {
        grid-template-columns: 1fr;
    }
}
