/* Hub Advisor — final glass polish + Radix UI shell (Dialog, ScrollArea) */

:root {
  --hub-z: 200;
  --hub-navy: #04121f;
  /* Mobile: readable without heavy opacity */
  --hub-bg: rgba(5, 13, 20, 0.78);
  --hub-surface: rgba(10, 22, 32, 0.5);
  /* Desktop glass — very low tint, high blur lets hero shine through */
  --hub-panel: rgba(4, 14, 22, 0.26);
  --hub-glass: rgba(6, 18, 28, 0.3);
  --hub-border: rgba(255, 255, 255, 0.065);
  --hub-border-soft: rgba(255, 255, 255, 0.04);
  --hub-text: #eef4f7;
  --hub-muted: #8aa3b2;
  --hub-teal: #00a8a8;
  --hub-teal-soft: rgba(0, 168, 168, 0.14);
  --hub-gold: #e8a317;
  --hub-shadow: 0 14px 36px rgba(0, 0, 0, 0.28);
  --hub-glow: 0 0 28px rgba(0, 168, 168, 0.035);
  --hub-blur: blur(22px) saturate(1.32);
  --hub-blur-panel: blur(40px) saturate(1.52);
  --hub-panel-height: 62vh;
  --hub-panel-max-height: 68vh;
  /* Desktop width — narrow companion panel; hero keeps visual priority */
  --hub-panel-width: 22rem;
  --hub-typewriter-ms: 22ms;
  --hub-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --hub-ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --hub-chip-stagger: 40ms;
  --hub-bubble-radius: 0.75rem;
  --hub-header-h: 2.625rem;
  --hub-tap: 2.75rem;
  --hub-launch-size: 3rem;
  --hub-launch-icon: 1.375rem;
  /* Launch FAB — whisper-thin glass so hero copy stays readable underneath */
  --hub-launch-bg: rgba(4, 14, 22, 0.14);
  --hub-launch-bg-hover: rgba(6, 20, 30, 0.32);
  --hub-launch-blur: blur(10px) saturate(1.2);
  --hub-launch-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Full-viewport layer so FAB stays above mobile feed-scroll / hero */
#hub-advisor-root {
  position: fixed;
  inset: 0;
  z-index: var(--hub-z);
  pointer-events: none;
}

/* Launch FAB — circular, transparent; draggable via advisor-shell.jsx */
.hub-launch {
  position: fixed;
  right: max(1rem, env(safe-area-inset-right, 0px));
  bottom: max(1.25rem, calc(1.25rem + env(safe-area-inset-bottom, 0px)));
  z-index: calc(var(--hub-z) + 1);
  pointer-events: auto;
  width: var(--hub-launch-size);
  height: var(--hub-launch-size);
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: var(--hub-launch-bg);
  backdrop-filter: var(--hub-launch-blur);
  -webkit-backdrop-filter: var(--hub-launch-blur);
  color: var(--hub-text);
  box-shadow: var(--hub-launch-shadow);
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  transition:
    opacity 0.28s var(--hub-ease-out),
    transform 0.28s var(--hub-ease-out),
    border-color 0.28s var(--hub-ease-out),
    box-shadow 0.28s var(--hub-ease-out),
    background 0.28s var(--hub-ease-out);
}

/* User-dragged position — left/top set inline from React */
.hub-launch.is-placed {
  right: auto;
  bottom: auto;
}

.hub-launch-icon {
  width: var(--hub-launch-icon);
  height: var(--hub-launch-icon);
  flex-shrink: 0;
  color: rgba(255, 255, 255, 0.95);
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.55));
  transition: color 0.2s var(--hub-ease-out), transform 0.2s var(--hub-ease-out);
  pointer-events: none;
}

.hub-launch:hover,
.hub-launch:focus-visible {
  border-color: rgba(0, 168, 168, 0.22);
  background: var(--hub-launch-bg-hover);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.16), 0 0 16px rgba(0, 168, 168, 0.06);
}

.hub-launch:hover .hub-launch-icon,
.hub-launch:focus-visible .hub-launch-icon {
  color: var(--hub-teal);
  transform: scale(1.04);
}

.hub-launch.is-dragging {
  cursor: grabbing;
  background: rgba(6, 20, 30, 0.38);
  border-color: rgba(0, 168, 168, 0.3);
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.22);
  transition: none;
}

.hub-launch:focus-visible {
  outline: 2px solid var(--hub-teal);
  outline-offset: 2px;
}

.hub-launch.is-hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
}

/* --------------------------------------------------------------------------
   Panel — desktop: compact bottom-right glass; mobile: full-screen
   -------------------------------------------------------------------------- */
.hub-panel {
  position: fixed;
  z-index: calc(var(--hub-z) + 1);
  display: flex;
  flex-direction: column;
  min-height: 0;
  overscroll-behavior: contain;
  color: var(--hub-text);
  background: var(--hub-panel);
  backdrop-filter: var(--hub-blur-panel);
  -webkit-backdrop-filter: var(--hub-blur-panel);
  border: 1px solid var(--hub-border-soft);
  box-shadow: var(--hub-shadow), var(--hub-glow);
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px) scale(0.985);
  transition:
    opacity 0.32s var(--hub-ease-out),
    transform 0.32s var(--hub-ease-out),
    box-shadow 0.32s var(--hub-ease-out);
}

/* Whisper-thin glass sheen — premium without obscuring the hero */
.hub-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  background: linear-gradient(
    160deg,
    rgba(255, 255, 255, 0.04) 0%,
    rgba(255, 255, 255, 0.008) 35%,
    rgba(255, 255, 255, 0) 70%
  );
}

.hub-panel[data-state="open"],
.hub-panel.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
  box-shadow: var(--hub-shadow), 0 0 32px rgba(0, 168, 168, 0.04);
}

/* Radix Dialog — cinematic overlay (stronger on mobile, whisper on desktop) */
.hub-dialog-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--hub-z);
  background: rgba(2, 8, 14, 0.55);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  animation: hubOverlayIn 0.28s var(--hub-ease-out);
  overscroll-behavior: contain;
  touch-action: none;
}

.hub-dialog-overlay[data-state="closed"] {
  animation: hubOverlayOut 0.22s var(--hub-ease-out) forwards;
}

@keyframes hubOverlayIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes hubOverlayOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

@media (min-width: 768px) {
  .hub-dialog-overlay {
    background: rgba(2, 8, 14, 0.12);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    pointer-events: none;
  }
}

/* Radix Dialog.Content — panel open/close motion */
.hub-panel[data-radix-dialog-content] {
  max-width: none;
  margin: 0;
}

.hub-panel[data-state="closed"] {
  opacity: 0;
  pointer-events: none;
}

.hub-panel[data-state="open"] {
  animation: hubPanelIn 0.32s var(--hub-ease-out);
}

@keyframes hubPanelIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Radix ScrollArea — accessible message scroller */
.hub-scroll-root {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  position: relative;
  z-index: 1;
}

.hub-scroll-viewport {
  height: 100%;
  width: 100%;
  border-radius: inherit;
  overscroll-behavior: contain;
  overflow-anchor: none;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  overflow-y: auto;
  overflow-x: hidden;
  scroll-behavior: auto;
  background: linear-gradient(
    180deg,
    rgba(0, 168, 168, 0.055) 0%,
    rgba(0, 168, 168, 0.015) 22%,
    transparent 48%
  );
}

.hub-scroll-bar {
  display: flex;
  touch-action: none;
  user-select: none;
  padding: 2px 0;
  width: 8px;
  background: transparent;
}

.hub-scroll-bar[data-orientation="vertical"] {
  right: 2px;
}

.hub-scroll-thumb {
  flex: 1;
  background: rgba(255, 255, 255, 0.14);
  border-radius: 9999px;
  position: relative;
}

.hub-scroll-thumb::before {
  content: "";
  position: absolute;
  inset: 0 -4px;
}

.hub-scroll-thumb:hover {
  background: rgba(0, 168, 168, 0.35);
}

.hub-scroll-corner {
  background: transparent;
}

/* Floating "scroll to latest" — visible when user scrolls up during generation */
.hub-scroll-pill {
  position: absolute;
  bottom: 5.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(1.25rem);
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  border: 1px solid var(--hub-border);
  background: var(--hub-glass);
  backdrop-filter: var(--hub-blur);
  -webkit-backdrop-filter: var(--hub-blur);
  box-shadow: var(--hub-shadow);
  color: var(--hub-text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.2s var(--hub-ease),
    transform 0.2s var(--hub-ease);
  z-index: 6;
}

.hub-scroll-pill.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.hub-scroll-pill:active {
  transform: translateX(-50%) scale(0.92);
}

.hub-scroll-pill:focus-visible {
  outline: 2px solid var(--hub-teal);
  outline-offset: 2px;
}

@media (max-width: 767px) {
  .hub-scroll-pill {
    bottom: 6.5rem;
  }
}

/* Lock landing-page scroll while advisor panel is open (all viewports). */
html.hub-advisor-open {
  overflow: hidden !important;
  overscroll-behavior: none;
  height: 100%;
  width: 100%;
}

body.hub-advisor-open {
  overflow: hidden !important;
  overscroll-behavior: none;
  touch-action: none;
}

@media (max-width: 767px) {
  body.hub-advisor-open {
    touch-action: manipulation;
  }
}

html.hub-advisor-open .feed-scroll {
  overflow: hidden !important;
  touch-action: none;
}

/* Desktop — compact companion panel; hero narrative stays primary */
@media (min-width: 768px) {
  .hub-panel {
    top: auto;
    right: max(1.25rem, env(safe-area-inset-right, 0px));
    bottom: max(1.25rem, env(safe-area-inset-bottom, 0px));
    width: min(var(--hub-panel-width), calc(100vw - 2.5rem));
    height: min(var(--hub-panel-height), var(--hub-panel-max-height));
    max-height: var(--hub-panel-max-height);
    border-radius: 0.8rem;
  }

  .hub-header {
    background: rgba(0, 0, 0, 0.04);
    border-bottom-color: var(--hub-border-soft);
  }

  .hub-footer {
    background: rgba(0, 0, 0, 0.05);
    border-top-color: var(--hub-border-soft);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }

  /* Legibility on ultra-transparent glass */
  .hub-msg--assistant .hub-text,
  .hub-msg--opener .hub-text {
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
  }

  .hub-msg--user .hub-text {
    background: rgba(0, 168, 168, 0.16);
    border: none;
    text-shadow: none;
  }

  .hub-input-bar {
    background: rgba(6, 16, 24, 0.48);
    border-color: var(--hub-border-soft);
  }

  .hub-chip {
    background: rgba(6, 16, 24, 0.42);
    border-color: var(--hub-border-soft);
  }
}

/* Mobile — full-screen; lighter blur for GPU; denser tint for readability */
@media (max-width: 767px) {
  .hub-panel {
    inset: 0;
    width: 100%;
    height: 100dvh;
    max-height: 100dvh;
    border: none;
    border-radius: 0;
    background: var(--hub-bg);
    backdrop-filter: var(--hub-blur);
    -webkit-backdrop-filter: var(--hub-blur);
    transform: translateY(6px);
    padding:
      env(safe-area-inset-top, 0px)
      env(safe-area-inset-right, 0px)
      0
      env(safe-area-inset-left, 0px);
  }

  .hub-panel[data-state="open"],
  .hub-panel.is-open {
    transform: translateY(0);
  }

  html.hub-advisor-open {
    overflow: hidden;
  }

  .hub-header {
    flex-basis: var(--hub-tap);
    min-height: var(--hub-tap);
    padding: 0 1rem;
  }

  .hub-icon-btn {
    width: var(--hub-tap);
    height: var(--hub-tap);
  }

  .hub-thread {
    padding: 1.125rem 1rem 0.75rem;
    gap: 1rem;
  }

  .hub-chips {
    gap: 0.5rem;
    padding: 0.625rem 1rem 0;
  }

  .hub-chips--opener {
    gap: 0.2rem;
  }

  .hub-chips--in-thread {
    gap: 0.4rem;
    padding: 0.5rem 0.15rem 0.35rem;
  }

  .hub-chips--in-thread .hub-chip,
  .hub-chips--round2 .hub-chip {
    min-height: var(--hub-tap);
    font-size: 1rem;
    padding: 0.65rem 0.85rem;
    display: flex;
    align-items: center;
    width: 100%;
    border-radius: 0.5rem;
    background: rgba(0, 168, 168, 0.08);
    border: 1px solid rgba(0, 224, 224, 0.22);
    color: rgba(0, 224, 224, 0.95);
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
  }

  .hub-chips--in-thread .hub-chip:active,
  .hub-chips--round2 .hub-chip:active {
    background: rgba(0, 168, 168, 0.16);
    transform: scale(0.98);
  }

  .hub-chips--opener {
    gap: 0.4rem;
  }

  .hub-chips--followup {
    flex-wrap: nowrap;
    overflow-x: auto;
  }

  .hub-chip {
    font-size: 0.875rem;
    padding: 0.65rem 1rem;
    min-height: var(--hub-tap);
    display: inline-flex;
    align-items: center;
  }

  .hub-capture {
    padding: 0.75rem 1rem 0.35rem;
  }

  .hub-capture input[type="email"],
  .hub-capture input[type="text"] {
    min-height: var(--hub-tap);
    font-size: 1rem;
    padding: 0.65rem 0.75rem;
  }

  .hub-capture-actions {
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.55rem;
  }

  .hub-btn {
    min-height: var(--hub-tap);
    font-size: 0.875rem;
    padding: 0.65rem 1rem;
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .hub-capture-consent {
    font-size: 0.8125rem;
    margin-top: 0.5rem;
    gap: 0.5rem;
  }

  .hub-capture-consent input[type="checkbox"] {
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
    margin-top: 0.1rem;
  }

  .hub-capture-title {
    font-size: 0.9375rem;
  }

  .hub-capture-sub,
  .hub-capture-hint {
    font-size: 0.8125rem;
  }

  .hub-composer {
    padding: 0.625rem 1rem calc(0.625rem + env(safe-area-inset-bottom, 0px));
  }

  .hub-input-bar {
    padding: 0.55rem 0.55rem 0.55rem 1rem;
  }

  .hub-send {
    width: var(--hub-tap);
    height: var(--hub-tap);
  }

  .hub-launch {
    width: var(--hub-tap);
    height: var(--hub-tap);
    --hub-launch-size: var(--hub-tap);
    --hub-launch-icon: 1.5rem;
    bottom: max(1.25rem, calc(1.25rem + env(safe-area-inset-bottom, 0px)));
    /* Visible on hero but still light — drag if it covers copy */
    --hub-launch-bg: rgba(4, 14, 22, 0.32);
    --hub-launch-blur: blur(8px) saturate(1.2);
    --hub-launch-shadow: 0 2px 14px rgba(0, 0, 0, 0.28);
    border-color: rgba(255, 255, 255, 0.12);
  }

  .hub-launch:hover,
  .hub-launch:focus-visible,
  .hub-launch.is-dragging {
    --hub-launch-bg: rgba(4, 14, 22, 0.48);
    --hub-launch-shadow: 0 4px 18px rgba(0, 0, 0, 0.32);
  }

  .hub-msg--user .hub-text {
    max-width: 88%;
    padding: 0.45rem 0.7rem;
  }

  .hub-msg--chip .hub-text {
    padding: 0.3rem 0.55rem;
  }

  .hub-msg--locale-zh .hub-text,
  .hub-msg--locale-zh .hub-opener-live {
    font-size: 1rem;
    line-height: 1.75;
    letter-spacing: 0.01em;
  }

  .hub-msg--assistant > .hub-text {
    font-size: 0.9375rem;
    line-height: 1.62;
  }

  .hub-reveal-card,
  .hub-letter {
    max-width: 100%;
  }

  .hub-letter-body {
    font-size: 0.8125rem;
  }
}

@media (prefers-reduced-transparency: reduce) {
  .hub-panel,
  .hub-launch {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: rgba(6, 16, 24, 0.94);
  }

  .hub-footer {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}

/* Minimal header */
.hub-header {
  flex: 0 0 var(--hub-header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0.875rem;
  border-bottom: 1px solid var(--hub-border-soft);
  background: rgba(0, 0, 0, 0.08);
  position: relative;
  z-index: 1;
  transition: background 0.28s var(--hub-ease-out);
}

.hub-header-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.hub-header-titles {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  min-width: 0;
}

.hub-header-sub {
  display: none !important;
}

.hub-title {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hub-partner-badge {
  display: inline-block;
  margin-top: 0.15rem;
  padding: 0.1rem 0.45rem;
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #86efac;
  background: rgba(134, 239, 172, 0.12);
  border: 1px solid rgba(134, 239, 172, 0.35);
  border-radius: 999px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.hub-status {
  flex-shrink: 0;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 9999px;
  transition: background 0.25s var(--hub-ease-out), box-shadow 0.25s var(--hub-ease-out), opacity 0.25s;
}

/* Offline / reconnecting — muted grey */
.hub-status.is-offline {
  background: #728998;
  opacity: 0.75;
  box-shadow: none;
}

/* Online — bright teal, clearly visible */
.hub-status.is-live {
  background: #00e0e0;
  opacity: 1;
  box-shadow:
    0 0 0 2px rgba(0, 224, 224, 0.22),
    0 0 10px rgba(0, 224, 224, 0.55);
}

.hub-header-actions {
  display: flex;
  gap: 0.125rem;
}

.hub-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.875rem;
  height: 1.875rem;
  padding: 0;
  border: none;
  border-radius: 0.375rem;
  background: transparent;
  color: var(--hub-muted);
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}

.hub-icon-btn:hover {
  color: var(--hub-text);
  background: rgba(255, 255, 255, 0.05);
}

/* --------------------------------------------------------------------------
   Thread — fills available height, smooth scroll
   -------------------------------------------------------------------------- */
@keyframes hubMsgIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hub-thread {
  flex: 1 1 auto;
  min-height: 100%;
  overflow: visible;
  overscroll-behavior: contain;
  padding: 1.125rem 0.875rem 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 0.875rem;
  position: relative;
  z-index: 1;
}

.hub-msg,
.hub-chips--in-thread {
  scroll-margin-bottom: 1rem;
}

.hub-msg {
  display: flex;
  flex-direction: column;
  animation: hubMsgIn 0.3s var(--hub-ease) both;
}

.hub-msg--user {
  align-items: flex-end;
}

.hub-msg--assistant {
  align-items: flex-start;
  min-width: 0;
  max-width: 100%;
}

.hub-text {
  font-size: 0.9375rem;
  line-height: 1.65;
  word-break: break-word;
}

.hub-text p {
  margin: 0 0 0.7rem;
}

.hub-text p:last-child {
  margin-bottom: 0;
}

.hub-text ul,
.hub-text ol {
  margin: 0.25rem 0 0.7rem;
  padding: 0;
  list-style: none;
}

.hub-text li {
  position: relative;
  padding-left: 1.15rem;
  margin-bottom: 0.4rem;
}

.hub-text li:last-child {
  margin-bottom: 0;
}

.hub-text ul li::before {
  content: "–";
  position: absolute;
  left: 0;
  color: var(--hub-teal);
  opacity: 0.75;
  font-weight: 500;
}

.hub-text ol {
  counter-reset: hub-ol;
}

.hub-text ol li {
  counter-increment: hub-ol;
}

.hub-text ol li::before {
  content: counter(hub-ol) ".";
  position: absolute;
  left: 0;
  color: var(--hub-muted);
  font-size: 0.875em;
  font-variant-numeric: tabular-nums;
}

.hub-divider {
  border: none;
  border-top: 1px solid var(--hub-border);
  margin: 0.85rem 0;
}

.hub-cite {
  color: var(--hub-muted);
  font-size: 0.8125em;
}

.hub-citation {
  display: inline-block;
  margin: 0 0.1em;
  padding: 0 0.28em;
  font-size: 0.72em;
  font-weight: 600;
  line-height: 1.2;
  vertical-align: super;
  color: var(--hub-teal);
  background: rgba(0, 168, 168, 0.12);
  border: 1px solid rgba(0, 168, 168, 0.28);
  border-radius: 0.3rem;
  cursor: help;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.hub-citation:hover,
.hub-citation:focus-visible {
  background: rgba(0, 168, 168, 0.22);
  border-color: rgba(0, 224, 224, 0.45);
  outline: none;
}

.hub-citation-popover {
  position: fixed;
  z-index: 10050;
  max-width: min(22rem, calc(100vw - 1.5rem));
  padding: 0.65rem 0.75rem;
  font-size: 0.78rem;
  line-height: 1.45;
  color: rgba(238, 244, 247, 0.96);
  white-space: pre-wrap;
  word-break: break-word;
  background: rgba(12, 22, 30, 0.92);
  border: 1px solid rgba(0, 168, 168, 0.35);
  border-radius: 0.55rem;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.38);
  backdrop-filter: blur(10px);
  pointer-events: none;
}

.hub-msg--assistant {
  position: relative;
}

.hub-msg-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 2px;
  margin-top: 8px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

@media (hover: hover) and (pointer: fine) {
  .hub-msg--assistant:hover .hub-msg-actions,
  .hub-msg-actions:focus-within {
    opacity: 1;
  }

  .hub-msg-actions {
    gap: 0;
  }

  .hub-action-btn,
  .hub-msg-action {
    width: 28px;
    height: 28px;
    min-width: 28px;
    min-height: 28px;
    border-radius: 4px;
  }

  .hub-action-btn svg,
  .hub-msg-action svg {
    width: 15px;
    height: 15px;
  }
}

@media (hover: none), (pointer: coarse) {
  .hub-msg-actions {
    opacity: 1;
  }
}

.hub-action-btn,
.hub-msg-action {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  margin: 0;
  background: transparent;
  border: none;
  color: var(--hub-muted);
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.2s ease;
  -webkit-tap-highlight-color: transparent;
  line-height: 0;
}

.hub-action-btn:hover,
.hub-action-btn:focus-visible,
.hub-msg-action:hover,
.hub-msg-action:focus-visible {
  background: rgba(0, 168, 168, 0.1);
  color: var(--hub-text);
  outline: none;
}

.hub-action-btn svg,
.hub-msg-action svg {
  width: 18px;
  height: 18px;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke: currentColor;
  fill: none;
  pointer-events: none;
}

.hub-action-btn[data-action="up"] svg,
.hub-action-btn[data-action="down"] svg,
.hub-msg-action[data-action="up"] svg,
.hub-msg-action[data-action="down"] svg {
  fill: currentColor;
  stroke: none;
}

.hub-action-btn.is-active[data-action="up"],
.hub-msg-action.is-active[data-action="up"] {
  color: #10b981;
  background: rgba(16, 185, 129, 0.1);
}

.hub-action-btn.is-active[data-action="down"],
.hub-msg-action.is-active[data-action="down"] {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
}

.hub-action-btn.is-active[data-action="copy"],
.hub-msg-action.is-active[data-action="copy"] {
  color: var(--hub-teal);
  background: rgba(0, 168, 168, 0.12);
}

.hub-action-btn:disabled,
.hub-msg-action:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  pointer-events: none;
}

.hub-feedback-input {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  animation: hub-slide-down 0.2s ease-out;
}

.hub-feedback-input[hidden] {
  display: none !important;
}

.hub-feedback-input input,
.hub-feedback-field {
  flex: 1 1 auto;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid rgba(0, 168, 168, 0.25);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.2);
  color: var(--hub-text);
  font-size: 14px;
  outline: none;
  box-sizing: border-box;
}

.hub-feedback-input input:focus,
.hub-feedback-field:focus {
  border-color: var(--hub-teal);
  box-shadow: 0 0 0 2px rgba(0, 168, 168, 0.15);
}

.hub-feedback-submit {
  background: transparent;
  border: 1px solid var(--hub-teal);
  color: var(--hub-teal);
  border-radius: 6px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.hub-feedback-submit:hover,
.hub-feedback-submit:active,
.hub-feedback-submit:focus-visible {
  background: var(--hub-teal);
  color: #ffffff;
  outline: none;
}

.hub-feedback-submit:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  pointer-events: none;
}

@keyframes hub-slide-down {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hub-text table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.65rem 0;
  font-size: 0.84rem;
  font-variant-numeric: tabular-nums;
}

.hub-text th,
.hub-text td {
  border: 1px solid rgba(0, 168, 168, 0.2);
  padding: 0.4rem 0.55rem;
  text-align: left;
}

.hub-text th {
  position: sticky;
  top: 0;
  background: rgba(8, 16, 22, 0.95);
  color: rgba(238, 244, 247, 0.92);
  font-weight: 600;
}

.hub-text tr:nth-child(even) td {
  background: rgba(0, 168, 168, 0.04);
}

.hub-text strong {
  font-weight: 600;
  color: #fff;
}

/* User — right, compact bubble hugging text */
.hub-msg--user .hub-text {
  width: fit-content;
  max-width: 85%;
  padding: 0.45rem 0.7rem;
  border-radius: 0.625rem;
  background: rgba(0, 168, 168, 0.14);
  border: none;
  line-height: 1.45;
}

.hub-msg--chip .hub-text {
  padding: 0.3rem 0.58rem;
  font-size: 0.875rem;
  border-radius: 0.5rem;
  line-height: 1.4;
}

/* AI — left, plain text (no bubble chrome) */
.hub-msg--assistant > .hub-text {
  max-width: 100%;
  padding: 0.35rem 0.15rem;
  background: transparent;
  border: none;
  color: rgba(238, 244, 247, 0.96);
}

.hub-msg--assistant > .hub-msg-note {
  margin: 0.05rem 0.15rem 0;
  font-size: 0.75rem;
  line-height: 1.35;
  color: rgba(138, 163, 178, 0.88);
  font-style: italic;
  letter-spacing: 0.01em;
}

.hub-msg--opener > .hub-text {
  padding: 0.25rem 0 0.35rem;
  font-size: 0.9375rem;
  line-height: 1.68;
  letter-spacing: 0.01em;
  min-height: 3.25rem;
}

.hub-msg--locale-en .hub-opener-live {
  line-height: 1.62;
  letter-spacing: 0.004em;
}

.hub-msg--locale-zh .hub-opener-live {
  line-height: 1.72;
  letter-spacing: 0.02em;
}

.hub-opener-live {
  margin: 0;
  white-space: pre-line;
  word-break: break-word;
}

.hub-opener-content {
  display: inline;
}

.hub-opener-cursor {
  display: inline;
  color: var(--hub-teal);
  margin-left: 1px;
  vertical-align: baseline;
}

/* rAF stream cursor — block glyph with pulse; JS fades on finish */
.hub-cursor.hub-opener-cursor {
  display: inline-block;
  width: 0.45em;
  min-width: 3px;
  height: 1.05em;
  margin-left: 2px;
  vertical-align: text-bottom;
  color: var(--hub-teal);
  background-color: currentColor;
  font-size: 0;
  line-height: 0;
  opacity: 1;
  animation: hub-cursor-pulse 1s ease-in-out infinite;
}

.hub-cursor.hub-opener-cursor[style*="transition"] {
  animation: none;
  background-color: var(--hub-teal);
}

@keyframes hub-cursor-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.35;
  }
}

.hub-opener-typewriter.is-animating .hub-opener-cursor:not(.hub-cursor) {
  animation: hubCursorBlink 0.85s step-end infinite;
}

.hub-opener-typewriter.is-complete .hub-opener-cursor {
  display: none;
}

/* Reveal letters */
@keyframes hubCardIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.hub-letters {
  margin-top: 0.5rem;
  max-width: 100%;
}

.hub-letters-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0;
  border: none;
  background: none;
  color: var(--hub-muted);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: color 0.15s;
}

.hub-letters-toggle::after {
  content: "›";
  transition: transform 0.2s var(--hub-ease);
}

.hub-letters.is-open .hub-letters-toggle {
  color: var(--hub-gold);
}

.hub-letters.is-open .hub-letters-toggle::after {
  transform: rotate(90deg);
}

.hub-letters-stack {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.22s var(--hub-ease);
}

.hub-letters.is-open .hub-letters-stack {
  grid-template-rows: 1fr;
}

.hub-letters-inner {
  overflow: hidden;
}

.hub-letters.is-open .hub-letters-inner {
  padding-top: 0.45rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.hub-letter,
.hub-reveal-card {
  padding: 0.55rem 0 0.55rem 0.75rem;
  border-radius: 0;
  background: rgba(255, 255, 255, 0.02);
  border: none;
  border-left: 2px solid rgba(232, 163, 23, 0.32);
  opacity: 0;
}

.hub-letters.is-animating .hub-letter.is-revealed,
.hub-letters.is-animating .hub-reveal-card.is-revealed {
  animation: hubCardIn 0.35s var(--hub-ease) var(--delay, 0ms) forwards;
}

.hub-letter-title {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--hub-gold);
}

.hub-letter-meta {
  margin: 0.15rem 0 0;
  font-size: 0.6875rem;
  color: var(--hub-muted);
}

.hub-letter-body {
  --step-ms: var(--hub-typewriter-ms);
  margin: 0.4rem 0 0;
  font-size: 0.8125rem;
  line-height: 1.55;
  color: rgba(238, 244, 247, 0.9);
  min-height: 1.1em;
}

.hub-typewriter-line {
  display: inline-flex;
  align-items: baseline;
  max-width: 100%;
}

.hub-typewriter-text {
  display: inline-block;
  overflow: hidden;
  white-space: nowrap;
  width: 0;
  max-width: 100%;
}

.hub-letters.is-animating .hub-typewriter-text {
  animation:
    hubTypewriterWidth calc(var(--chars, 1) * var(--step-ms)) steps(var(--chars, 1), end) var(--delay, 0ms) forwards,
    hubTypewriterSettle 0.45s ease calc(var(--delay, 0ms) + var(--chars, 1) * var(--step-ms)) forwards;
}

@keyframes hubTypewriterWidth {
  from { width: 0; }
  to { width: calc(var(--chars, 1) * 1ch); }
}

@keyframes hubTypewriterSettle {
  from { opacity: 0.55; }
  to { opacity: 1; }
}

.hub-letters.is-complete .hub-typewriter-text {
  width: auto;
  white-space: pre-wrap;
  overflow: visible;
  opacity: 1;
}

.hub-letters.is-complete .hub-letter-body {
  animation: hubLetterBodyFade 0.4s ease forwards;
}

@keyframes hubLetterBodyFade {
  from { opacity: 0.75; }
  to { opacity: 1; }
}

.hub-typewriter-cursor {
  color: var(--hub-teal);
  margin-left: 1px;
}

.hub-letters.is-animating .hub-typewriter-cursor {
  animation:
    hubCursorBlink 0.9s step-end infinite,
    hubCursorHide 0.01s linear calc(var(--delay, 0ms) + var(--chars, 1) * var(--step-ms)) forwards;
}

@keyframes hubCursorBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

@keyframes hubCursorHide {
  to { opacity: 0; width: 0; margin: 0; overflow: hidden; }
}

/* --------------------------------------------------------------------------
   Footer — chips, capture, modern input bar
   -------------------------------------------------------------------------- */
.hub-footer {
  flex: 0 0 auto;
  border-top: 1px solid var(--hub-border-soft);
  background: rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: relative;
  z-index: 1;
  transition: background 0.28s var(--hub-ease-out);
}

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

.hub-chips {
  display: none;
  flex-wrap: nowrap;
  gap: 0.35rem;
  padding: 0.5rem 0.875rem 0;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
}

.hub-chips.is-active {
  display: flex;
}

.hub-chips[hidden] {
  display: none !important;
}

.hub-chips--in-thread {
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  gap: 0.15rem;
  padding: 0.25rem 0.15rem 0.125rem;
  margin-top: 0;
  overflow: visible;
  scroll-snap-type: none;
  align-items: flex-start;
}

/* Round 1 — plain suggestion lines (no card chrome) */
.hub-chips--in-thread .hub-chip {
  flex: none;
  width: auto;
  max-width: 100%;
  min-width: 0;
  min-height: 0;
  justify-content: flex-start;
  text-align: left;
  white-space: normal;
  line-height: 1.55;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  font-weight: 500;
  font-size: 0.9375rem;
  letter-spacing: 0.004em;
  padding: 0.3rem 0.15rem;
  color: rgba(0, 224, 224, 0.9);
}

.hub-chips--in-thread .hub-chip:hover {
  border: none;
  background: transparent;
  box-shadow: none;
  transform: none;
  color: #00e0e0;
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.hub-chips--in-thread .hub-chip:focus-visible {
  outline: 2px solid rgba(0, 224, 224, 0.4);
  outline-offset: 2px;
  border-radius: 0.25rem;
}

.hub-chips--in-thread .hub-chip:active {
  transform: none;
  background: transparent;
  color: rgba(0, 224, 224, 0.75);
}

.hub-chips--round2 {
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  gap: 0.35rem;
  padding: 0.5rem 0.875rem 0.25rem;
  overflow: visible;
  scroll-snap-type: none;
  align-items: stretch;
}

.hub-chips--round2 .hub-chip {
  flex: none;
  width: auto;
  max-width: 100%;
  min-width: 0;
  min-height: 0;
  justify-content: flex-start;
  text-align: left;
  white-space: normal;
  line-height: 1.55;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  font-weight: 500;
  font-size: 0.9375rem;
  letter-spacing: 0.004em;
  padding: 0.3rem 0.15rem;
  color: rgba(0, 224, 224, 0.9);
}

.hub-chips--round2 .hub-chip:hover {
  border: none;
  background: transparent;
  box-shadow: none;
  transform: none;
  color: #00e0e0;
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.hub-chips--opener {
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  gap: 0.15rem;
  overflow: visible;
  scroll-snap-type: none;
  padding-top: 0.25rem;
  padding-bottom: 0;
  align-items: flex-start;
}

.hub-chips--followup .hub-chip {
  border-radius: 9999px;
  flex-shrink: 0;
  white-space: nowrap;
  border: none;
  background: transparent;
  color: rgba(0, 224, 224, 0.9);
  padding: 0.35rem 0.55rem;
  min-height: 0;
  font-weight: 500;
  box-shadow: none;
}

.hub-chips--followup .hub-chip:hover {
  border: none;
  background: rgba(0, 168, 168, 0.08);
  color: #00e0e0;
  transform: none;
  box-shadow: none;
}

.hub-chips::-webkit-scrollbar {
  display: none;
}

.hub-chip {
  flex-shrink: 0;
  font-size: 0.75rem;
  padding: 0.4rem 0.7rem;
  border-radius: 0.5rem;
  border: 1px solid var(--hub-border-soft);
  background: var(--hub-surface);
  color: var(--hub-text);
  cursor: pointer;
  transition: border-color 0.2s var(--hub-ease-out), background 0.2s var(--hub-ease-out);
}

.hub-chip.hub-reveal-chip {
  opacity: 0;
  animation: hubChipIn 0.28s var(--hub-ease) calc(var(--chip-i, 0) * var(--hub-chip-stagger)) forwards;
}

.hub-chip:hover {
  border-color: rgba(0, 168, 168, 0.35);
  background: rgba(0, 168, 168, 0.06);
}

.hub-chips.is-faded {
  opacity: 0.3;
  pointer-events: none;
}

.hub-capture {
  display: none;
  padding: 0.5rem 0.875rem 0;
}

.hub-capture.is-visible {
  display: block;
  animation: hubMsgIn 0.3s var(--hub-ease) both;
}

.hub-capture-title {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 600;
}

.hub-capture-sub {
  margin: 0.1rem 0 0.4rem;
  font-size: 0.75rem;
  color: var(--hub-muted);
}

.hub-capture-row {
  display: flex;
  gap: 0.35rem;
}

.hub-capture input[type="email"],
.hub-capture input[type="text"] {
  flex: 1;
  min-width: 0;
  padding: 0.5rem 0.65rem;
  border-radius: 0.5rem;
  border: 1px solid var(--hub-border);
  background: var(--hub-surface);
  color: var(--hub-text);
  font-size: 0.8125rem;
}

.hub-capture-hint {
  margin: 0.15rem 0 0.4rem;
  font-size: 0.6875rem;
  color: var(--hub-muted);
  line-height: 1.35;
}

.hub-gate-error {
  margin: 0.35rem 0 0;
  font-size: 0.6875rem;
  color: #f0a0a0;
}

.hub-msg--system .hub-text {
  font-size: 0.8125rem;
  color: var(--hub-muted);
  text-align: center;
  padding: 0.35rem 0.5rem;
  border: 1px dashed var(--hub-border-soft);
  border-radius: 0.5rem;
  background: rgba(6, 16, 24, 0.35);
}

.hub-advisor-ended .hub-composer {
  opacity: 0.45;
  pointer-events: none;
}

.hub-capture-consent {
  display: flex;
  gap: 0.35rem;
  align-items: flex-start;
  margin-top: 0.35rem;
  font-size: 0.6875rem;
  color: var(--hub-muted);
}

.hub-capture-actions {
  display: flex;
  gap: 0.35rem;
  margin-top: 0.4rem;
}

.hub-btn {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.4rem 0.75rem;
  border-radius: 0.5rem;
  border: none;
  cursor: pointer;
}

.hub-btn--primary {
  background: var(--hub-gold);
  color: var(--hub-navy);
}

.hub-btn--ghost {
  background: transparent;
  color: var(--hub-muted);
  border: 1px solid var(--hub-border);
}

/* Input bar — flat, no circular send blob */
.hub-composer {
  padding: 0.5rem 0.875rem calc(0.5rem + env(safe-area-inset-bottom, 0px));
}

.hub-input-bar {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  padding: 0.5rem 0.5rem 0.5rem 0.875rem;
  border-radius: 0.75rem;
  border: 1px solid var(--hub-border-soft);
  background: var(--hub-surface);
  transition: border-color 0.22s var(--hub-ease-out), background 0.22s var(--hub-ease-out);
}

.hub-input-bar:focus-within {
  border-color: rgba(0, 168, 168, 0.28);
  background: rgba(6, 16, 24, 0.55);
}

.hub-composer textarea {
  flex: 1;
  resize: none;
  min-height: 1.375rem;
  max-height: 7.5rem;
  padding: 0.125rem 0;
  border: none;
  background: transparent;
  color: var(--hub-text);
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 0.9375rem;
  line-height: 1.45;
}

.hub-composer textarea:focus {
  outline: none;
}

.hub-composer textarea::placeholder {
  color: var(--hub-muted);
}

.hub-send {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  border: none;
  border-radius: 0.375rem;
  background: transparent;
  color: var(--hub-muted);
  cursor: pointer;
  transition: color 0.15s, background 0.15s, opacity 0.15s;
}

.hub-send:hover:not(:disabled),
.hub-send:focus-visible:not(:disabled) {
  color: var(--hub-teal);
  background: rgba(0, 168, 168, 0.14);
  outline: none;
  box-shadow: 0 0 0 2px rgba(0, 168, 168, 0.2);
}

.hub-send:active:not(:disabled) {
  color: #00e0e0;
  background: rgba(0, 168, 168, 0.22);
}

.hub-send:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.hub-send.hub-send--stop {
  color: #f0b4b4;
  opacity: 1;
  cursor: pointer;
}

.hub-send.hub-send--stop:hover:not(:disabled),
.hub-send.hub-send--stop:focus-visible:not(:disabled) {
  color: #ffc9c9;
  background: rgba(220, 90, 90, 0.18);
  box-shadow: 0 0 0 2px rgba(220, 90, 90, 0.22);
}

/* TTFT thinking — animated dots only */
.hub-msg--thinking {
  opacity: 0;
  animation: hubMsgIn 0.28s var(--hub-ease) 0.05s both;
}

.hub-thinking-container {
  display: flex;
  align-items: center;
  min-height: 2.5rem;
}

.hub-thinking-wrapper {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 0.85rem;
  background: rgba(0, 168, 168, 0.1);
  border: 1px solid rgba(0, 168, 168, 0.28);
  border-radius: 0.75rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
  transition: opacity 0.28s var(--hub-ease-out);
}

.hub-thinking-wrapper.is-complete {
  opacity: 0;
}

.hub-thinking-dots {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-width: 2.25rem;
}

.hub-thinking-dots span {
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  background: rgba(0, 224, 224, 0.88);
  animation: hubThinkingDot 1.15s ease-in-out infinite;
}

.hub-thinking-dots span:nth-child(2) {
  animation-delay: 0.16s;
}

.hub-thinking-dots span:nth-child(3) {
  animation-delay: 0.32s;
}

@keyframes hubThinkingDot {
  0%,
  80%,
  100% {
    opacity: 0.35;
    transform: scale(0.85);
  }

  40% {
    opacity: 1;
    transform: scale(1);
  }
}

/* Discovery chips — staggered reveal (fast-path + gate FSM) */
.hub-chip.hub-discovery-chip {
  opacity: 0;
  animation: hubChipIn 0.32s var(--hub-ease) calc(var(--chip-i, 0) * var(--hub-chip-stagger) + 40ms) forwards;
  transition:
    transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hub-chip.hub-discovery-chip.is-selected {
  transform: scale(0.95);
  opacity: 0.5;
  pointer-events: none;
}

.hub-chips.is-collapsed {
  max-height: 0;
  overflow: hidden;
  margin: 0 !important;
  padding: 0 !important;
  opacity: 0.4;
  pointer-events: none;
  transition:
    max-height 0.4s ease-out,
    opacity 0.3s ease,
    margin 0.3s ease;
}

.hub-chips--round2 .hub-discovery-chip:nth-child(1) { --chip-i: 0; }
.hub-chips--round2 .hub-discovery-chip:nth-child(2) { --chip-i: 1; }
.hub-chips--in-thread.hub-chips--opener .hub-discovery-chip:nth-child(1) { --chip-i: 0; }
.hub-chips--in-thread.hub-chips--opener .hub-discovery-chip:nth-child(2) { --chip-i: 1; }

@media (prefers-reduced-motion: reduce) {
  .hub-panel,
  .hub-launch,
  .hub-letters-stack,
  .hub-input-bar,
  .hub-thread {
    transition: none;
    scroll-behavior: auto;
  }

  .hub-msg,
  .hub-reveal-chip,
  .hub-discovery-chip,
  .hub-capture.is-visible {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }

  .hub-thinking-dots span {
    animation: none !important;
    opacity: 0.75 !important;
    transform: none !important;
  }

  .hub-thinking-wrapper {
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
  }

  .hub-letter,
  .hub-reveal-card {
    opacity: 1 !important;
    animation: none !important;
  }

  .hub-opener-typewriter.is-animating .hub-typewriter-text,
  .hub-opener-typewriter.is-animating .hub-typewriter-cursor {
    animation: none !important;
  }

  .hub-opener-typewriter.is-animating .hub-typewriter-text {
    width: auto !important;
    white-space: pre-wrap;
    opacity: 1 !important;
  }

  .hub-typewriter-text {
    width: auto !important;
    white-space: pre-wrap;
    animation: none !important;
  }

  .hub-typewriter-cursor {
    display: none;
  }

  .hub-letters.is-complete .hub-letter-body {
    animation: none !important;
    opacity: 1 !important;
  }

}
