:root {
  color-scheme: light;
  --ink: #18222f;
  --muted: #5f6d7c;
  --line: #d9e0e8;
  --panel: #ffffff;
  --soft: #f4f7fa;
  --accent: #18756f;
  --accent-dark: #0f5652;
  --gold: #b26b1f;
  --good: #1b7d47;
  --warn: #a35f00;
  --bad: #a93636;
  --shadow: 0 18px 45px rgba(25, 34, 48, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  width: 100%;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    linear-gradient(135deg, rgba(24, 117, 111, 0.12), transparent 32%),
    linear-gradient(315deg, rgba(178, 107, 31, 0.12), transparent 28%),
    #eef3f6;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
textarea,
input {
  font: inherit;
}

.home-active .app-shell {
  display: none;
}

body:not(.home-active) .home-screen {
  display: none;
}

.home-screen {
  min-height: 100vh;
  width: min(1380px, 100%);
  margin: 0 auto;
  padding: 18px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 18px;
  position: relative;
  overflow-x: hidden;
}

.home-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at var(--mx, 55%) var(--my, 42%), rgba(24, 117, 111, 0.2), transparent 24%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.18));
  pointer-events: none;
}

.home-topbar,
.home-hero,
.home-metrics {
  position: relative;
  z-index: 1;
}

.home-topbar {
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(217, 224, 232, 0.9);
  border-radius: 8px;
  padding: 10px 14px;
  box-shadow: var(--shadow);
}

.home-logo-small {
  width: 52px;
  height: 52px;
  object-fit: contain;
}

.home-hero {
  display: grid;
  grid-template-columns: minmax(320px, 0.95fr) minmax(320px, 1.05fr);
  gap: 18px;
  align-items: stretch;
}

.home-copy,
.home-console,
.home-metrics article {
  border: 1px solid rgba(217, 224, 232, 0.9);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.home-copy {
  padding: clamp(22px, 4vw, 42px);
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
}

.home-logo {
  width: min(220px, 62vw);
  height: auto;
  object-fit: contain;
}

.home-copy h1 {
  font-size: clamp(3rem, 9vw, 6.6rem);
}

.home-lede {
  color: var(--muted);
  font-size: clamp(1.1rem, 2vw, 1.35rem);
  max-width: 560px;
}

.home-search {
  display: grid;
  gap: 9px;
  max-width: 560px;
}

.home-search-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

input {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  min-height: 46px;
  color: var(--ink);
  background: #fbfcfd;
}

input:focus {
  outline: 3px solid rgba(24, 117, 111, 0.25);
  outline-offset: 2px;
}

.home-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.home-console {
  padding: clamp(18px, 3vw, 28px);
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
}

.console-header {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.console-header span {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--line);
}

.console-header span:nth-child(1) {
  background: var(--bad);
}

.console-header span:nth-child(2) {
  background: var(--gold);
}

.console-header span:nth-child(3) {
  background: var(--good);
}

.console-line {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fbfcfd;
}

.console-line span {
  color: var(--muted);
  text-align: right;
  overflow-wrap: anywhere;
}

.console-line.active {
  border-color: rgba(24, 117, 111, 0.5);
  background: rgba(24, 117, 111, 0.08);
}

.console-progress {
  height: 12px;
  border-radius: 999px;
  background: #e5ebf0;
  overflow: hidden;
}

.console-progress span {
  display: block;
  width: 42%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--gold));
  animation: scan 2.4s infinite ease-in-out;
}

@keyframes scan {
  50% {
    width: 86%;
  }
}

.home-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.home-metrics article {
  padding: 18px;
  transition: transform 180ms ease, border-color 180ms ease;
}

.home-metrics article:hover {
  transform: translateY(-4px);
  border-color: rgba(24, 117, 111, 0.5);
}

.home-metrics span,
.home-metrics strong {
  display: block;
}

.home-metrics span {
  color: var(--accent);
  font-weight: 800;
}

.home-metrics strong {
  margin-top: 6px;
  font-size: 1.18rem;
}

.home-metrics p {
  margin-top: 8px;
  color: var(--muted);
}

.app-shell {
  width: min(1380px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(320px, 430px) 1fr;
  gap: 18px;
  padding: 18px;
}

.lookup-panel,
.results-panel {
  min-width: 0;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(217, 224, 232, 0.9);
  box-shadow: var(--shadow);
}

.lookup-panel {
  min-height: calc(100vh - 36px);
  border-radius: 8px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 26px;
}

.results-panel {
  min-width: 0;
  border-radius: 8px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.brand-row {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 16px;
  align-items: center;
}

.brand-logo {
  max-width: 100%;
  width: 92px;
  height: 92px;
  border-radius: 8px;
  object-fit: contain;
  background: white;
  border: 1px solid var(--line);
  padding: 6px;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: clamp(1.75rem, 4vw, 2.65rem);
  line-height: 1;
  letter-spacing: 0;
}

.brand-row p,
.toolbar p,
.placeholder p,
.quick-notes span,
.result-sub,
.detail span,
.summary-grid span {
  color: var(--muted);
}

.lookup-form {
  display: grid;
  gap: 10px;
}

label {
  font-weight: 760;
}

textarea {
  width: 100%;
  resize: vertical;
  min-height: 210px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  color: var(--ink);
  background: #fbfcfd;
  line-height: 1.45;
}

textarea:focus,
button:focus-visible {
  outline: 3px solid rgba(24, 117, 111, 0.25);
  outline-offset: 2px;
}

.form-actions,
.export-actions,
.toolbar,
.result-head,
.result-actions {
  display: flex;
  align-items: center;
}

.form-actions {
  gap: 10px;
  flex-wrap: wrap;
}

button {
  max-width: 100%;
  border: 0;
  border-radius: 8px;
  min-height: 42px;
  padding: 0 14px;
  cursor: pointer;
  font-weight: 760;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.primary-button {
  background: var(--accent);
  color: white;
}

.primary-button:hover:not(:disabled) {
  background: var(--accent-dark);
}

.ghost-button,
.icon-button {
  background: var(--soft);
  color: var(--ink);
  border: 1px solid var(--line);
}

.ghost-button:hover:not(:disabled),
.icon-button:hover:not(:disabled) {
  background: #e8eef3;
}

.quick-notes {
  margin-top: auto;
  display: grid;
  gap: 10px;
}

.quick-notes div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fbfcfd;
}

.quick-notes strong,
.quick-notes span {
  display: block;
}

.toolbar {
  justify-content: space-between;
  gap: 14px;
}

h2 {
  font-size: 1.25rem;
}

.export-actions {
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.icon-button {
  min-width: 62px;
}

.status {
  min-height: 44px;
  border-radius: 8px;
  background: #f7fafc;
  border: 1px solid var(--line);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
}

.status span:last-child {
  min-width: 0;
  overflow-wrap: anywhere;
}

.status.busy {
  color: var(--accent-dark);
}

.status.error {
  color: var(--bad);
  background: #fff7f7;
}

.pulse {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: currentColor;
  display: inline-block;
}

.busy .pulse {
  animation: breathe 1s infinite;
}

@keyframes breathe {
  50% {
    opacity: 0.35;
    transform: scale(1.45);
  }
}

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

.summary-grid div {
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fbfcfd;
  padding: 12px;
  min-width: 0;
}

.summary-grid span,
.summary-grid strong {
  display: block;
}

.summary-grid strong {
  margin-top: 6px;
  font-size: 1.2rem;
  overflow-wrap: anywhere;
}

.results-list {
  display: grid;
  gap: 12px;
}

.placeholder,
.result-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.placeholder {
  min-height: 360px;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 24px;
}

.placeholder-visual {
  width: min(360px, 100%);
  aspect-ratio: 16 / 9;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  align-items: end;
  margin-bottom: 18px;
}

.placeholder-visual span {
  display: block;
  border-radius: 8px 8px 0 0;
  background: linear-gradient(180deg, rgba(24, 117, 111, 0.86), rgba(24, 117, 111, 0.18));
}

.placeholder-visual span:nth-child(1) {
  height: 42%;
}

.placeholder-visual span:nth-child(2) {
  height: 72%;
  background: linear-gradient(180deg, rgba(178, 107, 31, 0.86), rgba(178, 107, 31, 0.18));
}

.placeholder-visual span:nth-child(3) {
  height: 58%;
}

.placeholder-visual span:nth-child(4) {
  height: 86%;
  background: linear-gradient(180deg, rgba(24, 34, 47, 0.88), rgba(24, 34, 47, 0.18));
}

.result-card {
  padding: 16px;
  display: grid;
  gap: 14px;
}

.result-head {
  justify-content: space-between;
  gap: 12px;
}

.domain-title {
  min-width: 0;
}

.domain-title h3 {
  overflow-wrap: anywhere;
  font-size: 1.1rem;
}

.badge {
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.82rem;
  font-weight: 800;
  white-space: nowrap;
}

.badge.verified {
  color: #0f5530;
  background: #dff4e7;
}

.badge.partial {
  color: #6b4000;
  background: #fff0d8;
}

.badge.failed {
  color: #842727;
  background: #ffe2e2;
}

.age-line {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.age-line strong {
  font-size: clamp(1.4rem, 3vw, 2.1rem);
}

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

.detail {
  min-width: 0;
  border: 1px solid var(--line);
  background: white;
  border-radius: 8px;
  padding: 10px;
}

.detail span,
.detail strong {
  display: block;
}

.detail strong {
  margin-top: 5px;
  overflow-wrap: anywhere;
}

.nameservers {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.nameservers span {
  border-radius: 999px;
  background: #eef3f6;
  padding: 5px 8px;
  font-size: 0.82rem;
  color: var(--ink);
}

.notice {
  border-left: 4px solid var(--gold);
  background: #fff8ed;
  padding: 10px 12px;
  color: #62400f;
  border-radius: 6px;
}

@media (max-width: 980px) {
  .home-hero,
  .home-metrics {
    grid-template-columns: 1fr;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .lookup-panel {
    min-height: auto;
  }

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

@media (max-width: 620px) {
  .home-screen {
    padding: 10px;
    gap: 10px;
    grid-template-rows: auto auto auto;
  }

  .home-topbar {
    min-height: 56px;
    padding: 8px 10px;
  }

  .home-logo-small {
    width: 44px;
    height: 44px;
  }

  .home-copy,
  .home-console,
  .home-metrics article {
    box-shadow: 0 10px 28px rgba(25, 34, 48, 0.1);
  }

  .home-copy {
    padding: 18px;
    gap: 14px;
  }

  .home-logo {
    width: min(170px, 70vw);
  }

  .home-copy h1 {
    font-size: clamp(2.35rem, 15vw, 3.45rem);
    line-height: 0.98;
    overflow-wrap: anywhere;
  }

  .home-lede {
    font-size: 1rem;
  }

  .home-search-row {
    grid-template-columns: 1fr;
  }

  .home-actions,
  .form-actions,
  .export-actions {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .home-actions button,
  .home-search-row button,
  .form-actions button,
  .export-actions button {
    width: 100%;
  }

  .home-console {
    padding: 16px;
    gap: 10px;
  }

  .console-line {
    flex-direction: column;
    gap: 6px;
    padding: 12px;
  }

  .console-line span {
    text-align: left;
  }

  .app-shell {
    padding: 10px;
    gap: 10px;
  }

  .lookup-panel,
  .results-panel {
    padding: 14px;
    gap: 14px;
  }

  .brand-row {
    grid-template-columns: 62px 1fr;
    gap: 10px;
  }

  .brand-logo {
    width: 62px;
    height: 62px;
    padding: 4px;
  }

  .brand-row h1 {
    font-size: 1.85rem;
  }

  .brand-row p {
    font-size: 0.92rem;
    line-height: 1.35;
  }

  textarea {
    min-height: 160px;
  }

  .toolbar,
  .result-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .export-actions {
    justify-content: flex-start;
  }

  .icon-button {
    min-width: 0;
  }

  .status {
    align-items: flex-start;
  }

  .summary-grid,
  .details-grid {
    grid-template-columns: 1fr;
  }

  .placeholder {
    min-height: 260px;
    padding: 18px;
  }

  .result-card {
    padding: 12px;
  }

  .badge {
    white-space: normal;
  }

  .age-line strong {
    font-size: 1.45rem;
  }
}

@media (max-width: 380px) {
  .home-topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .home-topbar .ghost-button {
    width: 100%;
  }

  .home-copy,
  .home-console,
  .home-metrics article,
  .lookup-panel,
  .results-panel {
    padding: 12px;
  }

  .brand-row {
    grid-template-columns: 1fr;
  }

  .brand-logo {
    width: 78px;
    height: 78px;
  }
}
