:root {
  --bg: #edf5ff;
  --bg-2: #f8fcff;
  --ink: #0f2742;
  --muted: #436280;
  --line: #bfd5ea;
  --line-2: #d8e8f6;
  --brand: #0095ff;
  --brand-2: #00e2c2;
  --panel: rgba(255, 255, 255, 0.9);
  --panel-2: rgba(245, 251, 255, 0.92);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  color: var(--ink);
  background: linear-gradient(160deg, var(--bg-2) 0%, #eaf4ff 55%, var(--bg) 100%);
  min-height: 100vh;
}

.grid-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(var(--line-2) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-2) 1px, transparent 1px);
  background-size: 36px 36px;
  opacity: 0.55;
}

.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: rgba(237, 245, 255, 0.86);
  backdrop-filter: blur(5px);
  display: grid;
  place-items: center;
}

.loading-panel {
  width: min(620px, 92%);
  border: 1px solid var(--line);
  background: #ffffff;
  padding: 24px;
  box-shadow: 0 24px 60px rgba(15, 39, 66, 0.22);
}

.loading-panel h3 {
  margin: 0 0 8px;
  font-family: "Chakra Petch", sans-serif;
  color: #1265a7;
  font-size: 1.45rem;
}

.loading-panel p {
  margin: 0;
  color: #355978;
}

.loading-track {
  margin-top: 18px;
  height: 14px;
  border: 1px solid var(--line);
  background: #eef6ff;
}

.loading-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #34bcff, #0f7bd1);
  transition: width 0.25s ease;
}

.loading-pct {
  margin-top: 10px !important;
  font-family: "Chakra Petch", sans-serif;
  font-weight: 700;
  color: #0f6bb2 !important;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 22px;
  border-bottom: 1px solid var(--line);
  background: rgba(245, 251, 255, 0.9);
  backdrop-filter: blur(6px);
  font-family: "Chakra Petch", sans-serif;
}

.brand {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.brand span {
  color: var(--brand);
}

.online {
  padding: 4px 10px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 0.82rem;
  color: var(--brand);
  font-family: "Chakra Petch", sans-serif;
}

.wrap {
  width: min(1200px, 94%);
  margin: 0 auto;
  padding: 28px 0 44px;
  position: relative;
  z-index: 1;
}

.search-shell {
  text-align: center;
}

.search-shell h1 {
  margin: 18px 0 8px;
  font-family: "Chakra Petch", sans-serif;
  font-size: clamp(2rem, 6vw, 4.1rem);
  line-height: 0.96;
  letter-spacing: 0.01em;
}

.search-shell p {
  margin: 0;
  color: var(--muted);
}

.command-row {
  margin: 26px auto 12px;
  padding: 14px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  max-width: 1120px;
  border: 1px solid var(--line);
  background: var(--panel);
}

.command-row textarea,
.command-row button {
  border: 1px solid var(--line);
  border-radius: 0;
  font: inherit;
}

.command-row textarea {
  min-height: 64px;
  padding: 10px 12px;
  background: #fbfeff;
  color: var(--ink);
  resize: vertical;
}

.command-row textarea:focus {
  outline: 2px solid rgba(0, 149, 255, 0.26);
  border-color: var(--brand);
}

.action-row {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.command-row button {
  height: 48px;
  padding: 0 18px;
  background: linear-gradient(135deg, #35a8ff, #1885db);
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
}

.command-row button:disabled {
  opacity: 0.75;
  cursor: progress;
}

.command-row .ghost-button {
  background: #fff;
  color: #1f537e;
  border: 1px solid var(--line);
}

.pipeline {
  margin-top: 8px;
  font-size: 0.95rem;
}

.capsules {
  margin-top: 20px;
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.capsules article {
  border: 1px solid var(--line);
  background: var(--panel-2);
  text-align: left;
  padding: 14px;
}

.capsules h3 {
  margin: 0 0 10px;
  color: var(--brand);
  font-family: "Chakra Petch", sans-serif;
  font-size: 1.05rem;
}

.capsules ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  display: grid;
  gap: 6px;
}

.results {
  margin-top: 20px;
  display: grid;
  gap: 14px;
}

.status-card {
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 18px;
}

.section-kicker {
  margin: 0 0 6px;
  color: var(--brand);
  font-family: "Chakra Petch", sans-serif;
  font-size: 0.84rem;
  letter-spacing: 0.04em;
}

.status-card h2 {
  margin: 0 0 8px;
  font-family: "Chakra Petch", sans-serif;
}

.hidden {
  display: none;
}

.headline-strip {
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 18px;
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 24px;
  align-items: start;
}

.critical {
  margin: 0;
  font-family: "Chakra Petch", sans-serif;
  font-size: clamp(2rem, 5vw, 3.4rem);
  color: #0f3c64;
  line-height: 0.95;
}

.badge {
  display: inline-block;
  margin-top: 8px;
  padding: 5px 10px;
  background: #e8f4ff;
  border: 1px solid #b8dbff;
  color: #1564a3;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.summary {
  margin: 12px 0 0;
  color: var(--muted);
  max-width: 72ch;
  line-height: 1.35;
}

.integrity {
  text-align: right;
  max-width: 100%;
}

.integrity p {
  margin: 0;
  color: var(--muted);
  font-family: "Chakra Petch", sans-serif;
}

.integrity strong {
  display: block;
  font-size: 2.1rem;
  color: #0d5f9e;
  margin-top: 4px;
}

.integrity small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.35;
  word-break: break-word;
}

.intel-card {
  border: 1px solid var(--line);
  background: var(--panel);
}

.intel-card header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.intel-card header h3 {
  margin: 0;
  font-family: "Chakra Petch", sans-serif;
  color: var(--brand);
  font-size: 1.03rem;
}

.intel-card header span {
  color: var(--muted);
  font-size: 0.82rem;
}

.list {
  margin: 0;
  padding: 12px 18px 14px;
  display: grid;
  gap: 6px;
  color: var(--muted);
}

.tags {
  margin: 10px 14px 12px;
  color: var(--brand);
  font-family: "Chakra Petch", sans-serif;
}

.tab-row {
  padding: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tab-button {
  border: 1px solid var(--line);
  background: #fff;
  color: #1f537e;
  font: inherit;
  font-weight: 600;
  padding: 8px 12px;
  cursor: pointer;
}

.tab-button.active {
  background: linear-gradient(135deg, #35a8ff, #1885db);
  color: #fff;
  border-color: #1885db;
}

.dual-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 0 12px 12px;
}

.metric-box {
  margin: 12px;
  border: 1px solid var(--line);
  background: #fff;
  padding: 12px;
}

.metric-box h4 {
  margin: 0 0 10px;
  font-family: "Chakra Petch", sans-serif;
  color: #245a84;
}

.metric-box p {
  margin: 6px 0;
  color: #294764;
}

.artifact-grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.social-grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.artifact.wide {
  grid-column: 1 / -1;
}

.artifact-dek {
  margin: 12px;
  color: #294764;
}

.feed {
  margin: 0;
  padding: 0 14px 12px;
  display: grid;
  gap: 10px;
}

.feed p,
.feed > * {
  border: 1px solid var(--line);
  background: #fff;
  padding: 10px;
  margin: 0;
}

.comment-stack,
.qa-stack {
  padding: 0 12px 12px;
  display: grid;
  gap: 10px;
}

.comment,
.qa-item {
  border: 1px solid var(--line);
  background: #fff;
  padding: 10px;
}

.reddit-card {
  border: 1px solid #d7dbe2;
  background: #ffffff;
  border-radius: 10px;
  padding: 14px;
}

.reddit-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.reddit-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #ff4500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.08) inset;
}

.reddit-avatar span {
  color: #ffffff;
  font-family: "Chakra Petch", sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
}

.reddit-meta {
  display: grid;
  line-height: 1.2;
}

.reddit-meta strong {
  color: #1a2430;
  font-size: 1rem;
}

.reddit-meta span {
  color: #6d7788;
  font-size: 0.9rem;
}

.reddit-reply {
  margin: 10px 0 4px;
  color: #3d6d9a;
  font-size: 0.9rem;
}

.reddit-body {
  margin: 8px 0 0;
  color: #1d2734;
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.45;
}

.reddit-post-shell {
  border: 1px solid #d7dbe2;
  background: #ffffff;
  border-radius: 8px;
  margin: 12px;
  padding: 12px 14px;
}

.reddit-post-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.reddit-avatar.post-avatar {
  width: 32px;
  height: 32px;
  margin-right: 0;
}

.reddit-post-meta {
  display: grid;
  gap: 2px;
  line-height: 1.2;
}

.reddit-post-meta strong {
  color: #111c29;
  font-size: 1.02rem;
}

.reddit-post-meta span {
  color: #6d7788;
  font-size: 0.9rem;
}

.reddit-menu {
  margin-left: auto;
  color: #7d8798;
  font-weight: 700;
}

.reddit-post-body {
  margin: 12px 0 8px;
  color: #101a29;
  font-size: 1.25rem;
  line-height: 1.35;
}

.reddit-thread-summary {
  margin: 0;
  color: #364a63;
  line-height: 1.45;
}

.tweet-card {
  border: 1px #eff3f4 solid;
  background-color: #ffffff;
  color: #0f1419;
  padding: 0 14px;
  font-size: 15px;
}

.tweet-card .head {
  padding-top: 12px;
  display: flex;
  justify-content: space-between;
}

.tweet-card .head .title {
  display: flex;
  align-items: center;
}

.tweet-card .tweet-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  margin-right: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  background: #1da1f2;
  color: #ffffff;
}

.tweet-card .head .title .text .top {
  font-weight: 700;
  display: flex;
  align-items: center;
}

.tweet-card .head .title .text .bottom,
.tweet-card .head .dots {
  color: #536471;
}

.tweet-card .content .message {
  padding-top: 14px;
  font-size: 21px;
  line-height: 1.35;
  color: #0f1419;
}

.tweet-card .content .message .highlight {
  color: #1b95e0;
}

.tweet-card .content .tweet_info {
  color: #536471;
  padding: 14px 0;
  display: flex;
  gap: 8px;
}

.tweet-card .content .tweet_info .tweet_client {
  color: #1b95e0;
}

.tweet-card .stats {
  border-top: 1px #eff3f4 solid;
  color: #536471;
  padding: 14px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.tweet-card .stats .count {
  font-weight: 700;
  color: #0f1419;
}

.tweet-card .tail {
  border-top: 1px #eff3f4 solid;
  padding: 10px 0;
  display: flex;
  justify-content: space-around;
  color: #536471;
  font-size: 0.92rem;
}

.comment-head,
.qa-head,
.rating-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  color: #1c507a;
}

.sentiment {
  color: var(--brand);
  font-family: "Chakra Petch", sans-serif;
  font-size: 0.78rem;
}

.chip-cluster {
  padding: 0 12px 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip-cluster span {
  border: 1px solid var(--line);
  background: #f0f8ff;
  color: #165f99;
  padding: 6px 10px;
  font-size: 0.9rem;
}

blockquote {
  margin: 0 12px 12px;
  border-left: 3px solid #2d98ec;
  background: #eef7ff;
  padding: 10px 12px;
  color: #214c70;
}

.reveal {
  opacity: 0;
  transform: translateY(10px);
  animation: rise 0.45s ease forwards;
}

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

@media (max-width: 980px) {
  .command-row,
  .capsules,
  .dual-grid,
  .social-grid,
  .artifact-grid,
  .headline-strip {
    grid-template-columns: 1fr;
  }

  .integrity {
    text-align: left;
  }
}
