/* Main wrapper – full-bleed, centred, up to 1200px on desktop */
.mlh-wrapper {
    border: 1px solid #d0d0d0;
    padding: 16px;
    border-radius: 6px;
    background: #f9fafb;
    color: #222222;
    font-size: 14px;

    /* break out of theme's narrow content container */
    width: 100vw;
    max-width: 1200px;
    margin-left: 50%;
    transform: translateX(-50%);
}

/* Headings */
.mlh-title {
    margin-top: 0;
    margin-bottom: 8px;
    font-size: 1.25rem;
    font-weight: 700;
    color: #000000 !important;
}

.mlh-legend h4,
.mlh-row-block h4 {
    margin-top: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #111111;
}

/* Form */
.mlh-form {
    margin-bottom: 16px;
}

.mlh-input-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 8px;
}

.mlh-field {
    flex: 1 1 150px;
}

.mlh-input {
    width: 100%;
    padding: 6px 8px;
    box-sizing: border-box;
    border-radius: 4px;
    border: 1px solid #c4c4c4;
    background: #ffffff;
    color: #222222;
}

.mlh-input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 1px #2563eb33;
}

.mlh-save-field {
    display: flex;
    align-items: flex-end;
}

.mlh-save-label {
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.mlh-button {
    margin-top: 10px;
    padding: 8px 16px;
    cursor: pointer;
    border-radius: 4px;
    border: 1px solid #2563eb;
    background: #2563eb;
    color: #ffffff;
    font-weight: 600;
}

.mlh-button:hover {
    background: #1d4ed8;
    border-color: #1d4ed8;
}

/* Results layout */
.mlh-results {
    margin-top: 16px;
    color: #222222;
}

.mlh-row-block {
    margin-bottom: 16px;
    padding: 8px 10px;
    border: 1px solid #e2e2e2;
    border-radius: 4px;
    background: #ffffff;
}

.mlh-row-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.mlh-section {
    flex: 1 1 180px;
    border: 1px solid #dddddd;
    padding: 8px;
    border-radius: 4px;
    background: #f3f4f6;
}

.mlh-section-title {
    font-weight: 600;
    margin-bottom: 4px;
    font-size: 0.9rem;
    color: #111111;
}

/* Tables */
.mlh-inner-table {
    width: 100%;
    border-collapse: collapse;
}

.mlh-inner-table td {
    padding: 4px;
    text-align: center;
}

/* Number pill */
.mlh-number {
    display: inline-block;
    min-width: 30px;
    padding: 4px 6px;
    border-radius: 4px;
    border: 1px solid #999999;
    font-weight: 700;
    font-size: 0.9rem;
    color: #111111;
    background: #ffffff;
}

/* Stronger colours for the number pills in the table */
.mlh-number.mlh-occ-1 {
    background: #1d4ed8;   /* deep blue */
    color: #ffffff;
    border-color: #1d4ed8;
}

.mlh-number.mlh-occ-2 {
    background: #16a34a;   /* deep green */
    color: #ffffff;
    border-color: #16a34a;
}

.mlh-number.mlh-occ-3 {
    background: #ea580c;   /* deep orange */
    color: #ffffff;
    border-color: #ea580c;
}

.mlh-number.mlh-occ-4plus {
    background: #b91c1c;   /* deep red */
    color: #ffffff;
    border-color: #b91c1c;
}

/* SELF outline stays on top of the colour */
.mlh-number.mlh-self {
    box-shadow: 0 0 0 2px #6d28d9 inset;
}

/* Legend + notices */
.mlh-legend {
    margin-top: 16px;
    font-size: 0.9rem;
    color: #222222;
}

.mlh-legend ul {
    list-style: none;
    padding-left: 0;
}

.mlh-legend li {
    margin-bottom: 4px;
}

.mlh-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.75rem;
    border: 1px solid #999999;
}

/* Deep colours for legend badges */
.mlh-badge.mlh-occ-1 {
    background: #1d4ed8;
    color: #ffffff;
    border-color: #1d4ed8;
}

.mlh-badge.mlh-occ-2 {
    background: #16a34a;
    color: #ffffff;
    border-color: #16a34a;
}

.mlh-badge.mlh-occ-3 {
    background: #ea580c;
    color: #ffffff;
    border-color: #ea580c;
}

.mlh-badge.mlh-occ-4plus {
    background: #b91c1c;
    color: #ffffff;
    border-color: #b91c1c;
}

.mlh-badge.mlh-self {
    background: #6d28d9;
    color: #ffffff;
    border-color: #4c1d95;
}

.mlh-legend-output {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px dashed #cbd5e1;
}

.mlh-legend-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
    font-size: 0.9rem;
}

.mlh-legend-values {
    font-weight: 600;
    color: #111827;
}

.mlh-legend-values.mlh-empty {
    font-weight: 400;
    font-style: italic;
    color: #6b7280;
}

/* Notices */
.mlh-notice {
    padding: 8px 12px;
    border-radius: 4px;
    margin: 8px 0;
    color: #111111;
}

.mlh-notice-warning {
    background: #fef3c7;
    border: 1px solid #fbbf24;
}

/* Front-end logs table */
.pwc-logs-wrapper {
    margin-top: 24px;
    padding: 16px;
    border-radius: 6px;
    border: 1px solid #d1d5db;
    background: #f9fafb;
}

.pwc-logs-title {
    margin-top: 0;
    margin-bottom: 6px;
    font-size: 1.1rem;
    font-weight: 600;
    color: #111827;
}

.pwc-logs-help {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 0.9rem;
    color: #4b5563;
}

.pwc-logs-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.pwc-logs-table th,
.pwc-logs-table td {
    border: 1px solid #e5e7eb;
    padding: 6px 8px;
    text-align: left;
}

.pwc-logs-table th {
    background: #e5e7eb;
    font-weight: 600;
    color: #111827;
}

.pwc-log-row:nth-child(even) {
    background: #f3f4f6;
}

.pwc-log-row.pwc-hidden {
    opacity: 0.25;
}

/* Responsive tweaks for tablets / phones */
@media (max-width: 768px) {
    .mlh-wrapper {
        width: 100%;
        max-width: 100%;
        margin: 0 auto;
        transform: none;
    }

    .mlh-input-row {
        flex-direction: column;
    }

    .mlh-row-grid {
        flex-direction: column;
    }

    .mlh-section {
        flex: 1 1 100%;
    }

    .pwc-logs-table {
        font-size: 0.8rem;
    }
}