/* Project tabs above the conversation (public/chat-tabs.js). No entrance animation: the row is redrawn with the
   chat and must never blink. */
.chat-tabbar { position: relative; display: flex; align-items: center; gap: 6px; margin: 0 0 12px; }
.chat-tabs { position: relative; flex: 1; min-width: 0; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.chat-tabs::-webkit-scrollbar { display: none; }
.chat-tab, .chat-more-btn {
  flex: none; display: inline-flex; align-items: center; gap: 7px; min-height: 44px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--card); color: var(--ink-2);
  font: inherit; font-size: 14px; font-weight: 500; cursor: pointer; white-space: nowrap;
  transition: background .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease);
}
.chat-tab:hover, .chat-more-btn:hover { color: var(--ink); background: var(--fill-2); }
.chat-tab:focus-visible, .chat-more-btn:focus-visible, .chat-more-item:focus-visible { outline: 2px solid var(--pen); outline-offset: 1px; }
.chat-tab[aria-selected="true"] { background: var(--ink); border-color: var(--ink); color: var(--on-ink); font-weight: 600; }
.chat-tab-name { max-width: 11em; overflow: hidden; text-overflow: ellipsis; }
.chat-tab-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
/* Work running in this project now: the dot gets a soft ring and a ripple (currentColor is the project colour).
   app.js sets --live-phase from the clock, so a redrawn row carries the ripple on instead of restarting it. */
.chat-tab-dot.live { position: relative; box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 28%, transparent); }
.chat-tab-dot.live::after {
  content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid currentColor; opacity: 0;
  animation: chat-tab-live 1.8s var(--ease) var(--live-phase, 0ms) infinite;
}
@keyframes chat-tab-live { 0% { transform: scale(.6); opacity: .7; } 100% { transform: scale(1.25); opacity: 0; } }
.chat-tab-count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--butter); color: var(--on-butter); font-size: 12px; font-weight: 700; line-height: 20px; text-align: center; font-variant-numeric: tabular-nums; }
.chat-more-chev { display: inline-grid; transition: transform .2s var(--ease); }
.chat-more-btn[aria-expanded="true"] .chat-more-chev { transform: rotate(180deg); }
.chat-more-menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 200px; max-width: min(280px, calc(100vw - 32px));
  display: flex; flex-direction: column; padding: 6px; border: 1px solid var(--line); border-radius: 16px; background: var(--card); box-shadow: var(--lift);
}
.chat-more-item {
  display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 12px; border: 0; border-radius: 10px; background: none;
  font: inherit; font-size: 14px; color: var(--ink); text-align: left; cursor: pointer;
}
.chat-more-item:hover { background: var(--fill-2); }
.chat-more-item[aria-checked="true"] { font-weight: 700; }
.chat-more-item .chat-tab-name { flex: 1; max-width: none; }
/* A hidden copy of every tab, measured to decide how many fit in the row. Zero-sized so it never adds scroll. */
.chat-tabs-ruler { position: absolute; left: 0; top: 0; width: 0; height: 0; overflow: hidden; visibility: hidden; pointer-events: none; }
.chat-tabs-ruler-row { display: flex; width: max-content; }
.chat-tabs-ruler .chat-tab, .chat-tabs-ruler .chat-more-btn { font-weight: 600; }
.chat-tab-empty { margin: 4px 0 0; font-size: 14px; color: var(--ink-3); }

@media (max-width: 430px) {
  .chat-tab, .chat-more-btn { padding: 0 12px; font-size: 13px; }
  .chat-tab-name { max-width: 7.5em; }
}

@media (prefers-reduced-motion: reduce) {
  .chat-tab, .chat-more-btn, .chat-more-chev { transition: none; }
  .chat-tab-dot.live::after { animation: none; transform: none; }
}

/* What is new for him in the chat (app.js "new for him"): a small tag on each of Momo's messages he has not seen
   and on each question waiting for him, and a quiet line above the first new message. The line is placed in the
   gap above its row and takes no room, and a tag sits last in its line, so neither moves anything when it goes. */
.new-tag {
  display: inline-block; padding: 1px 7px; border-radius: 999px; background: var(--butter); color: var(--on-butter);
  font-size: 10.5px; font-weight: 700; line-height: 14px; letter-spacing: .01em;
  /* Its pill reaches past the line but takes no more height than the time beside it, so its going moves nothing. */
  margin-block: -4px;
}
.has-new-line { position: relative; }
.new-divider {
  position: absolute; left: 0; right: 0; top: -6px; transform: translateY(-50%); display: flex; align-items: center; gap: 8px;
  pointer-events: none;
}
.new-divider::before, .new-divider::after { content: ""; flex: 1; height: 1px; background: var(--butter-edge); }
.new-divider::before { flex: 0 0 12px; }
.new-divider-label { font-size: 10.5px; font-weight: 700; line-height: 12px; color: var(--ink-3); }
/* Nothing above the first message to set apart, so the line would only be cut off at the top. */
.convo > .has-new-line:first-child > .new-divider { display: none; }
.new-tag.fading, .new-divider.fading { animation: chat-new-fade 1.2s var(--ease) forwards; }
@keyframes chat-new-fade { 0%, 40% { opacity: 1; } 100% { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .new-tag.fading, .new-divider.fading { animation: none; opacity: 0; }
}
