/* Odpovědět into one thread of Fred (the owner, 29. 11. 2026; public/js/fred-chat.js, src/fredThreads.ts; the same as INTECHI CRM
   public/css/threads.css): the icon button of a message at its top right (every message on the same axis), the chosen thread as one chip over
   the field with Zrušit odpověď on the right, the chip of the thread in the bubble of the reply, the choices of „Ke kterému?“. Chips never
   wrap: a long name ends with an ellipsis. */
html.sd .fred-msg.has-reply {
  position: relative;
  padding-right: calc(var(--sd-action-size, 30px) + 14px);
  min-height: calc(var(--sd-action-size, 30px) + 12px);
  /* an explicit min-height would let the column of the log shrink the bubble under its content */
  flex-shrink: 0;
}
/* (over the position of the shared .btn.ia) */
html.sd .fred-msg.has-reply > .btn.ia.ia.fred-msg-reply {
  position: absolute;
  top: 6px;
  right: 6px;
  white-space: normal;
}
html.sd .fred-reply {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 0;
  min-width: 0;
}
html.sd .fred-reply[hidden] {
  display: none;
}
html.sd .fred-reply-to,
html.sd .fred-msg-re {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  max-width: 100%;
  white-space: nowrap;
}
html.sd .fred-reply-to {
  flex: 0 1 auto;
  background: var(--sd-action-blue-bg);
  border-color: var(--sd-action-blue-line);
  color: var(--sd-action-blue-ink);
}
html.sd .fred-reply-x {
  flex: none;
  margin-left: auto;
}
html.sd .fred-reply-t {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* „Zapsáno k lístku …“ under an answer of Fred: the message was written on the note it answers (a link to the note; the same as INTECHI CRM) */
html.sd .badge.fred-msg-wrote {
  display: flex;
  width: fit-content;
  margin-top: 6px;
  text-decoration: none;
  background: var(--sd-action-blue-bg);
  border-color: var(--sd-action-blue-line);
  color: var(--sd-action-blue-ink);
}
@media (pointer: coarse) {
  html.sd .badge.fred-msg-wrote {
    min-height: 44px;
  }
}
/* the chip in the bubble of the person (the colour of the bubble behind it) */
html.sd .fred-msg.me > .fred-msg-re {
  display: flex;
  width: fit-content;
  margin-bottom: 4px;
  background: rgb(255 255 255 / 18%);
  border-color: rgb(255 255 255 / 35%);
  color: #fff;
}
html.sd .fred-which .johny-ask-choice {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  max-width: 100%;
}
/* the success of an agent on its row of the page of Fred: one chip on the axis of its name */
html.sd .badge.agent-score {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 8px;
  vertical-align: middle;
  font-size: 12px;
  white-space: nowrap;
}
html.sd .fred-upload-for {
  margin-bottom: 4px;
}
/* the bell: Odpovědět on the right of its row, on the axis of the row */
html.sd .bell-menu li.has-reply {
  display: flex;
  align-items: center;
  gap: 6px;
}
html.sd .bell-menu li.has-reply > a {
  flex: 1 1 auto;
  min-width: 0;
}
html.sd .bell-menu li.has-reply > .btn {
  flex: none;
  margin-right: 6px;
}
/* the proposal of a new agent (src/views/fredPage.ts proposalTodo, the owner 30. 11. 2026): name, group and words side by side while they fit */
html.sd .bot-prop-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
html.sd .bot-prop-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px 12px;
}
html.sd .bot-prop-fields .fred-f {
  margin: 0;
}
@media (max-width: 860px) {
  html.sd .bot-prop-fields {
    grid-template-columns: minmax(0, 1fr);
  }
}
/* on a phone: the score chip without its icon (it stays on the line of the name), the choices of a card of an agent one under another on
   one axis (no row of two and one) */
@media (max-width: 640px) {
  html.sd .badge.agent-score,
  html.sd .bot-row-name > .badge.agent-count {
    margin-left: 4px;
  }
  html.sd .badge.agent-score > i {
    display: none;
  }
  html.sd .bot-need .bot-choices {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    justify-items: stretch;
  }
  html.sd .bot-need .bot-choices > form,
  html.sd .bot-need .bot-choices > form > .btn,
  html.sd .bot-need .bot-choices > .btn {
    width: 100%;
    justify-content: flex-start;
  }
}
