:root {
    color-scheme: light;
    --page: #f5f7fa;
    --surface: #ffffff;
    --surface-soft: #f8fafc;
    --surface-hover: #f5f8fb;
    --text: #18202b;
    --text-soft: #384657;
    --muted: #6f7c8c;
    --muted-2: #9aa5b2;
    --line: #e3e8ef;
    --line-strong: #d5dce5;
    --navy: #142238;
    --navy-hover: #0d1828;
    --accent: #2e67d1;
    --green: #15804f;
    --green-bg: #effaf4;
    --green-line: #ccebd9;
    --red: #bd3d4a;
    --red-bg: #fff3f4;
    --red-line: #f0d1d5;
    --amber: #936913;
    --amber-bg: #fff8e8;
    --amber-line: #efdfb7;
    --shadow: 0 18px 55px rgba(20, 34, 56, .075), 0 2px 8px rgba(20, 34, 56, .035);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    min-height: 100vh;
    background: var(--page);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
button, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }

.whois-shell {
    width: min(940px, calc(100% - 40px));
    margin: 48px auto;
}

.whois-card {
    position: relative;
    overflow: hidden;
    padding: 34px 36px 26px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.whois-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 3px;
    background: linear-gradient(90deg, var(--navy) 0%, #3c69a6 50%, #b7c9e1 100%);
}

.whois-header {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-icon {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border: 1px solid #dce4ed;
    border-radius: 13px;
    background: linear-gradient(180deg, #fbfcfe 0%, #f4f7fb 100%);
    color: #345171;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.8);
}
.header-icon svg { width: 25px; height: 25px; }
.header-copy { min-width: 0; }

.whois-kicker {
    display: block;
    margin-bottom: 4px;
    color: #8793a2;
    font-size: 10px;
    font-weight: 750;
    letter-spacing: .13em;
}

.whois-header h1 {
    margin: 0;
    color: var(--text);
    font-size: 28px;
    line-height: 1.2;
    letter-spacing: -.035em;
    font-weight: 720;
}

.whois-header p {
    max-width: 690px;
    margin: 7px 0 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.55;
}

.whois-form {
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid #edf0f4;
}

.field-label {
    display: block;
    margin: 0 0 9px 1px;
    color: #4a5868;
    font-size: 12px;
    font-weight: 650;
}

.domain-field {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) auto;
    align-items: center;
    min-height: 58px;
    padding: 5px;
    border: 1px solid var(--line-strong);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .025);
    transition: border-color .18s ease, box-shadow .18s ease;
}
.domain-field:hover { border-color: #c8d0db; }
.domain-field:focus-within {
    border-color: #9caabd;
    box-shadow: 0 0 0 4px rgba(44, 85, 133, .07), 0 2px 5px rgba(15, 23, 42, .035);
}

.field-icon {
    display: grid;
    place-items: center;
    width: 48px;
    height: 46px;
    color: #7d8997;
}
.field-icon svg { width: 22px; height: 22px; }

.domain-field input {
    min-width: 0;
    width: 100%;
    height: 46px;
    padding: 0 12px 0 3px;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text);
    font-size: 15px;
    font-weight: 540;
}
.domain-field input::placeholder { color: #a5afbb; font-weight: 450; }

.domain-field button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-width: 122px;
    height: 46px;
    padding: 0 18px;
    border: 1px solid var(--navy);
    border-radius: 9px;
    background: var(--navy);
    color: #fff;
    font-size: 13px;
    font-weight: 690;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(20, 34, 56, .13);
    transition: background .16s ease, border-color .16s ease, transform .16s ease, box-shadow .16s ease;
}
.domain-field button svg { width: 16px; height: 16px; }
.domain-field button:hover:not(:disabled) {
    background: var(--navy-hover);
    border-color: var(--navy-hover);
    box-shadow: 0 5px 13px rgba(20, 34, 56, .18);
}
.domain-field button:active:not(:disabled) { transform: translateY(1px); }
.domain-field button:disabled { opacity: .62; cursor: wait; box-shadow: none; }

.form-error {
    margin: 9px 2px 0;
    color: var(--red);
    font-size: 12px;
    line-height: 1.45;
}

.loading-state {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 18px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: var(--surface-soft);
}
.loading-state > div { display: flex; flex-direction: column; gap: 2px; }
.loading-state strong { color: var(--text-soft); font-size: 12.5px; font-weight: 650; }
.loading-state span:not(.spinner) { color: var(--muted); font-size: 11.5px; }
.spinner {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    border: 2px solid #dce2e9;
    border-top-color: #53657a;
    border-radius: 50%;
    animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.result-panel {
    margin-top: 22px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
    overflow: hidden;
    animation: result-in .2s ease-out;
}
@keyframes result-in {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

.result-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    padding: 22px 24px 20px;
    border-bottom: 1px solid #edf0f4;
    background: linear-gradient(180deg, #ffffff 0%, #fbfcfe 100%);
}
.result-domain-wrap { min-width: 0; }
.result-label {
    display: block;
    margin-bottom: 5px;
    color: #8a96a5;
    font-size: 10px;
    font-weight: 720;
    letter-spacing: .09em;
    text-transform: uppercase;
}
.result-head h2 {
    margin: 0;
    color: var(--text);
    font-size: 22px;
    line-height: 1.25;
    letter-spacing: -.025em;
    font-weight: 710;
    overflow-wrap: anywhere;
}
.availability-text {
    max-width: 620px;
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 12.5px;
    line-height: 1.48;
}

.availability-badge {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 30px;
    padding: 0 11px;
    border: 1px solid transparent;
    border-radius: 8px;
    font-size: 11.5px;
    font-weight: 700;
    white-space: nowrap;
}
.availability-badge::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 0 3px rgba(0,0,0,.025);
}
.availability-badge.is-available { color: var(--green); background: var(--green-bg); border-color: var(--green-line); }
.availability-badge.is-taken { color: var(--red); background: var(--red-bg); border-color: var(--red-line); }
.availability-badge.is-unknown { color: var(--amber); background: var(--amber-bg); border-color: var(--amber-line); }

.details-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
    padding: 8px 12px;
    background: #fff;
}
.detail-item {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    min-height: 78px;
    padding: 14px 12px;
}
.detail-item:nth-child(odd) { border-right: 1px solid #edf0f4; }
.detail-item:nth-child(n+3) { border-top: 1px solid #edf0f4; }
.detail-icon {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 35px;
    height: 35px;
    border: 1px solid #e2e7ed;
    border-radius: 9px;
    background: var(--surface-soft);
    color: #607084;
}
.detail-icon svg { width: 18px; height: 18px; }
.detail-item > div { min-width: 0; }
.detail-item span:not(.detail-icon),
.block-title {
    display: block;
    color: #8894a2;
    font-size: 10.5px;
    font-weight: 620;
}
.detail-item strong {
    display: block;
    margin-top: 4px;
    color: #303b49;
    font-size: 13px;
    line-height: 1.4;
    font-weight: 650;
    overflow-wrap: anywhere;
}

.info-block {
    padding: 18px 24px 20px;
    border-top: 1px solid #edf0f4;
    background: #fff;
}
.block-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 11px;
}
.block-title {
    color: #465568;
    font-size: 11.5px;
    font-weight: 680;
}
.block-subtitle {
    display: block;
    margin-top: 2px;
    color: #9aa4b0;
    font-size: 10.5px;
    line-height: 1.4;
}
.chip-list { display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
    max-width: 100%;
    min-height: 27px;
    padding: 5px 9px;
    border: 1px solid #dde4eb;
    border-radius: 7px;
    background: #f8fafc;
    color: #536274;
    font-size: 10.5px;
    line-height: 1.35;
    font-weight: 560;
    overflow-wrap: anywhere;
}

.raw-details { border-top: 1px solid #edf0f4; background: #fff; }
.raw-details summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 15px 24px;
    cursor: pointer;
    color: #536274;
    font-size: 11.5px;
    font-weight: 650;
    list-style: none;
    user-select: none;
}
.raw-details summary::-webkit-details-marker { display: none; }
.raw-details summary::after {
    content: "+";
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    border: 1px solid var(--line);
    border-radius: 6px;
    color: #7c8998;
    font-size: 15px;
    font-weight: 500;
}
.raw-details[open] summary::after { content: "−"; }
.summary-hint { margin-left: auto; color: #9ba5b1; font-size: 10.5px; font-weight: 500; }
.raw-details pre {
    max-height: 340px;
    overflow: auto;
    margin: 0 24px 22px;
    padding: 15px;
    border: 1px solid #202a37;
    border-radius: 9px;
    background: #151d28;
    color: #d8e0ea;
    font: 10.5px/1.62 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    white-space: pre-wrap;
    word-break: break-word;
}

.whois-footnote {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 18px;
    color: #929da9;
    font-size: 10.5px;
    line-height: 1.55;
}
.whois-footnote svg { flex: 0 0 auto; width: 15px; height: 15px; margin-top: 1px; }

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
[hidden] { display: none !important; }

@media (max-width: 720px) {
    .whois-shell { width: min(100% - 24px, 940px); margin: 24px auto; }
    .whois-card { padding: 25px 22px 20px; border-radius: 15px; }
    .whois-header { align-items: flex-start; gap: 13px; }
    .header-icon { width: 43px; height: 43px; border-radius: 11px; }
    .header-icon svg { width: 22px; height: 22px; }
    .whois-header h1 { font-size: 24px; }
    .whois-header p { font-size: 13px; }
    .whois-form { margin-top: 22px; padding-top: 20px; }
    .domain-field { grid-template-columns: 42px minmax(0,1fr) auto; min-height: 54px; }
    .field-icon { width: 42px; height: 42px; }
    .domain-field input { height: 42px; font-size: 14px; }
    .domain-field button { min-width: 108px; height: 42px; padding: 0 15px; }
    .result-head { padding: 19px 18px 17px; }
    .result-head h2 { font-size: 20px; }
    .details-grid { padding: 6px 10px; }
    .detail-item { min-height: 72px; padding: 12px 10px; }
    .info-block { padding: 16px 18px 18px; }
    .raw-details summary { padding: 14px 18px; }
    .raw-details pre { margin: 0 18px 18px; }
}

@media (max-width: 520px) {
    .whois-shell { width: min(100% - 18px, 940px); margin: 14px auto; }
    .whois-card { padding: 20px 16px 17px; border-radius: 13px; }
    .header-icon { width: 40px; height: 40px; }
    .whois-header h1 { font-size: 21px; }
    .whois-header p { margin-top: 5px; font-size: 12px; }
    .whois-kicker { font-size: 9px; }
    .domain-field { grid-template-columns: 40px minmax(0,1fr); padding: 4px; }
    .field-icon { width: 40px; }
    .domain-field button { grid-column: 1 / -1; width: 100%; margin-top: 4px; }
    .result-head { flex-direction: column; gap: 12px; }
    .availability-badge { min-height: 28px; }
    .details-grid { grid-template-columns: 1fr; padding: 0 14px; }
    .detail-item { min-height: 65px; padding: 12px 0; }
    .detail-item:nth-child(odd) { border-right: 0; }
    .detail-item:nth-child(n+2) { border-top: 1px solid #edf0f4; }
    .detail-icon { width: 33px; height: 33px; }
    .block-subtitle { display: none; }
    .summary-hint { display: none; }
}
