    :root {
      --display: "Libre Caslon Display", "Canela", "Canela Deck", "Iowan Old Style", "Baskerville", "Times New Roman", serif;
      --ink: #111827;
      --muted: #6b6b6b;
      --hairline: rgba(17, 24, 39, 0.08);
      --panel: #ffffff;
      --panel-soft: #fafafa;
      --accent: #111827;
    }

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

    html, body {
      font-family: "Inter", sans-serif;
      background: #ffffff;
      color: var(--ink);
      min-height: 100vh;
    }

    body { position: relative; }

    #qava-dot-base-fixed {
      position: fixed;
      inset: 0;
      pointer-events: none;
      z-index: 0;
      background-image: radial-gradient(circle, rgba(17, 24, 39, 0.16) 1px, transparent 1.35px);
      background-size: 20px 20px;
      background-repeat: repeat;
    }

    /* App shell embed (app.qava.ai/community iframe) — no mini nav.
       Keep the page transparent so the parent shell’s dotted bg shows in the
       side margins; those margins are inside this document so wheel-scroll
       still moves the chat. */
    html.community-embed,
    html.community-embed body,
    body.embed-app {
      background: transparent;
    }
    body.embed-app .header-container,
    html.community-embed .header-container {
      display: none !important;
    }
    body.embed-app #qava-dot-base-fixed,
    html.community-embed #qava-dot-base-fixed {
      display: block !important;
    }
    body.embed-app .chat-page,
    body.embed-app .thread-page,
    body.embed-app .profile-page,
    html.community-embed .chat-page,
    html.community-embed .thread-page,
    html.community-embed .profile-page {
      padding-top: 16px;
    }

    body > *:not(#qava-dot-base-fixed):not(#mentionDropdown):not(#mentionInviteToast):not(#reportModal):not(#communityAuthModal):not(.community-toast) { position: relative; z-index: 1; }

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

    /* Prototype chrome */
    .proto-bar {
      position: sticky;
      top: 0;
      z-index: 2000;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 16px;
      padding: 10px 20px;
      background: #111827;
      color: #fff;
      font-size: 13px;
    }

    .proto-bar strong { font-weight: 500; }

    .proto-tabs {
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
    }

    .proto-tab {
      border: 1px solid rgba(255,255,255,0.22);
      background: transparent;
      color: #fff;
      border-radius: 999px;
      padding: 6px 14px;
      font: inherit;
      font-size: 12px;
      cursor: pointer;
    }

    .proto-tab.is-active {
      background: #fff;
      color: #111827;
      border-color: #fff;
    }

    .proto-toggle {
      display: flex;
      align-items: center;
      gap: 8px;
      font-size: 12px;
      color: rgba(255,255,255,0.85);
    }

    .proto-toggle input { accent-color: #fff; }

    /* Navbar */
    .header-container {
      width: calc(100% - 22px);
      margin: 0 auto;
      padding: 8px 20px;
      display: flex;
      justify-content: space-between;
      align-items: center;
      min-height: 58px;
      position: sticky;
      top: 42px;
      z-index: 1200;
      background: rgba(255, 255, 255, 0.24);
      backdrop-filter: blur(18px) saturate(150%);
      isolation: isolate;
    }

    .header-container::before {
      content: "";
      position: absolute;
      left: 6px; right: 6px; top: 3px; bottom: 3px;
      border-radius: 12px;
      background: linear-gradient(180deg, rgba(255,255,255,0.62) 0%, rgba(255,255,255,0.5) 55%, rgba(255,255,255,0.44) 100%);
      backdrop-filter: blur(26px) saturate(165%);
      box-shadow: 0 10px 24px rgba(17, 24, 39, 0.08), inset 0 1px 0 rgba(255,255,255,0.7);
      z-index: 0;
      pointer-events: none;
    }

    .header-container > * { position: relative; z-index: 1; }

    .header-logo img { display: block; width: 24px; height: 24px; border-radius: 6px; }

    .header-center { display: flex; flex: 1; margin-left: 40px; }

    .navigation { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

    .nav-item .nav-text {
      font-size: 14px;
      font-weight: 300;
      color: #6b6b6b;
      padding: 0 4px;
      white-space: nowrap;
    }

    .nav-item:hover .nav-text,
    .nav-item.is-active .nav-text { color: #000; }

    .header-right { display: flex; align-items: center; gap: 8px; }

    /* Match templates.html: Premium + Get Started share an auth-section cluster.
       qava-landing.css sets .header-container .auth-section { gap: 28px }. */
    .auth-section {
      display: flex;
      align-items: center;
      gap: 8px;
    }

    .join-button {
      padding: 6px 12px;
      background: #2b2b2b;
      border: 1px solid #2b2b2b;
      border-radius: 6px;
      color: #fff;
      font-size: 13px;
      font-weight: 400;
      text-decoration: none;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      white-space: nowrap;
    }
    .join-button .join-text {
      color: #fff;
      font-family: "Inter", sans-serif;
      font-size: 13px;
      font-weight: 400;
      line-height: 1.2;
      white-space: nowrap;
    }

    /* Match templates Premium control: Inter 300, grey → black on hover. */
    .qava-premium-nav-btn {
      padding: 0;
      border: none;
      background: transparent;
      cursor: pointer;
      transition: color 0.2s ease;
      font-family: "Inter", sans-serif;
      font-size: 14px;
      font-weight: 300;
      color: #6b6b6b;
      white-space: nowrap;
      display: inline-flex;
      align-items: center;
      gap: 6px;
      text-decoration: none;
      line-height: 1.4;
    }
    .qava-premium-nav-btn .nav-text {
      color: inherit;
      font-family: "Inter", sans-serif;
      font-size: 14px;
      font-weight: 300;
      line-height: 1.4;
      padding: 0 4px;
    }
    .qava-premium-nav-btn:hover,
    .qava-premium-nav-btn:hover .nav-text,
    .qava-premium-nav-btn:focus-visible,
    .qava-premium-nav-btn:focus-visible .nav-text {
      color: #000;
      background: transparent;
    }
    .qava-premium-nav-icon {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 15px;
      height: 15px;
      flex-shrink: 0;
      margin-top: -1px;
    }
    .qava-premium-nav-icon svg { width: 15px; height: 15px; display: block; }

    /* Views */
    .view { display: none; }
    .view.is-active { display: block; }

    /* Landing hero (from qava.ai homepage) */
    .feature-cards-section {
      background: transparent;
      padding: 56px 0 8px;
    }

    .feature-cards-container {
      max-width: 900px;
      margin: 0 auto;
      padding: 0 32px;
    }

    .hero-content {
      text-align: center;
      max-width: 980px;
      margin: 0 auto;
    }

    .matching-cta-buttons {
      display: flex;
      gap: 12px;
      justify-content: center;
      align-items: center;
      padding-top: 8px;
      flex-wrap: wrap;
    }

    .cta-button {
      font-size: 13px;
      font-weight: 500;
      padding: 4px 12px;
      border-radius: 6px;
      text-decoration: none;
      display: inline-flex;
      align-items: center;
      gap: 6px;
    }

    .cta-button-primary {
      background: #ecf2ff;
      color: #1163fe;
      border: 1px solid #ecf2ff;
    }

    .cta-button-secondary {
      background: transparent;
      color: #111827;
      font-weight: 300;
    }

    #qava-ai-toolset-cta {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      font-size: 13px;
      font-weight: 400;
      color: #111827;
      text-decoration: none;
      padding: 4px 12px;
      border-radius: 6px;
    }

    .landing-howitworks-wrap {
      width: min(1040px, calc(100vw - 120px));
      margin: 84px auto 120px;
    }

    .qava-hiw-step-visual.is-placeholder {
      min-height: 280px;
      background: #f9fafb;
      border: 1px dashed rgba(17, 24, 39, 0.1);
      border-radius: 10px;
      display: grid;
      place-items: center;
      color: #9ca3af;
      font-size: 13px;
      font-weight: 300;
    }

    /* Landing preview section */
    .landing-section {
      width: min(1040px, calc(100vw - 120px));
      margin: 52px auto 0;
      text-align: center;
      position: relative;
    }

    .landing-section-head {
      margin-bottom: 0;
      text-align: center;
    }

    .landing-kicker {
      font-size: 10px;
      font-weight: 600;
      letter-spacing: 0.12em;
      text-transform: uppercase;
      color: #6b6b6b;
      margin-bottom: 4px;
    }

    .landing-title {
      font-family: var(--display);
      font-size: clamp(26px, 2.6vw, 36px);
      font-weight: 400;
      letter-spacing: -0.012em;
      line-height: 1.05;
      margin-bottom: 4px;
    }

    .landing-sub {
      font-size: 13px;
      font-weight: 300;
      color: #6b6b6b;
      line-height: 1.35;
      margin-bottom: 12px;
      max-width: 480px;
      margin-left: auto;
      margin-right: auto;
    }

    .landing-thread-wrap {
      position: relative;
      width: min(680px, 100%);
      margin: 0 auto;
    }

    .landing-thread-wrap .landing-thread-controls {
      position: absolute;
      top: -34px;
      right: 0;
      z-index: 5;
      display: flex;
      align-items: center;
      gap: 6px;
    }

    .landing-thread-wrap .thread-display-menu-slot {
      position: static;
    }

    .landing-opener-nav {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 28px;
      height: 28px;
      border: 1px solid rgba(17, 24, 39, 0.08);
      background: rgba(255, 255, 255, 0.72);
      border-radius: 7px;
      color: #9ca3af;
      cursor: pointer;
      transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
    }

    .landing-opener-nav:hover,
    .landing-opener-nav.is-active {
      color: #4b5563;
      border-color: rgba(17, 24, 39, 0.14);
      background: #fff;
    }

    .landing-opener-nav svg {
      width: 15px;
      height: 15px;
    }

    .landing-thread-shell {
      width: 100%;
      margin: 0;
      border: 1px solid var(--hairline);
      border-radius: 8px;
      background: #ffffff;
      box-shadow: 0 12px 32px rgba(17,24,39,0.05);
      overflow: hidden;
      text-align: left;
      transition: box-shadow 0.22s ease;
      cursor: pointer;
      position: relative;
    }

    .landing-thread-shell:hover {
      box-shadow: 0 14px 36px rgba(17,24,39,0.07);
    }

    @keyframes threadSeqIn {
      from {
        opacity: 0;
        transform: translateY(6px);
      }
      to {
        opacity: 1;
        transform: translateY(0);
      }
    }

    @keyframes threadReplyIn {
      from {
        opacity: 0;
        transform: translateX(var(--seq-x, 56px));
      }
      to {
        opacity: 1;
        transform: translateX(0);
      }
    }

    @keyframes threadSeqPop {
      from {
        opacity: 0;
        transform: scale(0.88);
      }
      to {
        opacity: 1;
        transform: scale(1);
      }
    }

    @media (prefers-reduced-motion: no-preference) {
      .landing-thread-shell[data-thread-anim-pending="1"]:not(.is-live-done) .thread-seq-hidden {
        display: none !important;
      }

      .landing-thread-shell.is-live-pending .thread-seq-hidden {
        display: none !important;
      }

      .thread-seq-reveal {
        animation: threadSeqIn 0.38s cubic-bezier(0.22, 1, 0.36, 1) both;
      }

      .thread-seq-reply.thread-seq-reveal {
        animation-name: threadReplyIn;
        animation-duration: 0.52s;
        animation-delay: var(--seq-delay, 0ms);
        animation-timing-function: cubic-bezier(0.33, 1, 0.68, 1);
      }

      .thread-seq-pop {
        animation: threadSeqPop 0.28s cubic-bezier(0.22, 1, 0.36, 1) both;
      }

      .landing-thread-shell.is-live-pending .landing-opener-carousel .thread-seq-hidden {
        opacity: 0;
      }

      .landing-thread-shell.is-carousel-revealing .landing-opener-slide.is-seq-active .thread-replies-wrap > .reply.thread-seq-hidden,
      .landing-thread-shell.is-carousel-revealing .landing-opener-slide.is-seq-active .reply-more.thread-seq-hidden {
        display: none !important;
      }

      .landing-thread-shell.is-live-done .landing-opener-slide .thread-post {
        opacity: 1;
        transform: none;
      }
    }

    .landing-thread-scroll {
      position: relative;
      padding: 14px 16px 0;
      overflow: hidden;
      background: #fff;
    }

    .landing-thread-scroll::after {
      content: '';
      position: absolute;
      left: 0;
      right: 0;
      bottom: 0;
      height: 72px;
      background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.88) 52%, #fff 100%);
      pointer-events: none;
      z-index: 1;
      opacity: 0;
      transition: opacity 0.22s ease;
    }

    .landing-thread-scroll.is-bottom-faded::after {
      opacity: 1;
    }

    .landing-thread-pause-indicator {
      position: absolute;
      right: 12px;
      bottom: 8px;
      z-index: 2;
      display: flex;
      align-items: center;
      justify-content: center;
      width: 20px;
      height: 20px;
      color: #9ca3af;
      opacity: 0;
      pointer-events: none;
      transition: opacity 0.15s ease;
    }

    .landing-thread-pause-indicator svg {
      width: 14px;
      height: 14px;
    }

    .landing-thread-shell.is-carousel-paused .landing-thread-pause-indicator {
      opacity: 1;
    }

    body.pref-thread-compact .landing-thread-scroll {
      --landing-compact-height: 248px;
      height: var(--landing-compact-height);
    }

    body.pref-thread-compact .landing-opener-carousel,
    body.pref-thread-compact .landing-opener-track {
      height: 100%;
    }

    body.pref-thread-compact .landing-opener-slide {
      height: 100%;
      min-height: 100%;
      background: #fff;
    }

    body.pref-thread-compact .landing-opener-slide .thread-post {
      flex: 1;
      min-height: 0;
      overflow: hidden;
    }

    body.pref-thread-compact .landing-opener-slide .thread-body {
      overflow: hidden;
    }

    body.pref-thread-compact .landing-opener-slide .attach-chips {
      margin-top: 8px;
      margin-bottom: 0;
    }

    body.pref-thread-compact .landing-opener-slide .thread-replies-toggle {
      flex: 0 0 auto;
      margin-top: auto;
      padding: 4px 0 12px;
      text-align: left;
      background: #fff;
      border: 0;
      -webkit-appearance: none;
      appearance: none;
    }

    .landing-section .thread-replies-toggle {
      background: #fff;
      border: 0;
      -webkit-appearance: none;
      appearance: none;
    }

    .landing-section .thread-replies-toggle:hover {
      background: #fff;
    }

    body:not(.pref-thread-compact) .landing-thread-scroll {
      --landing-expanded-height: 500px;
      height: var(--landing-expanded-height);
    }

    body:not(.pref-thread-compact) .landing-section .reply-more {
      display: none;
    }

    body:not(.pref-thread-compact) .landing-opener-carousel,
    body:not(.pref-thread-compact) .landing-opener-track {
      height: 100%;
    }

    body:not(.pref-thread-compact) .landing-opener-slide {
      min-height: 100%;
    }

    .landing-section .thread-post {
      padding-bottom: 0;
      margin-bottom: 0;
      border-bottom: 0;
    }

    .thread-detail .thread-post {
      padding-bottom: 14px;
      margin-bottom: 0;
      border-bottom: 0;
    }

    .landing-section .thread-meta,
    .thread-detail .thread-meta {
      gap: 8px;
      margin-bottom: 8px;
    }

    .landing-section .thread-meta .avatar,
    .thread-detail .thread-meta .avatar {
      width: 26px;
      height: 26px;
      font-size: 11px;
    }

    .landing-section .meta-top,
    .thread-detail .meta-top {
      font-size: 11px;
      line-height: 1.3;
    }

    .landing-section .meta-sub,
    .thread-detail .meta-sub {
      font-size: 10px;
      margin-top: 1px;
    }

    .landing-section .thread-tags,
    .thread-detail .thread-tags {
      display: flex;
      gap: 5px;
      flex-wrap: wrap;
      margin-left: auto;
      align-items: flex-start;
    }

    .landing-section .thread-tag,
    .thread-detail .thread-tag {
      font-size: 9px;
      font-weight: 500;
      letter-spacing: 0.06em;
      text-transform: uppercase;
      color: #fff;
      background: #111827;
      border-radius: 4px;
      padding: 3px 8px;
      white-space: nowrap;
    }

    .landing-section .attach-chips,
    .thread-detail .attach-chips {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
      margin-top: 8px;
      margin-bottom: 0;
      max-width: 100%;
    }

    .thread-detail .thread-post .attach-chips {
      margin-bottom: 12px;
    }

    .landing-section .meta-top,
    .landing-section .reply-meta,
    .thread-detail .meta-top,
    .thread-detail .reply-meta {
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      max-width: 100%;
    }

    .landing-opener-carousel {
      overflow: hidden;
    }

    .landing-opener-track {
      display: flex;
      transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
      will-change: transform;
    }

    .landing-opener-track.is-loop-resetting {
      transition: none;
    }

    .landing-opener-slide {
      flex: 0 0 100%;
      width: 100%;
      min-width: 100%;
      display: flex;
      flex-direction: column;
    }

    .landing-opener-slide[data-open-chat] {
      cursor: pointer;
    }

    @media (prefers-reduced-motion: reduce) {
      .landing-opener-track {
        transition: none;
      }
    }

    .landing-section .attach-chip,
    .thread-detail .attach-chip {
      display: inline-flex;
      align-items: center;
      gap: 5px;
      font-size: 10px;
      font-weight: 400;
      color: #374151;
      background: #f9fafb;
      border: 1px solid rgba(17, 24, 39, 0.08);
      border-radius: 5px;
      padding: 4px 8px;
    }

    .landing-section .attach-chip svg,
    .thread-detail .attach-chip svg {
      width: 11px;
      height: 11px;
      color: #6b7280;
      flex-shrink: 0;
    }

    .landing-section .thread-title,
    .thread-detail .thread-title {
      font-family: var(--display);
      font-size: 17px;
      font-weight: 400;
      line-height: 1.2;
      letter-spacing: -0.01em;
      margin-top: 4px;
      margin-bottom: 6px;
    }

    .landing-section .thread-body,
    .thread-detail .thread-body {
      font-size: 12px;
      line-height: 1.5;
    }

    .landing-section .thread-body ul,
    .thread-detail .thread-body ul {
      margin: 6px 0 0 16px;
    }

    .landing-section .thread-body li,
    .thread-detail .thread-body li {
      margin-bottom: 4px;
    }

    .landing-section .thread-body p + p,
    .thread-detail .thread-body p + p { margin-top: 6px; }

    .landing-section .thread-stats {
      gap: 10px;
      margin-top: 8px;
      font-size: 10px;
    }

    .landing-section .reply,
    .thread-detail .reply,
    .feed-item .reply {
      gap: 12px;
      padding: 10px 8px 5px 6px;
      border-top: 1px solid rgba(17,24,39,0.06);
      border-left: 2px solid transparent;
      transition: border-color 0.18s ease, background 0.18s ease;
    }

    .landing-section .reply > div:not(.avatar),
    .thread-detail .reply > div:not(.avatar),
    .feed-item .reply > div:not(.avatar) {
      min-width: 0;
      padding-right: 2px;
    }

    .landing-section .reply:hover,
    .thread-detail .reply:hover,
    .feed-item .reply:hover {
      border-left-color: transparent;
      background: rgba(17, 24, 39, 0.015);
    }

    .landing-section .reply-more,
    .thread-detail .reply-more,
    .feed-replies-more {
      display: flex;
      align-items: center;
      margin: 0;
      padding: 9px 8px 9px 6px;
      font-size: 10px;
      font-weight: 400;
      line-height: 1.2;
      color: #6b7280;
      border-top: 1px solid rgba(17,24,39,0.06);
      border-bottom: 1px solid rgba(17,24,39,0.06);
    }

    .landing-section .reply .attach-chips,
    .thread-detail .reply .attach-chips {
      margin-top: 4px;
      margin-bottom: 6px;
    }

    .landing-section .reply .avatar,
    .thread-detail .reply .avatar,
    .feed-item .reply .avatar {
      width: 22px;
      height: 22px;
      font-size: 9px;
    }

    .landing-section .reply-meta,
    .thread-detail .reply-meta,
    .feed-item .reply-meta {
      font-size: 10px;
      margin-bottom: 2px;
    }

    .landing-section .reply-body,
    .thread-detail .reply-body,
    .feed-item .reply-body {
      margin-top: 8px;
      font-size: 12px;
      line-height: 1.45;
    }

    .landing-section .reply-body ul,
    .thread-detail .reply-body ul,
    .feed-item .reply-body ul {
      margin: 4px 0 0 16px;
    }

    .landing-section .reply-body li,
    .thread-detail .reply-body li,
    .feed-item .reply-body li {
      margin-bottom: 3px;
    }

    .landing-section .reply-body p,
    .thread-detail .reply-body p,
    .feed-item .reply-body p {
      margin: 0;
    }

    .landing-section .reply-body p + p,
    .landing-section .reply-body p + ul,
    .thread-detail .reply-body p + p,
    .thread-detail .reply-body p + ul,
    .feed-item .reply-body p + p,
    .feed-item .reply-body p + ul {
      margin-top: 10px;
    }

    .landing-section .reply-body a,
    .thread-detail .reply-body a,
    .thread-detail .thread-body a,
    .feed-item .reply-body a {
      color: #2563eb;
      text-decoration: underline;
      text-underline-offset: 2px;
    }

    #view-thread .thread-replies-wrap {
      display: block !important;
    }

    #view-thread .thread-replies-toggle {
      display: none;
    }

    #view-thread .reply-more {
      display: none !important;
    }

    .reply-mention {
      font-weight: 500;
      color: #111827;
      background: rgba(17, 24, 39, 0.06);
      border-radius: 3px;
      padding: 0 2px;
      white-space: nowrap;
    }

    .reply-mention:not(.is-external) {
      cursor: pointer;
    }

    .reply-mention:not(.is-external):hover {
      background: rgba(17, 24, 39, 0.1);
    }

    .landing-section .reply-time,
    .thread-detail .reply-time,
    .feed-item .reply-time {
      font-size: 10px;
      font-weight: 300;
      color: #9ca3af;
      white-space: nowrap;
    }

    .reply-heart {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      margin-top: 4px;
      padding: 0;
      border: 0;
      background: transparent;
      font-size: 10px;
      font-weight: 400;
      line-height: 1;
      color: #9ca3af;
      cursor: pointer;
    }

    .reply-heart svg {
      width: 12px;
      height: 12px;
      stroke: #9ca3af;
      fill: none;
      flex-shrink: 0;
      display: block;
    }

    .reply-heart span {
      display: block;
      line-height: 1;
    }

    .landing-section .reply-heart,
    .thread-detail .reply-heart,
    .feed-item .reply-heart {
      margin-top: 3px;
    }

    .reply-actions-row .reply-heart,
    .thread-op-actions .reply-heart {
      margin-top: 0;
      font-size: 10px;
      line-height: 1;
      color: #6b7280;
    }

    .reply-heart.is-active {
      color: #111827;
    }

    .reply-heart.is-active svg {
      stroke: #111827;
      fill: #111827;
    }

    .landing-section .reply-highlight,
    .thread-detail .reply-highlight {
      display: block;
      margin: 0 0 4px;
      padding: 0;
      border: 0;
      font: inherit;
      color: inherit;
    }

    .landing-section .thread-premium-bar {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
      margin-top: 0;
      padding: 9px 14px;
      border-top: 0;
      background: #fff;
      font-size: 10px;
      font-weight: 300;
      color: #6b7280;
    }

    body.pref-thread-compact .thread-replies-wrap:not(.is-collapsed) {
      border-bottom: 1px solid var(--hairline);
    }

    .landing-section .thread-premium-bar svg {
      width: 11px;
      height: 11px;
      color: #9ca3af;
      flex-shrink: 0;
    }

    .landing-section .thread-premium-bar strong {
      font-weight: 500;
      color: #4b5563;
    }

    .landing-cta-row {
      display: flex;
      justify-content: center;
      gap: 10px;
      margin-top: 16px;
      flex-wrap: wrap;
    }

    .landing-cta-row .btn {
      border-radius: 6px;
    }

    .landing-cta-row .btn-ghost {
      background: #ffffff;
    }

    .landing-cta-row .btn-ghost:hover {
      background: #ffffff;
      border-color: rgba(17,24,39,0.28);
    }

    .btn {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      padding: 8px 14px;
      border-radius: 8px;
      font-size: 13px;
      font-weight: 400;
      cursor: pointer;
      border: 1px solid transparent;
      transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
    }

    .btn-primary {
      background: #2b2b2b;
      color: #fff;
      border-color: #2b2b2b;
    }

    .btn-primary:hover { background: #000; border-color: #000; }

    .btn-ghost {
      background: transparent;
      color: #111827;
      border-color: rgba(17,24,39,0.14);
    }

    .btn-ghost:hover { border-color: rgba(17,24,39,0.28); }

    .thread-page-bar .back-chat-link {
      margin-bottom: 0;
    }

    .back-chat-link {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      margin-bottom: 18px;
      padding: 0;
      border: 0;
      background: none;
      font: inherit;
      font-size: 13px;
      font-weight: 400;
      color: #6b7280;
      cursor: pointer;
      transition: color 0.18s ease;
    }

    .back-chat-link:hover {
      color: #111827;
    }

    /* Thread components */
    .thread-post {
      padding-bottom: 18px;
      margin-bottom: 18px;
      border-bottom: 1px solid var(--hairline);
    }

    .thread-meta {
      display: flex;
      align-items: center;
      gap: 10px;
      margin-bottom: 12px;
    }

    .avatar {
      width: 34px;
      height: 34px;
      border-radius: 50%;
      background: #e8e8e8;
      flex-shrink: 0;
      display: grid;
      place-items: center;
      font-family: var(--display);
      font-size: 13px;
      font-weight: 400;
      color: #111827;
      letter-spacing: -0.01em;
    }

    .meta-lines { min-width: 0; }

    .meta-top {
      font-size: 12px;
      font-weight: 400;
      color: #4b5563;
      line-height: 1.35;
    }

    .meta-top strong { font-weight: 500; color: #111827; }

    .meta-sub {
      font-size: 11px;
      font-weight: 300;
      color: #9ca3af;
      margin-top: 2px;
    }

    .thread-title {
      font-family: var(--display);
      font-size: 22px;
      line-height: 1.2;
      letter-spacing: -0.01em;
      margin-bottom: 10px;
    }

    .thread-body {
      font-size: 15px;
      line-height: 1.65;
      font-weight: 300;
      color: #2e2e2e;
    }

    .thread-body p + p { margin-top: 10px; }

    .thread-body ul {
      margin: 10px 0 0 18px;
    }

    .thread-body li { margin-bottom: 6px; }

    .thread-body a {
      color: #111827;
      text-decoration: underline;
      text-underline-offset: 2px;
    }

    .thread-stats {
      display: flex;
      gap: 14px;
      margin-top: 14px;
      font-size: 12px;
      color: #6b7280;
      font-weight: 300;
    }

    .reply {
      display: flex;
      gap: 10px;
      padding: 14px 0;
      border-top: 1px solid rgba(17,24,39,0.06);
    }

    .reply .avatar { width: 28px; height: 28px; font-size: 11px; }

    .reply-body {
      flex: 1;
      min-width: 0;
      font-size: 14px;
      line-height: 1.6;
      font-weight: 300;
      color: #2e2e2e;
    }

    .reply-meta {
      font-size: 11px;
      color: #9ca3af;
      margin-bottom: 4px;
    }

    .reply-meta strong { color: #4b5563; font-weight: 500; }

    /* Chat page */
    .chat-page {
      width: min(680px, 100%);
      margin: 48px auto 100px;
    }

    .chat-head {
      margin-bottom: 20px;
    }

    .chat-head-row {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 12px;
    }

    .thread-page-bar {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      margin-bottom: 18px;
    }

    .thread-display-menu {
      position: relative;
      flex-shrink: 0;
    }

    .thread-display-trigger {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 28px;
      height: 28px;
      border: 1px solid rgba(17, 24, 39, 0.08);
      background: rgba(255, 255, 255, 0.72);
      border-radius: 7px;
      color: #9ca3af;
      cursor: pointer;
      transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
    }

    .thread-display-trigger:hover,
    .thread-display-trigger[aria-expanded="true"] {
      color: #4b5563;
      border-color: rgba(17, 24, 39, 0.14);
      background: #fff;
    }

    .thread-display-trigger svg {
      width: 15px;
      height: 15px;
    }

    .thread-display-panel {
      position: absolute;
      top: calc(100% + 6px);
      right: 0;
      min-width: 214px;
      padding: 4px;
      border: 1px solid rgba(17, 24, 39, 0.1);
      border-radius: 10px;
      background: #fff;
      box-shadow: 0 10px 28px rgba(17, 24, 39, 0.1);
      z-index: 3000;
    }

    /* In the composer toolbar: match the formatting buttons and open rightward,
       overlaying content (the composer-card doesn't clip like the feed-card). */
    .toolbar .thread-display-menu { display: inline-flex; }
    .toolbar .thread-display-trigger {
      width: 28px;
      height: 28px;
      border-radius: 6px;
      border: 1px solid rgba(17, 24, 39, 0.08);
      background: #fff;
      color: #6b7280;
    }
    .toolbar .thread-display-trigger svg { width: 14px; height: 14px; }
    .toolbar .thread-display-trigger:hover,
    .toolbar .thread-display-trigger[aria-expanded="true"] {
      color: #111827;
      border-color: rgba(17, 24, 39, 0.16);
      background: #fafafa;
    }
    .toolbar .thread-display-panel {
      left: 0;
      right: auto;
    }

    .thread-display-option {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      padding: 8px 10px;
      border-radius: 7px;
      cursor: pointer;
      user-select: none;
    }

    .thread-display-option:hover {
      background: rgba(17, 24, 39, 0.035);
    }

    .thread-display-option-label {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      font-size: 13px;
      font-weight: 400;
      color: #374151;
      line-height: 1.2;
    }

    .thread-display-option-label svg {
      width: 15px;
      height: 15px;
      color: #6b7280;
      flex-shrink: 0;
    }

    .thread-display-option input {
      position: absolute;
      opacity: 0;
      pointer-events: none;
    }

    .toggle-switch {
      width: 36px;
      height: 20px;
      border-radius: 999px;
      background: #e5e7eb;
      position: relative;
      flex-shrink: 0;
      transition: background 0.15s ease;
    }

    .toggle-switch::after {
      content: '';
      position: absolute;
      top: 2px;
      left: 2px;
      width: 16px;
      height: 16px;
      border-radius: 50%;
      background: #fff;
      box-shadow: 0 1px 2px rgba(17, 24, 39, 0.18);
      transition: transform 0.15s ease;
    }

    .thread-display-option input:checked + .toggle-switch {
      background: #111827;
    }

    .thread-display-option input:checked + .toggle-switch::after {
      transform: translateX(16px);
    }

    .thread-replies-toggle {
      display: block;
      width: 100%;
      margin: 0;
      padding: 10px 10px;
      border: 0;
      background: transparent;
      font: inherit;
      font-size: 12px;
      font-weight: 400;
      color: #6b7280;
      text-align: left;
      cursor: pointer;
      transition: color 0.15s ease, background 0.15s ease;
    }

    .thread-replies-toggle:hover {
      color: #111827;
      background: transparent;
    }

    body.pref-thread-compact .thread-replies-wrap.is-collapsed {
      display: none;
    }

    body:not(.pref-thread-compact) .thread-replies-wrap {
      display: block;
    }

    .landing-opener-slide .thread-replies-toggle {
      flex: 0 0 auto;
      margin: 10px 0 0;
    }

    body.pref-thread-small-text .thread-detail .thread-title,
    body.pref-thread-small-text .landing-section .thread-title,
    body.pref-thread-small-text .feed-item h3,
    body.pref-thread-small-text .feed-opener h3 {
      font-size: 15px;
    }

    body.pref-thread-small-text .thread-detail .thread-body,
    body.pref-thread-small-text .thread-detail .reply-body,
    body.pref-thread-small-text .landing-section .thread-body,
    body.pref-thread-small-text .landing-section .reply-body,
    body.pref-thread-small-text .feed-excerpt,
    body.pref-thread-small-text .thread-detail .meta-top,
    body.pref-thread-small-text .thread-detail .reply-meta,
    body.pref-thread-small-text .landing-section .meta-top,
    body.pref-thread-small-text .landing-section .reply-meta {
      font-size: 11px;
    }

    body.pref-thread-full-width .chat-page {
      width: min(960px, calc(100vw - 48px));
    }

    body.pref-thread-full-width .landing-section {
      width: min(1200px, calc(100vw - 48px));
    }

    body.pref-thread-full-width .landing-thread-wrap {
      width: min(960px, 100%);
    }

    body.pref-thread-full-width .landing-thread-shell {
      width: 100%;
    }

    .chat-head h1 {
      font-family: var(--display);
      font-size: clamp(28px, 3.2vw, 36px);
      font-weight: 400;
      letter-spacing: -0.02em;
      line-height: 1.05;
      margin-bottom: 6px;
    }

    .chat-head p {
      font-size: 13px;
      font-weight: 300;
      color: #6b6b6b;
      line-height: 1.45;
      max-width: 520px;
      margin-bottom: 0;
    }

    .composer-card,
    .feed-card {
      border: 1px solid var(--hairline);
      border-radius: 10px;
      background: rgba(255,255,255,0.82);
      box-shadow: 0 8px 24px rgba(17,24,39,0.04);
    }

    .composer-card {
      padding: 12px 14px 10px;
      margin-bottom: 16px;
      background: var(--panel-soft);
    }

    .composer-card .avatar {
      width: 24px;
      height: 24px;
      font-size: 10px;
    }

    .composer-top {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      margin-bottom: 8px;
    }

    .composer-top-actions {
      display: flex;
      align-items: center;
      gap: 10px;
      margin-left: auto;
    }

    .composer-lock {
      display: inline-flex;
      align-items: center;
      gap: 5px;
      font-size: 11px;
      color: #9ca3af;
      font-weight: 300;
    }

    .composer-lock svg {
      width: 12px;
      height: 12px;
    }

    .composer-fields {
      display: flex;
      flex-direction: column;
      gap: 10px;
    }

    .composer-field-label {
      display: block;
      margin-bottom: 4px;
      font-size: 10px;
      font-weight: 500;
      letter-spacing: 0.06em;
      text-transform: uppercase;
      color: #9ca3af;
    }

    .composer-field-input {
      position: relative;
      border: 1px solid rgba(17, 24, 39, 0.1);
      border-radius: 8px;
      background: #fff;
      overflow: visible;
      transition: border-color 0.12s ease;
    }

    .composer-field-input:focus-within {
      border-color: #111827;
    }

    .reply-box .input-with-gate {
      border: 1px solid rgba(17, 24, 39, 0.1);
      border-radius: 8px;
      background: #fff;
      overflow: visible;
      transition: border-color 0.12s ease;
    }

    .reply-box .input-with-gate:focus-within {
      border-color: #111827;
    }

    .composer-field-input:has(:disabled) {
      background: #fafafa;
    }

    .composer-title {
      width: 100%;
      border: 0;
      padding: 10px 12px;
      font-family: var(--display);
      font-size: 19px;
      line-height: 1.3;
      font-weight: 400;
      letter-spacing: -0.01em;
      color: #111827;
      background: transparent;
      outline: none;
      box-shadow: none;
      -webkit-appearance: none;
      appearance: none;
    }

    .composer-title:focus,
    .composer-title:focus-visible {
      outline: none;
      box-shadow: none;
    }

    .composer-title:disabled {
      color: #9ca3af;
      cursor: not-allowed;
    }

    .composer-title::placeholder,
    .composer-input::placeholder {
      color: #9ca3af;
      font-weight: 300;
      opacity: 1;
    }

    .composer-title::placeholder {
      font-family: inherit;
      font-size: 19px;
      line-height: 1.3;
      letter-spacing: -0.01em;
    }

    .composer-input::placeholder {
      font-size: 13px;
      line-height: 1.5;
    }

    .composer-input {
      width: 100%;
      min-height: 88px;
      resize: vertical;
      border: 0;
      border-radius: 0;
      padding: 10px 12px;
      font: inherit;
      font-size: 13px;
      line-height: 1.5;
      font-weight: 300;
      color: #111827;
      background: transparent;
      outline: none;
      box-shadow: none;
      -webkit-appearance: none;
      appearance: none;
    }

    .composer-input[contenteditable] {
      overflow-y: auto;
      white-space: pre-wrap;
      word-break: break-word;
    }

    .composer-input[contenteditable]:empty::before {
      content: attr(data-placeholder);
      color: #9ca3af;
      -webkit-text-fill-color: #9ca3af;
      font-weight: 300;
      pointer-events: none;
    }

    .composer-input[contenteditable] strong,
    .composer-input[contenteditable] b {
      font-weight: 600;
    }

    .composer-input[contenteditable] a {
      color: #111827;
      text-decoration: underline;
      text-underline-offset: 2px;
      cursor: pointer;
    }

    .composer-input[contenteditable] ul {
      margin: 4px 0;
      padding-left: 20px;
      list-style: disc;
    }

    .composer-input[contenteditable] ol {
      margin: 4px 0;
      padding-left: 20px;
      list-style: decimal;
    }

    .composer-input[contenteditable] li {
      margin: 2px 0;
    }

    .input-with-gate:not(.is-enabled):not(.has-draft):not(.is-editing) .composer-input[contenteditable]:empty::before {
      opacity: 0;
    }

    .composer-input:focus,
    .composer-input:focus-visible {
      outline: none;
      box-shadow: none;
    }

    .composer-input:disabled,
    .composer-input[contenteditable="false"] {
      color: #9ca3af;
      cursor: not-allowed;
    }

    .input-with-gate:not(.is-enabled):not(.has-draft):not(.is-editing) .composer-input {
      color: transparent;
      -webkit-text-fill-color: transparent;
      caret-color: transparent;
    }

    .input-with-gate:not(.is-enabled):not(.has-draft):not(.is-editing) .composer-input::placeholder {
      opacity: 0;
    }

    .input-with-gate.has-draft .composer-input,
    .input-with-gate.is-enabled .composer-input,
    .input-with-gate.is-editing .composer-input {
      color: #111827;
      -webkit-text-fill-color: #111827;
      caret-color: auto;
    }

    /* Keep the fake placeholder gray — -webkit-text-fill-color on the input
       would otherwise paint ::before black when the composer is unlocked. */
    .input-with-gate.is-enabled .composer-input[contenteditable]:empty::before,
    .input-with-gate.is-editing .composer-input[contenteditable]:empty::before,
    .input-with-gate.has-draft .composer-input[contenteditable]:empty::before {
      color: #9ca3af;
      -webkit-text-fill-color: #9ca3af;
    }

    .input-with-gate {
      position: relative;
    }

    .input-gate-prompt {
      position: absolute;
      inset: 0;
      padding: 10px 12px;
      pointer-events: none;
      font-size: 13px;
      line-height: 1.5;
      font-weight: 300;
      color: #9ca3af;
      -webkit-text-fill-color: #9ca3af;
    }

    .input-gate-prompt a {
      pointer-events: auto;
      color: #9ca3af;
      -webkit-text-fill-color: #9ca3af;
      text-decoration: underline;
      text-underline-offset: 2px;
    }

    .input-gate-prompt a:hover {
      color: #6b7280;
      -webkit-text-fill-color: #6b7280;
    }

    .input-with-gate.is-enabled .input-gate-prompt {
      display: none;
    }

    .input-with-gate.has-draft .input-gate-prompt,
    .input-with-gate.is-editing .input-gate-prompt {
      display: none;
    }

    .input-with-gate.has-draft .composer-input:disabled,
    .input-with-gate.has-draft .composer-input[contenteditable="false"],
    .input-with-gate.has-draft textarea:disabled {
      color: #374151;
      -webkit-text-fill-color: #374151;
    }

    .composer-fields.has-draft .composer-title:disabled {
      color: #374151;
      -webkit-text-fill-color: #374151;
    }

    .composer-attachments {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
      margin-top: 8px;
    }

    .composer-attachments:empty {
      display: none;
    }

    .composer-attach-chip {
      display: inline-flex;
      align-items: center;
      gap: 5px;
      border: 1px solid rgba(17, 24, 39, 0.1);
      background: #fafafa;
      border-radius: 999px;
      padding: 3px 8px 3px 6px;
      font-size: 11px;
      color: #4b5563;
    }

    .composer-attach-chip svg {
      width: 12px;
      height: 12px;
      flex-shrink: 0;
      color: #9ca3af;
    }

    .composer-attach-remove {
      border: 0;
      background: transparent;
      color: #9ca3af;
      cursor: pointer;
      padding: 0 2px;
      font-size: 14px;
      line-height: 1;
    }

    .composer-attach-remove:hover {
      color: #111827;
    }

    .composer-collab-box {
      margin-top: 32px;
      margin-bottom: 32px;
      padding: 14px 16px;
      border-radius: 10px;
      background: #111827;
      color: #fff;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 20px;
    }

    .composer-collab-left {
      flex: 1;
      min-width: 0;
      display: flex;
      flex-direction: column;
      align-items: flex-start;
      gap: 12px;
    }

    .composer-collab-heading {
      margin: 0;
      font-family: var(--display);
      font-size: clamp(22px, 2.35vw, 30px);
      font-weight: 400;
      letter-spacing: -0.02em;
      line-height: 1.05;
      color: rgba(255, 255, 255, 0.92);
      white-space: nowrap;
    }

    .composer-collab-cta {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      padding: 8px 14px;
      border: 1px solid #fff;
      border-radius: 8px;
      font-size: 13px;
      font-weight: 400;
      line-height: 1.2;
      color: #111827;
      background: #fff;
      text-decoration: none;
      transition: background 0.15s ease, border-color 0.15s ease;
      white-space: nowrap;
    }

    .composer-collab-cta:hover {
      background: #f3f4f6;
      border-color: #f3f4f6;
    }

    .composer-collab-right {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 10px;
      flex-shrink: 0;
    }

    .composer-collab-right-heading {
      margin: 0;
      font-size: 13px;
      font-weight: 400;
      line-height: 1.4;
      color: rgba(255, 255, 255, 0.92);
      text-align: center;
      width: calc(92px * 3 + 8px * 2);
    }

    .composer-collab-actions {
      display: flex;
      flex-wrap: wrap;
      justify-content: center;
      gap: 8px;
    }

    .composer-collab-btn {
      display: inline-flex;
      flex: 0 0 92px;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 6px;
      width: 92px;
      padding: 10px 8px;
      border: 1px solid rgba(255, 255, 255, 0.22);
      border-radius: 10px;
      font: inherit;
      font-size: 12px;
      font-weight: 400;
      line-height: 1.2;
      color: #fff;
      background: transparent;
      text-decoration: none;
      transition: background 0.15s ease, border-color 0.15s ease;
    }

    .composer-collab-btn svg {
      width: 18px;
      height: 18px;
      opacity: 0.9;
    }

    .composer-collab-btn:hover {
      background: rgba(255, 255, 255, 0.08);
      border-color: rgba(255, 255, 255, 0.38);
    }

    .feed-excerpt strong,
    .thread-body strong {
      font-weight: 500;
    }

    .composer-actions {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      margin-top: 8px;
      flex-wrap: wrap;
    }

    .toolbar {
      display: flex;
      align-items: center;
      gap: 4px;
      flex-wrap: wrap;
    }

    .tool-btn {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 28px;
      height: 28px;
      border: 1px solid rgba(17,24,39,0.08);
      background: #fff;
      color: #6b7280;
      border-radius: 6px;
      padding: 0;
      cursor: pointer;
      transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
    }

    .tool-btn svg {
      width: 14px;
      height: 14px;
      flex-shrink: 0;
    }

    .tool-btn:hover:not(:disabled) {
      color: #111827;
      border-color: rgba(17,24,39,0.16);
      background: #fafafa;
    }

    .tool-btn:disabled { opacity: 0.4; cursor: not-allowed; }

    .composer-footer {
      display: flex;
      align-items: center;
      gap: 10px;
      margin-left: auto;
    }

    .word-count {
      font-size: 11px;
      color: #9ca3af;
      font-weight: 300;
      white-space: nowrap;
    }

    .word-count.is-over { color: #b91c1c; }

    .btn-post {
      padding: 3px 9px;
      font-size: 12px;
      border-radius: 5px;
    }

    .composer-suggestions {
      display: none;
    }

    .composer-try-asking-wrap {
      position: relative;
    }

    .composer-try-asking-trigger {
      border: 0;
      background: transparent;
      font: inherit;
      font-size: 11px;
      color: #6b7280;
      cursor: pointer;
      text-decoration: underline;
      text-underline-offset: 2px;
      padding: 0;
    }

    .composer-try-asking-trigger:hover,
    .composer-try-asking-wrap.is-open .composer-try-asking-trigger {
      color: #111827;
    }

    .composer-try-asking-menu {
      position: absolute;
      top: calc(100% + 6px);
      right: 0;
      z-index: 60;
      min-width: 200px;
      background: #fff;
      border: 1px solid #111827;
      border-radius: 8px;
      padding: 4px;
      box-shadow: 0 12px 32px rgba(17,24,39,0.12);
    }

    .composer-try-asking-menu[hidden] {
      display: none !important;
    }

    .composer-try-asking-menu-label {
      padding: 6px 10px 4px;
      font-size: 10px;
      font-weight: 500;
      letter-spacing: 0.06em;
      text-transform: uppercase;
      color: #9ca3af;
    }

    .try-asking-option {
      display: block;
      width: 100%;
      padding: 8px 10px;
      border: 0;
      border-radius: 5px;
      background: transparent;
      font: inherit;
      font-size: 12px;
      color: #111827;
      text-align: left;
      cursor: pointer;
    }

    .try-asking-option:hover {
      background: rgba(17,24,39,0.04);
    }

    .try-asking-more-items[hidden] {
      display: none !important;
    }

    .composer-agenda {
      margin-top: 10px;
    }

    .composer-agenda-header {
      display: flex;
      align-items: baseline;
      justify-content: space-between;
      gap: 8px;
      margin-bottom: 6px;
    }

    .composer-agenda-header-left {
      display: flex;
      align-items: baseline;
      gap: 6px;
    }

    .composer-agenda-label {
      font-size: 10px;
      font-weight: 500;
      letter-spacing: 0.06em;
      text-transform: uppercase;
      color: #9ca3af;
    }

    .composer-agenda-hint {
      font-size: 10px;
      color: #9ca3af;
      font-weight: 300;
    }

    .composer-tags-row {
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      gap: 6px;
    }

    .composer-tags {
      display: contents;
    }

    .tag-pill.is-extra {
      display: none;
    }

    .composer-agenda.is-expanded .tag-pill.is-extra {
      display: inline-flex;
    }

    .composer-topics-more {
      border: 0;
      background: transparent;
      font: inherit;
      font-size: 11px;
      color: #6b7280;
      cursor: pointer;
      text-decoration: underline;
      text-underline-offset: 2px;
      padding: 4px 0;
      line-height: 1.25;
    }

    .composer-agenda.is-expanded .composer-topics-more {
      display: none;
    }

    .composer-suggestions-label {
      width: 100%;
      font-size: 10px;
      font-weight: 500;
      letter-spacing: 0.06em;
      text-transform: uppercase;
      color: #9ca3af;
      margin-bottom: 1px;
    }

    .suggestion-pill {
      border: 1px solid rgba(17, 24, 39, 0.1);
      background: #fafafa;
      color: #4b5563;
      border-radius: 999px;
      padding: 2px 9px;
      font: inherit;
      font-size: 11px;
      font-weight: 400;
      line-height: 1.25;
      cursor: pointer;
      transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
    }

    .suggestion-pill:hover {
      background: #f3f4f6;
      border-color: rgba(17, 24, 39, 0.16);
      color: #111827;
    }

    .feed-card { overflow: hidden; }

    .feed-section-wrap {
      position: relative;
    }

    .feed-display-menu-row {
      display: flex;
      justify-content: flex-end;
      margin-bottom: 6px;
    }

    .feed-header {
      padding: 12px 16px 14px;
      background: var(--panel-soft);
      border-bottom: 0;
    }

    .feed-section-label {
      display: block;
      margin-bottom: 6px;
      font-size: 10px;
      font-weight: 500;
      letter-spacing: 0.06em;
      text-transform: uppercase;
      color: #9ca3af;
    }

    .feed-section-title {
      margin: 0 0 5px;
      font-family: var(--display);
      font-size: 20px;
      font-weight: 400;
      line-height: 1.2;
      letter-spacing: -0.01em;
      color: #111827;
    }

    .feed-section-body {
      margin: 0;
      font-size: 12px;
      font-weight: 300;
      color: #9ca3af;
      line-height: 1.45;
    }

    /* Discussions shell: header/toolbar stay framed; threads are separate cards. */
    .feed-section-wrap > .feed-card {
      border: 0;
      background: transparent;
      box-shadow: none;
      overflow: visible;
    }

    .feed-header {
      border: 1px solid var(--hairline);
      border-bottom: 0;
      border-radius: 10px 10px 0 0;
      background: var(--panel-soft);
    }

    .feed-toolbar {
      border: 1px solid var(--hairline);
      border-top: 1px solid rgba(17, 24, 39, 0.06);
      border-radius: 0 0 10px 10px;
      background: rgba(255, 255, 255, 0.92);
      margin-bottom: 0;
    }

    .feed-list {
      display: flex;
      flex-direction: column;
      gap: 16px;
      padding: 16px 0 8px;
      background: transparent;
    }

    .feed-item {
      display: block;
      padding: 0;
      border: 1px solid var(--hairline);
      border-radius: 10px;
      background: #ffffff;
      overflow: hidden;
      transition: background 0.15s ease;
    }

    .feed-item + .feed-item {
      border-top: 1px solid var(--hairline);
      padding-top: 0;
    }

    .feed-opener {
      display: block;
      padding: 14px 16px 10px;
      color: inherit;
      text-decoration: none;
      cursor: pointer;
      background: var(--panel-soft);
      transition: background 0.15s ease;
    }

    .feed-opener:hover {
      background: #f3f4f6;
    }

    .feed-replies {
      padding: 0 8px 10px 16px;
      background: #ffffff;
    }

    .feed-inline-reply {
      display: flex;
      align-items: flex-start;
      gap: 12px;
      padding: 10px 12px 12px;
      border-top: 1px solid rgba(17, 24, 39, 0.06);
      background: #fff;
    }

    .feed-inline-reply .avatar {
      width: 28px;
      height: 28px;
      font-size: 11px;
    }

    .feed-inline-reply-field {
      flex: 1;
      min-width: 0;
    }

    .feed-inline-reply .feed-reply-input {
      min-height: 36px;
      max-height: 120px;
      overflow-y: auto;
      padding: 8px 10px;
      border: 1px solid rgba(17, 24, 39, 0.1);
      border-radius: 6px;
      font-size: 12px;
      font-weight: 300;
      line-height: 1.4;
      outline: none;
      background: #fff;
    }

    .feed-inline-reply .feed-reply-input:focus {
      border-color: #111827;
    }

    .feed-inline-reply .input-with-gate:not(.is-enabled) .feed-reply-input {
      cursor: pointer;
      background: #fafafa;
    }

    .feed-item .reply {
      padding-left: 0;
    }

    .feed-replies-more {
      display: block;
      padding: 8px 8px 4px 6px;
      border: 0;
      background: transparent;
      font: inherit;
      font-size: 11px;
      font-weight: 400;
      color: #6b7280;
      text-align: left;
      cursor: pointer;
      transition: color 0.15s ease;
    }

    .feed-replies-more:hover {
      color: #111827;
    }

    .feed-opener h3 {
      font-family: var(--display);
      font-size: 18px;
      line-height: 1.2;
      margin: 6px 0 4px;
      font-weight: 400;
    }

    .feed-excerpt {
      font-size: 13px;
      line-height: 1.45;
      color: #4b5563;
      font-weight: 300;
      display: -webkit-box;
      -webkit-line-clamp: 2;
      -webkit-box-orient: vertical;
      overflow: hidden;
    }

    .feed-stats {
      display: flex;
      align-items: center;
      gap: 12px;
      margin-top: 8px;
      font-size: 11px;
      color: #6b7280;
      font-weight: 400;
    }

    .feed-stat {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      line-height: 1;
    }

    .feed-stat svg {
      width: 12px;
      height: 12px;
      flex-shrink: 0;
      stroke: currentColor;
      fill: none;
    }

    .feed-stat span {
      display: block;
      line-height: 12px;
      transform: translateY(0.5px);
    }

    .feed-item .avatar {
      width: 26px;
      height: 26px;
      font-size: 10px;
    }

    .feed-item .meta-top {
      font-size: 11px;
    }

    .feed-item .meta-sub {
      font-size: 10px;
    }

    /* Thread detail page inside chat */
    .thread-detail {
      padding: 14px 16px 0;
    }

    .reply-time {
      font-size: 10px;
      font-weight: 300;
      color: #9ca3af;
      white-space: nowrap;
    }

    .reply-box {
      padding: 12px 14px 10px;
      border-top: 1px solid rgba(17, 24, 39, 0.06);
    }

    .reply-box .avatar {
      width: 24px;
      height: 24px;
      font-size: 10px;
    }

    .reply-box .composer-actions {
      margin-top: 8px;
    }

    @media (max-width: 860px) {
      .landing-section,
      .landing-howitworks-wrap,
      .landing-opener-carousel,
      .chat-page { width: calc(100vw - 32px); }
      .header-center { display: none; }
      .header-container { top: 78px; }
    }

    @media (max-width: 520px) {
      .composer-collab-box {
        flex-direction: column;
        align-items: flex-start;
        gap: 14px;
      }

      .composer-collab-right {
        align-items: center;
        width: 100%;
      }

      .composer-collab-right-heading {
        text-align: center;
      }

      .composer-collab-actions {
        justify-content: center;
      }

      .landing-section .meta-lines {
        min-width: 0;
        flex: 1;
      }

      .landing-section .thread-meta {
        flex-wrap: nowrap;
      }

      .landing-section .thread-tags {
        display: none;
      }

      .landing-section .meta-top,
      .landing-section .reply-meta {
        font-size: 10px;
      }
    }

    /* Enhancements */
    .feed-toolbar {
      display: flex;
      align-items: center;
      justify-content: flex-start;
      gap: 10px;
      padding: 10px 16px;
    }

    .feed-toolbar label {
      font-size: 11px;
      color: #6b7280;
      display: flex;
      align-items: center;
      gap: 6px;
    }

    .feed-toolbar select {
      font: inherit;
      font-size: 11px;
      border: 1px solid rgba(17,24,39,0.1);
      border-radius: 6px;
      padding: 4px 8px;
      background: #fff;
      outline: none;
    }

    .feed-toolbar select:focus,
    .feed-toolbar select:active {
      border-color: #111827;
    }

    .feed-sort-wrap {
      position: relative;
    }

    .feed-sort-trigger {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      font: inherit;
      font-size: 11px;
      color: #111827;
      border: 1px solid rgba(17,24,39,0.1);
      border-radius: 6px;
      padding: 4px 8px;
      background: #fff;
      cursor: pointer;
      outline: none;
      transition: border-color 0.12s ease;
    }

    .feed-sort-trigger:hover {
      border-color: rgba(17,24,39,0.2);
    }

    .feed-sort-trigger[aria-expanded="true"] {
      border-color: #111827;
    }

    .feed-sort-icon {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      color: #111827;
      flex-shrink: 0;
    }

    .feed-sort-icon svg {
      width: 12px;
      height: 12px;
    }

    .feed-sort-menu {
      position: absolute;
      top: calc(100% + 4px);
      left: 0;
      z-index: 40;
      min-width: 140px;
      background: #fff;
      border: 1px solid #111827;
      border-radius: 8px;
      padding: 4px;
      box-shadow: 0 8px 24px rgba(17,24,39,0.08);
    }

    .feed-sort-menu[hidden] {
      display: none;
    }

    .feed-sort-option {
      display: block;
      width: 100%;
      padding: 7px 10px;
      border: 0;
      border-radius: 5px;
      background: transparent;
      font: inherit;
      font-size: 11px;
      color: #111827;
      text-align: left;
      cursor: pointer;
    }

    .feed-sort-option:hover,
    .feed-sort-option.is-selected {
      background: rgba(17,24,39,0.04);
    }

    .feed-opener-meta-row {
      display: flex;
      align-items: flex-start;
      gap: 12px;
      margin-bottom: 6px;
    }

    .feed-opener-meta-row .meta-lines { flex: 1; min-width: 0; }

    .feed-tag-pill {
      font-size: 9px;
      font-weight: 500;
      letter-spacing: 0.04em;
      text-transform: uppercase;
      color: #6b7280;
      background: rgba(17,24,39,0.04);
      border-radius: 4px;
      padding: 3px 6px;
      white-space: nowrap;
    }

    .feed-stat-time {
      margin-left: auto;
      font-size: 10px;
      color: #9ca3af;
    }

    .feed-item.has-unread .feed-opener h3::after {
      content: '';
      display: inline-block;
      width: 6px;
      height: 6px;
      margin-left: 6px;
      border-radius: 50%;
      background: #111827;
      vertical-align: middle;
    }

    .feed-unread { color: #111827; font-weight: 500; }

    body.pref-thread-compact .feed-item .feed-excerpt,
    body.pref-thread-compact .feed-item .feed-replies {
      display: none !important;
    }

    .thread-post.is-op {
      background: rgba(17,24,39,0.02);
      border-radius: 8px;
      padding: 14px 12px;
      margin: 0 -4px 14px;
    }

    .thread-op-actions, .reply-actions-row {
      display: flex;
      align-items: center;
      flex-wrap: wrap;
      gap: 8px;
      margin-top: 10px;
    }

    .thread-op-heart, .thread-action-btn, .reply-to-btn, .reply-save-btn, .mark-best-btn, .report-btn, .thread-edit-btn {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      padding: 0;
      border: 0;
      background: transparent;
      font: inherit;
      font-size: 10px;
      line-height: 1;
      color: #6b7280;
      cursor: pointer;
    }

    .thread-op-heart svg { width: 12px; height: 12px; }

    .thread-op-heart.is-active, .thread-action-btn.is-active, .reply-save-btn.is-active { color: #111827; }

    .member-link {
      padding: 0;
      border: 0;
      background: transparent;
      font: inherit;
      font-weight: 500;
      color: inherit;
      cursor: pointer;
      text-decoration: underline;
      text-underline-offset: 2px;
    }

    .reply.is-nested {
      margin-left: 12px;
    }

    .reply.is-best-answer {
      background: rgba(17,24,39,0.02);
      border-radius: 6px;
    }

    .best-answer-badge {
      font-size: 9px;
      font-weight: 500;
      letter-spacing: 0.04em;
      text-transform: uppercase;
      color: #111827;
    }

    .thread-empty-state {
      padding: 20px 16px;
      text-align: center;
      font-size: 13px;
      color: #6b7280;
      border-top: 1px solid rgba(17,24,39,0.06);
    }

    .thread-bridge-actions {
      padding: 14px 16px;
      border-top: 1px solid rgba(17, 24, 39, 0.06);
      border-bottom: 1px solid rgba(17, 24, 39, 0.06);
      background: rgba(17, 24, 39, 0.015);
      text-align: center;
    }

    .thread-bridge-label {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      font-size: 11px;
      font-weight: 400;
      letter-spacing: 0.01em;
      text-transform: none;
      color: #9ca3af;
      margin: 0;
      text-decoration: none;
      cursor: pointer;
      transition: color 0.15s ease;
    }

    .thread-bridge-label:hover {
      color: #111827;
    }

    .thread-bridge-icon {
      width: 12px;
      height: 12px;
      flex-shrink: 0;
    }

    .thread-bridge-actions + .reply-box-sticky-wrap {
      border-top: 0;
      box-shadow: none;
    }

    .thread-bridge-actions + .reply-box-sticky-wrap .reply-box {
      border-top: 0;
    }

    #view-thread .thread-detail + .reply-box-sticky-wrap {
      border-top: 0;
      box-shadow: none;
    }

    #view-thread .thread-detail + .reply-box-sticky-wrap .reply-box {
      border-top: 0;
    }

    .thread-bridge-btns {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
    }

    .thread-bridge-btn {
      display: inline-flex;
      align-items: center;
      padding: 7px 12px;
      border: 1px solid rgba(17,24,39,0.12);
      border-radius: 6px;
      background: #fff;
      font-size: 11px;
      color: #111827;
      cursor: pointer;
      text-decoration: none;
    }

    .thread-bridge-btn:hover { background: rgba(17,24,39,0.03); }

    .reply-box-sticky-wrap {
      position: sticky;
      bottom: 0;
      z-index: 20;
      background: #fff;
      border-top: 1px solid rgba(17,24,39,0.06);
      box-shadow: 0 -8px 24px rgba(17,24,39,0.04);
    }

    .composer-tags-row {
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      gap: 6px;
    }

    .tag-pill {
      display: inline-flex;
      align-items: center;
      gap: 5px;
      border: 1px solid rgba(17,24,39,0.1);
      background: #fff;
      border-radius: 999px;
      padding: 4px 10px;
      font: inherit;
      font-size: 11px;
      color: #6b7280;
      cursor: pointer;
    }
    .tag-pill-emoji { font-size: 12px; line-height: 1; }

    .tag-pill.is-selected {
      background: #111827;
      border-color: #111827;
      color: #fff;
    }

    .composer-draft-row {
      display: flex;
      justify-content: flex-end;
      margin-top: 6px;
    }

    .save-draft-btn {
      border: 0;
      background: transparent;
      font: inherit;
      font-size: 11px;
      color: #6b7280;
      cursor: pointer;
      text-decoration: underline;
      text-underline-offset: 2px;
    }

    #mentionDropdown.mention-dropdown {
      position: fixed;
      z-index: 4000;
      min-width: 220px;
      max-width: min(360px, calc(100vw - 24px));
      max-height: 260px;
      display: flex;
      flex-direction: column;
      background: #fff;
      border: 1px solid #111827;
      border-radius: 8px;
      box-shadow: 0 12px 32px rgba(17,24,39,0.12);
      overflow: hidden;
    }

    .mention-dropdown[hidden] {
      display: none !important;
    }

    .mention-dropdown-header {
      padding: 8px 12px 6px;
      font-size: 10px;
      font-weight: 500;
      letter-spacing: 0.06em;
      text-transform: uppercase;
      color: #9ca3af;
      border-bottom: 1px solid rgba(17,24,39,0.06);
    }

    .mention-list {
      overflow-y: auto;
      max-height: 160px;
    }

    .mention-option {
      display: flex;
      align-items: center;
      justify-content: space-between;
      width: 100%;
      padding: 8px 12px;
      border: 0;
      background: transparent;
      font: inherit;
      font-size: 12px;
      text-align: left;
      cursor: pointer;
      color: #111827;
    }

    .mention-option:hover,
    .mention-option.is-highlighted {
      background: rgba(17,24,39,0.04);
    }

    .mention-option-role {
      font-size: 10px;
      color: #9ca3af;
      margin-left: 8px;
      white-space: nowrap;
    }

    .mention-invite {
      border-top: 1px solid rgba(17,24,39,0.06);
      padding: 10px 12px;
      background: rgba(17,24,39,0.015);
    }

    .mention-invite-label {
      font-size: 10px;
      font-weight: 500;
      letter-spacing: 0.04em;
      text-transform: uppercase;
      color: #6b7280;
      margin-bottom: 6px;
    }

    .mention-invite-form {
      display: flex;
      gap: 6px;
      align-items: center;
    }

    .mention-invite-form input {
      flex: 1;
      min-width: 0;
      font: inherit;
      font-size: 12px;
      border: 1px solid rgba(17,24,39,0.1);
      border-radius: 6px;
      padding: 6px 8px;
      outline: none;
    }

    .mention-invite-form input:focus {
      border-color: #111827;
    }

    .mention-invite-btn {
      flex-shrink: 0;
      border: 1px solid #111827;
      border-radius: 6px;
      background: #111827;
      color: #fff;
      font: inherit;
      font-size: 11px;
      padding: 6px 10px;
      cursor: pointer;
      white-space: nowrap;
    }

    .mention-invite-btn:hover {
      background: #000;
    }

    .mention-empty {
      padding: 10px 12px;
      font-size: 12px;
      color: #9ca3af;
    }

    #mentionInviteToast.mention-invite-toast {
      position: fixed;
      bottom: 24px;
      left: 50%;
      transform: translateX(-50%);
      z-index: 5000;
      max-width: min(420px, calc(100vw - 32px));
      padding: 12px 16px;
      background: #111827;
      color: #fff;
      border-radius: 10px;
      font-size: 12px;
      line-height: 1.45;
      box-shadow: 0 12px 32px rgba(17,24,39,0.2);
    }

    .mention-invite-toast[hidden] {
      display: none !important;
    }

    .mention-invite-toast strong {
      display: block;
      font-weight: 500;
      margin-bottom: 2px;
    }

    .mention-invite-toast span {
      text-decoration: underline;
      text-underline-offset: 2px;
    }

    .reply-mention.is-external {
      background: rgba(17,24,39,0.04);
      border: 1px dashed rgba(17,24,39,0.14);
      cursor: default;
    }

    .input-with-gate { position: relative; }

    .proto-modal {
      position: fixed;
      inset: 0;
      z-index: 5000;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 20px;
      background: rgba(255, 255, 255, 0.52);
      backdrop-filter: blur(14px) saturate(150%);
      -webkit-backdrop-filter: blur(14px) saturate(150%);
    }

    #reportModal.proto-modal.qava-modal-overlay {
      position: fixed;
      inset: 0;
      z-index: 5000;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 20px;
      background: rgba(255, 255, 255, 0.52);
      backdrop-filter: blur(14px) saturate(150%);
      -webkit-backdrop-filter: blur(14px) saturate(150%);
    }

    .proto-modal[hidden],
    #reportModal.proto-modal[hidden] { display: none !important; }

    html.is-modal-open,
    body.is-modal-open {
      overflow: hidden;
    }

    .proto-modal-card {
      width: min(420px, 100%);
      background: rgba(255, 255, 255, 0.96);
      border: 1px solid rgba(17, 24, 39, 0.08);
      border-radius: 12px;
      padding: 20px;
      box-shadow: 0 24px 60px rgba(17, 24, 39, 0.16);
    }

    .proto-modal-card h3 {
      font-family: var(--display);
      font-size: 20px;
      font-weight: 400;
      margin-bottom: 12px;
    }

    .proto-modal-close {
      float: right;
      border: 0;
      background: transparent;
      font-size: 18px;
      cursor: pointer;
      color: #6b7280;
    }

    .report-modal-sub {
      font-size: 12px;
      color: #6b7280;
      line-height: 1.45;
      margin-bottom: 16px;
    }

    .report-field {
      margin-bottom: 14px;
    }

    .report-field select,
    .report-field textarea {
      width: 100%;
      font: inherit;
      font-size: 13px;
      line-height: 1.5;
      color: #111827;
      border: 1px solid rgba(17, 24, 39, 0.1);
      border-radius: 8px;
      padding: 10px 12px;
      background: #fff;
      outline: none;
      transition: border-color 0.12s ease;
    }

    .report-category-wrap {
      position: relative;
    }

    .report-category-trigger {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      width: 100%;
      font: inherit;
      font-size: 13px;
      line-height: 1.5;
      color: #111827;
      border: 1px solid rgba(17, 24, 39, 0.1);
      border-radius: 8px;
      padding: 10px 12px;
      background: #fff;
      cursor: pointer;
      outline: none;
      transition: border-color 0.12s ease;
      text-align: left;
    }

    .report-category-trigger:hover {
      border-color: rgba(17, 24, 39, 0.2);
    }

    .report-category-trigger[aria-expanded="true"] {
      border-color: #111827;
    }

    .report-category-icon {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      color: #111827;
      flex-shrink: 0;
    }

    .report-category-icon svg {
      width: 12px;
      height: 12px;
    }

    .report-category-menu {
      position: absolute;
      top: calc(100% + 4px);
      left: 0;
      right: 0;
      z-index: 2;
      background: #fff;
      border: 1px solid #111827;
      border-radius: 8px;
      padding: 4px;
      box-shadow: 0 8px 24px rgba(17, 24, 39, 0.1);
    }

    .report-category-menu[hidden] {
      display: none;
    }

    .report-category-option {
      display: block;
      width: 100%;
      padding: 8px 10px;
      border: 0;
      border-radius: 5px;
      background: transparent;
      font: inherit;
      font-size: 13px;
      color: #111827;
      text-align: left;
      cursor: pointer;
    }

    .report-category-option:hover,
    .report-category-option.is-selected {
      background: rgba(17, 24, 39, 0.04);
    }

    .report-field select:focus,
    .report-field textarea:focus {
      border-color: #111827;
    }

    .report-field textarea {
      min-height: 96px;
      resize: vertical;
      font-weight: 300;
    }

    .report-field textarea::placeholder {
      color: #9ca3af;
    }

    .report-submit-row {
      display: flex;
      justify-content: flex-end;
      gap: 8px;
      margin-top: 4px;
    }

    .report-cancel-btn {
      padding: 8px 14px;
      border: 0;
      background: transparent;
      font: inherit;
      font-size: 12px;
      color: #6b7280;
      cursor: pointer;
    }

    .report-cancel-btn:hover {
      color: #111827;
    }

    .reply.is-hidden,
    .thread-post.is-hidden {
      display: none !important;
    }

    /* User profile page */
    .profile-card {
      padding: 0;
    }

    .profile-page {
      padding: 20px 18px 24px;
    }

    .profile-hero {
      display: flex;
      align-items: center;
      gap: 14px;
      margin-bottom: 14px;
    }

    .profile-avatar {
      width: 56px;
      height: 56px;
      font-size: 18px;
    }

    .profile-identity {
      display: flex;
      flex-direction: column;
      align-items: flex-start;
      text-align: left;
      min-width: 0;
    }

    .profile-identity h1 {
      font-family: var(--display);
      font-size: 24px;
      font-weight: 400;
      line-height: 1.15;
      margin: 0 0 2px;
    }

    .profile-username {
      font-family: "Inter", sans-serif;
      font-size: 13px;
      font-weight: 300;
      line-height: 1.3;
      color: #6b7280;
      margin: 0;
    }

    .profile-role {
      font-size: 12px;
      color: #6b7280;
      font-weight: 300;
      margin: 4px 0 0;
    }

    .profile-bio {
      font-size: 13px;
      line-height: 1.55;
      color: #4b5563;
      margin-bottom: 16px;
      max-width: 52ch;
    }

    .profile-stats {
      display: flex;
      flex-wrap: wrap;
      gap: 10px;
      margin-bottom: 22px;
      padding-bottom: 20px;
      border-bottom: 1px solid rgba(17, 24, 39, 0.08);
    }

    .profile-stat {
      display: flex;
      flex-direction: column;
      gap: 2px;
      min-width: 88px;
      padding: 10px 12px;
      border: 1px solid rgba(17, 24, 39, 0.08);
      border-radius: 8px;
      background: rgba(17, 24, 39, 0.02);
    }

    .profile-stat strong {
      font-family: var(--display);
      font-size: 18px;
      font-weight: 400;
      color: #111827;
    }

    .profile-stat span {
      font-size: 10px;
      color: #9ca3af;
      letter-spacing: 0.02em;
    }

    .profile-section {
      margin-bottom: 20px;
    }

    .profile-section:last-child {
      margin-bottom: 0;
    }

    .profile-section-label {
      display: block;
      margin-bottom: 8px;
      font-size: 10px;
      font-weight: 500;
      letter-spacing: 0.06em;
      text-transform: uppercase;
      color: #9ca3af;
    }

    .profile-thread-list,
    .profile-reply-list,
    .profile-saved-list {
      display: flex;
      flex-direction: column;
      gap: 8px;
    }

    .profile-thread-item,
    .profile-reply-item,
    .profile-saved-item {
      display: block;
      width: 100%;
      padding: 12px 14px;
      border: 1px solid rgba(17, 24, 39, 0.08);
      border-radius: 8px;
      background: #fff;
      text-align: left;
      cursor: pointer;
      transition: border-color 0.15s ease, background 0.15s ease;
      font: inherit;
      font-weight: 300;
    }

    .profile-thread-item:hover,
    .profile-reply-item:hover,
    .profile-saved-item:hover {
      border-color: rgba(17, 24, 39, 0.14);
      background: rgba(17, 24, 39, 0.02);
    }

    .profile-saved-type {
      font-size: 10px;
      font-weight: 500;
      letter-spacing: 0.05em;
      text-transform: uppercase;
      color: #9ca3af;
      margin-bottom: 4px;
    }

    .profile-thread-item h3,
    .profile-reply-item h3,
    .profile-saved-item h3 {
      font-family: var(--display);
      font-size: 15px;
      font-weight: 400;
      line-height: 1.35;
      margin-bottom: 4px;
      color: #111827;
    }

    .profile-thread-meta,
    .profile-reply-meta {
      font-size: 11px;
      color: #9ca3af;
      font-weight: 300;
    }

    .profile-reply-excerpt {
      font-size: 12px;
      line-height: 1.45;
      font-weight: 300;
      color: #2e2e2e;
      margin-top: 6px;
    }

    .profile-reply-excerpt .reply-mention {
      font-weight: 500;
    }

    .profile-empty-note {
      font-size: 12px;
      color: #9ca3af;
      font-weight: 300;
    }

    /* Photo avatar (falls back to initials when no photo) */
    .avatar { overflow: hidden; }
    .avatar img {
      width: 100%;
      height: 100%;
      border-radius: 50%;
      object-fit: cover;
      object-position: var(--avatar-pos, 50% 50%);
      display: block;
      aspect-ratio: 1 / 1;
    }
    .profile-avatar { flex: 0 0 auto; overflow: hidden; }

    /* Profile tag lists (reasons / interests / org types) */
    .profile-tag-list {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
    }
    .profile-tag {
      display: inline-flex;
      align-items: center;
      padding: 5px 10px;
      border: 1px solid rgba(17, 24, 39, 0.1);
      border-radius: 999px;
      background: rgba(17, 24, 39, 0.02);
      font-size: 12px;
      font-weight: 300;
      color: #374151;
      line-height: 1.2;
    }

    /* Education & certifications list */
    .profile-edu-list { display: flex; flex-direction: column; gap: 6px; }
    .profile-edu-item {
      font-size: 13px;
      font-weight: 300;
      color: #374151;
      line-height: 1.4;
    }
    .profile-edu-year { color: #9ca3af; font-size: 12px; }

    /* Education editor cards (edit-profile modal) */
    .pe-edu-card {
      position: relative;
      display: flex;
      flex-direction: column;
      gap: 12px;
      padding: 14px 14px 14px 14px;
      border: 1px solid rgba(17, 24, 39, 0.1);
      border-radius: 6px;
      background: #fafafa;
      margin-bottom: 10px;
    }
    .pe-edu-card .pe-input { margin: 0; background: #fff; }
    .pe-edu-field { display: flex; flex-direction: column; }
    .pe-sub-label {
      font-size: 11px;
      font-weight: 500;
      letter-spacing: 0.03em;
      text-transform: uppercase;
      color: #9ca3af;
      margin: 0 0 5px;
    }
    .pe-year-field { max-width: 130px; }
    .pe-edu-bottom {
      display: flex;
      align-items: flex-end;
      justify-content: space-between;
      gap: 12px;
    }
    .pe-edu-bottom .pe-year-field { flex: 0 0 auto; }
    .pe-edu-actions {
      display: flex;
      align-items: center;
      gap: 10px;
      padding-bottom: 8px; /* align with the Year input, not its label */
    }
    .pe-primary {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      cursor: pointer;
      border: none;
      background: none;
      padding: 0;
      font: inherit;
      font-size: 12px;
      font-weight: 300;
      color: #374151;
      user-select: none;
    }
    .pe-primary-box {
      flex: 0 0 auto;
      width: 18px; height: 18px;
      border: 1px solid #d0d0d0;
      border-radius: 4px;
      background: #fff;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: border-color 0.2s ease;
    }
    .pe-primary-box svg { opacity: 0; transform: scale(0); transition: opacity 0.2s ease, transform 0.2s ease; }
    .pe-primary-box.checked { border-color: #000; }
    .pe-primary-box.checked svg { opacity: 1; transform: scale(1); }
    .pe-primary-label { color: #9ca3af; transition: color 0.2s ease; }
    .pe-primary[aria-pressed="true"] .pe-primary-label { color: #111827; }
    .pe-edu-remove {
      flex: 0 0 auto;
      width: 22px; height: 22px;
      display: grid;
      place-items: center;
      border: 1px solid rgba(17, 24, 39, 0.14);
      border-radius: 6px;
      background: #fff;
      color: #9ca3af;
      cursor: pointer;
      line-height: 0;
    }
    .pe-edu-remove:hover { background: rgba(17, 24, 39, 0.04); color: #111827; }
    .pe-edu-add {
      align-self: flex-start;
      margin-top: 2px;
      display: inline-flex;
      align-items: center;
      gap: 5px;
      padding: 5px 11px;
      border: 1px dashed rgba(17, 24, 39, 0.24);
      border-radius: 999px;
      background: #fff;
      font-size: 12.5px;
      font-weight: 300;
      color: #374151;
      cursor: pointer;
    }
    .pe-edu-add .pe-ico { color: #6b7280; }
    .pe-edu-add:hover { background: rgba(17, 24, 39, 0.03); }
    .pe-group-sub {
      font-size: 12.5px;
      font-weight: 300;
      color: #6b7280;
      margin: -2px 0 10px;
    }

    /* Predictive school combobox (light dropdown under the field) */
    .pe-combo { position: relative; }
    .pe-combo .pe-edu-inst { padding-right: 34px; }
    .pe-combo-caret {
      position: absolute;
      top: 50%;
      right: 12px;
      transform: translateY(-50%);
      display: grid;
      place-items: center;
      color: #6b7280;
      pointer-events: none;
    }
    .pe-combo-caret .pe-ico { display: block; }
    .pe-combo-caret .pe-ico-minus { display: none; }
    .pe-combo.is-open .pe-combo-caret .pe-ico-plus { display: none; }
    .pe-combo.is-open .pe-combo-caret .pe-ico-minus { display: block; }
    .pe-combo-panel {
      position: absolute;
      z-index: 6;
      top: calc(100% + 6px);
      left: 0;
      right: 0;
      max-height: 240px;
      overflow-y: auto;
      padding: 6px;
      background: #fff;
      border: 1px solid rgba(17, 24, 39, 0.14);
      border-radius: 8px;
      box-shadow: 0 16px 40px rgba(17, 24, 39, 0.16);
    }
    .pe-combo-panel[hidden] { display: none; }
    .pe-combo-option {
      display: block;
      width: 100%;
      padding: 8px 10px;
      border: none;
      border-radius: 5px;
      background: none;
      font: inherit;
      font-size: 13.5px;
      font-weight: 300;
      color: #374151;
      text-align: left;
      cursor: pointer;
    }
    .pe-combo-option:hover { background: rgba(17, 24, 39, 0.04); }
    .pe-combo-empty {
      padding: 10px;
      font-size: 12.5px;
      font-weight: 300;
      color: #9ca3af;
    }

    /* ===== Profile editor modal ===== */
    /* Both classes are on the dialog element; the base `.community-auth-dialog`
       rule appears later in this file, so we raise specificity here to win. */
    .community-auth-dialog.pe-dialog {
      width: min(820px, calc(100vw - 32px));
      /* top is 12vh; leave ~6vh below so the form clears the screen bottom */
      max-height: 82vh;
      overflow-y: auto;
      padding-bottom: 32px;
      border-radius: 8px;
    }
    .pe-dialog .community-auth-close { top: 12px; right: 12px; color: #9ca3af; }
    .pe-dialog .community-auth-close:hover { color: #111827; }
    .pe-dialog .community-auth-sub { margin-bottom: 24px; }
    .pe-form { display: flex; flex-direction: column; gap: 4px; }
    .pe-photo-row {
      display: flex;
      align-items: center;
      gap: 16px;
      padding-bottom: 20px;
      margin-bottom: 8px;
      border-bottom: 1px solid rgba(17, 24, 39, 0.08);
    }
    .pe-avatar { width: 88px; height: 88px; font-size: 26px; flex: 0 0 auto; overflow: hidden; }
    .pe-avatar.is-draggable { cursor: grab; }
    .pe-avatar.is-draggable.is-dragging { cursor: grabbing; }
    .pe-avatar.is-draggable img { user-select: none; -webkit-user-drag: none; }
    .pe-photo-actions { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
    .pe-photo-btn {
      display: inline-block;
      padding: 0;
      border: none;
      background: none;
      font-size: 14px;
      font-weight: 400;
      color: #111827;
      cursor: pointer;
      text-decoration: underline;
      text-underline-offset: 3px;
      text-decoration-color: rgba(17, 24, 39, 0.28);
    }
    .pe-photo-btn:hover { text-decoration-color: #111827; }
    .pe-photo-hint { font-size: 11.5px; font-weight: 300; color: #9ca3af; }
    .pe-label {
      font-size: 11px;
      font-weight: 500;
      letter-spacing: 0.04em;
      text-transform: uppercase;
      color: #9ca3af;
      margin-top: 20px;
      margin-bottom: 6px;
    }
    .pe-input {
      width: 100%;
      padding: 10px 12px;
      border: 1px solid rgba(17, 24, 39, 0.16);
      border-radius: 6px;
      font-size: 14px;
      font-weight: 300;
      font-family: inherit;
      color: #111827;
    }
    .pe-input::placeholder { font-weight: 300; color: #9ca3af; }
    .pe-input:focus { outline: none; border-color: var(--ink); }
    .pe-textarea { resize: vertical; line-height: 1.5; }
    .pe-group-label {
      font-family: var(--display);
      font-size: 20px;
      font-weight: 400;
      color: #111827;
      margin: 22px 0 8px;
    }
    .pe-chips { display: flex; flex-wrap: wrap; gap: 6px; }
    .pe-chip {
      display: inline-flex;
      align-items: center;
      gap: 5px;
      padding: 6px 11px;
      border: 1px solid rgba(17, 24, 39, 0.14);
      border-radius: 999px;
      background: #fff;
      font-size: 12.5px;
      font-weight: 300;
      color: #374151;
      cursor: pointer;
      transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
    }
    .pe-chip:hover { border-color: rgba(17, 24, 39, 0.3); }
    .pe-chip.is-selected {
      background: var(--ink);
      border-color: var(--ink);
      color: #fff;
    }
    .pe-chip-emoji { font-size: 13px; line-height: 1; }

    /* Dropdown multi-select */
    .pe-ms { position: relative; }
    .pe-ms-control {
      width: 100%;
      display: flex;
      align-items: center;
      gap: 8px;
      min-height: 44px;
      padding: 7px 10px 7px 12px;
      border: 1px solid rgba(17, 24, 39, 0.16);
      border-radius: 6px;
      background: #fff;
      font: inherit;
      cursor: pointer;
      text-align: left;
    }
    .pe-ms.is-open .pe-ms-control { border-color: var(--ink); }
    .pe-ms-tags {
      flex: 1 1 auto;
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
      min-width: 0;
    }
    .pe-ms-placeholder { font-size: 14px; font-weight: 300; color: #9ca3af; }
    /* Matches the app.qava.ai signup chips: small, light-gray, no border. */
    .pe-ms-tag {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      padding: 5px 8px 5px 10px;
      border-radius: 999px;
      background: #f3f4f6;
      color: #1f2937;
      border: none;
      font-size: 13px;
      font-weight: 300;
      line-height: 1.2;
    }
    .pe-ms-tag-emoji { font-size: 13px; line-height: 1; }
    .pe-ms-tag-x {
      display: inline-grid;
      place-items: center;
      width: 15px; height: 15px;
      border-radius: 999px;
      background: transparent;
      color: #9ca3af;
      font-size: 12px;
      line-height: 1;
      cursor: pointer;
    }
    .pe-ms-tag-x:hover { background: rgba(17, 24, 39, 0.1); color: #374151; }
    .pe-ms-caret { flex: 0 0 auto; color: #6b7280; display: grid; place-items: center; }
    .pe-ms-caret .pe-ico { display: block; }
    .pe-ms-caret .pe-ico-minus { display: none; }
    .pe-ms.is-open .pe-ms-caret .pe-ico-plus { display: none; }
    .pe-ms.is-open .pe-ms-caret .pe-ico-minus { display: block; }
    .pe-ms-panel {
      position: absolute;
      z-index: 5;
      top: calc(100% + 6px);
      left: 0;
      right: 0;
      max-height: 260px;
      overflow-y: auto;
      padding: 6px;
      background: #fff;
      border: 1px solid rgba(17, 24, 39, 0.14);
      border-radius: 8px;
      box-shadow: 0 16px 40px rgba(17, 24, 39, 0.16);
    }
    .pe-ms-panel[hidden] { display: none; }
    .pe-ms-option {
      width: 100%;
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 8px 10px;
      border: none;
      border-radius: 5px;
      background: none;
      font: inherit;
      font-size: 13.5px;
      font-weight: 300;
      color: #374151;
      cursor: pointer;
      text-align: left;
    }
    .pe-ms-option:hover { background: rgba(17, 24, 39, 0.04); }
    .pe-ms-check {
      flex: 0 0 auto;
      width: 18px; height: 18px;
      border: 1px solid #d0d0d0;
      border-radius: 4px;
      background: #fff;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: border-color 0.2s ease;
    }
    .pe-ms-check svg {
      opacity: 0;
      transform: scale(0);
      transition: opacity 0.2s ease, transform 0.2s ease;
    }
    .pe-ms-option.is-selected .pe-ms-check { border-color: #000; }
    .pe-ms-option.is-selected .pe-ms-check svg {
      opacity: 1;
      transform: scale(1);
    }
    .pe-ms-emoji { flex: 0 0 auto; font-size: 14px; line-height: 1; }
    .pe-ms-optlabel { flex: 1 1 auto; }

    /* Optional single-select role dropdown (mirrors the multi-select styling) */
    .pe-optional {
      text-transform: none;
      letter-spacing: 0;
      font-weight: 300;
      color: #b0b4bd;
      margin-left: 6px;
    }
    .pe-cell-field + .pe-role { margin-top: 12px; }
    .pe-role { position: relative; margin-bottom: 4px; }
    .pe-role-control {
      width: 100%;
      display: flex;
      align-items: center;
      gap: 8px;
      min-height: 44px;
      padding: 7px 10px 7px 12px;
      border: 1px solid rgba(17, 24, 39, 0.16);
      border-radius: 6px;
      background: #fff;
      font: inherit;
      cursor: pointer;
      text-align: left;
    }
    .pe-role.is-open .pe-role-control { border-color: var(--ink); }
    .pe-role-value {
      flex: 1 1 auto;
      min-width: 0;
      font-size: 14px;
      font-weight: 300;
      color: #111827;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .pe-role-control.is-placeholder .pe-role-value { color: #9ca3af; }
    .pe-role-panel {
      position: absolute;
      z-index: 5;
      top: calc(100% + 6px);
      left: 0;
      right: 0;
      max-height: 260px;
      overflow-y: auto;
      padding: 6px;
      background: #fff;
      border: 1px solid rgba(17, 24, 39, 0.14);
      border-radius: 8px;
      box-shadow: 0 16px 40px rgba(17, 24, 39, 0.16);
    }
    .pe-role-panel[hidden] { display: none; }
    .pe-role-option {
      width: 100%;
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 8px 10px;
      border: none;
      border-radius: 5px;
      background: none;
      font: inherit;
      font-size: 13.5px;
      font-weight: 300;
      color: #374151;
      cursor: pointer;
      text-align: left;
    }
    .pe-role-option:hover { background: rgba(17, 24, 39, 0.04); }
    .pe-role-optlabel { flex: 1 1 auto; }
    .pe-role-tick { flex: 0 0 auto; display: inline-grid; place-items: center; opacity: 0; transform: scale(0); transition: opacity 0.15s ease, transform 0.15s ease; }
    .pe-role-option.is-selected .pe-role-tick { opacity: 1; transform: scale(1); }
    .pe-role-other { margin-top: 8px; }
    .pe-role-other[hidden] { display: none; }
    .pe-bio-after-role { margin-top: 8px; }
    .pe-name-row {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 10px;
      margin-top: 4px;
    }
    .pe-username-field { margin-top: 10px; margin-bottom: 2px; }
    .pe-username-input {
      display: flex;
      align-items: center;
      gap: 0;
      border: 1px solid #e5e7eb;
      border-radius: 8px;
      background: #fff;
      overflow: hidden;
    }
    .pe-username-input:focus-within { border-color: var(--ink); }
    .pe-username-at {
      flex: 0 0 auto;
      padding: 0 0 0 12px;
      font-size: 14px;
      font-weight: 400;
      color: #9ca3af;
      line-height: 1;
      user-select: none;
    }
    .pe-username-input .pe-input {
      border: none;
      border-radius: 0;
      padding-left: 4px;
      background: transparent;
    }
    .pe-username-input .pe-input:focus { outline: none; border: none; }
    .pe-username-hint {
      margin: 6px 0 0;
      font-size: 11px;
      font-weight: 300;
      color: #9ca3af;
      line-height: 1.35;
    }
    .pe-cell-field { margin-top: 10px; margin-bottom: 2px; }
    @media (max-width: 480px) {
      .pe-name-row { grid-template-columns: 1fr; }
    }

    .pe-actions {
      display: flex;
      justify-content: flex-end;
      align-items: center;
      gap: 10px;
      margin-top: 24px;
    }
    /* Cancel: plain gray text, turns black on hover. */
    .pe-cancel {
      margin: 0;
      padding: 6px 14px;
      font-size: 12px;
      line-height: 1.2;
      border: none;
      border-radius: 6px;
      background: none;
      color: #9ca3af;
      font-weight: 200;
      cursor: pointer;
    }
    .pe-cancel:hover { background: none; color: #111827; }
    /* Save: grey filled pill (same dimensions as Cancel), smaller font.
       Combined selector beats the later `.community-auth-submit` base rule. */
    .community-auth-submit.pe-save {
      width: auto;
      margin: 0;
      padding: 6px 14px;
      font-size: 11px;
      font-weight: 400;
      line-height: 1.2;
      border: none;
      border-radius: 6px;
      background: #111827;
      color: #fff;
      cursor: pointer;
    }
    .community-auth-submit.pe-save:hover:not(:disabled) { background: #000; }
    .community-auth-submit.pe-save:disabled {
      background: #e5e7eb;
      color: #9ca3af;
      opacity: 1;
      cursor: default;
    }

    /* ===== Community auth + live-state UI ===== */

    /* Empty feed state (API reachable, no live threads yet) */
    .feed-empty {
      display: flex;
      flex-direction: column;
      align-items: center;
      text-align: center;
      gap: 10px;
      padding: 56px 24px;
      color: var(--muted);
    }
    .feed-empty-icon {
      width: 46px;
      height: 46px;
      display: grid;
      place-items: center;
      border-radius: 14px;
      background: var(--panel-soft);
      border: 1px solid var(--hairline);
      color: var(--ink);
    }
    .feed-empty-icon svg { width: 22px; height: 22px; }
    .feed-empty h3 { font-size: 17px; font-weight: 600; color: var(--ink); }
    .feed-empty p { font-size: 14px; font-weight: 300; max-width: 340px; }

    /* Header auth control */
    .community-auth-control { display: inline-flex; align-items: center; }
    .community-auth-signin {
      appearance: none;
      border: 1px solid var(--hairline);
      background: #fff;
      color: var(--ink);
      font: inherit;
      font-size: 14px;
      font-weight: 500;
      padding: 8px 16px;
      border-radius: 999px;
      cursor: pointer;
      transition: background .15s ease, border-color .15s ease;
    }
    .community-auth-signin:hover { background: var(--panel-soft); border-color: rgba(17,24,39,0.18); }

    .community-auth-control { position: relative; }
    .community-auth-chip {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      border: none;
      background: none;
      border-radius: 999px;
      padding: 0;
      cursor: pointer;
      font: inherit;
    }
    .community-auth-chip:hover .community-auth-avatar,
    .community-auth-chip[aria-expanded="true"] .community-auth-avatar {
      border-color: var(--ink);
    }
    .community-auth-avatar {
      width: 28px; height: 28px;
      border-radius: 50%;
      background: #fff;
      color: var(--ink);
      border: 1px solid var(--ink);
      display: grid; place-items: center;
      line-height: 1;
      box-sizing: border-box;
    }
    .community-auth-avatar svg {
      width: 14px;
      height: 14px;
      display: block;
    }
    .community-auth-name { display: none; }
    .community-auth-badge {
      font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .4px;
      color: #92400e; background: #fef3c7; padding: 2px 6px; border-radius: 6px;
    }
    /* Match app.qava.ai Header profile dropdown */
    .community-auth-menu {
      position: absolute;
      top: calc(100% + 8px);
      right: 0;
      width: 220px;
      background: #fff;
      border: none;
      border-radius: 8px;
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
      padding: 6px 0;
      display: flex;
      flex-direction: column;
      z-index: 50;
    }
    .community-auth-menu[hidden] { display: none; }
    .community-auth-menu-header { padding: 0 12px 2px; }
    .community-auth-menu-title {
      margin: 0;
      font-size: 13px;
      font-weight: 500;
      color: #111111;
      line-height: 16px;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .community-auth-menu-email {
      margin: 0;
      font-size: 11px;
      font-weight: 300;
      color: #7c7c7c;
      line-height: 14px;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .community-auth-menu-divider {
      height: 1px;
      background: #e6e6e6;
      margin: 4px 0;
    }
    .community-auth-menu-item {
      appearance: none;
      border: none;
      background: none;
      text-align: left;
      font: inherit;
      padding: 2px 8px;
      border-radius: 0;
      cursor: pointer;
      width: 100%;
      color: #111111;
      text-decoration: none;
      box-sizing: border-box;
    }
    .community-auth-menu-item-inner {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      width: 100%;
      box-sizing: border-box;
      padding: 4px 6px;
      border-radius: 6px;
      font-size: 13px;
      font-weight: 300;
      color: #111111;
      line-height: 1.3;
      transition: background-color 0.15s ease;
    }
    .community-auth-menu-item-inner svg { flex: 0 0 auto; color: #111111; }
    .community-auth-menu-item:hover .community-auth-menu-item-inner {
      background: rgba(0, 0, 0, 0.04);
    }

    /* Sign-in modal */
    body.community-auth-open { overflow: hidden; }
    /* !important defeats the site-wide `body > *` z-index/position rule in
       qava-landing.css, which would otherwise drop the modal to z-index:1. */
    .community-auth-modal {
      position: fixed !important;
      inset: 0;
      z-index: 4000 !important;
    }
    .community-auth-modal[hidden] { display: none !important; }
    .community-auth-overlay {
      position: fixed; inset: 0;
      background: rgba(17,24,39,0.45);
      backdrop-filter: blur(3px);
    }
    /* Centre against the viewport via left:50% (robust even when the page has
       horizontal overflow, unlike margin:auto / flex centering). */
    .community-auth-dialog {
      position: fixed;
      top: 12vh;
      left: 50%;
      transform: translateX(-50%);
      width: min(420px, calc(100vw - 32px));
      background: #fff;
      border-radius: 18px;
      padding: 28px 26px 22px;
      box-shadow: 0 24px 60px rgba(17,24,39,0.28);
      animation: communityAuthPop .18s ease-out;
    }
    @keyframes communityAuthPop {
      from { transform: translateX(-50%) translateY(8px); opacity: 0; }
      to { transform: translateX(-50%) translateY(0); opacity: 1; }
    }
    .community-auth-close {
      position: absolute; top: 12px; right: 12px;
      appearance: none; border: none; background: none;
      display: inline-flex; align-items: center; justify-content: center;
      width: 24px; height: 24px; padding: 0; line-height: 0;
      color: #9ca3af; cursor: pointer;
      transition: color 0.15s ease;
    }
    .community-auth-close svg { display: block; width: 14px; height: 14px; }
    .community-auth-close:hover { color: #111827; background: none; }
    .community-auth-dialog h2 { font-family: var(--display); font-size: 26px; font-weight: 400; color: var(--ink); }
    .community-auth-sub { margin-top: 8px; font-size: 14px; font-weight: 300; color: var(--muted); }
    .community-auth-form { margin-top: 18px; display: flex; flex-direction: column; gap: 8px; }
    .community-auth-form[hidden] { display: none !important; }
    .community-auth-form label { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); }
    .community-auth-form input {
      font: inherit; font-size: 15px; font-weight: 300;
      padding: 11px 13px;
      border: 1px solid rgba(17,24,39,0.16);
      border-radius: 10px;
      outline: none;
    }
    .community-auth-form input:focus { border-color: var(--ink); }
    .community-auth-submit {
      margin-top: 6px;
      appearance: none; border: none;
      background: var(--ink); color: #fff;
      font: inherit; font-size: 15px; font-weight: 500;
      padding: 12px 16px; border-radius: 10px; cursor: pointer;
    }
    .community-auth-submit:disabled { opacity: .6; cursor: default; }
    .community-auth-link {
      appearance: none; border: none; background: none;
      font: inherit; font-size: 13px; color: var(--muted);
      cursor: pointer; text-decoration: underline; padding: 4px 0;
    }
    .community-auth-msg { margin-top: 12px; font-size: 13px; border-radius: 8px; padding: 9px 11px; }
    .community-auth-msg.is-info { background: #eff6ff; color: #1e40af; }
    .community-auth-msg.is-success { background: #ecfdf5; color: #065f46; }
    .community-auth-msg.is-error { background: #fef2f2; color: #991b1b; }
    .community-auth-foot { margin-top: 16px; font-size: 13px; font-weight: 300; color: var(--muted); }
    .community-auth-foot a { text-decoration: underline; }

    /* Toast (write feedback) */
    .community-toast {
      position: fixed;
      left: 50%;
      bottom: 26px;
      transform: translateX(-50%) translateY(12px);
      background: var(--ink);
      color: #fff;
      font-size: 14px;
      padding: 11px 18px;
      border-radius: 999px;
      box-shadow: 0 12px 32px rgba(17,24,39,0.28);
      opacity: 0;
      transition: opacity .25s ease, transform .25s ease;
      position: fixed !important;
      z-index: 4100 !important;
      max-width: 90vw;
    }
    .community-toast.is-visible { opacity: 1; transform: translateX(-50%) translateY(0); }
    .community-toast.is-error { background: #991b1b; }
    .community-toast.is-success { background: #065f46; }
