/* 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;
}
/* :where() keeps this reset at a bare class's weight, so .session-project
   and .session-pill below still set their own type; an :is() here outranked
   them and the project's name fell back to the page's 15px regular beside
   the title. */
.chat-session-float :where(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 project the conversation works in (projects.js), before the title.
   The sidebar's switcher names it, so this shows only while the sidebar is
   put away on a wide screen (a phone has the drawer), and only for a
   project of its own -- the main one goes unnamed, but for a while after
   it is picked here, and then slides away behind the sidebar opener
   (projects.js animates it). It reads as one line
   with the title -- the name alone, in the title's own type and ink (the
   drawing stays with the sidebar's switcher), only the slash between them
   faint -- and a click opens the switcher's menu. */
.session-project,
.session-project-sep { display: none }
@media (min-width: 821px) {
  :root[data-sidebar="collapsed"] .session-project:not([hidden]) { display: inline-flex }
  :root[data-sidebar="collapsed"] .session-project:not([hidden]) + .session-project-sep { display: inline }
}
.session-project {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 14rem;
  align-items: center;
  height: 1.85rem;
  padding: 0 .45rem;
  background: transparent;
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  font-size: .95rem;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: 0;
}
.session-project:hover,
.session-project[aria-expanded="true"] {
  background: var(--shell-hover);
  color: var(--text);
}
.session-project-name {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.session-project-sep {
  flex: 0 0 auto;
  color: var(--muted2);
  opacity: .6;
  font-size: .95rem;
  user-select: none;
}

/* 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;
}

/* 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 }
}
