/* LiveFramework docked chat (text + voice). Loaded on every _LiveLayout page. */

.lf-chat-toggle {
  position: relative;
  width: 38px;
  padding-left: 0;
  padding-right: 0;
  justify-content: center;
}

.lf-chat-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 1.1rem;
  height: 1.1rem;
  padding: 0 0.25rem;
  border-radius: 999px;
  background: #dc3545;
  color: #fff;
  font-size: 0.65rem;
  line-height: 1.1rem;
  text-align: center;
  font-weight: 700;
}

.lf-chat {
  position: fixed;
  /* Docked inside the <main> band of the app-shell frame: below the fixed header and
     above the footer status bar (both heights are measured into CSS variables). */
  top: var(--lf-top-edge, var(--lf-header-height));
  right: 0;
  bottom: var(--lf-footer-height, 0px);
  width: min(760px, 100vw);
  /* Same band as .lf-shell-panel / .lf-apps; shellHomeStack.ts raises the one the user asked for. */
  z-index: 1074;
  background: #fff;
  box-shadow: -8px 0 28px rgba(0, 0, 0, 0.18);
  display: flex;
  flex-direction: column;
}
.lf-chat[hidden] { display: none !important; }

/* Standalone chat page (Views/Chat/Panel.cshtml) shown in a surface — see issue #19 §15.2: fill the
   surface instead of docking to a header/footer it does not have, and hide the shell-only
   controls the surface's own chrome already replaces: the #lfChatToggle rendered just to satisfy
   chat.ts's start() guard, and the docked/floating maximize+pin toggles (the window IS already
   "chat, maximized/pinned", nothing else makes sense here).
   Absolute rather than fixed, and keyed off the surface: it used to be html.lf-bare on a document
   of its own, whose viewport was the window (issue #59). */
.lf-surface-inline .lf-chat {
  position: absolute;
  inset: 0;
  width: auto;
  box-shadow: none;
}
.lf-surface-inline .lf-chat-toggle,
.lf-surface-inline #lfChatMaximize,
.lf-surface-inline #lfChatPin {
  display: none;
}

/* Maximized: the overlay stretches over the whole <main> band. */
.lf-chat.is-max {
  left: 0;
  width: auto;
  box-shadow: none;
}

/* Docked into one of the shell's zones (issue #188, F4 and N7). The zone decides where it is
   and how wide, so every piece of the overlay geometry goes away — exactly as .lf-apps.lf-docked
   does, and for the reason that panel had the rule from its first day: a re-parented element
   that keeps `position: fixed` is drawn where its coordinates put it whatever its parent is, and
   gives the zone that holds it no size at all.

   This replaced `.lf-chat.is-pinned`, which said the same thing about a column built by hand in
   the body row: two descriptions of one state, with two widths and two drag handles, and the
   pair is what made the handle work on the right and not on the left. */
.lf-chat.lf-docked {
  position: static;
  width: auto;
  height: auto;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  box-shadow: none;
  border-left: 0;
}

/* Title bar: styled like a section title (section-title in site.css) — name on the left,
   active-user search in the middle, window controls on the right. */
.lf-chat-titlebar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.45rem 0.85rem;
  background: #f8f9fa;
  border-bottom: 2px solid #adb5bd;
}
.lf-chat-titlebar-title {
  flex: 0 0 auto;
  margin: 0;
  font-size: 1.15rem;
  font-weight: 600;
  color: #495057;
}
.lf-chat-titlebar-actions { display: flex; gap: 0.15rem; flex: 0 0 auto; }
.lf-chat-icon-btn.is-on { background: #5a6268; color: #fff; }
.lf-chat-icon-btn.is-on:hover { background: #495057; color: #fff; }

.lf-chat-users {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  max-width: 34rem;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.15rem 0.2rem 0.15rem 0.55rem;
  background: #fff;
  border: 1px solid #ced4da;
  border-radius: 8px;
  color: #6c757d;
}
.lf-chat-users:focus-within { border-color: #adb5bd; box-shadow: 0 0 0 2px rgba(90, 98, 104, 0.15); }
.lf-chat-users input {
  border: 0;
  outline: 0;
  width: 100%;
  min-width: 0;
  background: transparent;
  font-size: 0.875rem;
}
.lf-chat-users-open { width: 26px; height: 26px; }
.lf-chat-users-open[aria-expanded="true"] i { transform: rotate(180deg); }
.lf-chat-users-list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 3;
  max-height: 18rem;
  overflow-y: auto;
  padding: 0.25rem 0;
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}
.lf-chat-users-list[hidden] { display: none !important; }
.lf-chat-users-list .lf-chat-row { padding: 0.35rem 0.75rem; }
.lf-chat-users-list .lf-chat-row .lf-chat-dot { border-color: #fff; }
.lf-chat-users-list .lf-chat-row.is-active { background: #e9ecef; }
.lf-chat-users-empty { padding: 0.5rem 0.85rem; font-size: 0.8rem; color: #6c757d; }

.lf-chat-shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 0;
  flex: 1;
}

.lf-chat-list {
  border-right: 1px solid #dee2e6;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: #f8f9fa;
}

.lf-chat-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.7rem 0.85rem 0.4rem;
}

.lf-chat-list-head h2 {
  font-size: 1.05rem;
  font-weight: 650;
  margin: 0;
  color: #343a40;
}

.lf-chat-icon-btn {
  border: 0;
  background: transparent;
  color: #495057;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.lf-chat-icon-btn:hover { background: rgba(0, 0, 0, 0.06); color: #212529; }

.lf-chat-search {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0 0.7rem 0.55rem;
  padding: 0.3rem 0.55rem;
  background: #fff;
  border: 1px solid #ced4da;
  border-radius: 8px;
  color: #6c757d;
}
.lf-chat-search input {
  border: 0;
  outline: 0;
  width: 100%;
  background: transparent;
  font-size: 0.875rem;
}

.lf-chat-online-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #6c757d;
  padding: 0.15rem 0.85rem;
}

.lf-chat-people,
.lf-chat-convos {
  overflow-y: auto;
}
.lf-chat-people { max-height: 7.5rem; flex: 0 0 auto; }
.lf-chat-convos { flex: 1 1 auto; min-height: 0; padding-bottom: 0.5rem; }

.lf-chat-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 0.85rem;
  cursor: pointer;
  border: 0;
  background: transparent;
  width: 100%;
  text-align: left;
  color: inherit;
}
.lf-chat-row:hover,
.lf-chat-row.is-active { background: #e9ecef; }

.lf-chat-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #5a6268;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 700;
  flex: 0 0 auto;
  position: relative;
}
.lf-chat-avatar.is-group { background: #3d5a80; }
/* The assistant (issue #212): not a person, so an icon rather than initials, and no presence dot. */
.lf-chat-avatar.is-assistant { background: #6a4c93; }
.lf-chat-avatar .lf-chat-dot {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #adb5bd;
  border: 2px solid #f8f9fa;
}
.lf-chat-avatar .lf-chat-dot.on { background: #28a745; }

.lf-chat-row-meta { min-width: 0; flex: 1; }
.lf-chat-row-name {
  font-weight: 600;
  font-size: 0.88rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lf-chat-row-preview {
  font-size: 0.75rem;
  color: #6c757d;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lf-chat-unread {
  min-width: 1.15rem;
  height: 1.15rem;
  padding: 0 0.3rem;
  border-radius: 999px;
  background: #0d6efd;
  color: #fff;
  font-size: 0.7rem;
  line-height: 1.15rem;
  text-align: center;
  font-weight: 700;
}

.lf-chat-thread {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: #fff;
}
.lf-chat-thread[hidden] { display: none !important; }
.lf-chat-thread-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.7rem;
  border-bottom: 1px solid #dee2e6;
}
.lf-chat-thread-who { display: flex; align-items: center; gap: 0.55rem; min-width: 0; flex: 1; }
.lf-chat-thread-title { font-weight: 650; font-size: 0.95rem; }
.lf-chat-thread-sub { font-size: 0.75rem; color: #6c757d; }
.lf-chat-thread-actions { display: flex; gap: 0.15rem; }
.lf-chat-back { display: none; }

.lf-chat-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  color: #868e96;
  padding: 2rem;
  text-align: center;
  grid-column: 2;
}
.lf-chat-empty i { font-size: 2rem; opacity: 0.5; }
.lf-chat.has-thread .lf-chat-empty { display: none; }

.lf-chat-messages {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 0.85rem 1rem;
  background: linear-gradient(#f4f6f8, #eef1f4);
}

.lf-chat-day {
  text-align: center;
  font-size: 0.72rem;
  color: #6c757d;
  margin: 0.6rem 0;
}

.lf-chat-bubble {
  max-width: 78%;
  margin: 0.28rem 0;
  padding: 0.4rem 0.65rem;
  border-radius: 12px;
  font-size: 0.9rem;
  line-height: 1.35;
  position: relative;
  white-space: pre-wrap;
  word-break: break-word;
}
.lf-chat-bubble.mine {
  margin-left: auto;
  background: #5a6268;
  color: #fff;
  border-bottom-right-radius: 4px;
}
.lf-chat-bubble.theirs {
  background: #fff;
  border: 1px solid #dee2e6;
  border-bottom-left-radius: 4px;
}
.lf-chat-bubble.system {
  margin: 0.5rem auto;
  max-width: 90%;
  background: transparent;
  border: 0;
  color: #6c757d;
  font-size: 0.78rem;
  text-align: center;
}
.lf-chat-bubble-name { font-size: 0.72rem; font-weight: 700; opacity: 0.8; margin-bottom: 0.1rem; }
.lf-chat-bubble-time { font-size: 0.68rem; opacity: 0.7; margin-top: 0.15rem; text-align: right; }
.lf-chat-bubble.deleted { font-style: italic; opacity: 0.75; }

/* The assistant's answer while it is still being written (#193 F4). Dimmed, and without a
   timestamp, because it is not a message yet — it has no id and nothing has stored it. */
.lf-chat-bubble.lf-chat-streaming { opacity: 0.75; }
.lf-chat-quote {
  border-left: 3px solid rgba(13, 110, 253, 0.7);
  padding: 0.15rem 0.4rem;
  margin-bottom: 0.25rem;
  font-size: 0.78rem;
  opacity: 0.9;
}

.lf-chat-typing {
  font-size: 0.78rem;
  color: #6c757d;
  padding: 0.15rem 1rem;
  min-height: 1.3rem;
}

.lf-chat-reply {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.35rem 0.85rem;
  background: #eef2f6;
  border-top: 1px solid #dee2e6;
  font-size: 0.8rem;
}
.lf-chat-reply[hidden] { display: none !important; }
.lf-chat-reply-who { font-weight: 700; }
.lf-chat-reply-body { color: #6c757d; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 28rem; }

.lf-chat-composer {
  display: flex;
  align-items: flex-end;
  gap: 0.45rem;
  padding: 0.55rem 0.7rem 0.7rem;
  border-top: 1px solid #dee2e6;
  background: #fff;
}
.lf-chat-composer textarea {
  flex: 1;
  resize: none;
  max-height: 8rem;
  border: 1px solid #ced4da;
  border-radius: 10px;
  padding: 0.45rem 0.65rem;
  font: inherit;
}
.lf-chat-send {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 10px;
  background: #5a6268;
  color: #fff;
  cursor: pointer;
}
.lf-chat-send:hover { background: #495057; }

.lf-chat-menu {
  position: absolute;
  z-index: 2;
  min-width: 180px;
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  padding: 0.25rem;
}
.lf-chat-menu button {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 0.4rem 0.65rem;
  border-radius: 6px;
  font-size: 0.875rem;
}
.lf-chat-menu button:hover { background: #f1f3f5; }

.lf-chat-incoming {
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: rgba(22, 25, 28, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
}
.lf-chat-incoming[hidden] { display: none !important; }
.lf-chat-incoming-card {
  background: #fff;
  border-radius: 16px;
  padding: 1.6rem 1.8rem;
  text-align: center;
  width: min(360px, calc(100vw - 2rem));
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
}
.lf-chat-incoming-pulse {
  width: 64px;
  height: 64px;
  margin: 0 auto 0.8rem;
  border-radius: 50%;
  background: #28a745;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  animation: lf-chat-pulse 1.4s ease-in-out infinite;
}
@keyframes lf-chat-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.55); }
  70% { box-shadow: 0 0 0 16px rgba(40, 167, 69, 0); }
}
.lf-chat-incoming-actions { display: flex; gap: 0.6rem; justify-content: center; margin-top: 1rem; }

.lf-chat-call-btn {
  border: 0;
  border-radius: 999px;
  padding: 0.45rem 1rem;
  font-weight: 650;
  cursor: pointer;
}
.lf-chat-call-btn.accept { background: #28a745; color: #fff; }
.lf-chat-call-btn.decline,
.lf-chat-call-btn.hangup { background: #dc3545; color: #fff; }

.lf-chat-active-call {
  position: fixed;
  top: calc(var(--lf-top-edge, var(--lf-header-height)) + 8px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 1080;
  background: #212529;
  color: #f8f9fa;
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}
.lf-chat-active-call[hidden] { display: none !important; }
.lf-chat-active-call-inner {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.4rem 0.55rem 0.4rem 0.9rem;
  font-size: 0.88rem;
}
.lf-chat-active-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #28a745;
  animation: lf-chat-pulse 1.4s ease-in-out infinite;
}
.lf-chat-active-call .lf-chat-icon-btn { color: #f8f9fa; }
.lf-chat-active-call .lf-chat-icon-btn.is-on { background: #dc3545; }

.lf-chat-dialog {
  position: fixed;
  inset: 0;
  z-index: 1210;
  background: rgba(22, 25, 28, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
}
.lf-chat-dialog[hidden] { display: none !important; }
.lf-chat-dialog-card {
  background: #fff;
  border-radius: 12px;
  padding: 1.1rem 1.2rem;
  width: min(420px, calc(100vw - 2rem));
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.22);
}
.lf-chat-dialog-card h3 { margin: 0 0 0.8rem; font-size: 1.05rem; }
.lf-chat-field { display: flex; flex-direction: column; gap: 0.3rem; margin-bottom: 0.75rem; font-size: 0.85rem; }
.lf-chat-field input {
  border: 1px solid #ced4da;
  border-radius: 8px;
  padding: 0.4rem 0.55rem;
}
.lf-chat-group-picks { max-height: 12rem; overflow-y: auto; border: 1px solid #dee2e6; border-radius: 8px; }
.lf-chat-pick {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.6rem;
  font-size: 0.85rem;
}
.lf-chat-dialog-actions { display: flex; justify-content: flex-end; gap: 0.45rem; }

@media (max-width: 720px) {
  .lf-chat { width: 100vw; }
  /* A DOCKED chat has no narrow-screen rule of its own any more: down the edge of a narrow
     screen every side is a rail and the chat opens from it as a drawer (css/core/shell.css,
     "The drawer"). This used to lay it over the page as a full-width overlay, permanently —
     which is the thing the drawer replaced. */
  .lf-chat-titlebar { gap: 0.4rem; padding: 0.4rem 0.6rem; }
  .lf-chat-titlebar-title { font-size: 1rem; }
  .lf-chat-shell { grid-template-columns: 1fr; }
  .lf-chat.has-thread .lf-chat-list,
  .lf-chat:not(.has-thread) .lf-chat-thread { display: none; }
  .lf-chat.has-thread .lf-chat-empty { display: none; }
  .lf-chat-back { display: inline-flex; }
  .lf-chat:not(.has-thread) .lf-chat-empty { grid-column: 1; }
}

/* ── The assistant's working (#193 F4, D8) ───────────────────────────────────── */
/* A tool call and its result are the audit trail of how a number was reached, so they are cards
   rather than grey system notices: a system notice is where a reader's eye goes to skip. Muted
   enough to stay behind the answer, structured enough to be read when the answer surprises. */

.lf-chat-card {
    align-self: flex-start;
    max-width: 85%;
    margin: 0.15rem 0;
    padding: 0.35rem 0.5rem;
    border-radius: 0.4rem;
    border: 1px solid var(--bs-border-color, #dee2e6);
    background: var(--bs-tertiary-bg, #f8f9fa);
    font-size: 0.78rem;
}

.lf-chat-card-head {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--bs-secondary-color, #6c757d);
}

.lf-chat-card-name {
    font-family: var(--bs-font-monospace, monospace);
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lf-chat-card-detail {
    margin: 0.3rem 0 0;
    padding: 0;
    font-family: var(--bs-font-monospace, monospace);
    font-size: 0.72rem;
    white-space: pre-wrap;
    word-break: break-word;
    color: var(--bs-body-color, #212529);
}

/* Clipped rather than hidden: a couple of lines is enough to recognise what came back, and the
   button is what says there is more. */
.lf-chat-card-detail.is-clipped {
    max-height: 3.2rem;
    overflow: hidden;
}

.lf-chat-card-more {
    margin-top: 0.2rem;
    padding: 0;
    border: 0;
    background: none;
    font-size: 0.72rem;
    color: var(--bs-link-color, #0d6efd);
    cursor: pointer;
}

/* A change the assistant proposed (issue #214; Mcp.md §5). Not muted like the working cards: this
   one waits for the reader, and nothing happens until they answer it. */
.lf-chat-card-confirm {
    border-color: var(--bs-warning-border-subtle, #ffe69c);
    background: var(--bs-warning-bg-subtle, #fff3cd);
    max-width: 95%;
}

.lf-chat-confirm-summary {
    margin-top: 0.3rem;
    font-size: 0.82rem;
    color: var(--bs-body-color, #212529);
}

.lf-chat-confirm-actions {
    display: flex;
    gap: 0.4rem;
    margin-top: 0.4rem;
}

.lf-chat-confirm-status {
    margin-top: 0.3rem;
    font-size: 0.78rem;
}

.lf-chat-confirm-status.is-error { color: var(--bs-danger, #dc3545); }

/* The assistant's answers as markdown (issue #212, F4): compact, inside a bubble. */
.lf-md { white-space: normal; }
.lf-md > :first-child { margin-top: 0; }
.lf-md > :last-child { margin-bottom: 0; }
.lf-md p, .lf-md ul, .lf-md ol, .lf-md pre, .lf-md table, .lf-md blockquote { margin: 0 0 .5rem; }
.lf-md h1, .lf-md h2, .lf-md h3, .lf-md h4 { font-size: 1rem; font-weight: 600; margin: .5rem 0 .25rem; }
.lf-md ul, .lf-md ol { padding-left: 1.25rem; }
.lf-md code { font-size: .85em; padding: 0 .2em; border-radius: .2rem; background: rgba(127, 127, 127, .15); }
.lf-md pre { padding: .5rem; overflow-x: auto; border-radius: .3rem; background: rgba(127, 127, 127, .12); }
.lf-md pre code { padding: 0; background: none; }
.lf-md table { border-collapse: collapse; display: block; overflow-x: auto; max-width: 100%; font-size: .85rem; }
.lf-md th, .lf-md td { border: 1px solid rgba(127, 127, 127, .35); padding: .15rem .4rem; text-align: left; }
.lf-md blockquote { padding-left: .6rem; border-left: 3px solid rgba(127, 127, 127, .4); }
.lf-chat-md-raw pre { margin: 0; white-space: pre-wrap; word-break: break-word; font-size: .85rem; background: none; padding: 0; }
.lf-chat-md-switch { border: 0; background: none; padding: 0 0 0 .5rem; font-size: inherit; color: inherit; opacity: .75; text-decoration: underline; cursor: pointer; }

/* One iteration of the assistant's loop, at full detail (issue #212, G). */
.lf-chat-trace { align-self: center; max-width: 92%; font-size: .72rem; font-family: var(--bs-font-monospace, monospace); opacity: .7; padding: .1rem .4rem; }
.lf-chat-trace.is-error { color: var(--bs-danger, #dc3545); opacity: 1; }
.lf-chat-detail { font-size: .75rem; padding: .1rem .25rem; max-width: 11rem; border-radius: .3rem; border: 1px solid rgba(127, 127, 127, .4); background: transparent; color: inherit; }

/* System → AI conversations, the transcript panel (issue #212, G). */
.lf-ai-transcript { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.lf-ai-transcript-bar { display: flex; gap: .5rem; align-items: center; padding: .5rem; border-bottom: 1px solid rgba(127, 127, 127, .25); }
.lf-ai-transcript-bar select { max-width: 16rem; }
.lf-ai-transcript-body { flex: 1 1 auto; overflow: auto; padding: .75rem 1rem; }
.lf-ai-transcript-body .lf-md { white-space: normal; max-width: 60rem; }
.lf-ai-transcript-body .lf-md h1 { font-size: 1.3rem; }
.lf-ai-transcript-body .lf-md pre { max-height: 20rem; }
.lf-ai-transcript-raw { white-space: pre-wrap; word-break: break-word; font-size: .85rem; }

/* System → AI behaviour (issue #342). Bootstrap does the controls; this is the layout and the marks. */
.lf-ai-behaviour { display: flex; flex-direction: column; gap: .75rem; padding: .75rem 1rem; min-height: 0; }
.lf-ai-behaviour-status { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; padding: .5rem .75rem; border: 1px solid rgba(127, 127, 127, .3); border-radius: .5rem; }
.lf-ai-behaviour-body { display: grid; grid-template-columns: minmax(14rem, 18rem) minmax(0, 1fr); gap: 1rem; align-items: start; }
@media (max-width: 52rem) { .lf-ai-behaviour-body { grid-template-columns: minmax(0, 1fr); } }
.lf-ai-behaviour-list .list-group-item { cursor: pointer; }
.lf-ai-behaviour-pane { max-width: 62rem; }
.lf-ai-behaviour-save { position: sticky; bottom: 0; display: flex; gap: .5rem; align-items: center; padding: .6rem 0; margin-top: 1rem; background: var(--bs-body-bg, transparent); border-top: 1px solid rgba(127, 127, 127, .3); }
.lf-ai-behaviour-block { padding: .5rem .6rem; margin-bottom: .5rem; border: 1px solid rgba(127, 127, 127, .3); border-radius: .4rem; }
.lf-ai-behaviour-block.locked { background: rgba(127, 127, 127, .08); }
.lf-ai-behaviour-block.off textarea { opacity: .5; }
.lf-ai-behaviour-locked { padding: .6rem .75rem; border: 1px dashed rgba(127, 127, 127, .5); border-radius: .4rem; }
.lf-ai-behaviour-multi { display: flex; flex-wrap: wrap; gap: .25rem .5rem; max-height: 14rem; overflow: auto; }
.lf-ai-behaviour-prompt { white-space: pre-wrap; word-break: break-word; font-size: .8rem; max-height: 28rem; overflow: auto; padding: .5rem; border: 1px solid rgba(127, 127, 127, .3); border-radius: .4rem; }
.lf-ai-behaviour-prompt .added { background: rgba(25, 135, 84, .18); }
.lf-ai-behaviour-try { display: grid; gap: .75rem; margin-top: .75rem; }
.lf-ai-behaviour-try.compare { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.lf-ai-behaviour-try-card { padding: .6rem .75rem; border: 1px solid rgba(127, 127, 127, .3); border-radius: .4rem; }
.lf-ai-behaviour-try-text { white-space: pre-wrap; word-break: break-word; }
