:root {
    --bg-0: #081722;
    --bg-1: #0e2533;
    --bg-2: #123147;
    --panel: #f6f9fc;
    --panel-muted: #e9f0f7;
    --ink-0: #112331;
    --ink-1: #41596f;
    --line: #cdd8e3;
    --accent: #1b8ec5;
    --accent-2: #0e5f9e;
    --danger: #be2f2f;
    --success: #157a58;
    --warning: #bf7a17;
}

html,
body {
    margin: 0;
    min-height: 100%;
    font-family: "IBM Plex Sans", "Trebuchet MS", "Segoe UI", sans-serif;
    color: var(--ink-0);
    background:
        radial-gradient(1200px 420px at 12% -20%, rgba(67, 154, 204, 0.34), transparent 62%),
        radial-gradient(900px 480px at 90% -8%, rgba(23, 112, 168, 0.28), transparent 58%),
        linear-gradient(180deg, var(--bg-1), var(--bg-0));
}

a,
.btn-link {
    color: var(--accent-2);
}

.btn-primary {
    color: #fff;
    background-color: var(--accent);
    border-color: #157aad;
}

.btn-primary:hover {
    background-color: #167caf;
    border-color: #146f9f;
}

.content {
    padding-top: 1rem;
}

h1,
h2,
h3,
h4 {
    letter-spacing: 0.01em;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #2d945d;
}

.invalid {
    outline: 1px solid #ca2f2f;
}

.validation-message {
    color: #ca2f2f;
}

.console-shell {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.panel {
    background: linear-gradient(180deg, #ffffff 0%, var(--panel) 100%);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 0.9rem;
    box-shadow: 0 6px 20px rgba(10, 20, 34, 0.08);
}

.panel.muted {
    background: var(--panel-muted);
}

.hero {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
    color: #eaf5ff;
}

.hero h1 {
    margin: 0;
    font-size: 1.55rem;
}

.hero p {
    margin: 0.4rem 0 0;
    color: #afd2eb;
}

.quota-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(120px, 1fr));
    gap: 0.45rem;
    min-width: 390px;
}

.quota-cell {
    background: rgba(6, 34, 54, 0.58);
    border: 1px solid rgba(173, 214, 241, 0.36);
    border-radius: 10px;
    padding: 0.45rem 0.65rem;
    color: #eaf7ff;
}

.quota-cell span {
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #9cc7df;
}

.quota-cell strong {
    font-size: 0.92rem;
}

.query-form {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.5rem;
}

.query-input {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    padding: 0.6rem 0.75rem;
    font-size: 0.95rem;
}

.panel-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
}

.panel-title-row h1,
.panel-title-row h2 {
    margin: 0;
}

.dense-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.84rem;
}

.dense-table th,
.dense-table td {
    border-bottom: 1px solid var(--line);
    padding: 0.38rem 0.45rem;
    vertical-align: top;
}

.dense-table th {
    font-weight: 700;
    color: #2b475b;
    text-transform: uppercase;
    font-size: 0.68rem;
    letter-spacing: 0.03em;
}

.records-table td:nth-child(1) {
    width: 84px;
}

.record-line {
    display: flex;
    justify-content: space-between;
    gap: 0.6rem;
    align-items: center;
    margin-bottom: 0.2rem;
}

.record-line.compact {
    margin-left: 0.8rem;
}

.actions {
    display: inline-flex;
    gap: 0.2rem;
}

.country-flag {
    display: inline-block;
    width: 1.25rem;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: 2px;
    border: 1px solid #aac7da;
    margin-right: 0.25rem;
    vertical-align: text-bottom;
    background: #fff;
}

.country-flag-fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    background: transparent;
    color: #4f6b7f;
}

.country-code {
    color: #4f6b7f;
    font-size: 0.75rem;
    margin-left: 0.2rem;
}

.action-btn,
.icon-btn {
    border: 1px solid #8fb4cd;
    border-radius: 6px;
    background: #f0f8ff;
    font-size: 0.63rem;
    font-weight: 700;
    color: #14527c;
    padding: 0.16rem 0.3rem;
    min-width: 30px;
    height: 1.72rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.28rem;
}

.action-btn {
    line-height: 1;
}

.action-btn-icon {
    font-size: 0.8rem;
    width: 0.95rem;
    text-align: center;
}

.action-btn-text {
    font-size: 0.72rem;
}

.action-btn:hover,
.icon-btn:hover {
    background: #ddf1ff;
}

.action-btn-view,
.icon-btn.action-view {
    border-color: #8fb4cd;
    background: #e8f4fd;
    color: #154f77;
}

.action-btn-view:hover,
.icon-btn.action-view:hover {
    background: #d9ecfa;
}

.action-btn-delete,
.icon-btn.action-delete {
    border-color: #deabab;
    background: #ffeaea;
    color: #8d2a2a;
}

.action-btn-delete:hover,
.icon-btn.action-delete:hover {
    background: #ffdada;
}

.action-btn-save,
.action-btn-update,
.action-btn-refresh,
.action-btn-copy,
.action-btn-edit,
.action-btn-password,
.action-btn-pw,
.action-btn-toggle,
.action-btn-reverse,
.action-btn-ip,
.action-btn-domain,
.action-btn-blacklist {
    border-color: #8fb4cd;
    background: #e8f4fd;
    color: #154f77;
}

.action-btn-save:hover,
.action-btn-update:hover,
.action-btn-refresh:hover,
.action-btn-copy:hover,
.action-btn-edit:hover,
.action-btn-password:hover,
.action-btn-pw:hover,
.action-btn-toggle:hover,
.action-btn-reverse:hover,
.action-btn-ip:hover,
.action-btn-domain:hover,
.action-btn-blacklist:hover {
    background: #d9ecfa;
}

.scan-row-clickable {
    cursor: pointer;
}

.scan-row-clickable:hover td {
    background: #f3f9ff;
}

.history-table .actions-col {
    width: 1%;
    white-space: nowrap;
}

.grid-two {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.grid-three {
    display: grid;
    grid-template-columns: 2fr 1fr auto;
    gap: 0.7rem;
    align-items: end;
}

.panel-section {
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 0.7rem;
    background: #fff;
}

.panel-section h3,
.panel-section h4 {
    margin: 0 0 0.45rem;
}

.web-intel-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.web-tabs {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    margin-bottom: 0.55rem;
}

.web-tabs button {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.web-tab-target {
    color: #4d6f86;
    font-size: 0.72rem;
}

.web-tab-active {
    background: #dff0fc;
    border-color: #73a8cc;
}

.web-card {
    border: 1px solid #d4e5f1;
    border-radius: 8px;
    padding: 0.65rem;
    background: #f8fcff;
}

.web-title-row {
    display: flex;
    gap: 0.55rem;
    align-items: center;
    margin-bottom: 0.55rem;
}

.web-favicon {
    width: 1.7rem;
    height: 1.7rem;
    border-radius: 6px;
    border: 1px solid #b7d1e3;
    background: #fff;
    object-fit: contain;
}

.web-page-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #1a415d;
}

.web-facts-list {
    margin: 0.55rem 0 0;
    padding-left: 1.2rem;
    color: #34566e;
}

.web-cert-valid {
    color: #1e7a4f;
    font-weight: 600;
}

.web-cert-warning {
    color: #9f641e;
    font-weight: 600;
}

.web-cert-san-list {
    margin: 0;
    padding-left: 1.1rem;
}

.web-cert-san-item {
    color: #2b4f67;
    font-size: 0.78rem;
    margin: 0.1rem 0;
}

.scan-panel .panel-header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: start;
    margin-bottom: 0.6rem;
}

.eyebrow {
    text-transform: uppercase;
    color: #5d7a90;
    font-size: 0.7rem;
    letter-spacing: 0.03em;
}

.result-title {
    margin: 0.2rem 0 0;
    font-size: 1.18rem;
}

.flag {
    margin-left: 0.3rem;
}

.chips {
    display: flex;
    gap: 0.3rem;
    flex-wrap: wrap;
}

.chip {
    font-size: 0.7rem;
    color: #1a3f57;
    border: 1px solid #9ebcd1;
    background: #ebf5fb;
    border-radius: 999px;
    padding: 0.2rem 0.5rem;
}

.chip.warning {
    background: #fff5e5;
    border-color: #f0cca0;
    color: #8f5c1c;
}

.chip.danger {
    background: #ffe9e9;
    border-color: #f1b8b8;
    color: #8f2929;
}

.chip.success {
    background: #e8fff2;
    border-color: #a4dfc2;
    color: #1c6d4d;
}

.rdap-toggle {
    display: flex;
    gap: 0.4rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.rdap-tab-active {
    background: #dff0fc;
    border-color: #73a8cc;
}

.rdap-card-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.8rem;
}

.rdap-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.rdap-chip {
    display: inline-block;
    border: 1px solid #a8c6d8;
    border-radius: 999px;
    background: #f0f8fe;
    color: #24465c;
    padding: 0.16rem 0.5rem;
    font-size: 0.72rem;
}

.rdap-notice {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfdff;
    padding: 0.55rem;
    margin-bottom: 0.5rem;
}

.rdap-notice-title {
    font-weight: 700;
    margin-bottom: 0.2rem;
}

.rdap-empty {
    color: #4f6778;
    background: #f3f8fc;
    border: 1px dashed #b3cbdd;
    border-radius: 8px;
    padding: 0.55rem;
}

.xml-viewer {
    margin: 0;
    width: 100%;
    max-width: 100%;
    max-height: 420px;
    overflow: auto;
    background: #0f2334;
    color: #d4e8f8;
    border-radius: 8px;
    padding: 0.65rem;
    font-size: 0.76rem;
    line-height: 1.45;
}

.xml-node {
    margin-left: 0.75rem;
}

.xml-summary {
    cursor: pointer;
    list-style: none;
}

.xml-summary::-webkit-details-marker {
    display: none;
}

.xml-summary::before {
    content: "▸";
    color: #7db5da;
    margin-right: 0.35rem;
}

.xml-node[open] > .xml-summary::before {
    content: "▾";
}

.xml-line {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.xml-children {
    margin-left: 1rem;
}

.xml-tag {
    color: #7dd3fc;
}

.xml-bracket,
.xml-equals {
    color: #9ac0d9;
}

.xml-attr-name {
    color: #f2cc72;
}

.xml-attr-value {
    color: #86efac;
}

.xml-text {
    color: #d1e9ff;
}

.xml-toolbar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.45rem;
}

.xml-copy-status {
    font-size: 0.75rem;
    color: #4e6b7f;
}

.blacklist-group {
    border: 1px solid var(--line);
    border-radius: 8px;
    margin-bottom: 0.5rem;
    background: #fcfeff;
    padding: 0.4rem 0.5rem;
}

.blacklist-group-title {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.6rem;
    font-weight: 700;
    color: #274b63;
    list-style: none;
}

.blacklist-group-title::-webkit-details-marker {
    display: none;
}

.blacklist-group-title::before {
    content: "▸";
    color: #5789a9;
    margin-right: 0.3rem;
}

.blacklist-group[open] > .blacklist-group-title::before {
    content: "▾";
}

.blacklist-flag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 4.6rem;
    max-width: 4.6rem;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    border: 1px solid;
    border-radius: 999px;
    padding: 0.12rem 0.45rem;
    letter-spacing: 0.02em;
}

.blacklist-flag-red {
    color: #8c2323;
    background: #ffe8e8;
    border-color: #e8abab;
}

.blacklist-flag-green {
    color: #1e674a;
    background: #e8fff2;
    border-color: #9fd9bc;
}

.blacklist-target-label {
    text-align: left;
    overflow-wrap: anywhere;
}

.virustotal-meta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.virustotal-stat-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.virustotal-stat-chip {
    border: 1px solid #b8d4e6;
    border-radius: 999px;
    background: #f1f8fd;
    color: #23465f;
    font-size: 0.72rem;
    padding: 0.16rem 0.5rem;
}

.virustotal-link {
    font-size: 0.78rem;
    color: #16577e;
    text-decoration: none;
    font-weight: 600;
}

.virustotal-link:hover {
    text-decoration: underline;
}

.virustotal-checked-label {
    margin-top: 0.4rem;
    font-size: 0.76rem;
}

.virustotal-link-row {
    margin-top: 0.45rem;
}

.virustotal-results {
    border: 1px solid var(--line);
    border-radius: 8px;
    margin-top: 0.5rem;
    background: #fcfeff;
    padding: 0.4rem 0.5rem;
}

.virustotal-results-title {
    cursor: pointer;
    list-style: none;
    color: #274b63;
    font-weight: 700;
}

.virustotal-results-title::-webkit-details-marker {
    display: none;
}

.virustotal-results-title::before {
    content: "▸";
    color: #5789a9;
    margin-right: 0.3rem;
}

.virustotal-results[open] > .virustotal-results-title::before {
    content: "▾";
}

.virustotal-category {
    display: inline-flex;
    align-items: center;
    border: 1px solid #c5d9e8;
    border-radius: 999px;
    background: #f2f8fd;
    color: #2f536a;
    font-size: 0.7rem;
    padding: 0.08rem 0.42rem;
}

.virustotal-category-malicious {
    border-color: #ecafaf;
    background: #ffe9e9;
    color: #8b2626;
}

.virustotal-category-suspicious {
    border-color: #f1c48b;
    background: #fff3e3;
    color: #8e5a1e;
}

.virustotal-category-harmless {
    border-color: #9fd9bc;
    background: #e8fff2;
    color: #1f684b;
}

.note-list {
    margin: 0;
    padding-left: 1rem;
    font-size: 0.84rem;
}

.mx-item {
    margin-bottom: 0.5rem;
}

.mx-host {
    font-weight: 600;
}

.spf-list {
    margin-top: 0.6rem;
    font-size: 0.82rem;
}

.password-box {
    margin-top: 0.6rem;
    border: 1px dashed #7da8c5;
    background: #ebf7ff;
    padding: 0.6rem;
    border-radius: 8px;
}

.metric {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    height: 38px;
    display: flex;
    align-items: center;
    padding: 0 0.5rem;
}

.admin-actions {
    display: flex;
    gap: 0.5rem;
}

.rdap-admin-grid {
    display: grid;
    grid-template-columns: 1fr 2fr auto auto;
    gap: 0.7rem;
    align-items: end;
}

.rdap-enabled-toggle {
    min-width: 110px;
}

.rdap-hint {
    margin-top: 0.55rem;
    font-size: 0.78rem;
    color: #46667d;
}

.rdap-toolbar {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 0.45rem;
}

.rdap-toolbar .form-control {
    min-width: 230px;
    flex: 1 1 260px;
}

.rdap-toolbar-btn {
    min-width: 106px;
    height: 2rem;
    padding: 0.22rem 0.48rem;
}

.rdap-toolbar-btn .action-btn-icon {
    font-size: 0.86rem;
    width: 1rem;
}

.rdap-toolbar-btn .action-btn-text {
    font-size: 0.76rem;
}

.rdap-pagination {
    margin: 0.4rem 0 0.6rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.rdap-pagination-actions {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.rdap-page-status {
    color: #4f6b7f;
    font-size: 0.78rem;
}

.rdap-summary {
    margin: 0.45rem 0 0.6rem;
    font-size: 0.78rem;
    color: #4f6b7f;
    display: flex;
    gap: 0.55rem;
    flex-wrap: wrap;
}

.rdap-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1200;
    padding: 1rem;
    background: rgba(6, 22, 34, 0.52);
    display: flex;
    align-items: center;
    justify-content: center;
}

.rdap-modal {
    width: min(760px, 100%);
    max-height: calc(100vh - 2rem);
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: linear-gradient(180deg, #ffffff 0%, var(--panel) 100%);
    padding: 0.85rem;
    box-shadow: 0 18px 40px rgba(2, 20, 32, 0.28);
}

.rdap-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.5rem;
}

.rdap-modal-header h3 {
    margin: 0;
}

.rdap-modal-header .rdap-toolbar-btn {
    min-width: 90px;
    height: 2rem;
    padding: 0.22rem 0.45rem;
}

.rdap-modal-actions {
    margin-top: 0.7rem;
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.rdap-modal-actions .rdap-toolbar-btn {
    min-width: 110px;
    height: 2rem;
    padding: 0.22rem 0.5rem;
}

.app-topbar {
    color: #85b9d6;
    background: rgba(4, 23, 36, 0.76);
    border-bottom: 1px solid rgba(152, 197, 225, 0.26);
}

.topbar-title {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.topbar-icon {
    display: inline-flex;
    width: 1.1rem;
    justify-content: center;
    font-size: 0.88rem;
    line-height: 1;
}

.blazor-error-boundary {
    background: #bc2d2d;
    color: #fff;
    padding: 1rem;
}

.form-floating > .form-control-plaintext::placeholder,
.form-floating > .form-control::placeholder {
    color: var(--ink-1);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder,
.form-floating > .form-control:focus::placeholder {
    text-align: start;
}

@media (max-width: 1024px) {
    .grid-two,
    .grid-three,
    .query-form,
    .quota-strip,
    .rdap-card-grid,
    .rdap-admin-grid,
    .web-intel-grid {
        grid-template-columns: 1fr;
        min-width: 0;
    }

    .hero {
        flex-direction: column;
    }

    .panel {
        padding: 0.7rem;
    }
}
