.ibn-client-tags-heading { gap: 10px; }
.ibn-tag-config-trigger {
  display: inline-flex; align-items: center; gap: 5px; flex-shrink: 0;
  padding: 5px 8px; border: 1px solid var(--border, #d8e1ef); border-radius: 7px;
  background: var(--surface, #fff); color: var(--blue, #247fff);
  font: inherit; font-size: 11px; font-weight: 700; cursor: pointer;
}
.ibn-tag-config-trigger svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.ibn-client-tags-note { margin: -3px 0 10px; color: var(--muted, #64748b); font-size: 10px; line-height: 1.5; }
.ibn-client-tags-card .ibn-activity { flex: 0 0 auto; }
.ibn-client-tags-card .ibn-activity-card {
  width: 100%; min-height: 44px; background: var(--surface, #fff);
  color: var(--text-strong, #0f172a); text-align: left; font: inherit; cursor: pointer;
}
.ibn-client-tags-card .ibn-activity-card span { overflow-wrap: anywhere; }
.ibn-client-tags-card .ibn-activity-card small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ibn-activity-card[data-tag-color="blue"] { border-left-color: #247fff; }
.ibn-activity-card[data-tag-color="green"] { border-left-color: #16a34a; }
.ibn-activity-card[data-tag-color="amber"] { border-left-color: #f59e0b; }
.ibn-activity-card[data-tag-color="purple"] { border-left-color: #9333ea; }
.ibn-activity-card[data-tag-color="red"] { border-left-color: #dc2626; }
.ibn-activity-card[data-tag-color="slate"] { border-left-color: #64748b; }
.ibn-tag-empty { padding: 30px 14px; text-align: center; border: 1px dashed var(--border, #d8e1ef); border-radius: 10px; }
.ibn-tag-empty strong { font-size: 13px; }
.ibn-tag-empty p { color: var(--muted, #64748b); font-size: 12px; line-height: 1.6; }
.ibn-tag-empty button { border: 0; background: transparent; color: var(--blue, #247fff); font: inherit; font-size: 12px; cursor: pointer; }

body.ibn-tag-selector-open { overflow: hidden; }
.ibn-tag-selector {
  box-sizing: border-box; width: 500px; max-width: calc(100vw - 32px);
  max-height: calc(100dvh - 48px); margin: auto; padding: 0;
  border: 1px solid var(--border, #d8e1ef); border-radius: 16px;
  background: var(--surface, #fff); color: var(--text-strong, #0f172a);
  box-shadow: 0 24px 80px rgba(15, 23, 42, .2); overflow: hidden; font: inherit;
}
.ibn-tag-selector::backdrop { background: rgba(15, 23, 42, .35); }
.ibn-tag-selector[open], .ibn-tag-selector form { display: flex; flex-direction: column; }
.ibn-tag-selector form { min-height: 0; max-height: calc(100dvh - 50px); }
.ibn-tag-selector button {
  padding: 8px 16px; border: 1px solid var(--border, #d8e1ef); border-radius: 8px;
  background: var(--surface, #fff); color: inherit; font: inherit; font-size: 12px; font-weight: 650; cursor: pointer;
}
.ibn-tag-selector button:disabled { opacity: .4; cursor: default; }
.ibn-tag-selector button.is-primary { background: var(--blue, #247fff); border-color: var(--blue, #247fff); color: #fff; }
.ibn-tag-selector :is(button, input):focus-visible, .ibn-tag-config-trigger:focus-visible,
.ibn-client-tags-card .ibn-activity-card:focus-visible { outline: 2px solid var(--blue, #247fff); outline-offset: 3px; }
.ibn-tag-selector-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 22px 22px 16px; flex-shrink: 0; }
.ibn-tag-selector-head h2 { margin: 0; font-size: 18px; line-height: 1.5; }
.ibn-tag-selector-head p { margin: 6px 0 0; color: var(--muted, #64748b); font-size: 12px; line-height: 1.6; }
.ibn-tag-selector-head button { padding: 0; width: 28px; height: 28px; flex-shrink: 0; border: 0; font-size: 22px; color: var(--muted, #64748b); }
.ibn-tag-selection-summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 22px 12px; flex-shrink: 0; }
.ibn-tag-selection-summary span { color: var(--muted, #64748b); font-size: 12px; }
.ibn-tag-selection-summary button { padding: 3px 0; border: 0; color: var(--blue, #247fff); }
.ibn-tag-choice-list { display: grid; gap: 8px; padding: 0 22px 20px; overflow-y: auto; min-height: 0; }
.ibn-tag-choice { display: flex; align-items: center; gap: 10px; padding: 12px; border: 1px solid var(--border-light, #e8edf5); border-radius: 10px; cursor: pointer; }
.ibn-tag-choice.is-selected { border-color: rgba(var(--blue-rgb, 36, 127, 255), .28); background: rgba(var(--blue-rgb, 36, 127, 255), .035); }
.ibn-tag-choice input { width: 16px; height: 16px; flex-shrink: 0; margin: 0; accent-color: var(--blue, #247fff); }
.ibn-tag-choice > span:first-of-type { flex: 1; min-width: 0; }
.ibn-tag-choice strong { display: block; font-size: 13px; overflow-wrap: anywhere; }
.ibn-tag-choice small { display: block; margin-top: 4px; color: var(--muted, #64748b); font-size: 11px; line-height: 1.5; overflow-wrap: anywhere; }
.ibn-tag-choice-count { flex-shrink: 0; color: var(--muted, #64748b); font-size: 12px; font-variant-numeric: tabular-nums; }
.ibn-tag-unavailable { margin: 0; padding: 26px 10px; color: var(--muted, #64748b); text-align: center; font-size: 12px; line-height: 1.8; }
.ibn-tag-status { margin: 0; padding: 0 22px 14px; color: #dc2626; font-size: 12px; line-height: 1.6; }
.ibn-tag-selector-footer { display: flex; justify-content: flex-end; gap: 8px; padding: 16px 22px; border-top: 1px solid var(--border-light, #e8edf5); flex-shrink: 0; }
@media (max-width: 480px) {
  .ibn-tag-selector-head { padding: 18px 16px 14px; }
  .ibn-tag-selection-summary { padding: 0 16px 12px; }
  .ibn-tag-choice-list { padding: 0 16px 16px; }
  .ibn-tag-selector-footer { padding: 14px 16px; }
}
