/* Ayra ix community — article layout + reading-companion chat panel */

/* Community pages set their own --accent/--accent2 pair; keep the primary CTA in that pair
   instead of shared.css's hardcoded teal second stop, which clashes on non-teal pages. */
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
}

/* Article column owns the full prose width. Chat is parked in the right
   margin (fixed) so it never shares a grid track with the hero / .post-img. */
.article-wrap {
  /* Wider column so photos/tables match local rewrite preview (chat sits in margin) */
  --prose-w: 900px;
  --chat-w: 300px;
  --article-gap: clamp(20px, 2vw, 36px);
  --wrap-pad-x: 20px;
  display: block;
  width: 100%;
  max-width: none;
  margin: 0 auto;
  padding: calc(var(--nav-h) + 48px) var(--wrap-pad-x) 80px;
  position: relative;
  z-index: 1;
  box-sizing: border-box;
}

article.post {
  min-width: 0;
  width: 100%;
  max-width: var(--prose-w);
  margin: 0 auto;
}

/* ── Article media (match local rewrites: never crop) ──
   No forced OG aspect / object-fit:cover on article images — that was cutting
   diagrams on both sides. Images scale to column width at natural height. */
article.post {
  --media-aspect: 1200 / 630;
}

article.post > picture:has(.post-hero),
article.post > picture:first-child,
article.post .post-hero-wrap {
  border-radius: 16px;
  border: 1px solid var(--border);
  margin-bottom: var(--space-6);
}

article.post .post-hero-wrap {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow: hidden; /* clip to border-radius only */
  background: rgba(0, 0, 0, 0.32);
}

article.post .post-hero-wrap picture:has(.post-hero),
article.post picture:has(.post-hero) {
  display: block;
  width: 100%;
  max-width: 100%;
  aspect-ratio: auto;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.post-hero-caption {
  padding: 10px 16px 12px;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  line-height: var(--leading-snug);
  color: var(--muted-strong);
  border-top: 1px solid var(--border);
  text-align: center;
}

article.post .post-figure,
article.post picture {
  max-width: 100%;
}
article.post .post-figure picture,
article.post picture:has(.post-img) {
  display: block;
  width: 100%;
  max-width: 100%;
  aspect-ratio: auto;
  margin: 0;
  background: rgba(0, 0, 0, 0.15);
  border: 0;
  border-radius: 0;
  overflow: visible;
}

/* One rule for every article image — full asset visible */
article.post img,
article.post .post-hero,
article.post .post-img,
article.post .post-figure img {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  height: auto !important;
  margin: 0;
  border: 0;
  border-radius: 0;
  object-fit: contain !important;
  object-position: center;
  box-sizing: border-box;
}

article.post .viz-block img,
article.post .viz-block svg,
article.post svg {
  max-width: 100%;
  height: auto;
  overflow: visible;
}

/* Desktop: chat parked in right margin; article uses the rest and can go wider */
@media (min-width: 981px) {
  .article-wrap {
    padding-left: var(--wrap-pad-x);
    padding-right: calc(var(--chat-w) + var(--article-gap) + var(--wrap-pad-x));
  }

  article.post {
    margin: 0 auto;
    max-width: min(var(--prose-w), 100%);
  }

  .chat-rail {
    position: fixed;
    top: calc(var(--nav-h) + 24px);
    /* Anchor beside the centered prose column — not flush to the viewport edge.
       Gap from article right edge stays --article-gap; on narrow desktops falls
       back to --wrap-pad-x so the rail never leaves the viewport. */
    right: max(
      var(--wrap-pad-x),
      calc((100vw - var(--prose-w)) / 2 - var(--chat-w) - var(--article-gap))
    );
    width: var(--chat-w);
    min-width: 0;
    z-index: 40;
  }
}

@media (min-width: 1400px) {
  .article-wrap { --prose-w: 960px; --chat-w: 320px; }
}

@media (min-width: 1600px) {
  .article-wrap { --prose-w: 1000px; }
}
/* Article atmosphere — local rewrite look (purple wash + orbs punch through flat --bg overrides) */
body[data-article-slug] {
  --bg: #030308;
  --bg-deep: #010104;
}
body[data-article-slug]::before {
  background:
    radial-gradient(ellipse 95% 60% at 50% -12%, rgba(139, 92, 246, 0.28), transparent 58%),
    radial-gradient(ellipse 70% 45% at 85% 30%, rgba(0, 232, 219, 0.12), transparent 52%),
    radial-gradient(ellipse 55% 40% at 10% 68%, rgba(236, 72, 153, 0.12), transparent 50%),
    linear-gradient(180deg, #140a2e 0%, #0c0820 28%, #030308 55%, #010104 100%) !important;
}
body[data-article-slug] .orb1 {
  width: 680px; height: 680px; top: -180px; left: -120px;
  background: rgba(0, 232, 219, 0.1) !important;
}
body[data-article-slug] .orb2 {
  width: 560px; height: 560px; bottom: -120px; right: -100px;
  background: rgba(139, 92, 246, 0.14) !important;
  animation-delay: -9s;
}

.post .eyebrow-line {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px; color: #38bdf8;
  letter-spacing: 0.14em; text-transform: uppercase; font-weight: 600;
  margin-bottom: var(--space-5);
  padding: 6px 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  border-radius: 9999px;
  box-shadow: 0 0 24px rgba(56, 189, 248, 0.08);
}
.post .eyebrow-line::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: #38bdf8; box-shadow: 0 0 8px rgba(56, 189, 248, 0.6);
  flex-shrink: 0;
}
.post h1 {
  font-family: var(--font-display);
  font-size: clamp(2.1rem, 4.4vw, 3.1rem);
  font-weight: 700; line-height: 1.08;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-5);
  color: #f4f4f5;
  background: none;
  -webkit-text-fill-color: #f4f4f5;
  -webkit-background-clip: border-box;
  background-clip: border-box;
}
/* Multi-color title highlight — match local .article-title em flash */
article.post h1 em,
.post h1 em {
  font-style: normal;
  font-weight: 700;
  display: inline;
  color: #00e8db; /* fallback if clip unsupported */
  background-image: linear-gradient(135deg, #00e8db 0%, #38bdf8 32%, #8b5cf6 68%, #ec4899 100%);
  background-color: transparent;
  background-size: 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-fill-color: transparent;
  filter: drop-shadow(0 0 20px rgba(0, 232, 219, 0.28)) drop-shadow(0 0 28px rgba(139, 92, 246, 0.22));
}
.post .post-meta {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 12px; color: var(--muted); letter-spacing: 0.01em;
  margin-bottom: var(--space-10);
  padding-bottom: var(--space-6);
  border-bottom: 1px solid var(--border);
}
.post h2 {
  font-family: var(--font-display);
  font-size: var(--text-xl); font-weight: 600;
  letter-spacing: -0.01em;
  margin: var(--space-12) 0 var(--space-5);
  padding-top: var(--space-8);
  border-top: 1px solid var(--border);
  position: relative;
  /* Soft theme-aware section headings — muted mix of each article’s
     --accent/--accent2 (community pages set unique pairs) into slate. */
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--accent) 48%, #e2e8f0),
    color-mix(in srgb, var(--accent2) 40%, #94a3b8) 48%,
    #94a3b8
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}
.post h2::before {
  content: ''; position: absolute; top: -1px; left: 0;
  width: 48px; height: 1px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
}
/* Poll/quiz/publisher/xlinks/engage chrome h2s stay solid white (sample excluded those). */
article.post .c-article-quiz h2,
article.post .c-quiz-head h2,
article.post .c-publisher h2,
article.post .c-xlinks h2,
article.post .c-engage h2,
article.post .cm-related h2 {
  background: none;
  background-image: none;
  -webkit-background-clip: border-box;
  background-clip: border-box;
  color: var(--text, #f1f5f9);
  -webkit-text-fill-color: var(--text, #f1f5f9);
}
.post > h2:first-of-type { border-top: none; padding-top: 0; margin-top: var(--space-8); }
.post p {
  font-size: 17px; color: var(--text2);
  line-height: 1.75;
  margin-bottom: var(--space-5);
}
/* Inline / keep-exploring links — bright sky on dark (not browser navy). */
article.post a:any-link,
.post a:any-link {
  color: var(--link, var(--accent, #67e8f9));
  -webkit-text-fill-color: currentColor;
}
article.post a:hover,
.post a:hover {
  color: var(--link-hover, #a5f3fc);
  -webkit-text-fill-color: currentColor;
}
/* Inline code — fixed high-contrast chips (not per-page --accent; indigo-on-navy was unreadable).
   Explicit -webkit-text-fill-color beats h1 gradient transparent fill inheritance in WebKit. */
.article-wrap article.post code,
article.post p code,
article.post li code,
article.post blockquote code,
article.post td code,
article.post th code,
.post code {
  font-family: var(--font-mono);
  font-size: 0.92em;
  background: #2a2d31;
  padding: 0.15em 0.4em;
  border-radius: var(--radius-sm);
  color: #5eead4;
  -webkit-text-fill-color: #5eead4;
  -webkit-background-clip: border-box;
  background-clip: border-box;
}
.post .post-subtitle {
  font-size: var(--text-lg);
  color: var(--text2);
  font-style: italic;
  margin: 0 0 var(--space-8);
  padding-bottom: 0;
  border-bottom: 0;
}
.post ul, .post ol { margin: 0 0 var(--space-5) 1.2em; }
.post li { color: var(--text2); line-height: 1.75; padding: 4px 0; }
.post blockquote {
  position: relative;
  padding: var(--space-6) var(--space-8) var(--space-6) var(--space-8);
  margin: var(--space-8) 0;
  background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 8%, transparent), color-mix(in srgb, var(--accent2) 4%, transparent));
  border: 1px solid var(--border);
  border-left: 2px solid var(--accent);
  border-radius: var(--radius-lg);
  color: var(--text);
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: -0.005em;
}
.post blockquote::before {
  content: '"';
  position: absolute; top: 2px; left: var(--space-6);
  font-family: var(--font-display); font-size: 3.2rem; font-weight: 700;
  line-height: 1; color: var(--accent); opacity: 0.35;
}

/* ── Article data viz: stat cards, bar charts, sparklines, comparison tables ── */
@keyframes barGrow {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}
@media (prefers-reduced-motion: reduce) {
  .bar-fill { animation: none !important; }
}

.viz-block {
  position: relative;
  margin: var(--space-10) 0;
  padding: var(--space-6);
  border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--border));
  border-radius: 16px;
  background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 6%, transparent), rgba(255,255,255,0.01));
  box-shadow: 0 1px 0 rgba(255,255,255,0.04) inset, 0 20px 40px -24px rgba(0,0,0,0.5);
  overflow: visible;
  box-sizing: border-box;
}
/* Never force media aspect on viz — SVG diagrams were getting clipped */
article.post .viz-block:has(> svg) {
  overflow: visible;
}
article.post .viz-block svg {
  width: 100%;
  height: auto;
  display: block;
}
.viz-block::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent2), transparent);
}

/* ── Questions to Consider — airy glass reflect panel ── */
.questions-block {
  --questions-grad-a: #ff8c00;
  --questions-grad-b: #ff69b4;
  position: relative;
  margin: var(--space-12) 0 var(--space-8);
  padding: clamp(28px, 3.5vw, 36px) clamp(28px, 3.5vw, 36px) clamp(24px, 3vw, 32px)
           clamp(32px, 4vw, 40px);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.025));
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  backdrop-filter: blur(16px) saturate(1.25);
  -webkit-backdrop-filter: blur(16px) saturate(1.25);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.06) inset,
    0 24px 48px -32px rgba(0, 0, 0, 0.42);
  overflow: hidden;
}
.questions-block::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, var(--questions-grad-a), var(--questions-grad-b), transparent 82%);
  opacity: 0.9;
}
.questions-block::after {
  content: '';
  position: absolute;
  top: 14px;
  bottom: 14px;
  left: 0;
  width: 2px;
  border-radius: 0 2px 2px 0;
  background: linear-gradient(180deg, var(--questions-grad-a), var(--questions-grad-b));
  opacity: 0.65;
}
.questions-block .questions-heading {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  color: rgba(255, 255, 255, 0.96);
  margin: 0 0 clamp(20px, 2.5vw, 28px);
  letter-spacing: -0.01em;
  text-transform: none;
}
.questions-block .questions-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  counter-reset: questions;
}
.questions-block .questions-list li {
  counter-increment: questions;
  display: flex;
  gap: 0.55em;
  font-size: var(--text-base);
  line-height: 1.78;
  color: rgba(255, 255, 255, 0.88);
}
.questions-block .questions-list li::before {
  content: counter(questions) '.';
  font-weight: 700;
  color: rgba(255, 255, 255, 0.92);
  flex-shrink: 0;
  min-width: 1.25em;
}
.questions-block .questions-list li strong {
  color: #f0f0f5;
  font-weight: 600;
}
.viz-label {
  font-family: var(--font-mono);
  font-size: 10px; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--accent); margin-bottom: var(--space-2);
}
.viz-title {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: var(--text-sm);
  color: #00e8db;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: var(--space-5);
}
.viz-source {
  margin-top: var(--space-5);
  font-size: 12.5px; color: var(--muted); line-height: 1.6;
  border-top: 1px solid var(--border); padding-top: var(--space-4);
}
.viz-illustrative {
  display: inline-block; font-size: 9.5px; font-weight: 700;
  font-family: var(--font-mono);
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--muted); border: 1px solid var(--border);
  border-radius: var(--radius-full); padding: 3px 9px; margin-left: 8px;
  vertical-align: middle;
}

.stat-row {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--space-4); margin: var(--space-8) 0;
}
.stat-card {
  position: relative;
  padding: var(--space-6) var(--space-5) var(--space-5);
  border: 1px solid var(--border);
  border-radius: 14px;
  background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 8%, transparent), rgba(255,255,255,0.015));
  transition: transform .25s cubic-bezier(.16,1,.3,1), border-color .25s, box-shadow .25s;
}
.stat-card::before {
  content: ''; position: absolute; top: 0; left: var(--space-5); right: var(--space-5); height: 2px;
  background: linear-gradient(90deg, var(--accent), transparent);
  border-radius: var(--radius-full);
}
.stat-card:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
  box-shadow: 0 16px 32px -16px color-mix(in srgb, var(--accent) 25%, transparent);
}
.stat-card .stat-num {
  font-family: var(--font-mono); font-weight: 600;
  font-variant-numeric: tabular-nums;
  font-size: 1.9rem; color: var(--accent); line-height: 1;
  margin-bottom: var(--space-3);
  letter-spacing: -0.01em;
}
.stat-card .stat-label {
  font-size: 13.5px; color: var(--text2); line-height: 1.55;
}
.stat-card .stat-src { font-family: var(--font-mono); font-size: 10.5px; color: var(--muted); margin-top: var(--space-3); }

.bar-list { display: flex; flex-direction: column; gap: var(--space-4); }
.bar-row { display: grid; grid-template-columns: 140px 1fr 56px; align-items: center; gap: var(--space-3); }
.bar-row .bar-name { font-size: 13.5px; color: var(--text2); }
.bar-track {
  height: 8px; border-radius: var(--radius-full);
  background: rgba(255,255,255,0.05); overflow: hidden;
}
.bar-fill {
  display: block;
  height: 100%; border-radius: var(--radius-full);
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  transform-origin: left;
  animation: barGrow .9s cubic-bezier(.16,1,.3,1) both;
}

/* Vertical trend — year-over-year scores */
.trend-chart {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: clamp(20px, 4vw, 40px);
  height: 180px;
  padding: 0 var(--space-2) var(--space-2);
  border-bottom: 1px solid var(--border);
}
.trend-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  flex: 1;
  max-width: 120px;
  height: 100%;
  justify-content: flex-end;
}
.trend-bar {
  position: relative;
  width: 100%;
  max-width: 72px;
  height: calc(var(--h, 50%) * 1.55);
  max-height: 140px;
  border-radius: 10px 10px 4px 4px;
  background: linear-gradient(180deg, var(--accent), color-mix(in srgb, var(--accent) 55%, var(--accent2)));
  box-shadow: 0 8px 24px -8px color-mix(in srgb, var(--accent) 40%, transparent);
}
.trend-col--peak .trend-bar {
  background: linear-gradient(180deg, var(--accent2), var(--accent));
}
.trend-val {
  position: absolute;
  top: -26px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
  white-space: nowrap;
}
.trend-yr {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.06em;
}
.trend-baseline {
  margin-top: var(--space-3);
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}

/* Side-by-side reader journey */
.flow-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}
.flow-path {
  padding: var(--space-5);
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255,255,255,0.02);
}
.flow-path--old { border-color: color-mix(in srgb, #f38ba0 25%, var(--border)); }
.flow-path--new {
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
  background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 6%, transparent), rgba(255,255,255,0.01));
}
.flow-path-head {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: var(--space-4);
}
.flow-path--new .flow-path-head { color: var(--accent); }
.flow-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  counter-reset: flow;
}
.flow-steps li {
  position: relative;
  padding: 10px 0 10px 28px;
  font-size: 13.5px;
  color: var(--text2);
  line-height: 1.45;
  border-left: 1px dashed var(--border);
  margin-left: 8px;
}
.flow-steps li:first-child { padding-top: 0; }
.flow-steps li:last-child { border-left-color: transparent; padding-bottom: 0; }
.flow-steps li::before {
  content: '';
  position: absolute;
  left: -5px;
  top: 14px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--border);
  border: 2px solid var(--bg, #0a0708);
}
.flow-path--new .flow-steps li::before { background: var(--accent); }
.flow-steps li.flow-dead {
  color: #f38ba0;
  font-weight: 500;
}
.flow-steps li.flow-dead::before { background: #f38ba0; }

/* Funnel — attrition through stages */
.funnel-viz {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.funnel-step {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: var(--w, 100%);
  max-width: 100%;
  min-width: 140px;
  padding: 12px 18px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 10%, transparent), rgba(255,255,255,0.02));
  font-size: 13.5px;
  color: var(--text2);
  transition: width .6s cubic-bezier(.16,1,.3,1);
}
.funnel-step span { color: var(--text); font-weight: 500; }
.funnel-step strong {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  color: var(--accent);
}
.funnel-step:first-child { border-color: color-mix(in srgb, var(--accent) 30%, var(--border)); }

/* Stacked composition bar (parts of a whole) */
.stack-bar {
  display: flex;
  height: 14px;
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: var(--space-5);
  border: 1px solid var(--border);
}
.stack-seg {
  height: 100%;
  background: var(--seg-color, var(--accent));
  opacity: var(--seg-opacity, 1);
}
.stack-legend {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--space-3);
}
.stack-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text2);
}
.stack-legend-item::before {
  content: '';
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--seg-color, var(--accent));
  flex-shrink: 0;
}

/* Token routing split */
.split-bar {
  display: flex;
  height: 36px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  margin: var(--space-4) 0;
}
.split-seg {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--bg, #0a0708);
}
.split-seg--local {
  flex: 8;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
}
.split-seg--frontier {
  flex: 2;
  background: rgba(255,255,255,0.12);
  color: var(--text2);
  border-left: 1px solid var(--border);
}
.split-labels {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  color: var(--muted);
}
.bar-row .bar-val {
  font-family: var(--font-mono); font-variant-numeric: tabular-nums;
  font-size: 13px; font-weight: 600; color: var(--text); text-align: right;
}

.spark-wrap { display: flex; align-items: flex-end; gap: var(--space-2); }
.spark-wrap svg { flex: 1; overflow: visible; }
.spark-endlabels { display: flex; justify-content: space-between; margin-top: var(--space-3); }
.spark-endlabels span { font-family: var(--font-mono); font-size: 11px; color: var(--muted); }
.spark-endlabels strong { font-variant-numeric: tabular-nums; color: var(--text); font-weight: 600; }

.cmp-table { width: 100%; border-collapse: collapse; font-size: 13.5px; border-radius: 12px; overflow: hidden; }
.cmp-table th, .cmp-table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--border); }
.cmp-table th { color: var(--muted); font-weight: 600; font-family: var(--font-mono); font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em; background: rgba(255,255,255,0.02); }
.cmp-table tbody tr { transition: background .15s; }
.cmp-table tbody tr:hover { background: rgba(255,255,255,0.02); }
.cmp-table tbody tr:nth-child(even) { background: rgba(255,255,255,0.012); }
.cmp-table td { color: var(--text2); }
.cmp-table td:first-child { color: var(--text); font-weight: 500; }
.cmp-table tr:last-child td { border-bottom: none; }
.cmp-table .cell-bad { color: #f38ba0; }
.cmp-table .cell-good { color: var(--accent); font-weight: 500; }

/* ── Chat panel ── */
.chat-panel {
  position: sticky; top: calc(var(--nav-h) + 24px);
  display: flex; flex-direction: column;
  height: calc(100vh - var(--nav-h) - 48px);
  max-height: 720px;
  border: 1px solid rgba(251,146,60,0.18);
  border-radius: var(--radius-lg);
  background: linear-gradient(160deg, rgba(251,146,60,0.05), rgba(244,114,182,0.03)), var(--bg-elevated, rgba(255,255,255,0.02));
  backdrop-filter: blur(12px);
  overflow: hidden;
}
.chat-head {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.chat-head .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 10px var(--accent);
  flex-shrink: 0;
}
.chat-head .chat-title { font-weight: 600; font-size: var(--text-sm); }
.chat-head .chat-sub { font-size: var(--text-xs); color: var(--muted); }
.chat-user {
  margin-left: auto; display: flex; align-items: center; gap: 8px;
}
.chat-user img { width: 26px; height: 26px; border-radius: 50%; }
.chat-user button {
  background: none; border: none; color: var(--muted);
  font-size: var(--text-xs); cursor: pointer; padding: 4px;
}
.chat-user button:hover { color: var(--text); }

.chat-log {
  flex: 1; overflow-y: auto;
  padding: 16px;
  display: flex; flex-direction: column; gap: 12px;
  scroll-behavior: smooth;
}
.chat-msg {
  max-width: 88%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
  white-space: pre-wrap;
  word-wrap: break-word;
}
.chat-msg.user {
  align-self: flex-end;
  background: linear-gradient(135deg, rgba(251,146,60,0.25), rgba(244,114,182,0.2));
  border: 1px solid rgba(251,146,60,0.3);
  color: var(--text);
  border-bottom-right-radius: 4px;
}
.chat-msg.assistant {
  align-self: flex-start;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  color: var(--text2);
  border-bottom-left-radius: 4px;
}
.chat-msg.thinking { color: var(--muted); font-style: italic; }
.chat-note {
  text-align: center; font-size: var(--text-xs); color: var(--muted);
  padding: 4px 12px;
}

.chat-gate {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 14px; padding: 24px; text-align: center;
}
.chat-gate p { font-size: var(--text-sm); color: var(--muted); max-width: 260px; line-height: var(--leading-relaxed); }
.google-btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 11px 22px;
  border-radius: var(--radius-full);
  background: #fff; color: #1f1f1f;
  font-weight: 600; font-size: var(--text-sm);
  text-decoration: none;
  transition: transform .2s, box-shadow .2s;
}
.google-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(251,146,60,0.25); }
.google-btn svg { width: 18px; height: 18px; }

.chat-input-row {
  display: flex; gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.chat-input-row textarea {
  flex: 1; min-width: 0; resize: none;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  padding: 10px 12px;
  min-height: 42px; max-height: 120px;
  outline: none;
}
.chat-input-row textarea:focus { border-color: rgba(251,146,60,0.4); }
.chat-send {
  align-self: flex-end;
  flex-shrink: 0;
  border: none; cursor: pointer;
  width: 42px; height: 42px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #fb923c, #f472b6);
  color: #0a0708; font-size: 16px; font-weight: 700;
  transition: opacity .2s, transform .2s;
}
.chat-send:hover { transform: translateY(-1px); }
.chat-send:disabled { opacity: .4; cursor: default; transform: none; }

/* ── Nav auth widget ── */
#authWidget { display: flex; align-items: center; gap: 8px; }
#authWidget img { width: 26px; height: 26px; border-radius: 50%; }
#authWidget span,
#authWidget .auth-profile-link,
#authWidget .ayx-nav-user {
  font-size: var(--text-sm);
  font-weight: 600;
  color: #7dd3fc;
  text-decoration: none;
}
#authWidget .auth-profile-link:link,
#authWidget .auth-profile-link:visited,
#authWidget .ayx-nav-user:link,
#authWidget .ayx-nav-user:visited {
  color: #7dd3fc;
}
#authWidget .auth-profile-link:hover,
#authWidget .auth-profile-link:focus-visible,
#authWidget .ayx-nav-user:hover,
#authWidget .ayx-nav-user:focus-visible {
  color: #fff;
}
#authWidget > button {
  background: none; border: 1px solid var(--border);
  border-radius: var(--radius-full);
  color: var(--muted); font-size: var(--text-xs);
  padding: 5px 12px; cursor: pointer;
}
#authWidget > button:hover { color: var(--text); border-color: var(--border-strong); }
.google-btn.google-btn-sm { padding: 7px 16px; font-size: var(--text-xs); }
.google-btn.google-btn-sm svg { width: 14px; height: 14px; }

/* Mobile: chat becomes a bottom sheet behind a floating button */
.chat-fab { display: none; }
body.chat-sheet-open { overflow: hidden; }

/* Desktop: the chat panel is sticky and normally stays in view, but on very
   long articles it scrolls past its own grid-cell bottom edge near the end.
   A small floating button appears (JS toggles .chat-fab-visible via an
   IntersectionObserver on .chat-panel) so there's always a one-click way
   back to it. */
@media (min-width: 981px) {
  .chat-fab-desktop {
    display: flex; align-items: center; gap: 8px;
    position: fixed;
    right: clamp(16px, 3vw, 32px);
    bottom: 28px;
    z-index: 59;
    padding: 12px 20px;
    border: none; border-radius: var(--radius-full);
    background: linear-gradient(135deg, #fb923c, #f472b6);
    color: #0a0708; font-weight: 700; font-size: var(--text-sm);
    cursor: pointer;
    box-shadow: 0 12px 30px rgba(251,146,60,0.35);
    opacity: 0; pointer-events: none; transform: translateY(10px);
    transition: opacity .25s, transform .25s;
  }
  .chat-fab-desktop.visible { opacity: 1; pointer-events: auto; transform: translateY(0); }
}

@media (max-width: 980px) {
  .article-wrap {
    padding: calc(var(--nav-h) + 48px) 20px calc(80px + env(safe-area-inset-bottom, 0px));
  }
  article.post { max-width: none; margin: 0 auto; }
  .chat-rail {
    position: static;
    width: auto;
    right: auto;
  }
  .flow-compare { grid-template-columns: 1fr; }
  .bar-row { grid-template-columns: 1fr; gap: var(--space-2); }
  .bar-row .bar-val { text-align: left; }
  .chat-panel {
    position: fixed; left: 0; right: 0; bottom: 0;
    top: auto;
    height: min(78dvh, calc(100dvh - var(--nav-h) - 12px));
    max-height: none;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    transform: translateY(105%);
    transition: transform .35s cubic-bezier(.3,1,.4,1);
    z-index: 60;
    background: var(--bg-deep, #0a0708);
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  .chat-panel.open { transform: translateY(0); }
  .chat-panel.keyboard-open {
    transition: none;
    height: auto;
    max-height: none;
  }
  .chat-fab {
    display: flex; align-items: center; gap: 8px;
    position: fixed;
    left: 50%;
    right: auto;
    bottom: calc(18px + env(safe-area-inset-bottom, 0px));
    transform: translateX(-50%);
    z-index: 59;
    padding: 13px 22px;
    border: none; border-radius: var(--radius-full);
    background: linear-gradient(135deg, #fb923c, #f472b6);
    color: #0a0708; font-weight: 700; font-size: var(--text-sm);
    cursor: pointer;
    box-shadow: 0 12px 30px rgba(251,146,60,0.35);
    transition: opacity .25s, transform .25s;
    white-space: nowrap;
  }
  body.chat-sheet-open .chat-fab {
    opacity: 0;
    pointer-events: none;
    transform: translateX(-50%) translateY(16px);
  }
  .chat-input-row {
    padding: 12px 12px max(12px, env(safe-area-inset-bottom, 0px));
  }
  .chat-close { display: block !important; }
}
.chat-close {
  display: none;
  background: none; border: none; color: var(--muted);
  font-size: 20px; cursor: pointer; padding: 0 4px;
}

/* Legacy article viz components inside community posts */
.model-row { display: flex; flex-direction: column; gap: var(--space-4); margin: var(--space-8) 0; }
.model-card {
  padding: var(--space-5); border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: rgba(255,255,255,0.02);
}
.model-card-badge {
  display: inline-block; font-family: var(--font-mono);
  font-size: 9px; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; padding: 3px 8px; border-radius: var(--radius-full);
  margin-bottom: var(--space-3);
}
.model-card-badge.real { background: rgba(52,211,153,0.15); color: #34d399; }
.model-card-badge.hype { background: rgba(251,113,133,0.15); color: #f38ba0; }
.model-card-name { font-weight: 600; color: var(--text); margin-bottom: var(--space-2); }
.model-card-verdict { font-size: var(--text-sm); color: var(--text2); line-height: var(--leading-relaxed); }
.missing {
  margin: var(--space-8) 0; padding: var(--space-6);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 6%, transparent), rgba(255,255,255,0.01));
}
.missing-title { font-family: var(--font-display); font-weight: 600; margin-bottom: var(--space-3); color: var(--accent); }
.missing p { font-size: var(--text-sm); color: var(--text2); line-height: var(--leading-relaxed); }

/* Theme boxes — match local rewrite polish (green sanity check + purple status feed) */
.callout {
  background: color-mix(in srgb, var(--accent) 6%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 15%, transparent);
  border-radius: var(--radius-md);
  padding: var(--space-6);
  margin: var(--space-8) 0;
}
.callout h4,
.callout-title {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  margin-bottom: var(--space-4);
}
.callout p { color: var(--text2); font-size: var(--text-sm); line-height: var(--leading-relaxed); }
.callout table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
.callout th,
.callout td {
  padding: var(--space-3) var(--space-4);
  text-align: left;
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 10%, transparent);
}
.callout th { color: var(--accent); font-weight: 600; }
.callout td { color: var(--text2); }
.callout tr:last-child td { border-bottom: none; }

.quick-check {
  margin: var(--space-8) 0;
  padding: var(--space-6);
  border: 1px solid rgba(52, 211, 153, 0.2);
  border-radius: var(--radius-md);
  background: rgba(52, 211, 153, 0.04);
}
.quick-check-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-sm);
  color: #34d399;
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  margin-bottom: var(--space-4);
}
.qc-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3) 0;
  font-size: var(--text-sm);
  color: var(--text2);
  border-bottom: 1px solid rgba(52, 211, 153, 0.06);
  line-height: var(--leading-relaxed);
}
.qc-item:last-child { border-bottom: none; }
.qc-item em { color: var(--text); }
.qc-check {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(52, 211, 153, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
  border: none;
}
.qc-check::after {
  content: '\2713';
  font-size: 11px;
  color: #34d399;
  font-weight: 700;
  line-height: 1;
}

.alert-feed {
  margin: var(--space-8) 0;
  padding: var(--space-5);
  border: 1px solid rgba(192, 132, 252, 0.28);
  border-radius: var(--radius-lg);
  font-family: var(--font-mono);
  font-size: 12px;
  background: rgba(139, 92, 246, 0.05);
  box-shadow: 0 0 28px rgba(139, 92, 246, 0.1);
}
.alert-feed-title {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #c084fc;
  margin-bottom: var(--space-4);
}
.alert-line {
  display: flex;
  gap: var(--space-4);
  padding: var(--space-2) 0;
  border-bottom: 1px solid rgba(192, 132, 252, 0.1);
  align-items: center;
  color: var(--text2);
}
.alert-line:last-child { border-bottom: none; }
.alert-ts {
  color: #fbbf24;
  font-size: 11px;
  min-width: 60px;
  flex-shrink: 0;
}

.fp-card, .compare-grid, .decision-matrix { margin: var(--space-8) 0; }

/* chat-rail-anchor-20260715d */
