:root {
  --background: #fff;
  --foreground: #10233f;
  --primary: #1667e8;
  --border: #dce6f0;
  --muted: #687b92;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { min-width: 320px; margin: 0; color: var(--foreground); background: var(--background); font-family: var(--sans); }
button, input { font: inherit; }
[hidden] { display: none !important; }
.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; }

.app-shell {
  position: relative; min-height: 100vh; overflow: hidden; padding: 0 32px;
  background: linear-gradient(rgba(22,103,232,.027) 1px, transparent 1px), linear-gradient(90deg,rgba(22,103,232,.027) 1px,transparent 1px), #fff;
  background-size: 48px 48px;
}
.ambient { position: absolute; border-radius: 999px; pointer-events: none; }
.ambient-one { width: 620px; height: 620px; top: -370px; left: calc(50% - 310px); background: radial-gradient(circle, rgba(72,153,255,.14), transparent 70%); }
.ambient-two { width: 500px; height: 500px; top: 400px; right: -310px; background: radial-gradient(circle, rgba(37,208,156,.1), transparent 72%); }

.topbar { position: relative; z-index: 2; max-width: 1180px; height: 84px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #e2eaf2; }
.brand { display: inline-flex; align-items: center; gap: 11px; color: #122942; text-decoration: none; font-size: 16px; font-weight: 760; letter-spacing: -.025em; }
.brand-mark { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 11px; color: #fff; background: linear-gradient(135deg,#1b70ee,#26c79a); box-shadow: 0 9px 24px rgba(22,103,232,.2); font-size: 25px; line-height: 1; }
.service-state, .scan-meta { display: inline-flex; align-items: center; gap: 8px; color: #71849a; font: 10px var(--mono); text-transform: uppercase; letter-spacing: .1em; }
.pulse-dot { width: 7px; height: 7px; display: inline-block; border-radius: 50%; background: #20bb79; box-shadow: 0 0 0 4px rgba(32,187,121,.1), 0 0 12px rgba(32,187,121,.3); }

.hero { position: relative; z-index: 1; max-width: 820px; margin: 0 auto; padding: 88px 0 76px; text-align: center; }
.eyebrow, .section-kicker { display: inline-flex; align-items: center; gap: 8px; color: #51708f; font: 700 10px var(--mono); text-transform: uppercase; letter-spacing: .14em; }
.eyebrow { padding: 8px 12px; border: 1px solid #dce8f5; border-radius: 999px; background: rgba(246,250,255,.9); }
.eyebrow > span { color: #1670dc; }
.hero h1 { margin: 25px 0 22px; color: #102842; font-size: clamp(48px,7.4vw,82px); line-height: .99; letter-spacing: -.065em; font-weight: 720; }
.hero h1 span { color: transparent; background: linear-gradient(100deg,#125dcd 10%,#1a87e7 52%,#1eaf88 93%); background-clip: text; -webkit-background-clip: text; }
.hero-copy { max-width: 620px; margin: 0 auto; color: #657a91; font-size: 16px; line-height: 1.72; }

.search-panel { margin: 42px auto 0; padding: 17px; text-align: left; border: 1px solid #dae5f0; border-radius: 19px; background: rgba(255,255,255,.94); box-shadow: 0 26px 70px rgba(33,69,110,.12), inset 0 1px 0 #fff; backdrop-filter: blur(16px); }
.search-panel label { display: block; margin: 0 0 9px 3px; color: #5b7188; font-size: 10px; font-weight: 750; text-transform: uppercase; letter-spacing: .1em; }
.search-row { display: flex; gap: 10px; }
.input-wrap { position: relative; flex: 1; }
.input-wrap > span { position: absolute; z-index: 2; left: 16px; top: 50%; color: #7c91a7; transform: translateY(-50%); font-size: 20px; }
.input-wrap input { width: 100%; height: 54px; padding: 0 15px 0 46px; border: 1px solid #d9e3ed; border-radius: 11px; outline: none; background: #f9fbfd; color: #17304d; font: 14px var(--mono); }
.input-wrap input:focus { border-color: #4d8fe8; box-shadow: 0 0 0 4px rgba(61,128,229,.1); }
.search-row button { height: 54px; padding: 0 25px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 11px; cursor: pointer; background: linear-gradient(135deg,#1767e6,#155bcf); color: #fff; font-weight: 730; box-shadow: 0 11px 28px rgba(21,96,213,.22); }
.search-row button:hover { background: linear-gradient(135deg,#2877ed,#1767e6); }
.search-row button:disabled { opacity: .6; cursor: wait; }
.button-icon { font-size: 20px; line-height: 1; }
.search-panel > p { margin: 10px 0 0 3px; color: #8595a7; font-size: 11px; }

.error-banner { width: min(100%,640px); margin: 18px auto 0; padding: 14px 16px; display: flex; gap: 12px; text-align: left; border: 1px solid #f0cdd2; border-radius: 13px; background: #fff7f8; color: #c5364a; }
.error-banner > span { width: 20px; height: 20px; display: grid; place-items: center; flex: 0 0 auto; border: 1px solid currentColor; border-radius: 50%; font-weight: 800; }
.error-banner strong, .error-banner small { display: block; }
.error-banner strong { font-size: 13px; }
.error-banner small { margin-top: 3px; color: #91656b; font-size: 12px; line-height: 1.5; }

.results { position: relative; z-index: 1; max-width: 1180px; margin: 0 auto 80px; padding-top: 48px; border-top: 1px solid #e1e9f1; }
.results-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 25px; }
.section-kicker { display: block; margin-bottom: 9px; color: #6081a1; }
.results-heading h2 { margin: 0; color: #132f4c; font: 700 clamp(22px,4vw,31px) var(--mono); letter-spacing: -.04em; }
.metric-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; margin-bottom: 17px; }
.metric { min-height: 104px; padding: 20px; display: flex; align-items: center; gap: 15px; border: 1px solid #dde6ef; border-radius: 15px; background: rgba(255,255,255,.92); box-shadow: 0 8px 25px rgba(41,72,107,.045); }
.metric-accent { border-color: #b9d8fa; background: linear-gradient(135deg,#edf6ff,#f6fffb); }
.metric-icon { width: 40px; height: 40px; display: grid; place-items: center; flex: 0 0 auto; border: 1px solid #d7e7f7; border-radius: 11px; color: #1969d7; background: #f1f7ff; font-size: 18px; }
.metric div > span { display: block; color: #7a8da2; font-size: 10px; text-transform: uppercase; letter-spacing: .09em; }
.metric strong { display: block; margin-top: 4px; color: #17324f; font-size: 25px; line-height: 1; }

.table-card { overflow: hidden; border: 1px solid #dbe5ef; border-radius: 15px; background: rgba(255,255,255,.94); box-shadow: 0 14px 40px rgba(38,68,102,.055); }
table { width: 100%; border-collapse: collapse; }
thead { background: #f5f8fb; }
th { height: 46px; padding: 0 20px; color: #72869a; text-align: left; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .11em; }
th:last-child, td:last-child { text-align: right; }
td { height: 68px; padding: 0 20px; border-top: 1px solid #e8eef4; }
tbody tr { transition: background 150ms ease; }
tbody tr:hover { background: #f8fbfe; }
.host-cell { display: flex; align-items: center; gap: 11px; color: #183552; font: 13px var(--mono); }
.host-icon { width: 30px; height: 30px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 8px; color: #5681a8; background: #eef4fa; }
.status { min-width: 82px; padding: 6px 9px; display: inline-flex; align-items: center; gap: 6px; border: 1px solid transparent; border-radius: 999px; font: 700 11px var(--mono); }
.status-healthy, .status-success { color: #14855a; border-color: #c8ebdc; background: #effaf5; }
.status-redirect { color: #226cad; border-color: #cce2f6; background: #f1f8fe; }
.status-warning { color: #956216; border-color: #efdcae; background: #fffaf0; }
.status-danger, .status-offline { color: #bd4251; border-color: #f1d2d6; background: #fff7f8; }
.protocol, .latency { color: #6f8397; font: 11px var(--mono); text-transform: uppercase; }
.open-link { height: 34px; padding: 0 12px; display: inline-flex; align-items: center; gap: 6px; border: 1px solid #d4e1ed; border-radius: 9px; background: #fff; color: #42617e; text-decoration: none; font-size: 11px; }
.open-link:hover { border-color: #91b9e9; background: #f0f6fd; color: #165fbf; }
.source-note { margin: 16px 3px 0; color: #7f90a2; font-size: 11px; line-height: 1.6; }
.empty-state { padding: 70px 24px; text-align: center; border: 1px solid #dce6ef; border-radius: 15px; background: #fff; }
.empty-state > span { color: #6c94b9; font-size: 30px; }
.empty-state h3 { margin: 17px 0 7px; font-size: 16px; color: #17334f; }
.empty-state p { margin: 0; color: #71869a; font-size: 13px; }

.loading-results { min-height: 520px; }
.metric-skeleton, .row-skeleton { background: linear-gradient(90deg,#edf3f8,#f7f9fb,#edf3f8); background-size: 200% 100%; animation: shimmer 1.5s infinite; }
.metric-skeleton { height: 104px; border-radius: 14px; }
.skeleton-table { padding: 7px 20px; }
.row-skeleton { height: 54px; margin: 7px 0; border-radius: 8px; }
.spinner { display: inline-block; animation: spin 1.3s linear infinite; font-size: 17px; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { to { background-position: -200% 0; } }

footer { position: relative; z-index: 1; max-width: 1180px; height: 78px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; border-top: 1px solid #e1e9f1; color: #8293a5; font: 10px var(--mono); text-transform: uppercase; letter-spacing: .08em; }
footer > span:first-child { display: inline-flex; align-items: center; gap: 9px; }

@media (max-width: 820px) {
  .app-shell { padding: 0 20px; }
  .hero { padding: 68px 0 60px; }
  .metric-grid { grid-template-columns: repeat(2,1fr); }
  .table-card { overflow-x: auto; }
  table { min-width: 760px; }
}
@media (max-width: 560px) {
  .app-shell { padding: 0 16px; }
  .topbar { height: 72px; }
  .service-state { font-size: 0; }
  .hero { padding-top: 54px; }
  .hero h1 { font-size: 46px; }
  .hero-copy { font-size: 14px; }
  .search-panel { margin-top: 31px; padding: 13px; }
  .search-row { flex-direction: column; }
  .search-row button { width: 100%; }
  .results { padding-top: 38px; margin-bottom: 55px; }
  .results-heading { align-items: flex-start; flex-direction: column; }
  .metric { min-height: 88px; padding: 15px; gap: 10px; }
  .metric-icon { width: 34px; height: 34px; }
  footer { height: 95px; align-items: flex-start; justify-content: center; flex-direction: column; gap: 9px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, .spinner { animation: none !important; transition: none !important; } }
