:root {
  --bg: #0b0d12;
  --bg-elev: #12151c;
  --bg-card: #161a22;
  --border: #232836;
  --border-strong: #313749;
  --text: #e8ecf4;
  --text-dim: #8a93a6;
  --accent: #ff7a59;
  --accent-2: #ffb86b;
  --accent-soft: rgba(255, 122, 89, 0.12);
  --heart: #ff4d6d;
  --radius: 14px;
  --maxw: 1280px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

/* ---------- header ---------- */
.site-header {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 24px 24px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.2px;
}
.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 16px;
}

.site-header nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
@media (max-width: 900px) {
  .site-header {
    flex-wrap: wrap;
  }
  .site-header nav {
    width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 4px;
  }
  .site-header nav::-webkit-scrollbar { height: 3px; }
  .site-header nav::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
}

.primary, .ghost {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 14px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.1s ease, background 0.15s ease, border-color 0.15s ease;
  font-family: inherit;
}
.primary {
  background: var(--accent);
  color: #1a0b05;
}
.primary:hover { transform: translateY(-1px); }
.ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.ghost:hover { border-color: var(--accent); color: var(--accent); }
.ghost.active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}
.primary.big { padding: 14px 22px; font-size: 15px; }

/* ---------- hero ---------- */
.hero {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 48px 24px 24px;
}
.hero.narrow { max-width: 820px; }

/* ---------- featured section ---------- */
.featured {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px 32px;
}
.featured-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--accent-2);
  margin: 0 0 16px;
}
.featured-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}
.featured-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.featured-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent-2);
}
.featured-card img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  background: var(--bg-elev);
}
.featured-placeholder {
  width: 100%;
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  color: var(--accent-2);
  background: var(--bg-elev);
}
.featured-body {
  padding: 14px;
}
.featured-body h3 {
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 6px;
  line-height: 1.3;
}
.featured-reason {
  font-size: 13px;
  color: var(--text-dim);
  margin: 0;
  line-height: 1.4;
}

.hero h1 {
  font-size: clamp(32px, 5vw, 56px);
  line-height: 1.04;
  margin: 0 0 16px;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #fff, #ffb38a 75%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero p {
  max-width: 720px;
  margin: 0;
  color: var(--text-dim);
  font-size: 17px;
  line-height: 1.55;
}

/* ---------- headline stats band ---------- */
.headline {
  max-width: var(--maxw);
  margin: 24px auto 8px;
  padding: 0 24px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
}
.headline-stat {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.headline-stat .num {
  font-size: 28px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1;
}
.headline-stat .lbl {
  font-size: 13px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ---------- controls row (tabs + search) ---------- */
.controls {
  max-width: var(--maxw);
  margin: 24px auto 12px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.tabs {
  display: inline-flex;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px;
  gap: 2px;
}
.tab {
  background: transparent;
  color: var(--text-dim);
  border: 0;
  padding: 8px 18px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: color 0.15s ease, background 0.15s ease;
}
.tab:hover { color: var(--text); }
.tab.active {
  background: var(--accent);
  color: #1a0b05;
}

/* Verified-only toggle — sits with the sort tabs but reads as an on/off
   filter with a green active state so it doesn't look like a sort. */
.tab.verified-toggle {
  margin-left: 6px;
  border-left: 1px solid var(--border);
  padding-left: 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.tab.verified-toggle .checkmark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
}
.tab.verified-toggle.active {
  background: linear-gradient(180deg, #38b27a, #2b8c60);
  color: #fff;
}
.tab.verified-toggle.active .checkmark {
  background: #fff;
  color: #2b8c60;
  border-color: #fff;
}

.search {
  flex: 1;
  max-width: 360px;
}
.search input {
  width: 100%;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 10px 16px;
  font-size: 14px;
  color: var(--text);
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s ease;
}
.search input:focus { border-color: var(--accent); }
.search input::placeholder { color: var(--text-dim); }

/* ---------- pill row (category filters) ---------- */
.pill-row {
  max-width: var(--maxw);
  margin: 0 auto 16px;
  padding: 0 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.pill {
  background: var(--bg-elev);
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.pill:hover { color: var(--text); border-color: var(--border-strong); }
.pill.active {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent);
}
.pill-count {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 7px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  vertical-align: middle;
}
.pill.active .pill-count {
  background: rgba(255, 122, 89, 0.22);
  color: var(--accent);
}
.pill-hidden { display: none; }
.pill-more {
  background: transparent;
  color: var(--text-dim);
  border-style: dashed;
}
.pill-more:hover { color: var(--text); border-color: var(--accent); }
.pill-more.open {
  color: var(--accent);
  border-color: var(--accent);
  border-style: solid;
}

/* ---------- chips (inside cards + detail page) ---------- */
.chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-dim);
  border: 1px solid var(--border);
  white-space: nowrap;
}
.chip-category { background: var(--accent-soft); color: var(--accent); border-color: rgba(255,122,89,0.35); }
.chip-platform { background: rgba(56,182,255,0.10); color: #7cc7ff; border-color: rgba(56,182,255,0.3); }
.chip-trigger  { background: rgba(124,92,255,0.10); color: #b49dff; border-color: rgba(124,92,255,0.3); }
.chip-deployment { background: rgba(66,214,164,0.10); color: #7de6bf; border-color: rgba(66,214,164,0.3); }
.chip-hours    { background: rgba(255,184,107,0.10); color: var(--accent-2); border-color: rgba(255,184,107,0.3); }
.chip-integration { background: rgba(200,121,255,0.10); color: #d9a8ff; border-color: rgba(200,121,255,0.3); }

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 14px;
  min-height: 22px;
}

/* ---------- feed (uniform grid) ---------- */
.feed {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 8px 24px 64px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 22px;
  align-items: start;
}

.loading, .empty {
  color: var(--text-dim);
  padding: 40px 0;
  text-align: center;
  grid-column: 1 / -1;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}
.card::before {
  /* Subtle gradient accent on the top edge — only visible on hover */
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, transparent, transparent);
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  pointer-events: none;
  transition: background 0.3s ease;
}
.card:hover {
  transform: translateY(-3px);
  border-color: var(--border-strong);
  box-shadow: 0 12px 32px -12px rgba(0, 0, 0, 0.6);
}
.card:hover::before {
  background: linear-gradient(135deg, rgba(124, 92, 255, 0.5), rgba(124, 92, 255, 0));
}

.card-media {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #0a0c11;
  overflow: hidden;
}
.card-media img,
.card-media video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.card:hover .card-media img,
.card:hover .card-media video {
  transform: scale(1.03);
}
.card-media.placeholder {
  display: grid;
  place-items: center;
  color: var(--text-dim);
  font-size: 34px;
  background: linear-gradient(135deg, #1a1f2b, #10131a);
}

.card-body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  padding: 16px 18px 16px;
  gap: 0;
}
.card-title {
  font-size: 17px;
  font-weight: 700;
  margin: 0 0 8px;
  line-height: 1.3;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-pitch {
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--text-dim);
  margin: 0 0 14px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.handle {
  font-size: 12.5px;
  color: var(--text-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  flex: 1 1 auto;
}
.handle:hover { color: var(--accent); }

/* ---------- gamified "new agent" treatment ---------- */
.card.is-new {
  border-color: transparent;
  box-shadow:
    0 0 0 1px rgba(124, 92, 255, 0.55),
    0 12px 32px -12px rgba(124, 92, 255, 0.45);
  animation: card-new-pulse 2.8s ease-in-out infinite;
}
.card.is-new:hover {
  animation: none;
  box-shadow:
    0 0 0 1.5px rgba(124, 92, 255, 0.9),
    0 18px 44px -10px rgba(124, 92, 255, 0.55);
}
@keyframes card-new-pulse {
  0%, 100% {
    box-shadow:
      0 0 0 1px rgba(124, 92, 255, 0.45),
      0 10px 28px -14px rgba(124, 92, 255, 0.35);
  }
  50% {
    box-shadow:
      0 0 0 1.5px rgba(124, 92, 255, 0.8),
      0 16px 40px -10px rgba(124, 92, 255, 0.55);
  }
}

.new-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #fff;
  background: linear-gradient(135deg, #7c5cff, #5b3fd6);
  border-radius: 999px;
  box-shadow: 0 4px 14px -4px rgba(124, 92, 255, 0.7);
}
.new-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 8px 1px rgba(255, 255, 255, 0.8);
  animation: new-dot-blink 1.6s ease-in-out infinite;
}
@keyframes new-dot-blink {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.35; }
}

/* Cards that just flash in via live polling */
.card.just-arrived {
  animation: card-flash-in 0.9s ease-out;
}
@keyframes card-flash-in {
  0% {
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
    box-shadow: 0 0 0 2px rgba(124, 92, 255, 0);
  }
  40% {
    box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.7), 0 0 40px rgba(124, 92, 255, 0.5);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    box-shadow: 0 0 0 1px rgba(124, 92, 255, 0.55), 0 12px 32px -12px rgba(124, 92, 255, 0.45);
  }
}

.like-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.like-btn:hover { border-color: var(--heart); color: var(--heart); }
.like-btn.liked {
  color: var(--heart);
  border-color: var(--heart);
  background: rgba(255, 77, 109, 0.08);
}
.like-btn .heart::before {
  content: "♡";
  font-size: 15px;
  position: relative;
  top: 1px;
}
.like-btn.liked .heart::before { content: "♥"; }

/* ---------- detail page ---------- */
.detail {
  max-width: 1280px;
  margin: 0 auto;
  padding: 16px 24px 64px;
}

/* ---------- detail: hero (full-width media + title block) ---------- */
.detail-hero {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 24px;
}
.detail-media {
  background: #0a0c11;
  max-height: 520px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.detail-media img,
.detail-media video {
  width: 100%;
  height: auto;
  max-height: 520px;
  object-fit: cover;
}
.detail-media .placeholder-big {
  width: 100%;
  aspect-ratio: 16 / 7;
  display: grid;
  place-items: center;
  font-size: 64px;
  color: var(--text-dim);
  background: linear-gradient(135deg, #1a1f2b, #10131a);
}
.detail-hero-head {
  padding: 28px 32px 28px;
}
.detail-hero-head .chip-category {
  margin-bottom: 12px;
  display: inline-block;
}
.detail-hero-head h1 {
  font-size: clamp(26px, 3.4vw, 40px);
  margin: 10px 0 12px;
  line-height: 1.12;
  letter-spacing: -0.015em;
}
.detail-hero-head .detail-pitch {
  font-size: 17px;
  line-height: 1.55;
  color: var(--text-dim);
  margin: 0;
}

/* ---------- detail: 3-column layout ---------- */
.detail-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr) 300px;
  gap: 22px;
  align-items: start;
}
.detail-side {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: 16px;
}
.detail-main {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-width: 0;
  overflow: hidden;
}
@media (max-width: 1120px) {
  .detail-layout {
    grid-template-columns: 260px minmax(0, 1fr);
  }
  .detail-side-right {
    grid-column: 1 / -1;
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 16px;
  }
  .detail-side-right .side-card { flex: 1 1 280px; }
}
@media (max-width: 780px) {
  .detail-layout {
    grid-template-columns: 1fr;
  }
  .detail-side {
    position: static;
    flex-direction: column;
  }
  .detail-side-right { flex-direction: column; }
  .detail-side-right .side-card { flex: none; }
}

/* ---------- detail: side cards ---------- */
.side-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.side-card h3 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  margin: 0 0 14px;
  font-weight: 700;
}
.side-kv {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px dashed var(--border);
}
.side-kv:last-child { border-bottom: none; padding-bottom: 0; }
.side-kv:first-of-type { padding-top: 0; }
.side-kv-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  font-weight: 600;
  white-space: nowrap;
}
.side-kv-value {
  font-size: 13px;
  color: var(--text);
  text-align: right;
  word-break: break-word;
}
.side-subsection { margin-top: 14px; }
.side-subsection:first-child { margin-top: 0; }
.side-sub-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  font-weight: 600;
  margin-bottom: 8px;
}
.side-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.side-link {
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}
.side-link:hover { text-decoration: underline; }

/* ---------- detail: author card ---------- */
.author-card .author-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.author-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #1a0b05;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.5px;
  flex: 0 0 42px;
}
.author-meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.author-name {
  font-weight: 700;
  color: var(--text);
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.author-links {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}
.author-posted {
  font-size: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

/* ---------- detail: engagement card ---------- */
.engagement-card .engagement-row {
  display: flex;
  gap: 10px;
}
.engagement-card .like-btn-big {
  flex: 1;
  justify-content: center;
  padding: 10px 14px;
  font-size: 14px;
}
.share-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-elev);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.15s ease;
}
.share-btn:hover {
  background: var(--accent);
  color: #1a0b05;
  border-color: var(--accent);
}
.share-icon { font-size: 15px; }

/* ---------- detail: side metrics (big numbers) ---------- */
.side-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.side-metric {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.side-metric.wide { grid-column: 1 / -1; }
.side-metric-val {
  font-size: 20px;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -0.01em;
}
.side-metric-lbl {
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ---------- detail: AI score card ---------- */
.ai-card-row {
  display: flex;
  align-items: center;
  gap: 14px;
}
.ai-score-num {
  font-size: 26px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1;
}
.ai-score-unit {
  font-size: 13px;
  color: var(--text-dim);
  font-weight: 600;
  margin-left: 2px;
}
.ai-card .score-bar {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 6px;
  width: 120px;
}
.ai-card .score-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: 3px;
}
.ai-featured {
  margin: 12px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  color: var(--accent-2);
  font-size: 12px;
  line-height: 1.5;
}

/* ---------- detail: tabs ---------- */
.detail-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 24px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.015);
}
.d-tab {
  background: none;
  border: none;
  padding: 18px 20px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-dim);
  cursor: pointer;
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: color 0.15s ease;
}
.d-tab:hover { color: var(--text); }
.d-tab.active { color: var(--text); }
.d-tab.active::after {
  content: '';
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: -1px;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: 2px 2px 0 0;
}
.tab-badge {
  padding: 2px 8px;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}
.tab-panel.hidden { display: none; }
.overview-panel,
.updates-panel { padding: 0; }

.detail-section {
  padding: 24px 32px;
  border-top: 1px solid var(--border);
}
.detail-section:first-child { border-top: none; }
.detail-section h2 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  margin: 0 0 16px;
  font-weight: 700;
}
.updates-panel { padding: 28px 32px; }
@media (max-width: 640px) {
  .detail-hero-head { padding: 22px 20px; }
  .detail-section { padding: 22px 20px; }
  .updates-panel { padding: 22px 20px; }
  .detail-tabs { padding: 0 12px; }
  .d-tab { padding: 16px 12px; font-size: 13px; }
  .side-card { padding: 16px; }
}
.detail-story {
  font-size: 16px;
  line-height: 1.65;
  margin: 0;
  color: var(--text);
  white-space: pre-wrap;
}

.kv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px 24px;
}
.kv {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.kv-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  font-weight: 600;
}
.kv-value {
  font-size: 14px;
  color: var(--text);
}
.kv-list .kv-value {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.kv-list { grid-column: 1 / -1; }

/* v3 detail page: gotchas, satisfaction dots, external code links */
.gotcha-list {
  margin: 0;
  padding-left: 20px;
  color: var(--text);
  line-height: 1.55;
}
.gotcha-list li { margin-bottom: 8px; }
.gotcha-list li:last-child { margin-bottom: 0; }
.sat-dots {
  letter-spacing: 4px;
  color: #f5a623;
  font-size: 16px;
}
.ext-link {
  color: var(--accent, #7b5cff);
  text-decoration: none;
  word-break: break-all;
}
.ext-link:hover { text-decoration: underline; }

/* ---------- updates: vertical timeline treatment ---------- */
.updates-timeline {
  list-style: none;
  margin: 0;
  padding: 0 0 0 28px;
  position: relative;
}
.updates-timeline::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2) 40%, var(--border) 100%);
  border-radius: 2px;
}
.updates-timeline .update-item.timeline {
  position: relative;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 16px;
}
.updates-timeline .update-item.timeline:last-child { margin-bottom: 0; }
.updates-timeline .update-item.timeline::before {
  content: '';
  position: absolute;
  left: -28px;
  top: 18px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 3px solid var(--accent);
  box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.15);
}
.updates-timeline .update-item.timeline:first-child::before {
  background: var(--accent);
  box-shadow: 0 0 12px 2px rgba(255, 122, 89, 0.5);
}

.updates-empty {
  text-align: center;
  padding: 32px 20px;
  background: rgba(255, 255, 255, 0.015);
  border: 1px dashed var(--border);
  border-radius: 12px;
}
.updates-empty-icon {
  font-size: 28px;
  color: var(--text-dim);
  margin-bottom: 8px;
}
.updates-empty-title {
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}
.updates-empty p { margin: 0; }

/* Living database: "What's new" list + author-only pending + post form */
.updates-section .update-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.update-item {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.update-item.pending {
  background: rgba(245, 166, 35, 0.06);
  border-color: rgba(245, 166, 35, 0.35);
}
.update-item.acting { opacity: 0.5; }
.update-date {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  font-weight: 600;
}
.update-body {
  margin: 0;
  color: var(--text);
  line-height: 1.55;
  white-space: pre-wrap;
}
.update-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}
.approve-btn,
.reject-btn,
.post-update-btn {
  font: inherit;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
}
.approve-btn {
  background: linear-gradient(180deg, #38b27a, #2b8c60);
  color: #fff;
  border-color: #2b8c60;
}
.approve-btn:hover:not(:disabled) { filter: brightness(1.08); }
.reject-btn { color: #ff6b6b; border-color: rgba(255, 107, 107, 0.5); }
.reject-btn:hover:not(:disabled) { background: rgba(255, 107, 107, 0.08); }
.approve-btn:disabled,
.reject-btn:disabled,
.post-update-btn:disabled { opacity: 0.55; cursor: not-allowed; }

.pending-block {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px dashed var(--border);
}
.pending-block h3 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #f5a623;
  margin: 0 0 12px;
  font-weight: 700;
}

.post-update {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px dashed var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.post-update h3 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  margin: 0;
  font-weight: 700;
}
.update-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  color: var(--text);
  font: inherit;
  line-height: 1.5;
  resize: vertical;
}
.update-input:focus { outline: 2px solid var(--accent, #7b5cff); outline-offset: 1px; }
.post-update-btn {
  align-self: flex-start;
  background: linear-gradient(180deg, #7b5cff, #5b3cdc);
  color: #fff;
  border-color: #5b3cdc;
}
.post-update-btn:hover:not(:disabled) { filter: brightness(1.08); }
.post-update-status { font-size: 13px; }
.update-empty { padding: 8px 0; }

.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
}
.metric {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.metric-val {
  font-size: 22px;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -0.01em;
}
.metric-lbl {
  font-size: 12px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.image-prompt {
  background: #0a0c11;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 13px;
  line-height: 1.5;
  color: #d6dcec;
  white-space: pre-wrap;
  margin: 0;
}

/* ---------- stats page grid ---------- */
.stats-grid {
  max-width: var(--maxw);
  margin: 24px auto 64px;
  padding: 0 24px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
}
.stats-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px 22px;
  position: relative;
}
.stats-card.wide { grid-column: span 2; }
@media (max-width: 760px) {
  .stats-card.wide { grid-column: span 1; }
}
.stats-card h3 {
  margin: 0 0 16px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  font-weight: 700;
}
.stats-card canvas {
  width: 100% !important;
  height: 260px !important;
}
.empty-chart {
  color: var(--text-dim);
  font-size: 13px;
  padding: 40px 0;
  text-align: center;
}

/* ---------- submit page ---------- */
.doc {
  max-width: 820px;
  margin: 0 auto;
  padding: 8px 24px 64px;
}
.card-block {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 24px 28px;
  margin-bottom: 20px;
}
.card-block h2 {
  margin: 0 0 8px;
  font-size: 18px;
}
.card-block p {
  color: var(--text-dim);
  line-height: 1.6;
  margin: 0 0 14px;
}
.bullets {
  margin: 0;
  padding: 0 0 0 18px;
  color: var(--text-dim);
  line-height: 1.7;
}
.bullets strong { color: var(--text); }
.muted { color: var(--text-dim); font-size: 13px; }
.muted code,
.card-block code {
  background: #0a0c11;
  padding: 1px 6px;
  border-radius: 5px;
  font-size: 12.5px;
}

pre {
  background: #0a0c11;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  overflow-x: auto;
  font-size: 12.5px;
  line-height: 1.55;
  color: #d6dcec;
  margin: 0;
}
pre code { background: transparent; padding: 0; }

.code-wrap { position: relative; }
.copy-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.copy-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- verified badge ---------- */
.verified-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px 3px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: linear-gradient(135deg, rgba(66,214,164,0.22), rgba(56,182,255,0.22));
  color: #7de6bf;
  border: 1px solid rgba(66,214,164,0.45);
  white-space: nowrap;
}
.verified-badge::before {
  content: "✓";
  display: inline-block;
  font-size: 10px;
  font-weight: 900;
  width: 12px;
  height: 12px;
  line-height: 12px;
  text-align: center;
  border-radius: 999px;
  background: #42d6a4;
  color: #0b0e17;
}
.card-title .verified-badge {
  margin-left: 6px;
  transform: translateY(-1px);
}
.detail-head .verified-badge {
  margin-left: 8px;
  font-size: 12px;
  padding: 4px 11px 4px 9px;
}

/* ---------- author banner: delete + verify ---------- */
.author-banner {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  margin: 0 0 18px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(255,122,89,0.10), rgba(124,92,255,0.10));
  border: 1px solid rgba(255,122,89,0.35);
  color: var(--text);
  font-size: 13.5px;
}
.author-banner .author-banner-text {
  flex: 1 1 260px;
  line-height: 1.5;
}
.author-banner .author-banner-text strong { color: var(--accent-2); }
.author-banner .author-banner-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.verify-btn,
.delete-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.08s ease, box-shadow 0.2s ease;
}
.verify-btn {
  background: linear-gradient(135deg, #42d6a4, #38b6ff);
  color: #0b0e17;
  box-shadow: 0 6px 22px -10px rgba(66,214,164,0.75);
}
.verify-btn:hover { transform: translateY(-1px); }
.delete-btn {
  background: rgba(255,77,109,0.12);
  color: #ff8599;
  border-color: rgba(255,77,109,0.4);
}
.delete-btn:hover {
  background: rgba(255,77,109,0.22);
}

/* ---------- footer ---------- */
.site-footer {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-dim);
  font-size: 13px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 10px;
}
.site-footer a:hover { color: var(--accent); }
.donation {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1 1 auto;
  justify-content: center;
  flex-wrap: wrap;
}
.donation-label { color: var(--text-dim); white-space: nowrap; }
.donation code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 8px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.donation .copy-btn {
  font-size: 11px;
  padding: 4px 10px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-dim);
  border-radius: 6px;
  cursor: pointer;
}
.donation .copy-btn:hover { color: var(--accent); border-color: var(--accent); }
