/* Pie charts — GCSE statistics interactive tool */

body.pc-page {
    background: #f8f9fa !important;
    display: block !important;
    justify-content: unset !important;
    align-items: unset !important;
    min-height: auto !important;
    text-align: left !important;
}

.pc-wrap {
    max-width: 1100px;
    margin: 0 auto;
    padding: 1.5rem 1rem 3rem;
    font-family: "Rockwell", "Rockwell Nova", "Roboto Slab", serif;
    color: #1d1d1b;
}

.pc-wrap h1 {
    color: #c90c0f;
    text-align: center;
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
}

.pc-wrap h1 i {
    color: #fab719;
    margin-right: 0.35rem;
}

.pc-lead {
    text-align: center;
    color: #444;
    max-width: 760px;
    margin: 0 auto 1.5rem;
    line-height: 1.55;
}

.pc-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin-bottom: 1.25rem;
}

.pc-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.55rem 1rem;
    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;
}

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

.pc-tab.active {
    background: #8b0000;
    color: #fff;
}

.pc-panel {
    display: none;
}

.pc-panel.active {
    display: block;
}

.pc-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    align-items: start;
}

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

.pc-card {
    background: #fff;
    border: 3px solid #c90c0f;
    border-radius: 14px;
    padding: 1.25rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.pc-card-wide {
    margin-bottom: 1.25rem;
}

.pc-card h2 {
    color: #c90c0f;
    font-size: 1.15rem;
    margin: 0 0 0.85rem;
}

.pc-card h2 i {
    color: #fab719;
    margin-right: 0.35rem;
}

.pc-hint,
.pc-scenario-intro {
    color: #555;
    line-height: 1.5;
    margin: 0 0 1rem;
}

.pc-scenario-intro {
    text-align: center;
    max-width: 720px;
    margin: 0 auto 1.25rem;
}

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

.pc-scenario-btn {
    padding: 0.45rem 0.8rem;
    border: 2px solid #8b0000;
    background: #fff;
    color: #8b0000;
    border-radius: 999px;
    font-family: inherit;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
}

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

.pc-field {
    margin-bottom: 1rem;
}

.pc-field label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.35rem;
}

.pc-field input[type="text"],
.pc-field input[type="number"] {
    width: 100%;
    padding: 0.5rem 0.65rem;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
}

.pc-field input:focus {
    border-color: #c90c0f;
    outline: none;
}

.pc-data-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
}

.pc-data-table th,
.pc-data-table td {
    border: 1px solid #ddd;
    padding: 0.45rem 0.55rem;
    text-align: left;
}

.pc-data-table thead th {
    background: #f5f5f5;
    font-weight: 700;
}

.pc-data-table input[type="text"],
.pc-data-table input[type="number"] {
    width: 100%;
    min-width: 0;
    padding: 0.35rem 0.45rem;
    border: 2px solid #ccc;
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.95rem;
    box-sizing: border-box;
}

.pc-data-table input:focus {
    border-color: #c90c0f;
    outline: none;
}

.pc-data-table input.pc-readonly {
    background: #f8f8f8;
    border-color: #e0e0e0;
    color: #333;
}

.pc-data-table input.pc-missing {
    background: #fff8e1;
    border-color: #fab719;
}

.pc-data-table input.pc-correct {
    border-color: #2e7d32;
    background: #e8f5e9;
}

.pc-data-table input.pc-wrong {
    border-color: #c62828;
    background: #ffebee;
}

.pc-col-action {
    width: 2.5rem;
}

.pc-row-remove {
    border: none;
    background: transparent;
    color: #8b0000;
    cursor: pointer;
    padding: 0.25rem;
    font-size: 1rem;
}

.pc-row-remove:hover,
.pc-row-remove:focus-visible {
    color: #c90c0f;
    outline: 2px solid #1a1a1a;
    outline-offset: 1px;
}

.pc-total-row th,
.pc-total-row td {
    font-weight: 700;
    background: #fafafa;
}

.pc-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

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

.pc-btn-primary {
    background: #8b0000;
    color: #fff;
}

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

.pc-page .pc-btn-secondary {
    background: #fff;
    color: #8b0000 !important;
}

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

.pc-page .pc-tab {
    color: #8b0000 !important;
}

.pc-page .pc-tab:hover,
.pc-page .pc-tab:focus-visible,
.pc-page .pc-tab.active {
    color: #fff !important;
}

.pc-page .pc-scenario-btn {
    color: #8b0000 !important;
}

.pc-page .pc-scenario-btn:hover,
.pc-page .pc-scenario-btn:focus-visible,
.pc-page .pc-scenario-btn.active {
    color: #fff !important;
}

.pc-summary {
    margin-top: 0.75rem;
    font-weight: 600;
    color: #333;
}

.pc-working {
    margin-top: 0.75rem;
    padding: 0.85rem;
    background: #f8f9fa;
    border-radius: 8px;
    font-size: 0.92rem;
    line-height: 1.55;
}

.pc-chart-stage {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 280px;
    overflow-x: auto;
}

.pc-chart-stage svg {
    display: block;
    max-width: 100%;
    height: auto;
}

.pc-chart-caption {
    text-align: center;
    color: #555;
    font-size: 0.9rem;
    margin: 0.5rem 0 0;
}

.pc-double-chart {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    justify-content: center;
    align-items: flex-start;
}

.pc-double-chart .pc-chart-block {
    text-align: center;
}

.pc-double-chart .pc-chart-block h3 {
    margin: 0 0 0.5rem;
    color: #333;
    font-size: 1.05rem;
}

.pc-questions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.pc-question {
    padding: 0.85rem;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #fab719;
}

.pc-question p {
    margin: 0 0 0.5rem;
    line-height: 1.45;
}

.pc-question input[type="text"],
.pc-question input[type="number"] {
    width: 100%;
    max-width: 14rem;
    padding: 0.45rem 0.55rem;
    border: 2px solid #ccc;
    border-radius: 6px;
    font-family: inherit;
}

.pc-question input:focus {
    border-color: #c90c0f;
    outline: none;
}

.pc-question.pc-correct {
    border-left-color: #2e7d32;
    background: #e8f5e9;
}

.pc-question.pc-wrong {
    border-left-color: #c62828;
    background: #ffebee;
}

.pc-feedback {
    margin-top: 1rem;
    padding: 0.85rem 1rem;
    border-radius: 8px;
    line-height: 1.5;
}

.pc-feedback.pc-ok {
    background: #e8f5e9;
    border: 2px solid #2e7d32;
    color: #1b5e20;
}

.pc-feedback.pc-partial {
    background: #fff8e1;
    border: 2px solid #f9a825;
    color: #5d4037;
}

.pc-feedback.pc-bad {
    background: #ffebee;
    border: 2px solid #c62828;
    color: #b71c1c;
}

.pc-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    justify-content: center;
    margin-top: 0.75rem;
    font-size: 0.85rem;
}

.pc-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.pc-legend-swatch {
    width: 0.85rem;
    height: 0.85rem;
    border-radius: 2px;
    border: 1px solid rgba(0, 0, 0, 0.15);
}
