/* Hide real radio buttons without focusing them */
.tabs input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
    /* prevents focus scroll */
}

.tab-labels {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.tab-label {
    padding: 8px 14px;
    cursor: pointer;
    border-radius: 8px;
    border: 1px solid #ccc;
    user-select: none;
    transition: background 0.3s, color 0.3s;
}

.tabs input[type="radio"]:checked+.tab-label {
    background: #111;
    color: #fff;
    border-color: #111;
}

.tab-content {
    border: 1px solid #ddd;
    padding: 14px;
    border-radius: 8px;
    display: none;
}

#tab1:checked~.contents #panel1,
#tab2:checked~.contents #panel2 {
    display: block;
}

.contents {
    margin-top: 12px;
}

@media (max-width: 520px) {
    .tab-labels {
        flex-direction: column;
    }
}
