/* ============================================================
   Tag Input — HCL Domino Leap Custom Widget
   ============================================================ */

/* ── パレットのアイコン ── */
.ef-tag-widget-icon {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23555' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M20.59 13.41l-7.17 7.17a2 2 0 0 1-2.83 0L2 12V2h10l8.59 8.59a2 2 0 0 1 0 2.82z'/><line x1='7' y1='7' x2='7.01' y2='7'/></svg>");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 20px 20px;
}

/* ── 本体 ── */
.ef-tag {
  width: 100%;
  box-sizing: border-box;
  font-size: inherit;
}

/* タグと入力欄を1つの枠に並べ、幅が足りなければ折り返す */
.ef-tag-box {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  padding: 5px 8px;
  border: 1px solid #ccc;
  border-radius: 6px;
  background: #fff;
  box-sizing: border-box;
  cursor: text;
}
.ef-tag-box:focus-within {
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

/* ── タグ ── */
.ef-tag-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  padding: 3px 4px 3px 8px;
  border-radius: 4px;
  background: #e0f0ff;
  color: #1e3a5f;
  line-height: 1.4;
  box-sizing: border-box;
}
.ef-tag-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ef-tag-remove {
  flex: none;
  width: 18px;
  height: 18px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  font-size: 14px;
  font-weight: bold;
  line-height: 18px;
  text-align: center;
  cursor: pointer;
}
.ef-tag-remove:hover,
.ef-tag-remove:focus-visible {
  background: rgba(30, 58, 95, 0.15);
  outline: none;
}

/* ── 入力欄 ── */
.ef-tag-input {
  flex: 1 1 120px;     /* 残り幅いっぱいに伸び、120px を切ったら次の行へ */
  min-width: 120px;
  border: 0;
  border-radius: 0;
  outline: none;
  background: transparent;
  padding: 2px 0;
  margin: 0;
  font-size: inherit;
  font-family: inherit;
  box-shadow: none;
}
.ef-tag-input:disabled {
  cursor: not-allowed;
}

/* ── フィールドラベルと必須マーク ── */
.ef-tag-header {
  display: flex;
  align-items: baseline;
  gap: 2px;
  margin-bottom: 4px;
}
.ef-tag-required {
  color: #CA0005;
  font-weight: bold;
}
.ef-tag-title {
  overflow-wrap: anywhere;
}

/* ── Leap の検証エラー（必須未入力など） ──
   メッセージの色・フォントは freedomInvalid / lfFormFieldError クラスで Leap が設定する */
.ef-tag-invalid .ef-tag-title {
  font-weight: bold !important;
	color: var(--theme-error-main, #CA0005) !important;	
}
.ef-tag-invalid .ef-tag-box {
  border-color: var(--theme-error-main, #CA0005) !important;
}

/* ── 注意メッセージ（重複・上限） ── */
.ef-tag-message {
  min-height: 0;
  font-size: 12px;
  color: #b45309;
}
.ef-tag-message-show {
  margin-top: 4px;
}

/* ── 読み取り専用 ── */
.ef-tag-readonly .ef-tag-box {
  background: #f5f5f5;
  cursor: default;
}
.ef-tag-readonly .ef-tag-item {
  padding-right: 8px;
}
.ef-tag-empty {
  color: #888;
}

/* ── オーサリング画面のプレースホルダー ── */
.ef-tag-design-placeholder {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px dashed #9ca3af;
  border-radius: 6px;
  background: #f9fafb;
  color: #374151;
  box-sizing: border-box;
  overflow-x: hidden;
}
.ef-tag-design-icon {
  display: inline-flex;
  color: #3b82f6;
}
.ef-tag-design-label {
  font-weight: bold;
}
.ef-tag-design-info {
  font-size: 12px;
  color: #6b7280;
}
