/* lrob-toolkit / whois-info — frontend styles
 * Theme-aware by design: defaults inherit from the active theme via currentColor.
 * Customization via --lrob-tk-whois-* CSS variables (set on the wrapper by render.php).
 */

.lrob-tk-whois {
    /* User-overridable variables (empty defaults = inherit theme). */
    --lrob-tk-whois-primary: var(--wp--preset--color--primary, currentColor);
    --lrob-tk-whois-accent:  var(--wp--preset--color--accent,  var(--lrob-tk-whois-primary));
    --lrob-tk-whois-bg:      transparent;
    --lrob-tk-whois-border:  color-mix(in srgb, currentColor 25%, transparent);

    /* Internal tokens derived from currentColor for theme compatibility. */
    --lrob-tk-whois-muted:    color-mix(in srgb, currentColor 65%, transparent);
    --lrob-tk-whois-faint:    color-mix(in srgb, currentColor 10%, transparent);
    --lrob-tk-whois-surface:  color-mix(in srgb, currentColor 6%,  transparent);

    /* Semantic state hues — readable on light or dark backgrounds via color-mix tinting. */
    --lrob-tk-whois-success: #28a745;
    --lrob-tk-whois-warning: #d69e2e;
    --lrob-tk-whois-error:   #dc3545;
    --lrob-tk-whois-info:    #1976d2;

    box-sizing: border-box;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    color: inherit;
}
.lrob-tk-whois *,
.lrob-tk-whois *::before,
.lrob-tk-whois *::after {
    box-sizing: border-box;
}

.lrob-tk-whois.alignwide,
.lrob-tk-whois.alignfull {
    max-width: none;
}

/* ---- form ---- */
.lrob-tk-whois-form-wrap {
    text-align: center;
    margin-bottom: 30px;
}
.lrob-tk-whois-form {
    display: inline-flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
    margin: 0;
    max-width: 100%;
}
.lrob-tk-whois-input {
    padding: 12px 16px;
    border: 2px solid var(--lrob-tk-whois-border);
    border-radius: 6px;
    font-size: 16px; /* 16px exact prevents iOS zoom-on-focus */
    width: min(350px, 100%);
    background: transparent;
    color: inherit;
    transition: border-color 0.2s;
}
.lrob-tk-whois-input:focus {
    outline: none;
    border-color: var(--lrob-tk-whois-primary);
}
/* Submit button styling is delegated to the active theme via .wp-element-button.
 * In FSE themes, theme.json's button preset (color, padding, radius, hover)
 * applies automatically. We only keep the cursor for non-FSE fallbacks. */
.lrob-tk-whois-button {
    cursor: pointer;
}

/* ---- loading / error ---- */
.lrob-tk-whois-loading {
    text-align: center;
    padding: 40px;
}
.lrob-tk-whois-spinner {
    width: 50px;
    height: 50px;
    margin: 0 auto 20px;
    border: 4px solid var(--lrob-tk-whois-border);
    border-top-color: var(--lrob-tk-whois-primary);
    border-radius: 50%;
    animation: lrob-tk-whois-spin 1s linear infinite;
}
@keyframes lrob-tk-whois-spin {
    to { transform: rotate(360deg); }
}
.lrob-tk-whois-error {
    background: color-mix(in srgb, var(--lrob-tk-whois-error) 12%, transparent);
    border: 1px solid color-mix(in srgb, var(--lrob-tk-whois-error) 50%, transparent);
    border-radius: 6px;
    padding: 20px;
    margin: 20px 0;
    color: var(--lrob-tk-whois-error);
    text-align: center;
}

/* ---- header ---- */
.lrob-tk-whois-results {
    margin-top: 30px;
}
.lrob-tk-whois-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--lrob-tk-whois-border);
    flex-wrap: wrap;
}
.lrob-tk-whois-domain-title {
    font-size: 1.5em;
    margin: 0;
    color: inherit;
}
.lrob-tk-whois-source {
    font-size: 0.7em;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    opacity: 0.6;
    padding: 2px 8px;
    border: 1px solid currentColor;
    border-radius: 999px;
    white-space: nowrap;
}
.lrob-tk-whois-share {
    display: flex;
    align-items: center;
    gap: 10px;
}
.lrob-tk-whois-share-btn {
    background: transparent;
    border: 1px solid var(--lrob-tk-whois-border);
    border-radius: 6px;
    padding: 8px 12px;
    cursor: pointer;
    color: inherit;
    transition: all 0.2s;
}
.lrob-tk-whois-share-btn:hover {
    background: var(--lrob-tk-whois-faint);
    border-color: var(--lrob-tk-whois-primary);
    color: var(--lrob-tk-whois-primary);
}
.lrob-tk-whois-share-feedback {
    font-size: 0.875em;
    padding: 4px 12px;
    border-radius: 4px;
    display: none;
}
.lrob-tk-whois-share-feedback.is-success {
    background: color-mix(in srgb, var(--lrob-tk-whois-success) 18%, transparent);
    color: var(--lrob-tk-whois-success);
}
.lrob-tk-whois-share-feedback.is-error {
    background: color-mix(in srgb, var(--lrob-tk-whois-error) 18%, transparent);
    color: var(--lrob-tk-whois-error);
}

/* ---- tabs ---- */
.lrob-tk-whois-tabs {
    margin-top: 20px;
}
.lrob-tk-whois-tab-buttons {
    display: flex;
    justify-content: center;
    gap: 5px;
    border-bottom: 2px solid var(--lrob-tk-whois-border);
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.lrob-tk-whois-tab {
    padding: 12px 24px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font: inherit;
    font-weight: 600;
    color: inherit;
    transition: all 0.2s;
    margin-bottom: -2px;
    white-space: nowrap;
}
.lrob-tk-whois-tab:hover {
    color: var(--lrob-tk-whois-primary);
}
.lrob-tk-whois-tab.is-active {
    color: var(--lrob-tk-whois-primary);
    border-bottom-color: var(--lrob-tk-whois-primary);
}
.lrob-tk-whois-tab-content {
    display: none;
}
.lrob-tk-whois-tab-content.is-active {
    display: block;
}

/* ---- sections ---- */
/* CSS columns masonry-like packing: cards flow vertically and fill gaps,
 * no row-height stretching. 2 columns max above ~720px, 1 below. */
.lrob-tk-whois-grid {
    columns: 2 360px;
    column-gap: 20px;
}
.lrob-tk-whois-section {
    background: var(--lrob-tk-whois-bg, var(--lrob-tk-whois-surface));
    border: 1px solid var(--lrob-tk-whois-border);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    break-inside: avoid;
}
.lrob-tk-whois-section:last-child {
    margin-bottom: 0;
}
.lrob-tk-whois-section h3 {
    margin: 0 0 15px;
    font-size: 1.125em;
    display: flex;
    align-items: center;
    gap: 8px;
    color: inherit;
}

/* ---- hint pip + tooltip ---- */
.lrob-tk-whois-hint {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: var(--lrob-tk-whois-faint);
    color: inherit;
    border: 1px solid currentColor;
    border-radius: 50%;
    font-size: 0.75em;
    font-weight: bold;
    cursor: help;
    user-select: none;
    opacity: 0.7;
}
.lrob-tk-whois-hint:hover,
.lrob-tk-whois-hint:focus {
    opacity: 1;
    outline: none;
}
/* Tooltip: use the theme's contrast/base pair if available, otherwise a self-contained
 * inverted scheme that flips for both light and dark themes. */
.lrob-tk-whois-tooltip {
    position: absolute;
    background: var(--wp--preset--color--contrast, var(--wp--preset--color--foreground, #222));
    color: var(--wp--preset--color--base, var(--wp--preset--color--background, #fff));
    padding: 10px 15px;
    border-radius: 6px;
    font-size: 0.8125em;
    line-height: 1.5;
    max-width: 300px;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    pointer-events: none;
}

.lrob-tk-whois-empty {
    color: var(--lrob-tk-whois-muted);
    font-style: italic;
    margin: 0;
}

/* ---- info list ---- */
/* Grid layout: first column auto-sizes to the longest label in the section,
 * second column takes the rest. Each row uses subgrid so all labels align. */
.lrob-tk-whois-info-list {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 0;
}
.lrob-tk-whois-row {
    display: grid;
    grid-template-columns: subgrid;
    grid-column: 1 / -1;
    align-items: baseline;
    gap: 6px 12px;
    padding: 6px 0;
    border-top: 1px solid var(--lrob-tk-whois-faint);
    min-width: 0;
}
.lrob-tk-whois-row:first-child { border-top: none; }
.lrob-tk-whois-label {
    font-weight: 600;
    font-size: 0.8125em;
    opacity: 0.85;
}
.lrob-tk-whois-value {
    min-width: 0;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    color: var(--lrob-tk-whois-muted);
    word-break: break-word;
}
/* Fallback for browsers without subgrid: each row uses a fixed first column. */
@supports not (grid-template-columns: subgrid) {
    .lrob-tk-whois-row {
        grid-template-columns: minmax(110px, max-content) 1fr;
    }
}
/* Stack on very narrow screens. */
@media (max-width: 480px) {
    .lrob-tk-whois-info-list { grid-template-columns: 1fr; }
    .lrob-tk-whois-row { grid-template-columns: 1fr; }
}
.lrob-tk-whois-expiry {
    color: var(--lrob-tk-whois-primary);
    font-weight: 600;
}
.lrob-tk-whois-value-stack {
    flex: 1 1 60%;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.lrob-tk-whois-value-stack > .lrob-tk-whois-value {
    flex: initial;
}
.lrob-tk-whois-rel {
    font-family: inherit;
    font-style: italic;
    font-size: 0.85em;
    font-weight: 400;
    opacity: 0.7;
}
/* Expiry urgency: row-level state colors. */
.lrob-tk-whois-row.is-expired  .lrob-tk-whois-expiry,
.lrob-tk-whois-row.is-expired  .lrob-tk-whois-rel  { color: var(--lrob-tk-whois-error);   opacity: 1; }
.lrob-tk-whois-row.is-critical .lrob-tk-whois-expiry,
.lrob-tk-whois-row.is-critical .lrob-tk-whois-rel { color: var(--lrob-tk-whois-error);   opacity: 1; }
.lrob-tk-whois-row.is-warning  .lrob-tk-whois-expiry,
.lrob-tk-whois-row.is-warning  .lrob-tk-whois-rel { color: var(--lrob-tk-whois-warning); opacity: 1; }
.lrob-tk-whois-row.is-expired  .lrob-tk-whois-label::before,
.lrob-tk-whois-row.is-critical .lrob-tk-whois-label::before {
    content: '⚠ ';
    color: var(--lrob-tk-whois-error);
}
.lrob-tk-whois-row.is-warning  .lrob-tk-whois-label::before {
    content: 'ⓘ ';
    color: var(--lrob-tk-whois-warning);
}
.lrob-tk-whois-ok {
    color: var(--lrob-tk-whois-success);
    font-weight: 600;
}

.lrob-tk-whois-pill-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 5px;
}
.lrob-tk-whois-pill {
    background: var(--lrob-tk-whois-faint);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.75em;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.lrob-tk-whois-pill.is-status {
    background: color-mix(in srgb, var(--lrob-tk-whois-success) 18%, transparent);
    color: var(--lrob-tk-whois-success);
}

.lrob-tk-whois-ds-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 5px;
}
.lrob-tk-whois-ds-item {
    background: color-mix(in srgb, var(--lrob-tk-whois-info) 12%, transparent);
    color: var(--lrob-tk-whois-info);
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 0.75em;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* ---- email summary ---- */
.lrob-tk-whois-summary {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.lrob-tk-whois-summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid var(--lrob-tk-whois-faint);
}
.lrob-tk-whois-summary-item:last-child {
    border-bottom: none;
}
.lrob-tk-whois-summary-label {
    font-weight: 600;
}
.lrob-tk-whois-summary-value {
    font-size: 0.875em;
    font-weight: 600;
    text-align: right;
}
.lrob-tk-whois-summary-value.is-ok       { color: var(--lrob-tk-whois-success); }
.lrob-tk-whois-summary-value.is-warning  { color: var(--lrob-tk-whois-warning); }
.lrob-tk-whois-summary-value.is-error    { color: var(--lrob-tk-whois-error); }

/* ---- IP / NS / MX shared ---- */
.lrob-tk-whois-ip-label {
    margin: 0 0 8px;
    font-size: 0.875em;
    opacity: 0.85;
}
.lrob-tk-whois-ip-list,
.lrob-tk-whois-mx-list,
.lrob-tk-whois-txt-list,
.lrob-tk-whois-caa-list,
.lrob-tk-whois-dkim-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.lrob-tk-whois-ip-item,
.lrob-tk-whois-mx-item,
.lrob-tk-whois-txt-item,
.lrob-tk-whois-caa-item,
.lrob-tk-whois-dkim-item {
    padding: 10px;
    background: var(--lrob-tk-whois-surface);
    border: 1px solid var(--lrob-tk-whois-border);
    border-radius: 4px;
}
.lrob-tk-whois-ip-addr,
.lrob-tk-whois-mx-host {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-weight: 600;
    color: var(--lrob-tk-whois-primary);
    word-break: break-all;
}

/* ---- DNS overview (authoritative WHOIS NS + zone NS, side-by-side) ---- */
.lrob-tk-whois-dns-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.lrob-tk-whois-dns-col {
    min-width: 0;
}
.lrob-tk-whois-dns-col-title {
    font-weight: 600;
    font-size: 0.8125em;
    opacity: 0.75;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
@media (max-width: 480px) {
    .lrob-tk-whois-dns-grid { grid-template-columns: 1fr; }
}
.lrob-tk-whois-dnssec-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--lrob-tk-whois-faint);
    font-size: 0.9em;
}
.lrob-tk-whois-dnssec-summary .lrob-tk-whois-dns-col-title {
    margin-bottom: 0;
}
.lrob-tk-whois-dnssec-summary .lrob-tk-whois-empty {
    font-style: normal;
    opacity: 0.7;
}
.lrob-tk-whois-ip-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}
.lrob-tk-whois-badge,
.lrob-tk-whois-ttl {
    display: inline-block;
    background: var(--lrob-tk-whois-faint);
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 0.75em;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* MX */
.lrob-tk-whois-mx-head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 5px;
}
.lrob-tk-whois-mx-pri {
    background: var(--lrob-tk-whois-faint);
    color: inherit;
    border: 1px solid currentColor;
    padding: 2px 8px;
    border-radius: 3px;
    font-weight: 600;
    font-size: 0.75em;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.lrob-tk-whois[style*="--lrob-tk-whois-primary"] .lrob-tk-whois-mx-pri {
    background: var(--lrob-tk-whois-primary);
    border-color: var(--lrob-tk-whois-primary);
    color: var(--wp--preset--color--background, #fff);
}
.lrob-tk-whois-mx-ips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 5px;
}
.lrob-tk-whois-mx-ip {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.75em;
    background: var(--lrob-tk-whois-faint);
    padding: 2px 8px;
    border-radius: 3px;
}

/* SPF */
.lrob-tk-whois-spf {
    display: flex;
    flex-direction: column;
    gap: 15px;
}
.lrob-tk-whois-spf-status {
    padding: 10px 15px;
    border-radius: 6px;
    font-weight: 600;
}
.lrob-tk-whois-spf-status.is-valid {
    background: color-mix(in srgb, var(--lrob-tk-whois-success) 18%, transparent);
    color: var(--lrob-tk-whois-success);
}
.lrob-tk-whois-spf-status.is-warning {
    background: color-mix(in srgb, var(--lrob-tk-whois-warning) 18%, transparent);
    color: var(--lrob-tk-whois-warning);
}
.lrob-tk-whois-spf-status.is-invalid {
    background: color-mix(in srgb, var(--lrob-tk-whois-error) 18%, transparent);
    color: var(--lrob-tk-whois-error);
}
.lrob-tk-whois-spf-lookups {
    font-weight: normal;
    margin-left: 10px;
    opacity: 0.85;
}
.lrob-tk-whois-spf-record code,
.lrob-tk-whois-record code,
.lrob-tk-whois-txt-item code,
.lrob-tk-whois-dkim-item code,
.lrob-tk-whois-spf-details code {
    display: block;
    background: var(--lrob-tk-whois-faint);
    padding: 10px;
    padding-right: 40px; /* room for the copy button */
    border-radius: 4px;
    font-size: 0.8125em;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    word-break: break-all;
    margin-top: 5px;
    color: inherit;
}

/* ---- copy button on records ---- */
.lrob-tk-whois-record-wrap {
    position: relative;
}
.lrob-tk-whois-copy-btn {
    position: absolute;
    top: 8px;
    right: 6px;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--lrob-tk-whois-border);
    border-radius: 4px;
    cursor: pointer;
    color: inherit;
    opacity: 0.55;
    padding: 0;
    transition: opacity 0.2s, color 0.2s, border-color 0.2s, transform 0.2s;
}
.lrob-tk-whois-copy-btn:hover,
.lrob-tk-whois-copy-btn:focus {
    opacity: 1;
    outline: none;
}
.lrob-tk-whois-copy-btn.is-copied {
    color: var(--lrob-tk-whois-success);
    border-color: var(--lrob-tk-whois-success);
    opacity: 1;
}
.lrob-tk-whois-copy-btn.is-copied::after {
    content: '✓';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    background: var(--lrob-tk-whois-faint);
    border-radius: 3px;
}
.lrob-tk-whois-copy-btn.is-failed {
    color: var(--lrob-tk-whois-error);
    border-color: var(--lrob-tk-whois-error);
}

/* Raw WHOIS pre is the positioning context for its copy button. */
.lrob-tk-whois-raw {
    position: relative;
}
.lrob-tk-whois-raw pre {
    padding-right: 50px;
}
.lrob-tk-whois-spf-warnings {
    background: color-mix(in srgb, var(--lrob-tk-whois-warning) 12%, transparent);
    border: 1px solid color-mix(in srgb, var(--lrob-tk-whois-warning) 40%, transparent);
    border-radius: 4px;
    padding: 10px;
    color: var(--lrob-tk-whois-warning);
}
.lrob-tk-whois-spf-warning {
    margin: 5px 0;
    font-size: 0.875em;
}
.lrob-tk-whois-spf-includes {
    margin-top: 10px;
}
.lrob-tk-whois-spf-include {
    border-left: 3px solid var(--lrob-tk-whois-border);
    padding-left: 10px;
    margin: 10px 0;
}
.lrob-tk-whois-spf-include-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 5px;
    flex-wrap: wrap;
}
.lrob-tk-whois-spf-toggle {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 0.75em;
    padding: 0;
    color: inherit;
    transition: transform 0.2s;
}
.lrob-tk-whois-spf-toggle.is-expanded {
    transform: rotate(90deg);
}
.lrob-tk-whois-spf-domain {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-weight: 600;
}
.lrob-tk-whois-spf-found    { color: var(--lrob-tk-whois-success); font-size: 0.8125em; }
.lrob-tk-whois-spf-notfound { color: var(--lrob-tk-whois-error);   font-size: 0.8125em; }
.lrob-tk-whois-spf-details {
    margin-top: 8px;
    padding: 8px;
    background: var(--lrob-tk-whois-faint);
    border-radius: 4px;
}

/* DNSSEC */
.lrob-tk-whois-dnssec {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.lrob-tk-whois-dnssec-state {
    padding: 10px 15px;
    border-radius: 6px;
    font-weight: 600;
    margin: 0;
}
.lrob-tk-whois-dnssec-state.is-ok {
    background: color-mix(in srgb, var(--lrob-tk-whois-success) 18%, transparent);
    color: var(--lrob-tk-whois-success);
}
.lrob-tk-whois-dnssec-state.is-whois {
    background: color-mix(in srgb, var(--lrob-tk-whois-info) 18%, transparent);
    color: var(--lrob-tk-whois-info);
}
.lrob-tk-whois-dnssec-note {
    margin: 0;
    padding: 8px 12px;
    background: var(--lrob-tk-whois-faint);
    border-left: 3px solid var(--lrob-tk-whois-primary);
    font-size: 0.875em;
    color: var(--lrob-tk-whois-muted);
}
.lrob-tk-whois-dnssec-list {
    margin-top: 10px;
}
.lrob-tk-whois-dnssec-row {
    background: var(--lrob-tk-whois-faint);
    padding: 8px 12px;
    border-radius: 4px;
    margin: 5px 0;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.8125em;
    word-break: break-word;
}

/* CAA */
.lrob-tk-whois-caa-item {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}
.lrob-tk-whois-caa-flags {
    background: var(--lrob-tk-whois-faint);
    padding: 2px 8px;
    border-radius: 3px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.75em;
}
.lrob-tk-whois-caa-tag {
    background: var(--lrob-tk-whois-faint);
    color: inherit;
    border: 1px solid currentColor;
    padding: 2px 8px;
    border-radius: 3px;
    font-weight: 600;
    font-size: 0.75em;
}
.lrob-tk-whois[style*="--lrob-tk-whois-primary"] .lrob-tk-whois-caa-tag {
    background: var(--lrob-tk-whois-primary);
    border-color: var(--lrob-tk-whois-primary);
    color: var(--wp--preset--color--background, #fff);
}
.lrob-tk-whois-caa-value {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-weight: 600;
    word-break: break-all;
}

/* Raw WHOIS / RDAP */
.lrob-tk-whois-raw pre {
    background: var(--lrob-tk-whois-faint);
    padding: 15px;
    border-radius: 6px;
    overflow-x: auto;
    margin: 0;
}
.lrob-tk-whois-raw code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.8125em;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
}
/* RDAP "table view": server-rendered nested key/value tables + lists.
 * Safe to inject as innerHTML — every value passed through esc_html() server-side. */
.lrob-tk-whois-rdap {
    position: relative;
    padding-right: 40px; /* leave room for the floating copy button */
}
.lrob-tk-whois-rdap-tbl {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
    background: transparent;
}
.lrob-tk-whois-rdap-tbl th,
.lrob-tk-whois-rdap-tbl td {
    padding: 6px 10px;
    vertical-align: top;
    text-align: left;
    border: none;
}
.lrob-tk-whois-rdap-tbl > tbody > tr + tr > th,
.lrob-tk-whois-rdap-tbl > tbody > tr + tr > td {
    border-top: 1px solid var(--lrob-tk-whois-faint);
}
.lrob-tk-whois-rdap-tbl > tbody > tr > th {
    color: var(--lrob-tk-whois-info);
    font-weight: 600;
    font-size: 0.85em;
    white-space: nowrap;
    width: 1%;
}
/* Nested tables: subtle inset, no extra background */
.lrob-tk-whois-rdap-tbl .lrob-tk-whois-rdap-tbl > tbody > tr > th {
    color: color-mix(in srgb, var(--lrob-tk-whois-info) 70%, currentColor);
}
.lrob-tk-whois-rdap-list {
    margin: 0;
    padding-left: 1.5em;
}
.lrob-tk-whois-rdap-list > li {
    padding: 4px 0;
}
.lrob-tk-whois-rdap-list > li + li {
    border-top: 1px dashed var(--lrob-tk-whois-faint);
}
.lrob-tk-whois-rdap-inline {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.9em;
}
.lrob-tk-whois-rdap-str {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    word-break: break-word;
}
.lrob-tk-whois-rdap-num {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    color: var(--lrob-tk-whois-warning);
}
.lrob-tk-whois-rdap-bool {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    color: var(--lrob-tk-whois-success);
    font-weight: 600;
}
.lrob-tk-whois-rdap-null,
.lrob-tk-whois-rdap-empty {
    opacity: 0.5;
    font-style: italic;
}

/* DKIM */
.lrob-tk-whois-dkim-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.lrob-tk-whois-dkim-item strong {
    color: var(--lrob-tk-whois-primary);
}

/* ---- animations ---- */
@keyframes lrob-tk-whois-fade-up {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes lrob-tk-whois-fade {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* Results panel: fade + slide up when revealed. */
.lrob-tk-whois-results:not([hidden]) {
    animation: lrob-tk-whois-fade-up 0.35s ease-out both;
}

/* Cards stagger in within an active tab. */
.lrob-tk-whois-tab-content.is-active .lrob-tk-whois-section {
    animation: lrob-tk-whois-fade-up 0.35s ease-out both;
}
.lrob-tk-whois-tab-content.is-active .lrob-tk-whois-section:nth-child(1) { animation-delay: 0ms;   }
.lrob-tk-whois-tab-content.is-active .lrob-tk-whois-section:nth-child(2) { animation-delay: 60ms;  }
.lrob-tk-whois-tab-content.is-active .lrob-tk-whois-section:nth-child(3) { animation-delay: 120ms; }
.lrob-tk-whois-tab-content.is-active .lrob-tk-whois-section:nth-child(4) { animation-delay: 180ms; }
.lrob-tk-whois-tab-content.is-active .lrob-tk-whois-section:nth-child(5) { animation-delay: 240ms; }
.lrob-tk-whois-tab-content.is-active .lrob-tk-whois-section:nth-child(n+6) { animation-delay: 300ms; }

/* Card hover lift. */
.lrob-tk-whois-section {
    transition: transform 0.2s ease-out, border-color 0.2s ease-out, box-shadow 0.2s ease-out;
}
.lrob-tk-whois-section:hover {
    transform: translateY(-2px);
    border-color: color-mix(in srgb, currentColor 40%, transparent);
    box-shadow: 0 4px 12px color-mix(in srgb, currentColor 8%, transparent);
}

/* Tab cross-fade. */
.lrob-tk-whois-tab {
    transition: color 0.2s, border-color 0.2s;
}

/* Spinner already animates; slight pulse on the input border on focus. */
.lrob-tk-whois-input { transition: border-color 0.2s, box-shadow 0.2s; }
.lrob-tk-whois-input:focus {
    box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 12%, transparent);
}

/* Hint pip pulse on hover (subtle). */
.lrob-tk-whois-hint { transition: opacity 0.2s, transform 0.2s; }
.lrob-tk-whois-hint:hover,
.lrob-tk-whois-hint:focus { transform: scale(1.1); }

/* Tooltip fade. */
.lrob-tk-whois-tooltip:not([hidden]) {
    animation: lrob-tk-whois-fade 0.15s ease-out both;
}

/* Share feedback fade. */
.lrob-tk-whois-share-feedback {
    transition: opacity 0.3s;
}

/* Loading spinner: keep existing rotation, add fade-in. */
.lrob-tk-whois-loading:not([hidden]) {
    animation: lrob-tk-whois-fade 0.2s ease-out both;
}

/* Respect user motion preferences. */
@media (prefers-reduced-motion: reduce) {
    .lrob-tk-whois-results:not([hidden]),
    .lrob-tk-whois-tab-content.is-active .lrob-tk-whois-section,
    .lrob-tk-whois-tooltip:not([hidden]),
    .lrob-tk-whois-loading:not([hidden]) {
        animation: none;
    }
    .lrob-tk-whois-section,
    .lrob-tk-whois-section:hover,
    .lrob-tk-whois-tab,
    .lrob-tk-whois-input,
    .lrob-tk-whois-hint,
    .lrob-tk-whois-share-feedback {
        transition: none;
    }
    .lrob-tk-whois-section:hover {
        transform: none;
        box-shadow: none;
    }
    .lrob-tk-whois-hint:hover,
    .lrob-tk-whois-hint:focus {
        transform: none;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .lrob-tk-whois { padding: 15px; }
    /* Block-level flex on mobile so the form actually fills its parent.
     * inline-flex + flex-direction: column + stretch shrinks to intrinsic
     * content width and clips the placeholder. */
    .lrob-tk-whois-form {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        width: 100%;
    }
    .lrob-tk-whois-input {
        width: 100%;
        padding: 10px 12px;
    }
    .lrob-tk-whois-grid { columns: 1; }
    .lrob-tk-whois-header { flex-direction: column; align-items: flex-start; }
}
