@import url('https://fonts.googleapis.com/css2?family=Mulish:wght@400;500;600;700;800&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Mulish', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #F2F2F2;
  color: #333;
  min-height: 100vh;
  font-size: 15px;
}

/* ── Header ── */
.site-header {
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(44,62,80,.08);
  border-bottom: 1px solid #e8e8e8;
}
.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 14px 24px;
}
h1 { font-size: 1.15rem; font-weight: 800; letter-spacing: -.02em; color: #002348; }
.header-sub { font-size: .75rem; color: #888; margin-top: 3px; }
.header-link { color: #888; text-decoration: none; }
.header-link:hover { color: #F58700; text-decoration: underline; }

/* ── Intro blurb ── */
.intro-blurb {
  font-size: .92rem;
  color: #555;
  line-height: 1.6;
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 4px;
  padding: 12px 16px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}

/* ── Main ── */
main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px 24px 60px;
}

/* ── Controls bar ── */
.controls-bar {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

/* Stance pills */
.stance-pills {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.stance-pill {
  background: #fff;
  border: 1.5px solid #d2d2d2;
  color: #555;
  padding: 6px 14px;
  border-radius: 20px;
  cursor: pointer;
  font-size: .8rem;
  font-weight: 700;
  font-family: inherit;
  transition: all .15s;
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}
.stance-pill:hover { border-color: #aaa; color: #333; }
.stance-pill.active {
  background: #002348;
  border-color: #002348;
  color: #fff;
}
.stance-pill.stance-con.active  { background: #E8485A; border-color: #E8485A; }
.stance-pill.stance-pro.active  { background: #007B83; border-color: #007B83; }
.stance-pill.stance-neutral.active { background: #888; border-color: #888; }
.pill-count {
  font-size: .72rem;
  font-weight: 600;
  opacity: .75;
}

/* Search */
.search-wrap {
  flex: 1;
  min-width: 200px;
  position: relative;
  display: flex;
  align-items: center;
}
#search-input {
  width: 100%;
  padding: 9px 36px 9px 14px;
  font-size: .95rem;
  font-family: inherit;
  border: 2px solid #d2d2d2;
  border-radius: 4px;
  outline: none;
  transition: border-color .15s;
  background: #fff;
  color: #333;
}
#search-input:focus { border-color: #F58700; }
#search-input::placeholder { color: #aaa; }
.clear-btn {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  color: #bbb;
  font-size: 1rem;
  cursor: pointer;
  line-height: 1;
  padding: 2px;
}
.clear-btn:hover { color: #E8485A; }
.clear-btn.hidden { display: none; }

/* ── Key phrases ── */
.phrases-section {
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 4px;
  padding: 16px 20px;
  margin-bottom: 20px;
  box-shadow: 0 1px 4px rgba(0,0,0,.05);
}
.section-label {
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #888;
  margin-bottom: 14px;
}
.phrase-groups {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.phrase-group {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.group-label {
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #aaa;
  white-space: nowrap;
  padding-top: 6px;
  min-width: 96px;
}
.phrase-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.phrase-chip {
  background: #fff;
  border: 1px solid #d2d2d2;
  color: #444;
  padding: 4px 12px;
  border-radius: 3px;
  cursor: pointer;
  font-size: .82rem;
  font-family: inherit;
  font-weight: 500;
  transition: all .15s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.phrase-chip:hover {
  background: #F58700;
  border-color: #F58700;
  color: #fff;
}
.phrase-chip.active {
  background: #002348;
  border-color: #002348;
  color: #fff;
}
.phrase-chip.active:hover {
  background: #001830;
  border-color: #001830;
}
.chip-n {
  font-size: .7rem;
  font-weight: 700;
  opacity: .6;
}
.phrase-chip:hover .chip-n,
.phrase-chip.active .chip-n { opacity: .75; }

/* ── Results bar ── */
.results-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
#results-count {
  font-size: .8rem;
  color: #888;
  font-weight: 500;
}

/* ── Comment cards ── */
.comment-card {
  background: #fff;
  border: 1px solid #e8e8e8;
  border-left: 4px solid #d2d2d2;
  border-radius: 4px;
  padding: 14px 16px;
  margin-bottom: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.comment-card.stance-con     { border-left-color: #E8485A; }
.comment-card.stance-pro     { border-left-color: #007B83; }
.comment-card.stance-neutral { border-left-color: #bbb; }

.comment-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.comment-name {
  font-weight: 700;
  font-size: .88rem;
  color: #002348;
}
.comment-date {
  font-size: .75rem;
  color: #aaa;
}
.stance-badge {
  font-size: .65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: 2px 8px;
  border-radius: 3px;
  margin-left: auto;
}
.stance-badge.badge-con     { background: #fde8ea; color: #c0253a; }
.stance-badge.badge-pro     { background: #e0f4f5; color: #005a5f; }
.stance-badge.badge-neutral { background: #f0f0f0; color: #777; }

.comment-text {
  font-size: .88rem;
  color: #444;
  line-height: 1.65;
}
.comment-text mark {
  background: #fff3cd;
  color: inherit;
  border-radius: 2px;
  padding: 0 1px;
}
.comment-text .ellipsis { color: #bbb; }

.show-more-btn {
  background: none;
  border: none;
  color: #F58700;
  font-size: .8rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  padding: 4px 0 0;
  display: block;
}
.show-more-btn:hover { text-decoration: underline; }

/* ── Load more ── */
.load-more-row {
  text-align: center;
  margin-top: 16px;
}
.ghost-btn {
  background: none;
  border: 1px solid #d2d2d2;
  padding: 8px 24px;
  border-radius: 3px;
  cursor: pointer;
  font-size: .85rem;
  color: #555;
  font-family: inherit;
  transition: background .12s;
}
.ghost-btn:hover { background: #e8e8e8; }
.ghost-btn.hidden { display: none; }

/* ── Empty state ── */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: #aaa;
  font-size: .9rem;
}

/* ── Footer ── */
.site-footer {
  text-align: center;
  padding: 24px;
  color: #bbb;
  font-size: .78rem;
}

/* ── Responsive ── */
@media (max-width: 640px) {
  main { padding: 14px 14px 40px; }
  .controls-bar { gap: 10px; }
  .phrase-group { flex-direction: column; gap: 6px; }
  .group-label { min-width: auto; padding-top: 0; }
  h1 { font-size: 1rem; }
}
