/* Estimating the mean from grouped data */

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

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

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

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

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

.gme-lead a {
    color: #c90c0f;
    font-weight: 700;
}

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

.gme-card h2 {
    color: #c90c0f;
    font-size: 1.25rem;
    margin: 0 0 0.5rem;
}

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

.gme-card h3 {
    color: #c90c0f;
    font-size: 1.1rem;
    margin: 1rem 0 0.5rem;
}

.gme-hint {
    color: #555;
    font-size: 0.95rem;
    margin: 0 0 1rem;
    line-height: 1.5;
}

.gme-setup-grid,
.gme-calc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.75rem 1rem;
    margin-bottom: 1rem;
    align-items: end;
}

.gme-field label {
    display: block;
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 0.35rem;
    color: #1d1d1b;
}

.gme-field input[type="number"] {
    width: 100%;
    padding: 0.5rem 0.65rem;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    box-sizing: border-box;
    color: #1d1d1b;
    background: #fff;
}

.gme-field input:focus {
    border-color: #c90c0f;
    outline: none;
    box-shadow: 0 0 0 3px rgba(201, 12, 15, 0.2);
}

.gme-field-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: flex-end;
}

.gme-table-scroll {
    overflow-x: auto;
    margin-bottom: 1rem;
}

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

.gme-data-table th,
.gme-data-table td {
    border: 1px solid #dee2e6;
    padding: 0.5rem 0.65rem;
    text-align: center;
}

.gme-data-table thead th {
    background: #c90c0f;
    color: #fff;
    font-weight: 700;
}

.gme-data-table tfoot th,
.gme-data-table tfoot td {
    background: #f8f9fa;
    font-weight: 700;
}

.gme-data-table input[type="number"] {
    width: 4.5rem;
    padding: 0.35rem 0.45rem;
    border: 2px solid #ccc;
    border-radius: 6px;
    text-align: center;
    font-family: inherit;
    color: #1d1d1b;
    background: #fff;
}

.gme-data-table input.gme-wide {
    width: 5.5rem;
}

.gme-data-table .gme-interval-label {
    font-weight: 700;
    white-space: nowrap;
}

.gme-data-table .gme-fx-correct {
    color: #1d1d1b;
    font-weight: 700;
}

.gme-data-table .gme-fx-wrong {
    background: #fff3cd;
}

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

.gme-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.55rem 1rem;
    border-radius: 8px;
    font-family: inherit;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    border: 2px solid transparent;
    transition: transform 0.15s, box-shadow 0.15s;
}

.gme-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.gme-btn-primary {
    background: #c90c0f;
    color: #fff;
    border-color: #c90c0f;
}

.gme-btn-primary:hover:not(:disabled),
.gme-btn-primary:focus-visible:not(:disabled) {
    background: #a00a0c;
    border-color: #a00a0c;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(201, 12, 15, 0.3);
}

.gme-btn-secondary {
    background: #fab719;
    color: #1d1d1b;
    border-color: #fab719;
}

.gme-btn-secondary:hover:not(:disabled),
.gme-btn-secondary:focus-visible:not(:disabled) {
    background: #e6a517;
    border-color: #e6a517;
    color: #1d1d1b;
    transform: translateY(-1px);
}

.gme-btn-outline {
    background: #fff;
    color: #c90c0f;
    border-color: #c90c0f;
}

.gme-btn-outline:hover:not(:disabled),
.gme-btn-outline:focus-visible:not(:disabled) {
    background: #c90c0f;
    color: #fff;
    transform: translateY(-1px);
}

.gme-status {
    margin: 0.75rem 0 0;
    font-size: 0.95rem;
    min-height: 1.25rem;
}

.gme-status.gme-ok {
    color: #0d6e3a;
    font-weight: 700;
}

.gme-status.gme-error {
    color: #c90c0f;
    font-weight: 700;
}

.gme-formula-box {
    background: #f8f9fa;
    border: 2px solid #c90c0f;
    border-radius: 10px;
    padding: 0.85rem 1rem;
    text-align: center;
    font-weight: 700;
    margin: 1rem 0;
    font-size: 1.05rem;
}

.gme-feedback {
    margin-top: 1rem;
    padding: 0.85rem 1rem;
    border-radius: 10px;
    font-weight: 700;
}

.gme-feedback.gme-feedback-ok {
    background: #d4edda;
    border: 2px solid #28a745;
    color: #155724;
}

.gme-feedback.gme-feedback-warn {
    background: #fff3cd;
    border: 2px solid #fab719;
    color: #664d03;
}

.gme-feedback.gme-feedback-info {
    background: #e7f1ff;
    border: 2px solid #0d6efd;
    color: #084298;
}

.gme-results {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 2px solid #dee2e6;
}

.gme-stat-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.75rem;
    margin: 0;
}

.gme-stat {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 0.75rem 1rem;
    border: 1px solid #dee2e6;
}

.gme-stat dt {
    font-size: 0.85rem;
    color: #555;
    margin: 0 0 0.25rem;
    font-weight: 600;
}

.gme-stat dd {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: #1d1d1b;
}

.gme-stat-highlight {
    border-color: #c90c0f;
    background: #fff5f5;
}

.gme-stat-highlight dd {
    color: #c90c0f;
}

.gme-actual-data {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 2px dashed #dee2e6;
}

.gme-group-data {
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #fab719;
}

.gme-group-data strong {
    color: #c90c0f;
}

.gme-group-values {
    margin: 0.35rem 0 0;
    font-family: "Courier New", Courier, monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    word-break: break-word;
}

.gme-steps {
    margin: 0;
    padding-left: 1.25rem;
    line-height: 1.7;
}

.gme-steps li {
    margin-bottom: 0.35rem;
}

@media (max-width: 600px) {
    .gme-wrap h1 {
        font-size: 1.5rem;
    }

    .gme-card {
        padding: 1rem;
    }

    .gme-data-table {
        font-size: 0.85rem;
    }

    .gme-data-table input[type="number"] {
        width: 3.5rem;
    }
}
