:root {
  color-scheme: light;
  --bg: #f7f8f5;
  --surface: #ffffff;
  --surface-alt: #eef6f3;
  --ink: #18201d;
  --muted: #5f6b64;
  --line: #d9dfd8;
  --accent: #0f766e;
  --accent-strong: #0b5f59;
  --warm: #c7522a;
  --violet: #4f46e5;
  --shadow: 0 18px 40px rgba(24, 32, 29, 0.08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  min-width: 320px;
}

a {
  color: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 68px;
  padding: 12px clamp(16px, 4vw, 48px);
  background: rgba(247, 248, 245, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 760;
  white-space: nowrap;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-size: 17px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.language-label {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 740;
  white-space: nowrap;
}

.language-select,
.search-input,
.page-size,
.filter-select {
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}

.language-select {
  width: min(36vw, 156px);
  padding: 0 12px;
}

.workspace {
  width: min(1080px, calc(100% - 28px));
  margin: 0 auto;
  padding: clamp(18px, 4vw, 38px) 0 40px;
}

.intro {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.8fr);
  align-items: end;
  gap: clamp(16px, 3vw, 28px);
  margin-bottom: 16px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 760;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  max-width: 860px;
  font-size: clamp(2rem, 5vw, 3.9rem);
  line-height: 1.02;
  letter-spacing: 0;
}

.lead {
  margin: 12px 0 0;
  max-width: 720px;
  color: var(--muted);
  font-size: clamp(0.95rem, 2vw, 1.05rem);
  line-height: 1.55;
}

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

.metric {
  min-height: 74px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.metric-value {
  display: block;
  font-size: clamp(1.25rem, 2.6vw, 1.8rem);
  font-weight: 780;
  overflow-wrap: anywhere;
}

.metric-label {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.9rem;
}

.search-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  width: min(760px, 100%);
  margin: 14px auto;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.search-input {
  width: 100%;
  padding: 0 12px;
  font-size: 0.95rem;
}

.controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-select {
  width: 178px;
  padding: 0 10px;
}

.page-size {
  width: 82px;
  padding: 0 10px;
}

.button {
  min-width: 42px;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

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

.button:disabled {
  color: #9aa49f;
  background: #f0f2ef;
  cursor: not-allowed;
}

.results-shell {
  overflow: hidden;
  width: min(760px, 100%);
  margin: 0 auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.results-topbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 9px 12px;
  background: var(--surface-alt);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.88rem;
}

.status strong {
  color: var(--ink);
}

.site-list {
  min-height: 380px;
}

.site-row {
  display: grid;
  grid-template-columns: minmax(7ch, 72px) minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 6px 12px;
  border-bottom: 1px solid var(--line);
  font-size: 0.94rem;
}

.site-row:last-child {
  border-bottom: 0;
}

.rank {
  color: var(--warm);
  font-weight: 780;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.domain {
  overflow-wrap: anywhere;
  font-weight: 720;
  min-width: 0;
  color: var(--accent-strong);
  text-decoration: none;
}

.domain:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 12px;
  border-top: 1px solid var(--line);
}

.page-state {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.empty,
.loading,
.error {
  padding: 34px 16px;
  color: var(--muted);
  text-align: center;
}

.error {
  color: #a03825;
}

.content-band {
  margin-top: 20px;
  padding: 18px 0 0;
  border-top: 1px solid var(--line);
}

.content-band h2 {
  margin: 0 0 12px;
  font-size: clamp(1.35rem, 3vw, 2rem);
  letter-spacing: 0;
}

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

.content-item {
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.content-item h3 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.content-item p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.site-footer {
  padding: 18px clamp(16px, 4vw, 48px);
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.site-footer a {
  color: var(--accent-strong);
}

@media (max-width: 860px) {
  .intro,
  .content-grid {
    grid-template-columns: 1fr;
  }

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

  .site-row {
    grid-template-columns: minmax(7ch, 70px) minmax(0, 1fr);
  }
}

@media (max-width: 620px) {
  .site-header {
    align-items: stretch;
    flex-direction: column;
  }

  .header-actions,
  .language-select {
    width: 100%;
  }

  .header-actions {
    justify-content: space-between;
  }

  .search-panel,
  .results-topbar,
  .pager {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: stretch;
  }

  .controls {
    width: 100%;
  }

  .page-size,
  .filter-select,
  .button {
    flex: 1;
  }

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

  .site-row {
    grid-template-columns: minmax(7ch, 76px) minmax(0, 1fr);
    gap: 8px;
  }

  .rank {
    text-align: left;
  }

}
