:root {
  color-scheme: light;
  --bg: #f5f7f8;
  --panel: #ffffff;
  --ink: #152029;
  --muted: #64717d;
  --line: #dbe2e7;
  --green: #0b6b55;
  --green-soft: #e4f3ee;
  --blue: #285a8f;
  --amber: #8a5b11;
  --amber-soft: #fff4d8;
  --red: #8d2f2f;
  --red-soft: #fae8e8;
  --shadow: 0 18px 50px rgba(21, 32, 41, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  color: var(--ink);
  background:
    linear-gradient(180deg, #eef4f2 0, rgba(245, 247, 248, 0) 320px),
    var(--bg);
}

button,
input {
  font: inherit;
}

.shell {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 32px 0 48px;
}

.topbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--green);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: 34px;
  line-height: 1.1;
  letter-spacing: 0;
}

.status-pill {
  min-width: 108px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}

.upload-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 14px;
  align-items: stretch;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.dropzone {
  position: relative;
  display: flex;
  min-height: 112px;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
  padding: 18px;
  border: 1px dashed #aeb9c2;
  border-radius: 8px;
  background: #fbfcfc;
  cursor: pointer;
  transition:
    border-color 160ms ease,
    background 160ms ease;
}

.dropzone:hover,
.dropzone.is-dragging {
  border-color: var(--green);
  background: var(--green-soft);
}

.dropzone__label {
  font-size: 15px;
  font-weight: 800;
}

.dropzone__file {
  overflow: hidden;
  color: var(--muted);
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dropzone input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.primary-button,
.secondary-button,
.tab {
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 800;
}

.primary-button {
  display: inline-flex;
  min-width: 148px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 22px;
  color: #ffffff;
  background: var(--green);
}

.primary-button:disabled {
  cursor: progress;
  opacity: 0.72;
}

.secondary-button {
  display: inline-flex;
  height: 40px;
  align-items: center;
  gap: 6px;
  padding: 0 13px;
  color: var(--green);
  background: var(--green-soft);
}

.button-icon {
  font-size: 18px;
  line-height: 1;
}

.message {
  margin-top: 14px;
  padding: 14px 16px;
  border: 1px solid var(--red-soft);
  border-radius: 8px;
  color: var(--red);
  background: var(--red-soft);
  font-weight: 700;
}

.results {
  margin-top: 18px;
}

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

.metric {
  min-height: 98px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.metric__label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.metric__value {
  margin-top: 12px;
  font-size: 26px;
  font-weight: 900;
  line-height: 1;
}

.metric.is-green {
  border-color: #b9ddd2;
  background: var(--green-soft);
}

.metric.is-amber {
  border-color: #f2d693;
  background: var(--amber-soft);
}

.metric.is-red {
  border-color: #efc1c1;
  background: var(--red-soft);
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.tabs {
  display: inline-flex;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.tab {
  min-height: 38px;
  padding: 0 14px;
  color: var(--muted);
  background: transparent;
}

.tab.is-active {
  color: #ffffff;
  background: var(--blue);
}

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

.search {
  width: 240px;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--panel);
}

.table-wrap {
  overflow: auto;
  max-height: 62vh;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

th,
td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: var(--muted);
  background: #f9fbfb;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

td {
  font-size: 14px;
}

.domain-cell {
  font-weight: 800;
}

.number-cell {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.empty-row {
  color: var(--muted);
  text-align: center;
}

@media (max-width: 900px) {
  .upload-grid,
  .summary-grid {
    grid-template-columns: 1fr;
  }

  .primary-button {
    min-height: 48px;
  }

  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .toolbar-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .search {
    width: 100%;
  }
}

@media (max-width: 560px) {
  .shell {
    width: min(100vw - 20px, 1180px);
    padding-top: 18px;
  }

  .topbar {
    align-items: start;
    flex-direction: column;
  }

  h1 {
    font-size: 28px;
  }

  .tabs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    width: 100%;
  }

  .tab {
    padding: 0 8px;
  }
}
