/**
 * Textformat-Toolbar — Journey Builder, Conv Builder (shared).
 * Felder mit Klasse `builder-chat-text` erhalten die Toolbar per JS.
 */

.seq-input.builder-chat-text,
.seq-textarea.builder-chat-text,
.form-input.builder-chat-text,
.form-textarea.builder-chat-text {
  background: #fafbfc;
  border: 1px solid #c5cad3;
  border-radius: 4px;
}

.form-textarea.builder-chat-text,
.seq-textarea.builder-chat-text {
  min-height: 2.5rem;
}

.text-format-toolbar-wrapper {
  margin-bottom: 3px;
  width: 100%;
  max-width: 100%;
}

.text-format-toolbar {
  display: block;
}

.text-format-toolbar__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 6px;
}

.text-format-toolbar__format {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  max-width: 100%;
}

.text-format-toolbar__param {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
}

.text-format-btn--param {
  min-width: 24px;
  width: 24px;
  height: 18px;
  padding: 0 2px;
  font-size: 11px;
  font-weight: 600;
  font-family: ui-monospace, monospace;
  line-height: 1;
  color: #555;
  background: #e8e8e8;
  border-color: #c8c8c8;
}

.text-format-btn--param:hover,
.text-format-btn--param[aria-expanded="true"] {
  background: #ddd;
  border-color: #999;
  color: #222;
}

.text-format-btn--param:focus {
  border-color: #666;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1);
}

.text-format-param-menu {
  position: absolute;
  z-index: 200;
  top: 100%;
  left: 0;
  margin-top: 2px;
  min-width: min(100vw - 32px, 240px);
  max-width: 280px;
  max-height: min(50vh, 220px);
  overflow-x: hidden;
  overflow-y: auto;
  padding: 4px 0;
  background: #fff;
  border: 1px solid #c0c0c0;
  border-radius: 5px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
}

.text-format-param-group {
  border-bottom: 1px solid #eee;
  padding: 0 0 4px 0;
  margin-bottom: 2px;
}

.text-format-param-group:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.text-format-param-group__label {
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #888;
  padding: 4px 8px 2px 8px;
  line-height: 1.2;
}

.text-format-param-item {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-height: 28px;
  margin: 0;
  padding: 4px 8px;
  text-align: left;
  font-size: 11px;
  line-height: 1.2;
  color: #333;
  background: #fff;
  border: none;
  border-radius: 0;
  cursor: pointer;
  font-family: inherit;
}

.text-format-param-item:hover,
.text-format-param-item:focus {
  background: #f0f0f0;
  outline: none;
}

.text-format-param-item__name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.text-format-param-item__token {
  flex-shrink: 0;
  font-size: 9px;
  color: #666;
  background: #f2f2f2;
  padding: 1px 4px;
  border-radius: 2px;
  font-weight: 500;
}

.text-format-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 18px;
  padding: 0 4px;
  font-size: 9px;
  font-weight: 600;
  color: #555;
  background: #f0f0f0;
  border: 1px solid #ddd;
  border-radius: 3px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.text-format-btn:hover {
  background: #e5e5e5;
  color: #333;
}

.text-format-btn:focus {
  outline: none;
  border-color: #666;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.text-format-btn--italic {
  font-style: italic;
  font-weight: 600;
}

.text-format-btn--name {
  font-size: 8px;
  font-weight: normal;
  font-family: ui-monospace, monospace;
}
