:root {
  color-scheme: light;
  --bg: #f2efe8;
  --bg-deep: #e6e3d9;
  --surface: rgba(255, 252, 246, 0.82);
  --surface-strong: #fffdfa;
  --surface-muted: rgba(255, 252, 246, 0.58);
  --text: #18201d;
  --muted: #5b635f;
  --line: rgba(24, 32, 29, 0.12);
  --brand: #0f766e;
  --brand-soft: rgba(15, 118, 110, 0.1);
  --accent: #d97706;
  --accent-soft: rgba(217, 119, 6, 0.12);
  --danger: #b42318;
  --danger-soft: rgba(180, 35, 24, 0.12);
  --shadow: 0 24px 60px rgba(34, 43, 40, 0.12);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --container: 1220px;
}

* {
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", "Avenir Next", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(15, 118, 110, 0.12), transparent 28rem),
    radial-gradient(circle at 85% 15%, rgba(217, 119, 6, 0.14), transparent 26rem),
    linear-gradient(180deg, #f7f3eb 0%, var(--bg) 54%, #ebe6da 100%);
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

a {
  color: inherit;
}

.background-orb {
  position: fixed;
  inset: auto;
  border-radius: 999px;
  filter: blur(20px);
  opacity: 0.55;
  pointer-events: none;
}

.background-orb-a {
  top: 6rem;
  left: -4rem;
  width: 12rem;
  height: 12rem;
  background: rgba(15, 118, 110, 0.22);
}

.background-orb-b {
  right: 3rem;
  bottom: 4rem;
  width: 15rem;
  height: 15rem;
  background: rgba(217, 119, 6, 0.18);
}

.layout {
  position: relative;
  width: min(calc(100% - 2rem), var(--container));
  margin: 0 auto;
  padding: 1.5rem 0 3rem;
}

.panel {
  position: relative;
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.hero,
.controls,
.table-panel,
.feedback-panel {
  animation: rise 500ms ease both;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(18rem, 0.9fr);
  gap: 1.5rem;
  padding: 1.75rem;
}

.eyebrow,
.section-label {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.hero h1,
.table-toolbar h2 {
  margin: 0;
  font-family: "Space Grotesk", "Gill Sans", sans-serif;
  letter-spacing: -0.04em;
}

.hero h1 {
  font-size: clamp(2.3rem, 4vw, 4rem);
  line-height: 0.98;
  max-width: 11ch;
}

.lede,
.sync-note,
.table-caption,
.stat-meta,
.empty-copy,
.card-meta,
.card-bio,
.bio-details p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.hero-copy {
  display: grid;
  gap: 0.8rem;
}

.hero-status {
  display: grid;
  align-content: space-between;
  gap: 1rem;
  padding: 1.35rem;
  border-radius: calc(var(--radius-xl) - 0.3rem);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 252, 246, 0.72)),
    linear-gradient(135deg, rgba(15, 118, 110, 0.08), rgba(217, 119, 6, 0.08));
  border: 1px solid rgba(24, 32, 29, 0.08);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  width: fit-content;
  padding: 0.9rem 1.1rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(24, 32, 29, 0.08);
  color: var(--text);
  font-weight: 700;
}

.status-pill.is-error {
  background: #fff4ef;
  color: var(--danger);
}

.status-pill.is-loading .status-dot {
  animation: pulse 1200ms ease infinite;
}

.status-dot {
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 999px;
  background: var(--brand);
  box-shadow: 0 0 0 0 rgba(15, 118, 110, 0.45);
}

.status-pill.is-error .status-dot {
  background: var(--danger);
}

.controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(18rem, 1.2fr) auto;
  gap: 1rem;
  align-items: end;
  margin-top: 1.25rem;
  padding: 1.25rem;
}

.filter-stack,
.search-field {
  display: grid;
  gap: 0.6rem;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.filter-chip,
.refresh-button,
.platform-badge,
.source-pill,
.email-pill {
  border-radius: 999px;
  transition:
    transform 180ms ease,
    background-color 180ms ease,
    border-color 180ms ease,
    color 180ms ease;
}

.filter-chip {
  padding: 0.75rem 1rem;
  background: var(--surface-strong);
  border: 1px solid rgba(24, 32, 29, 0.08);
  color: var(--muted);
  font-weight: 700;
}

.filter-chip:hover,
.filter-chip:focus-visible,
.refresh-button:hover,
.refresh-button:focus-visible {
  transform: translateY(-1px);
}

.filter-chip.is-active {
  background: linear-gradient(135deg, var(--brand), #0f5f5b);
  border-color: transparent;
  color: white;
}

.search-field {
  min-width: 0;
}

.search-input-wrap {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-height: 3.2rem;
  padding: 0 1rem;
  border-radius: 999px;
  border: 1px solid rgba(24, 32, 29, 0.1);
  background: var(--surface-strong);
}

.search-input-wrap svg {
  flex: none;
  width: 1.1rem;
  height: 1.1rem;
  fill: var(--muted);
}

.search-input-wrap input {
  width: 100%;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text);
}

.refresh-button {
  min-height: 3.2rem;
  padding: 0 1.3rem;
  background: linear-gradient(135deg, #18201d, #27312d);
  color: white;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.refresh-button:disabled {
  cursor: wait;
  opacity: 0.68;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1.25rem;
}

.stat-card {
  padding: 1.1rem 1.15rem;
  border-radius: var(--radius-lg);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(255, 252, 246, 0.62)),
    var(--surface-muted);
  border: 1px solid rgba(24, 32, 29, 0.08);
  box-shadow: var(--shadow);
  animation: rise 560ms ease both;
}

.stat-card strong {
  display: block;
  margin-top: 0.55rem;
  font-family: "Space Grotesk", "Gill Sans", sans-serif;
  font-size: clamp(1.7rem, 3vw, 2.4rem);
  letter-spacing: -0.05em;
}

.feedback-panel {
  margin-top: 1.25rem;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-lg);
}

.feedback-panel.is-error {
  background: #fff4ef;
  border-color: rgba(180, 35, 24, 0.18);
}

.feedback-panel.is-loading {
  border-style: dashed;
}

.table-panel {
  margin-top: 1.25rem;
  padding: 1.35rem;
  overflow: hidden;
}

.table-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.table-toolbar h2 {
  font-size: clamp(1.6rem, 2vw, 2.2rem);
}

.table-caption {
  max-width: 26rem;
  text-align: right;
}

.table-scroll {
  overflow-x: auto;
  border-radius: calc(var(--radius-lg) - 0.25rem);
  border: 1px solid rgba(24, 32, 29, 0.08);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 980px;
  background: rgba(255, 255, 255, 0.66);
}

thead {
  background: rgba(24, 32, 29, 0.04);
}

th,
td {
  padding: 1rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid rgba(24, 32, 29, 0.08);
}

th {
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

tbody tr {
  transition: background-color 180ms ease;
}

tbody tr:hover {
  background: rgba(15, 118, 110, 0.04);
}

tbody tr:last-child td {
  border-bottom: 0;
}

.platform-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 0.75rem;
  border: 1px solid transparent;
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 800;
  font-size: 0.85rem;
}

.platform-badge[data-platform="instagram"] {
  background: var(--accent-soft);
  color: var(--accent);
}

.creator-cell {
  display: grid;
  gap: 0.32rem;
}

.handle-link {
  width: fit-content;
  font-weight: 800;
  text-decoration: none;
}

.handle-link:hover,
.handle-link:focus-visible,
.email-link:hover,
.email-link:focus-visible {
  text-decoration: underline;
  text-decoration-thickness: 0.12em;
  text-underline-offset: 0.16em;
}

.creator-name,
.date-meta,
.placeholder {
  color: var(--muted);
}

.email-link {
  font-weight: 700;
}

.email-pill,
.source-pill {
  display: inline-flex;
  align-items: center;
  max-width: 18rem;
  padding: 0.45rem 0.75rem;
  background: rgba(24, 32, 29, 0.05);
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
}

.email-pill {
  max-width: 22rem;
}

.source-pill {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bio-snippet {
  display: -webkit-box;
  max-width: 31ch;
  padding: 0.7rem 0.8rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(24, 32, 29, 0.08);
  background: rgba(255, 255, 255, 0.9);
  color: var(--muted);
  line-height: 1.5;
  text-align: left;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.bio-snippet:hover,
.bio-snippet:focus-visible {
  display: block;
  max-width: 33ch;
  box-shadow: 0 16px 28px rgba(24, 32, 29, 0.14);
  -webkit-line-clamp: unset;
  color: var(--text);
}

.followers-value {
  font-family: "Space Grotesk", "Gill Sans", sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--text);
}

.date-cell {
  display: grid;
  gap: 0.2rem;
}

.mobile-list {
  display: none;
  gap: 1rem;
  margin-top: 1.25rem;
}

.lead-card {
  display: grid;
  gap: 1rem;
  padding: 1.2rem;
  border-radius: var(--radius-lg);
  background: rgba(255, 252, 246, 0.84);
  border: 1px solid rgba(24, 32, 29, 0.08);
  box-shadow: var(--shadow);
  animation: rise 520ms ease both;
}

.card-head,
.card-row,
.card-actions {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.85rem;
}

.card-actions {
  flex-wrap: wrap;
}

.card-title {
  display: grid;
  gap: 0.35rem;
}

.card-title h3 {
  margin: 0;
  font-size: 1.05rem;
}

.card-title a {
  text-decoration: none;
}

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

.card-kpis div {
  padding: 0.8rem;
  border-radius: var(--radius-md);
  background: rgba(24, 32, 29, 0.04);
}

.card-kpis strong {
  display: block;
  font-family: "Space Grotesk", "Gill Sans", sans-serif;
  font-size: 1.2rem;
  letter-spacing: -0.04em;
  color: var(--text);
}

.card-kpis span {
  display: block;
  margin-bottom: 0.3rem;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.bio-details {
  border-radius: var(--radius-md);
  border: 1px solid rgba(24, 32, 29, 0.08);
  background: rgba(255, 255, 255, 0.76);
  overflow: hidden;
}

.bio-details summary {
  padding: 0.9rem 1rem;
  cursor: pointer;
  font-weight: 700;
  color: var(--muted);
  list-style: none;
}

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

.bio-details[open] summary {
  color: var(--text);
  border-bottom: 1px solid rgba(24, 32, 29, 0.08);
}

.bio-details p {
  padding: 0.9rem 1rem 1rem;
}

.empty-state {
  padding: 2rem;
  text-align: center;
}

.noscript-banner {
  width: min(calc(100% - 2rem), 40rem);
  margin: 1.5rem auto;
  padding: 1rem 1.2rem;
  border-radius: var(--radius-md);
  background: #fff4ef;
  color: var(--danger);
  font-weight: 700;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(15, 118, 110, 0.45);
  }

  70% {
    box-shadow: 0 0 0 10px rgba(15, 118, 110, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(15, 118, 110, 0);
  }
}

@media (max-width: 1080px) {
  .controls,
  .hero,
  .stats-grid {
    grid-template-columns: 1fr;
  }

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

  .table-caption {
    text-align: left;
  }
}

@media (max-width: 760px) {
  .layout {
    width: min(calc(100% - 1rem), var(--container));
    padding-top: 0.75rem;
  }

  .panel {
    border-radius: 1.5rem;
  }

  .hero,
  .controls,
  .table-panel {
    padding: 1rem;
  }

  .hero h1 {
    max-width: 13ch;
  }

  .controls {
    grid-template-columns: 1fr;
  }

  .refresh-button {
    width: 100%;
  }

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

  .table-panel {
    display: none;
  }

  .mobile-list {
    display: grid;
  }
}

@media (max-width: 520px) {
  .stats-grid,
  .card-kpis {
    grid-template-columns: 1fr;
  }

  .card-head,
  .card-row {
    flex-direction: column;
  }
}
