.j3d-contrast-checker__widget {
    display: grid;
    gap: 24px;
}

.j3d-contrast-checker__card {
    min-width: 0;
    padding: 24px;
    border: 1px solid #e8eaf3;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 2px 12px rgba(66, 76, 185, 0.08);
}

.j3d-contrast-checker__card h2 {
    margin: 0 0 22px;
    color: #2d3748;
    font-size: 21px;
}

.j3d-contrast-checker__card--bare {
    border: none;
    box-shadow: none;
}

.j3d-contrast-checker__groups {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
}

.j3d-contrast-checker__group {
    flex: 1 1 260px;
    min-width: 0;
}

.j3d-contrast-checker__fields {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.j3d-contrast-checker__field {
    flex: 1 1 140px;
    min-width: 0;
}

.j3d-contrast-checker__field--hex {
    flex: 1 1 160px;
}

.j3d-contrast-checker__field--picker {
    flex: 0 0 auto;
}

.j3d-contrast-checker__field label {
    display: block;
    margin-bottom: 7px;
    color: #4a5568;
    font-size: 14px;
    font-weight: 600;
}

.j3d-contrast-checker__field input[type="text"] {
    width: 100%;
    min-width: 0;
    min-height: 44px;
    padding: 9px 12px;
    border: 1px solid #d5dae8;
    border-radius: 6px;
    color: #1f2937;
    font-size: 16px;
    line-height: 1.4;
    box-sizing: border-box;
}

.j3d-contrast-checker__field input[type="color"] {
    width: 64px;
    min-height: 44px;
    padding: 4px;
    border: 1px solid #d5dae8;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
}

.j3d-contrast-checker__field input:focus {
    border-color: #424cb9;
    outline: 3px solid rgba(66, 76, 185, 0.25);
    outline-offset: 1px;
}

/* The theme forces "outline: 0 !important" on every a/button state, so the
   focus indicator here needs both !important and an ID selector to win. */
#j3d-contrast-checker-preview-link:focus,
#j3d-contrast-checker-preview-button:focus {
    outline: 3px solid rgba(66, 76, 185, 0.6) !important;
    outline-offset: 2px;
    text-decoration: underline;
}

.j3d-contrast-checker__field input[aria-invalid="true"] {
    border-color: #c53030;
}

.j3d-contrast-checker__error {
    min-height: 20px;
    margin: 6px 0 0;
    color: #c53030;
    font-size: 13px;
    line-height: 1.4;
}

.j3d-contrast-checker__swap-row {
    margin-top: 22px;
}

.j3d-contrast-checker__swap-row button {
    min-height: 44px;
}

.j3d-contrast-checker__ratio {
    margin: 0;
    color: #353fa0;
    font-size: 32px;
    font-weight: 700;
}

.j3d-converter__table-wrap {
    overflow-x: auto;
}

#j3d-contrast-checker-table th,
#j3d-contrast-checker-table td {
    vertical-align: middle;
}

.j3d-contrast-checker__status-cell {
    font-weight: 600;
    white-space: nowrap;
}

.j3d-contrast-checker__status-cell.is-pass {
    color: #276749;
}

.j3d-contrast-checker__status-cell.is-fail {
    color: #c53030;
}

.j3d-contrast-checker__status-cell.is-na {
    color: #6b7280;
    font-weight: 400;
    white-space: normal;
}

.j3d-contrast-checker__preview {
    padding: 24px;
    border: 1px solid #d5dae8;
    border-radius: 8px;
}

.j3d-contrast-checker__preview-normal {
    margin: 0 0 16px;
    font-size: 16px;
    line-height: 1.5;
}

.j3d-contrast-checker__preview-large {
    margin: 0 0 16px;
    font-size: 28px;
    font-weight: 700;
    line-height: 1.3;
}

.j3d-contrast-checker__preview-line {
    margin: 0 0 12px;
}

.j3d-contrast-checker__preview-line:last-child {
    margin-bottom: 0;
}

.j3d-contrast-checker__preview #j3d-contrast-checker-preview-link {
    text-decoration: underline;
}

.j3d-contrast-checker__preview-button {
    min-height: 44px;
    padding: 9px 20px;
    border: 1px solid currentColor;
    border-radius: 6px;
    font-size: 15px;
    cursor: default;
}

.j3d-contrast-checker__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.j3d-contrast-checker__actions button {
    min-height: 44px;
    white-space: normal;
}

.j3d-contrast-checker__actions button:focus {
    border-color: #424cb9;
    outline: 3px solid rgba(66, 76, 185, 0.25);
    outline-offset: 1px;
}

.j3d-contrast-checker__actions button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.j3d-contrast-checker__status {
    min-height: 24px;
    margin: 14px 0 0;
    color: #276749;
    font-size: 14px;
}

.j3d-contrast-checker__status.is-error {
    color: #c53030;
}

.j3d-contrast-checker__status.is-success {
    color: #276749;
}

.j3d-contrast-checker__report-label {
    display: block;
    margin: 14px 0 6px;
    color: #4a5568;
    font-size: 13px;
    font-weight: 600;
}

.j3d-contrast-checker__report-output {
    display: block;
    width: 100%;
    min-height: 44px;
    padding: 9px 12px;
    border: 1px solid #d5dae8;
    border-radius: 6px;
    color: #1f2937;
    font-family: monospace;
    font-size: 14px;
    line-height: 1.4;
    resize: vertical;
    box-sizing: border-box;
}

.j3d-contrast-checker__report-label[hidden],
.j3d-contrast-checker__report-output[hidden] {
    display: none;
}

@media (max-width: 480px) {
    .j3d-contrast-checker__card {
        padding: 18px;
    }

    .j3d-contrast-checker__actions {
        display: grid;
    }

    .j3d-contrast-checker__actions button {
        width: 100%;
    }

    .j3d-contrast-checker__swap-row button {
        width: 100%;
    }

    .j3d-contrast-checker__ratio {
        font-size: 26px;
    }
}
