/* Session controls — the current conversation's title in the main bar, with
   its pin and new-session buttons. The title is renamed where it stands:
   chat.js swaps it for the field below. The list of sessions is part of the
   sidebar (shell.css). */
.chat-session-float {
  flex: 0 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: .15rem;
  padding: 0 .3rem;
}
.chat-session-float :is(button, a) {
  cursor: pointer;
  font: inherit;
  outline: none;
  /* Defeat the global button:active translateY(1px) — these buttons carry
     no chrome, so a 1px nudge on click feels like a glitch, not a press. */
  transition: color .18s ease, opacity .18s ease, background .18s ease;
}
.chat-session-float :is(button, a):active { transform: none }
.chat-session-float :is(button, a):hover {
  border: 0;
  box-shadow: none;
}
.chat-session-float :is(button, a):focus-visible {
  outline: 2px solid var(--focus-outline);
  outline-offset: 1px;
}

/* The title — a click renames. */
.session-pill {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  max-width: 28rem;
  height: 1.85rem;
  background: transparent;
  border: 0;
  border-radius: 8px;
  padding: 0 .5rem;
  font-weight: 500;
  font-size: .95rem;
  line-height: 1.2;
  color: var(--muted);
}
.session-pill:hover {
  background: var(--shell-hover);
  color: var(--text);
}
.session-pill[hidden] { display: none }
.session-pill .ct-id {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: inherit;
  font-size: .95rem;
  font-weight: 500;
  letter-spacing: 0;
}
/* Still being named by the auto-titler (chat.js follows the sidebar's
   list): the name breathes until it lands. Keyframes in shell.css. */
.session-pill .ct-id.is-titling { animation: sb-titling 1.8s ease-in-out infinite }

/* The field the title turns into: the title's own box and type, as wide as
   what is written in it (chat.js sizes it where the browser cannot). */
.session-title-input {
  flex: 0 1 auto;
  field-sizing: content;
  width: auto;
  min-width: 6rem;
  max-width: min(28rem, 100%);
  height: 1.85rem;
  padding: 0 .5rem;
  border: 0;
  border-radius: 8px;
  background: var(--shell-hover);
  box-shadow: inset 0 0 0 1px var(--border2);
  color: var(--text);
  font: inherit;
  font-size: .95rem;
  font-weight: 500;
}
.session-title-input:focus {
  outline: none;
  border: 0;
  box-shadow: inset 0 0 0 1px var(--outline-hover);
}
.session-title-input:disabled {
  opacity: .6;
  cursor: progress;
}
.session-title-input[hidden] { display: none }

/* Pin and new-session — bare icon buttons; chat.js shows them once there is
   a session to pin or to leave. New-session is a link, so it opens in a new
   tab too. */
.session-pin-pill,
.session-new-pill {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.85rem;
  height: 1.85rem;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 8px;
  color: var(--muted2);
}
.session-pin-pill svg,
.session-new-pill svg {
  width: 1.1rem;
  height: 1.1rem;
  fill: none;
}
.session-pin-pill:hover,
.session-new-pill:hover {
  background: var(--shell-hover);
  color: var(--text);
}
.session-pin-pill[aria-pressed="true"] { color: var(--accent) }
.session-pin-pill[aria-pressed="true"] svg { fill: currentColor }
.session-pin-pill[hidden],
.session-new-pill[hidden] { display: none }

@media (max-width: 680px) {
  .chat-session-float { padding: 0 .1rem }
  .session-pill .ct-id { font-size: .9rem }
}
