/* ==========================================================================
   group-chat — screen.css
   Ghost theme for conversation-archetype sites: WhatsApp-style chat
   rendered as a readable blog transcript.

   Conventions
   - Mobile-first, single breakpoint at 720px.
   - Logical CSS properties (inline-start/end) so html[dir=rtl] just works.
   - Neutral grays + ONE accent (Ghost accent color, green fallback).
   - Text contrast >= 4.5:1 on all backgrounds.
   - Rubik everywhere (fleet rule).
   ========================================================================== */

/* ---------- design tokens ---------- */
:root {
  --gc-font: "Rubik", "Segoe UI", system-ui, -apple-system, sans-serif;

  /* neutral grays */
  --gc-ink: #1f2430;          /* primary text — 14.8:1 on white */
  --gc-ink-soft: #4a5162;     /* secondary text — 7.4:1 on white */
  --gc-ink-mute: #3c4254;     /* meta text on gray bubbles — 7:1+ */
  --gc-line: #e3e6ec;         /* hairlines */
  --gc-bg: #f6f7f9;           /* page background */
  --gc-surface: #ffffff;      /* cards, header */
  --gc-bubble: #f0f2f5;       /* chat bubble */
  --gc-bubble-accent: #e7f6ec;/* accent-tinted bubble */
  --gc-chip: #eceef2;         /* chips */
  --gc-chip-ink: #2c3342;     /* chip text — 9:1 on --gc-chip */

  /* the single accent */
  --gc-accent: var(--ghost-accent-color, #16a34a);
  --gc-accent-ink: #146c3a;   /* accent for TEXT on white — 5.2:1 */
  --gc-accent-strong: #0f5a2e;/* accent button bg — 6.5:1 w/ white text */

  --gc-radius: 18px;
  --gc-radius-sm: 10px;
  --gc-shell: 720px;
  --gc-shadow: 0 1px 2px rgba(21, 26, 38, 0.06), 0 8px 24px rgba(21, 26, 38, 0.07);
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--gc-font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--gc-ink);
  background: var(--gc-bg);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img, video { max-width: 100%; height: auto; }

a { color: var(--gc-accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; }

:focus-visible {
  outline: 3px solid var(--gc-accent);
  outline-offset: 2px;
  border-radius: 4px;
}

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

.gc-skip-link {
  position: absolute;
  inset-inline-start: 1rem;
  top: -3rem;
  z-index: 100;
  padding: 0.5rem 1rem;
  background: var(--gc-surface);
  color: var(--gc-ink);
  border-radius: 0 0 var(--gc-radius-sm) var(--gc-radius-sm);
  box-shadow: var(--gc-shadow);
  transition: top 0.15s ease;
}
.gc-skip-link:focus { top: 0; }

.gc-shell {
  max-width: var(--gc-shell);
  margin-inline: auto;
  padding-inline: 16px;
}
.gc-shell--post { max-width: 760px; }

.gc-icon { width: 1.15em; height: 1.15em; fill: currentColor; flex: none; }

/* ---------- header ---------- */
.gc-site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--gc-line);
}
.gc-site-header .gc-shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 58px;
}
.gc-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: var(--gc-ink);
  font-weight: 600;
  font-size: 1.02rem;
}
.gc-brand:hover { text-decoration: none; }
.gc-brand__icon { border-radius: 9px; flex: none; }
.gc-brand__name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gc-nav {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.gc-nav::-webkit-scrollbar { display: none; }
.gc-nav__link {
  padding: 6px 12px;
  border-radius: 999px;
  color: var(--gc-ink-soft);
  font-size: 0.92rem;
  font-weight: 500;
  white-space: nowrap;
}
.gc-nav__link:hover { background: var(--gc-chip); color: var(--gc-ink); text-decoration: none; }
.gc-nav__link.is-current { background: var(--gc-bubble-accent); color: var(--gc-accent-strong); }

@media (max-width: 719px) {
  .gc-nav__link { padding: 5px 10px; font-size: 0.86rem; }
}

/* ---------- feed ---------- */
.gc-main { padding-block: 20px 48px; flex: 1 0 auto; }

.gc-feed__header { padding: 10px 4px 18px; }
.gc-feed__title {
  margin: 0 0 6px;
  font-size: 1.35rem;
  font-weight: 700;
}
.gc-feed__desc {
  margin: 0;
  color: var(--gc-ink-soft);
  font-size: 0.95rem;
}

/* --- conversation card --- */
.gc-card {
  background: var(--gc-surface);
  border: 1px solid var(--gc-line);
  border-radius: var(--gc-radius);
  box-shadow: var(--gc-shadow);
  margin-bottom: 14px;
  overflow: hidden;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.gc-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(21, 26, 38, 0.07), 0 14px 32px rgba(21, 26, 38, 0.1);
}
.gc-card__link {
  display: block;
  padding: 16px 18px;
  color: inherit;
}
.gc-card__link:hover { text-decoration: none; }

.gc-card__top {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.gc-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--gc-chip);
  color: var(--gc-chip-ink);
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.5;
}
.gc-chip--tag { background: var(--gc-bubble-accent); color: var(--gc-accent-strong); }
.gc-chip--group .gc-icon { width: 0.95em; height: 0.95em; }

.gc-card__title {
  margin: 0 0 8px;
  font-size: 1.08rem;
  line-height: 1.45;
  font-weight: 600;
}
.gc-card__link:hover .gc-card__title { color: var(--gc-accent-strong); }

.gc-card__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--gc-ink-soft);
  font-size: 0.83rem;
}
.gc-card__meta-sep { color: var(--gc-line); }
.gc-card__hint {
  color: var(--gc-accent-ink);
  font-weight: 500;
  margin-inline-start: auto;
}

.gc-card__excerpt {
  margin: 10px 0 0;
  color: var(--gc-ink-soft);
  font-size: 0.9rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---------- pagination (Ghost default markup) ---------- */
.pagination {
  display: flex;
  justify-content: center;
  gap: 18px;
  padding: 18px 0 6px;
  font-size: 0.92rem;
}
.pagination a { color: var(--gc-accent-ink); font-weight: 500; }
.pagination .page-number { color: var(--gc-ink-soft); }

/* ==========================================================================
   POST — the transcript page
   ========================================================================== */
.gc-post { padding-top: 6px; }

.gc-post__header { padding: 14px 2px 18px; }

.gc-post__tag {
  display: inline-block;
  margin-bottom: 10px;
  padding: 3px 12px;
  border-radius: 999px;
  background: var(--gc-bubble-accent);
  color: var(--gc-accent-strong);
  font-size: 0.8rem;
  font-weight: 600;
}

.gc-post__title {
  margin: 0 0 10px;
  font-size: 1.45rem;
  line-height: 1.35;
  font-weight: 700;
}
@media (min-width: 720px) {
  .gc-post__title { font-size: 1.7rem; }
}

.gc-post__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  color: var(--gc-ink-soft);
  font-size: 0.88rem;
}
.gc-post__meta-sep { color: var(--gc-line); }
.gc-post__excerpt {
  flex-basis: 100%;
  margin: 6px 0 0;
  color: var(--gc-ink-soft);
}

/* --- share row: all buttons visually equal (no default highlight) --- */
.gc-share {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}
.gc-share__btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border: 1px solid var(--gc-line);
  border-radius: 999px;
  background: var(--gc-surface);
  color: var(--gc-ink-soft);
  font-size: 0.86rem;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
}
.gc-share__btn:hover {
  background: var(--gc-chip);
  color: var(--gc-ink);
  text-decoration: none;
}

/* ==========================================================================
   TRANSCRIPT — server HTML: div.gc-msg blocks with dir="rtl"|"ltr"
   ========================================================================== */
.gc-transcript {
  background: var(--gc-surface);
  border: 1px solid var(--gc-line);
  border-radius: var(--gc-radius);
  box-shadow: var(--gc-shadow);
  padding: 18px 14px 22px;
}
@media (min-width: 720px) {
  .gc-transcript { padding: 26px 26px 30px; }
}

/* generic <hr> inside transcript: subtle divider */
.gc-transcript hr {
  border: none;
  margin: 22px auto 18px;
  max-width: 220px;
  height: 1px;
  background: var(--gc-line);
}

/* ---------- message block ----------
   REAL server contract (pipeline/chat_pipeline.py, committed 10e3c8c):
     <div class="gc-date">2026-10-05</div>                    ← day separator
     <div class="gc-msg" dir="rtl|ltr">                       ← one sender group
       <div class="gc-sender">Dana</div>
       <p>text…</p> <figure class="kg-card">…</figure>        ← wa_to_html frags
       <div class="gc-time">10:04</div>
       <div class="gc-reactions" aria-label="reactions">🔥2 ❤️1</div>
     </div>
     <div class="gc-noise">· +3 short messages</div>

   Layout: padded block + absolutely-positioned avatar in a PHYSICAL gutter
   keyed to the page direction (WhatsApp convention: every avatar hugs the
   thread edge regardless of each bubble's own dir). Note: inset-inline-start
   would follow each block's OWN dir — wrong here — so physical sides below. */
.gc-msg {
  position: relative;
  /* comfortable gap between sender-group blocks; stacked same-sender
     paragraphs inside one block keep tight spacing via the p+p rule (4px) */
  margin: 0 0 12px;
  max-width: 100%;
}
.gc-msg:last-child { margin-bottom: 0; }
html[dir="ltr"] .gc-msg { padding-left: 46px; }
html[dir="rtl"] .gc-msg { padding-right: 46px; }

/* avatar circle in the gutter — physical side follows the page dir */
.gc-msg::before {
  content: "";
  position: absolute;
  top: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ffffff'%3E%3Cpath d='M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z'/%3E%3C/svg%3E"),
    linear-gradient(135deg, #9aa3b2, #6b7280);
  background-size: 20px 20px, cover;
  background-position: center;
  background-repeat: no-repeat;
}
html[dir="ltr"] .gc-msg::before { left: 0; }
html[dir="rtl"] .gc-msg::before { right: 0; }

/* real initials avatar (chat-bubble partial / transcript.js) replaces dot */
.gc-avatar {
  position: absolute;
  top: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  overflow: hidden;
}
html[dir="ltr"] .gc-avatar { left: 0; }
html[dir="rtl"] .gc-avatar { right: 0; }
.gc-msg:has(> .gc-avatar)::before { display: none; }

/* sender name + per-message time from the pipeline */
.gc-msg .gc-sender {
  margin: 0 2px 3px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--gc-accent-ink);
}
.gc-msg .gc-time {
  margin: 3px 2px 0;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--gc-ink-soft);
  text-align: start;
  width: fit-content;
}

/* the bubbles: content paragraphs get bubble chrome */
.gc-msg > p {
  margin: 0 0 4px;
  padding: 9px 14px;
  border-radius: 4px var(--gc-radius) var(--gc-radius) var(--gc-radius);
  background: var(--gc-bubble);
  color: var(--gc-ink-mute);
  overflow-wrap: break-word;
  max-width: 75%;
  width: fit-content;
}
html[dir="rtl"] .gc-msg > p {
  border-radius: var(--gc-radius) 4px var(--gc-radius) var(--gc-radius);
}

/* stacked consecutive paragraphs look like one bubble split by a hairline */
.gc-msg > p + p {
  margin-top: -4px;
  border-start-start-radius: var(--gc-radius-sm);
}

/* bubble typography */
.gc-msg p { line-height: 1.55; }
.gc-msg a {
  word-break: break-word;
  overflow-wrap: anywhere;
  unicode-bidi: isolate;
  direction: ltr;
  display: inline-block;      /* URL breaks follow LTR order, read naturally */
  max-width: 100%;
}
.gc-msg code {
  background: rgba(21, 26, 38, 0.08);
  border-radius: 5px;
  padding: 1px 5px;
  font-size: 0.88em;
}

/* media inside messages (kg-cards from the pipeline) */
.gc-msg .kg-image-card,
.gc-msg .kg-gallery-card,
.gc-msg .kg-video-card,
.gc-msg figure {
  margin: 8px 0;
  max-width: 75%;
  width: fit-content;
  border-radius: var(--gc-radius-sm);
  overflow: hidden;
  background: var(--gc-chip);
}
.gc-msg img { display: block; max-width: 100%; }
.gc-msg .kg-gallery-container { display: grid; gap: 4px; }
.gc-msg .kg-gallery-row { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; }
.gc-msg .kg-video-container { position: relative; padding-top: 56.25%; }
.gc-msg .kg-video-container video { position: absolute; inset: 0; width: 100%; height: 100%; }
.gc-msg figcaption {
  padding: 6px 10px;
  font-size: 0.78rem;
  color: var(--gc-ink-soft);
}

/* per-message reaction chips (pipeline: <div class="gc-reactions">🔥2 ❤️1</div>).
   Emoji+count pairs are LTR runs — isolate them so they never invert inside
   an RTL bubble. Subtle pill container keeps ownership unambiguous. */
.gc-msg .gc-reactions {
  margin: 6px 2px 0;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--gc-bubble-accent);
  color: var(--gc-accent-strong);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.1em;       /* separate emoji+count pairs */
  width: fit-content;
  unicode-bidi: isolate;
  direction: ltr;
}

/* date separator between days */
.gc-transcript .gc-date {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 20px 0 14px;
  color: var(--gc-ink-soft);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.gc-transcript .gc-date::before,
.gc-transcript .gc-date::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--gc-line);
}

/* skipped-messages notice (pipeline: · +N short messages) — LTR content */
.gc-transcript .gc-noise {
  margin: 8px 0;
  color: var(--gc-ink-soft);
  font-size: 0.78rem;
  font-style: italic;
  unicode-bidi: isolate;
  direction: ltr;
  text-align: start;
}
html[dir="ltr"] .gc-transcript .gc-noise { padding-left: 46px; }
html[dir="rtl"] .gc-transcript .gc-noise { padding-right: 46px; }

/* ==========================================================================
   REACTIONS — pipeline emits per-message rows:
   <div class="gc-reactions" aria-label="reactions">🔥2 ❤️1</div>
   styled above via .gc-msg .gc-reactions; transcript.js fills the aria-label.
   Legacy blockquote form (old render.py) keeps a minimal accent callout.
   ========================================================================== */
.gc-transcript blockquote {
  margin: 14px 0 6px;
  padding: 6px 14px;
  border-inline-start: 3px solid var(--gc-accent);
  border-radius: var(--gc-radius-sm);
  background: var(--gc-bubble-accent);
  color: var(--gc-accent-strong);
  font-size: 0.88rem;
}

/* ---------- post footer ---------- */
.gc-post__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 18px 2px 0;
}

.gc-next-thread {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 18px;
  padding: 14px 16px;
  border: 1px solid var(--gc-line);
  border-radius: var(--gc-radius);
  background: var(--gc-surface);
  color: inherit;
  box-shadow: var(--gc-shadow);
}
.gc-next-thread:hover { text-decoration: none; border-color: var(--gc-accent); }
.gc-next-thread__label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gc-ink-soft);
}
.gc-next-thread__title { font-weight: 600; color: var(--gc-accent-ink); }

/* ---------- error page ---------- */
.gc-error {
  padding: 64px 8px 40px;
  text-align: center;
}
.gc-error__code {
  margin: 0;
  font-size: 4.5rem;
  font-weight: 700;
  line-height: 1;
  color: var(--gc-accent);
}
.gc-error__title { margin: 12px 0 6px; font-size: 1.3rem; }
.gc-error__text { margin: 0 0 22px; color: var(--gc-ink-soft); }
.gc-btn {
  display: inline-block;
  padding: 10px 22px;
  border-radius: 999px;
  background: var(--gc-accent-strong);
  color: #ffffff;
  font-weight: 600;
}
.gc-btn:hover { background: #0c4a26; color: #ffffff; text-decoration: none; }

/* ---------- footer ---------- */
.gc-site-footer {
  border-top: 1px solid var(--gc-line);
  background: var(--gc-surface);
  padding: 20px 0 26px;
}
.gc-footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin-bottom: 10px;
  font-size: 0.88rem;
}
.gc-footer-nav a { color: var(--gc-ink-soft); }
.gc-footer-meta {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--gc-ink-soft);
  font-size: 0.84rem;
}
.gc-footer-meta a { color: var(--gc-accent-ink); font-weight: 500; }

/* ---------- motion safety ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .gc-card { transition: none; }
}

/* ---------- print: transcript reads like a document ---------- */
@media print {
  .gc-site-header, .gc-share, .gc-site-footer, .gc-next-thread { display: none; }
  .gc-transcript { border: none; box-shadow: none; padding: 0; }
}

/* ==========================================================================
   HERO — site cover image with title overlay (index only)
   ========================================================================== */
.gc-hero {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: 240px;
  max-height: 380px;
  margin: 0 0 20px;
  overflow: hidden;
  background: var(--gc-accent-strong); /* flat fallback band color */
}
.gc-hero__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}
/* scrim keeps the title >= 4.5:1 over ANY cover image */
.gc-hero__scrim {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to top, rgba(10, 14, 8, 0.82) 0%, rgba(10, 14, 8, 0.55) 45%, rgba(10, 14, 8, 0.28) 100%),
    linear-gradient(to bottom, rgba(10, 14, 8, 0.35), rgba(10, 14, 8, 0) 30%);
}
.gc-hero__body {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: var(--gc-shell);
  margin-inline: auto;
  padding: 20px 16px 24px;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 14px;
}
.gc-hero__icon {
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.18);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}
.gc-hero__text { min-width: 0; }
.gc-hero__title {
  margin: 0 0 4px;
  font-size: 1.6rem;
  line-height: 1.25;
  font-weight: 700;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.4);
}
.gc-hero__desc {
  margin: 0;
  max-width: 56ch;
  color: rgba(255, 255, 255, 0.94); /* 4.6:1 over scrim bottom */
  font-size: 0.95rem;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}
@media (min-width: 720px) {
  .gc-hero { min-height: 280px; }
  .gc-hero__title { font-size: 2rem; }
  .gc-hero__body { padding: 28px 16px 30px; }
}

/* ==========================================================================
   SEARCH — header toggle button + Content API dialog (native-search off)
   ========================================================================== */
.gc-search-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 38px;
  height: 38px;
  border: 1px solid var(--gc-line);
  border-radius: 999px;
  background: var(--gc-surface);
  color: var(--gc-ink-soft);
  cursor: pointer;
}
.gc-search-toggle:hover { background: var(--gc-chip); color: var(--gc-ink); }
.gc-search-toggle .gc-icon { width: 18px; height: 18px; }

/* dialog */
.gc-search[hidden] { display: none; }
.gc-search {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 8vh 16px 16px;
}
.gc-search-open { overflow: hidden; }
.gc-search__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 20, 32, 0.55);
  backdrop-filter: blur(3px);
}
.gc-search__panel {
  position: relative;
  width: 100%;
  max-width: 560px;
  max-height: 76vh;
  display: flex;
  flex-direction: column;
  background: var(--gc-surface);
  border-radius: var(--gc-radius);
  box-shadow: 0 24px 64px rgba(10, 14, 24, 0.35);
  overflow: hidden;
}
.gc-search__form {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--gc-line);
}
.gc-search__form .gc-icon { width: 18px; height: 18px; color: var(--gc-ink-soft); flex: none; }
.gc-search__input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  font-family: inherit;
  font-size: 1.05rem;
  color: var(--gc-ink);
}
.gc-search__input::placeholder { color: #6a7284; }
.gc-search__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex: none;
  border: 1px solid var(--gc-line);
  border-radius: 999px;
  background: var(--gc-surface);
  color: var(--gc-ink-soft);
  cursor: pointer;
}
.gc-search__close:hover { background: var(--gc-chip); color: var(--gc-ink); }
.gc-search__close .gc-icon { width: 16px; height: 16px; }
.gc-search__results {
  overflow-y: auto;
  padding: 8px;
}
.gc-search__item {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 10px;
  padding: 10px 12px;
  border-radius: var(--gc-radius-sm);
  color: inherit;
}
.gc-search__item:hover { background: var(--gc-chip); text-decoration: none; }
.gc-search__item-title { font-weight: 600; font-size: 0.95rem; }
.gc-search__item-meta { color: var(--gc-ink-soft); font-size: 0.78rem; }
.gc-search__empty {
  margin: 0;
  padding: 18px 16px 22px;
  color: var(--gc-ink-soft);
  font-size: 0.92rem;
  text-align: center;
}

/* ==========================================================================
   TAGBAR — horizontal scrollable category chip bar (index + tag pages)
   ========================================================================== */
.gc-tagbar {
  display: flex;
  gap: 8px;
  margin: 0 -16px 16px; /* bleed to viewport edges on mobile */
  padding: 2px 16px 8px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
}
.gc-tagbar::-webkit-scrollbar { display: none; }
.gc-tagbar__chip {
  flex: none;
  scroll-snap-align: start;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--gc-line);
  background: var(--gc-surface);
  color: var(--gc-ink-soft);
  font-size: 0.85rem;
  font-weight: 500;
  white-space: nowrap;
}
.gc-tagbar__chip:hover { background: var(--gc-chip); color: var(--gc-ink); text-decoration: none; }
.gc-tagbar__chip.is-active {
  background: var(--gc-accent-strong);
  border-color: var(--gc-accent-strong);
  color: #ffffff;
}
@media (min-width: 720px) {
  .gc-tagbar { margin: 0 0 16px; }
}

/* ==========================================================================
   REACTIONS SUMMARY — pipeline aside at the top of the transcript
   <aside class="gc-reactions-summary"><span class="gc-rx-total">12</span>
     <span class="gc-rx-chip">🔥×5</span>…</aside>
   ========================================================================== */
.gc-reactions-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
  padding: 10px 14px;
  border: 1px solid var(--gc-line);
  border-radius: var(--gc-radius-sm);
  background: var(--gc-surface);
  box-shadow: var(--gc-shadow);
}
/* content direction (data-dir on transcript root or the aside's own dir) —
   chips flow from the content start edge */
.gc-reactions-summary .gc-rx-total {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--gc-accent-strong);
}
.gc-reactions-summary .gc-rx-total::before {
  content: "✦";
  font-size: 0.8em;
  opacity: 0.7;
}
.gc-reactions-summary .gc-rx-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--gc-chip);
  color: var(--gc-chip-ink);
  font-size: 0.82rem;
  font-weight: 500;
  /* emoji×count pairs are neutral/LTR runs — isolate so RTL never inverts */
  unicode-bidi: isolate;
  direction: ltr;
}
/* cap visible chips at 6 (JS hides the rest as a safety net) */
.gc-reactions-summary .gc-rx-chip:nth-child(n + 8) { display: none; }
/* n-th: total is child 1, chips start at 2 → chips 8+ are the 7th+ chip */

/* ==========================================================================
   TOC — thread overview card (post page, filled by transcript.js)
   ========================================================================== */
.gc-toc {
  margin: 0 0 16px;
  padding: 14px 16px;
  border: 1px solid var(--gc-line);
  border-radius: var(--gc-radius);
  background: var(--gc-surface);
  box-shadow: var(--gc-shadow);
}
.gc-toc[hidden] { display: none; }
.gc-toc__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 26px;
}
.gc-toc__stat {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 72px;
}
.gc-toc__stat-value {
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--gc-ink);
}
.gc-toc__stat-label {
  font-size: 0.72rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gc-ink-soft);
}
.gc-toc__days {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--gc-line);
}
.gc-toc__days[hidden] { display: none; }
.gc-toc__day {
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid var(--gc-line);
  background: var(--gc-surface);
  color: var(--gc-ink-soft);
  font-size: 0.78rem;
  font-weight: 500;
}
.gc-toc__day:hover {
  background: var(--gc-bubble-accent);
  border-color: var(--gc-accent);
  color: var(--gc-accent-strong);
  text-decoration: none;
}

/* ==========================================================================
   EXCERPT DIRECTION — alignment follows CONTENT language, not site locale.
   Pipeline contract: transcript root div carries data-dir="rtl|ltr"; theme
   re-uses it via [data-dir] + :dir() selectors so a Hebrew excerpt aligns
   right even on an English (LTR) site and vice versa.
   ========================================================================== */

/* post-card excerpt: server can't know content dir at listing time, so we
   start from the SITE dir and let a [data-dir] hint (pipeline sets it on the
   excerpt span, or transcript.js auto-detects) flip alignment per content
   language. Extra ancestor class = higher specificity than the html[dir]
   rules above, so content language always wins. */
.gc-card__excerpt { text-align: start; }
html[dir="rtl"] .gc-card__excerpt { text-align: right; }
html[dir="ltr"] .gc-card__excerpt { text-align: left; }
.gc-card .gc-card__excerpt[data-dir="rtl"] { text-align: right; }
.gc-card .gc-card__excerpt[data-dir="ltr"] { text-align: left; }

/* post-page excerpt sits inside .gc-post__meta whose dir follows the site;
   content-dir override via data-dir attribute (same contract) */
.gc-post__excerpt { text-align: start; }
html[dir="rtl"] .gc-post__excerpt { text-align: right; }
html[dir="ltr"] .gc-post__excerpt { text-align: left; }
.gc-post .gc-post__excerpt[data-dir="rtl"] { text-align: right; }
.gc-post .gc-post__excerpt[data-dir="ltr"] { text-align: left; }

/* transcript root data-dir governs ALL transcript content alignment when
   present (content language wins over site locale inside the transcript) */
.gc-transcript[data-dir="rtl"] { direction: rtl; }
.gc-transcript[data-dir="rtl"] .gc-noise { text-align: right; }
.gc-transcript[data-dir="ltr"] .gc-noise { text-align: left; }
/* day/date chips are digit runs — keep LTR ordering regardless */
.gc-transcript .gc-date { direction: ltr; }

