:root {
  color-scheme: light;
  --bg: #ffffff;
  --text: #0c0c0d;
  --muted: #6c6c70;
  --soft: #f7f7f8;
  --line: #dcdcdf;
  --line-strong: #c8c8cc;
  --blue: #0a84ff;
  --yellow: #fff4c2;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  letter-spacing: 0;
}

a {
  color: inherit;
}

button,
input,
select {
  font: inherit;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.app-shell {
  width: 100%;
  min-height: 100vh;
}

.sip-nav {
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: 1fr minmax(220px, 280px) 1fr;
  align-items: center;
  height: 65px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  padding: 0 16px 0 24px;
  backdrop-filter: blur(16px);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}

.nav-links a {
  border: 1px solid transparent;
  padding: 7px 8px;
  text-decoration: none;
}

.nav-links a.active {
  border-color: var(--line);
  background: var(--soft);
}

.nav-search input {
  width: 100%;
  height: 31px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: #fafafa;
  color: var(--text);
  padding: 0 34px 0 8px;
  outline: none;
}

.nav-search {
  position: relative;
}

.nav-search::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 10px;
  width: 8px;
  height: 8px;
  border-right: 2px solid #777;
  border-bottom: 2px solid #777;
  transform: translateY(-58%) rotate(45deg);
}

.nav-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 18px;
}

.join-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 29px;
  background: #000;
  color: #fff;
  padding: 0 11px;
  text-decoration: none;
  font-size: 14px;
}

.summary {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 13px;
}

.summary span:first-child {
  font-size: 24px;
  font-weight: 700;
}

.muted {
  color: var(--muted);
}

.person-rail {
  position: sticky;
  top: 65px;
  z-index: 25;
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scrollbar-width: none;
  min-height: 80px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  padding: 12px 16px;
  backdrop-filter: blur(16px);
}

.person-rail::-webkit-scrollbar {
  display: none;
}

.rail-avatar {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f0f0f1;
  color: #111;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  overflow: hidden;
  padding: 0;
}

.rail-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.rail-avatar.active {
  box-shadow: 0 0 0 2px #000, 0 0 0 4px #fff;
}

.controls {
  display: grid;
  grid-template-columns: repeat(7, minmax(132px, 1fr)) minmax(160px, 0.9fr);
  gap: 0;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  border-right: 1px solid var(--line);
  padding: 11px 12px 12px;
}

.field span,
.toggle-row span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

input,
select {
  width: 100%;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: #fafafa;
  color: var(--text);
  padding: 0 8px;
  outline: none;
}

input:focus,
select:focus,
button:focus-visible {
  border-color: #000;
  box-shadow: 0 0 0 1px #000;
}

.toggle-row {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  padding: 10px 12px;
}

.toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 20px;
}

.toggle input {
  width: 14px;
  min-height: 14px;
  accent-color: #000;
}

.quick-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-bottom: 1px solid var(--line);
}

.quick-stats div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 52px;
  border-right: 1px solid var(--line);
  padding: 0 16px;
}

.stat-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.quick-stats strong {
  font-size: 26px;
}

.active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 37px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 7px 12px;
}

.pill {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: #3c3c40;
  padding: 5px 9px;
  font-size: 12px;
}

.results {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
  background: #fff;
}

.tweet-card {
  min-width: 0;
  min-height: 560px;
  overflow: hidden;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.card-head {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 12px;
  padding: 16px 16px 10px;
}

.person {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: 13px;
}

.person strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}

.mini-avatar {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #e9e9eb;
  object-fit: cover;
}

.handle {
  color: #000;
  text-decoration: none;
  white-space: nowrap;
}

.date {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.tweet-title {
  grid-column: 1 / -1;
  margin: 2px 0 0;
  color: #222;
  font-size: 17px;
  font-weight: 500;
  line-height: 1.25;
}

.metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 16px 12px;
}

.metric {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fafafa;
  padding: 4px 8px;
  color: var(--muted);
  font-size: 12px;
}

.metric strong {
  color: var(--text);
}

.media-badge {
  color: #000;
}

.note {
  margin: 0 16px 12px;
  border-left: 3px solid #000;
  background: var(--yellow);
  color: #2f2f12;
  padding: 8px 10px;
  font-size: 12px;
  line-height: 1.35;
}

.embed-frame {
  display: flex;
  justify-content: center;
  padding: 0 24px 24px;
}

.twitter-tweet {
  margin: 0 auto !important;
}

.link-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 16px 16px;
  border: 1px solid var(--line);
  background: #fafafa;
  color: var(--text);
  padding: 12px;
  text-decoration: none;
  font-size: 14px;
}

.link-card:hover {
  border-color: #000;
}

.empty-state {
  grid-column: 1 / -1;
  min-height: 360px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  display: grid;
  place-items: center;
  text-align: center;
}

.load-row {
  display: flex;
  justify-content: center;
  min-height: 72px;
  border-top: 1px solid var(--line);
  padding: 18px;
}

.load-more {
  min-height: 34px;
  border: 1px solid var(--line);
  background: #fff;
  color: #000;
  cursor: pointer;
  padding: 0 14px;
}

.load-more:hover {
  border-color: #000;
}

.load-sentinel {
  width: 1px;
  height: 1px;
}

[hidden] {
  display: none !important;
}

@media (max-width: 1120px) {
  .sip-nav {
    grid-template-columns: 1fr minmax(190px, 260px);
    height: auto;
    min-height: 65px;
    row-gap: 8px;
    padding: 12px 16px;
  }

  .nav-actions {
    grid-column: 1 / -1;
    justify-content: space-between;
  }

  .person-rail {
    top: 90px;
  }

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

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

@media (max-width: 720px) {
  .sip-nav {
    grid-template-columns: 1fr;
  }

  .nav-links {
    overflow-x: auto;
  }

  .person-rail {
    top: 134px;
  }

  .controls,
  .quick-stats,
  .results {
    grid-template-columns: 1fr;
  }

  .field,
  .quick-stats div,
  .tweet-card {
    border-right: 0;
  }

  .tweet-card {
    min-height: 480px;
  }
}
