.cidr-calculator {
    max-width: 720px;
    margin: 0 auto;
    padding: 1em 0;
}

/* Input row */
.cidr-calc-input-row {
    display: flex;
    gap: 0.5em;
    flex-wrap: wrap;
    margin-top: 0.4em;
}

.cidr-calc-input-row input[type="text"] {
    flex: 1 1 180px;
    min-width: 140px;
    padding: 0.5em 0.7em;
    font-size: 1em;
    font-family: inherit;
    border: 1px solid currentColor;
    border-radius: 4px;
    background: inherit;
    color: inherit;
    opacity: 0.85;
}

.cidr-calc-input-row input[type="text"]:focus {
    opacity: 1;
    outline: 2px solid currentColor;
    outline-offset: -1px;
}

.cidr-calc-input-row select {
    padding: 0.5em 0.7em;
    font-size: 1em;
    font-family: inherit;
    border: 1px solid currentColor;
    border-radius: 4px;
    background: inherit;
    color: inherit;
    opacity: 0.85;
    cursor: pointer;
}

.cidr-calc-input-row button {
    padding: 0.5em 1.2em;
    font-size: 1em;
    font-family: inherit;
    border: 1px solid currentColor;
    border-radius: 4px;
    background: inherit;
    color: inherit;
    cursor: pointer;
    opacity: 0.85;
    transition: opacity 0.15s;
}

.cidr-calc-input-row button:hover {
    opacity: 1;
}

/* Error */
.cidr-error {
    color: #c00;
    margin-top: 0.4em;
    font-size: 0.9em;
    display: none;
}

/* Results table */
.cidr-results {
    margin-top: 1.5em;
}

.cidr-results-table {
    width: 100%;
    border-collapse: collapse;
    font-family: inherit;
    color: inherit;
}

.cidr-results-table th,
.cidr-results-table td {
    padding: 0.5em 0.7em;
    border-bottom: 1px solid currentColor;
    text-align: left;
    opacity: 0.9;
}

.cidr-results-table th {
    width: 40%;
    font-weight: 600;
}

.cidr-results-table td {
    font-family: monospace;
}

/* Reference table */
.cidr-reference {
    margin-top: 2em;
}

.cidr-reference-table {
    width: 100%;
    border-collapse: collapse;
    font-family: inherit;
    color: inherit;
    font-size: 0.9em;
}

.cidr-reference-table th,
.cidr-reference-table td {
    padding: 0.35em 0.7em;
    border-bottom: 1px solid currentColor;
    text-align: left;
    opacity: 0.85;
}

.cidr-reference-table thead th {
    font-weight: 600;
    opacity: 1;
}

.cidr-reference-table td {
    font-family: monospace;
}

/* Responsive */
@media (max-width: 480px) {
    .cidr-calc-input-row {
        flex-direction: column;
    }

    .cidr-calc-input-row input[type="text"],
    .cidr-calc-input-row select,
    .cidr-calc-input-row button {
        width: 100%;
    }

    .cidr-results-table th,
    .cidr-results-table td {
        padding: 0.4em;
        font-size: 0.9em;
    }
}
