/* ---------- current public IP ---------- */

.ip-intro {
    margin: -5px 0 0;
    color: var(--text-dim);
    font-size: 13.5px;
}

.ip-address-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.ip-address-card {
    position: relative;
    min-width: 0;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background:
        radial-gradient(240px 150px at 100% 0%, var(--accent-soft), transparent 72%),
        var(--bg-input);
    overflow: hidden;
    transition: border-color 0.25s, transform 0.25s var(--ease-spring), opacity 0.25s;
}

.ip-address-card::after {
    content: '';
    position: absolute;
    left: 18px;
    right: 18px;
    bottom: 0;
    height: 2px;
    border-radius: 2px 2px 0 0;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    opacity: 0;
    transform: scaleX(0.35);
    transition: opacity 0.3s, transform 0.4s var(--ease-spring);
}

.ip-address-card:hover {
    border-color: var(--accent-border);
    transform: translateY(-2px);
}

.ip-address-available::after {
    opacity: 0.8;
    transform: scaleX(1);
}

.ip-address-unavailable {
    opacity: 0.68;
}

.ip-address-card-head,
.ip-address-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.ip-version {
    color: hsl(var(--accent-h) 78% 74%);
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 750;
    letter-spacing: 0.8px;
    text-transform: uppercase;
}

.ip-address-row {
    min-height: 64px;
}

.ip-address-value {
    min-width: 0;
    color: var(--text);
    font-family: var(--font-mono);
    font-size: clamp(16px, 2.1vw, 22px);
    font-weight: 650;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.ip-address-value:has(.spinner) {
    display: flex;
    align-items: center;
}

.ip-address-row .icon-button:disabled {
    opacity: 0.35;
    cursor: default;
    transform: none;
}

.ip-reverse-link {
    width: fit-content;
    margin-left: -10px;
}

.ip-reverse-link .icon {
    transition: transform 0.25s var(--ease-spring);
}

.ip-reverse-link:hover .icon {
    transform: translateX(3px);
}

.ip-info-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0;
}

.ip-info-grid > div {
    position: relative;
    padding: 8px 22px 4px;
    border-left: 1px solid var(--border);
}

.ip-info-grid > div:first-child {
    padding-left: 0;
    border-left: 0;
}

.ip-info-grid > div:last-child {
    padding-right: 0;
}

.ip-info-index {
    display: block;
    margin-bottom: 7px;
    color: var(--accent);
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
}

.ip-info-grid strong {
    font-size: 13.5px;
}

.ip-info-grid p {
    margin: 5px 0 0;
    color: var(--text-faint);
    font-size: 12.5px;
    line-height: 1.5;
}

.ip-address-card .badge:not(.badge-ok, .badge-warn) {
    color: var(--text-dim);
    background: var(--bg-raised);
}

.ip-address-card .spinner,
.dns-query-grid .spinner {
    flex-shrink: 0;
}

.ip-address-grid + .status-line {
    margin-top: 16px;
}

.ip-address-card button:disabled,
.ip-address-card button:disabled:hover,
.dns-query-grid button:disabled,
.dns-query-grid button:disabled:hover {
    opacity: 0.55;
    cursor: wait;
    transform: none;
    box-shadow: none;
}

/* ---------- DNS lookup ---------- */

.dns-query-grid {
    display: grid;
    grid-template-columns: minmax(240px, 1fr) 190px 180px auto;
    gap: 10px;
    align-items: stretch;
}

.dns-query-grid .button {
    white-space: nowrap;
}

.dns-query-grid input:disabled,
.dns-query-grid select:disabled {
    opacity: 0.72;
    cursor: wait;
}

.dns-examples {
    margin-top: 10px;
}

.dns-examples .chip {
    padding-block: 3px;
}

.dns-stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.dns-stat-tile {
    position: relative;
    min-width: 0;
    padding: 14px 15px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background:
        linear-gradient(145deg, hsl(var(--accent-h) 78% 58% / 0.08), transparent 64%),
        var(--bg-input);
    overflow: hidden;
}

.dns-stat-tile::after {
    content: '';
    position: absolute;
    right: -10px;
    bottom: -18px;
    width: 58px;
    height: 58px;
    border: 1px solid var(--accent-border);
    border-radius: 50%;
    opacity: 0.22;
}

.dns-stat-value,
.dns-stat-label {
    display: block;
    position: relative;
    z-index: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dns-stat-value {
    color: hsl(var(--accent-h) 78% 75%);
    font-family: var(--font-mono);
    font-size: clamp(15px, 2vw, 20px);
    font-weight: 700;
}

.dns-stat-positive {
    color: var(--ok);
}

.dns-stat-label {
    margin-top: 3px;
    color: var(--text-faint);
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.65px;
    text-transform: uppercase;
}

.dns-result-heading {
    margin: 18px 0 9px;
}

.dns-result-heading .panel-title {
    margin: 0;
}

.dns-record-table-wrap {
    max-height: 520px;
}

.dns-record-table {
    min-width: 860px;
}

.dns-record-table th {
    cursor: default;
}

.dns-record-table th:hover {
    color: var(--text);
}

.dns-record-table th:nth-child(5),
.dns-record-table td:nth-child(5) {
    width: 48%;
    max-width: 520px;
}

.dns-record-table td:nth-child(3),
.dns-record-table td:nth-child(5) {
    overflow: hidden;
    text-overflow: ellipsis;
}

.dns-record-table td:last-child {
    width: 42px;
    padding-inline: 4px 8px;
}

.dns-record-table .icon-button {
    width: 28px;
    height: 28px;
}

.dns-type-chip {
    padding: 2px 8px;
    font-size: 11px;
}

.dns-section-badge {
    padding: 2px 8px;
    font-size: 10.5px;
}

.dns-section-answer {
    color: var(--ok);
    background: rgba(63, 221, 154, 0.12);
}

.dns-section-authority {
    color: var(--warn);
    background: rgba(255, 197, 85, 0.12);
}

.dns-section-additional {
    color: hsl(262 85% 76%);
    background: hsl(262 85% 62% / 0.14);
}

.dns-empty-state {
    min-height: 170px;
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius-md);
    background: var(--bg-input);
    color: var(--text-dim);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-align: center;
}

.dns-empty-state > span:last-child {
    color: var(--text-faint);
    font-size: 12.5px;
}

.dns-empty-icon {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    margin-bottom: 4px;
    border-radius: 14px;
    color: var(--accent);
    background: var(--accent-soft);
}

.dns-empty-icon .icon {
    width: 24px;
    height: 24px;
}

.dns-command-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.dns-command-output {
    min-height: 42px;
    max-height: none;
}

.dns-raw-details {
    margin-top: 18px;
    border-top: 1px solid var(--border);
    padding-top: 14px;
}

.dns-raw-details summary {
    width: fit-content;
    color: var(--text-dim);
    font-size: 12.5px;
    font-weight: 650;
    cursor: pointer;
    transition: color 0.2s;
}

.dns-raw-details summary:hover {
    color: var(--text);
}

.dns-raw-output-row {
    align-items: flex-start;
    margin-top: 10px;
}

.dns-raw-output {
    min-height: 140px;
    max-height: 440px;
    margin: 0;
}

@media (max-width: 980px) {
    .dns-query-grid {
        grid-template-columns: minmax(0, 1fr) minmax(170px, 0.6fr);
    }

    .dns-stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .ip-address-grid,
    .dns-command-grid {
        grid-template-columns: 1fr;
    }

    .ip-info-grid {
        grid-template-columns: 1fr;
    }

    .ip-info-grid > div,
    .ip-info-grid > div:first-child,
    .ip-info-grid > div:last-child {
        padding: 14px 0;
        border-left: 0;
        border-top: 1px solid var(--border);
    }

    .ip-info-grid > div:first-child {
        padding-top: 4px;
        border-top: 0;
    }
}

@media (max-width: 560px) {
    .dns-query-grid,
    .dns-stat-grid {
        grid-template-columns: 1fr;
    }

    .dns-examples .hint-text {
        width: 100%;
    }

    .ip-address-row {
        min-height: 76px;
    }
}
