.label-chips { display:inline-flex; flex-wrap:wrap; gap:6px; max-width:100%; vertical-align:middle; }
.label-chip { display:inline-flex; align-items:center; gap:6px; padding:3px 8px; border:1px solid var(--border); border-radius:6px; background:var(--surface,#fff); color:var(--ink,#0d2936); font-size:12px; line-height:1.5; max-width:100%; overflow-wrap:anywhere; }
.label-chip i { width:9px; height:9px; border-radius:3px; flex-shrink:0; background:var(--label-color); box-shadow:inset 0 0 0 1px #0002; }
.row-title + .label-chips { margin-top:6px; }
.labels-picker { min-width:0; margin:0; padding:14px; border:1px solid var(--border); border-radius:10px; }
.labels-picker legend { padding:0 5px; font-weight:650; font-size:14px; }
.label-search { display:grid; gap:6px; margin-bottom:10px; font-size:12px; }
.label-options { display:flex; flex-wrap:wrap; gap:8px; max-height:208px; overflow-y:auto; padding:2px; }
.label-options .label-option { display:flex; flex-direction:row; align-items:center; gap:8px; min-height:44px; padding:5px 8px; cursor:pointer; border:1px solid var(--border); border-radius:8px; }
.label-option input[type=checkbox] { width:18px; height:18px; min-height:0; margin:0; flex-shrink:0; accent-color:var(--primary,#0891b2); }
.label-option:has(input:checked) { background:#ecfeff; border-color:#0891b2; }
.label-option:focus-within { outline:2px solid #0891b2; outline-offset:2px; }
.label-option .label-chip { border:0; background:transparent; padding:0; }
.labels-picker .help-text { display:block; margin-top:8px; }
.labels-picker [hidden], .label-option[hidden] { display:none!important; }
.label-manage-link { display:inline-block; padding:12px 0 0; font-size:13px; text-decoration:underline; }
.label-manage-link span { font-size:12px; }
.label-editor { display:flex; flex-wrap:wrap; align-items:end; gap:12px; }
.label-editor label { display:grid; gap:6px; }
.label-editor label:first-of-type { flex:1; min-width:180px; }
.label-editor input[type=color] { width:64px; height:44px; padding:4px; cursor:pointer; }
.labels-catalog { margin-top:20px; }
.labels-catalog .card-head p { margin:8px 0 0; max-width:750px; color:var(--muted); font-size:13px; }
.label-catalog-row { display:grid; grid-template-columns:minmax(120px,1fr) minmax(180px,2fr) auto; align-items:start; gap:16px; padding:14px 0; border-bottom:1px solid var(--border); }
.label-catalog-row:last-child { border-bottom:0; }
.label-catalog-row summary, .agenda-label-editor summary { min-height:44px; padding:10px 0; cursor:pointer; font-weight:600; font-size:14px; overflow-wrap:anywhere; }
.label-catalog-row .label-editor { margin-top:8px; }
.patient-label-filters { display:flex; flex-wrap:wrap; gap:10px; align-items:end; flex:1; }
.patient-label-filters label { display:grid; gap:5px; font-size:12px; }
.patient-label-filters label:first-child { flex:1; min-width:180px; }
.agenda-label-editor { margin-top:18px; border-top:1px solid var(--border); }
.agenda-label-editor .btn { margin-top:12px; }
.agenda-status-filter label + label { margin-top:14px; }
.calendar-event .label-chips { display:flex; flex-wrap:nowrap; overflow:hidden; gap:3px; margin-top:2px; }
.calendar-event .label-chip { padding:0 3px; font-size:10px; white-space:nowrap; flex-shrink:0; max-width:100%; }
.calendar-event .label-chip span { overflow:hidden; text-overflow:ellipsis; }
.calendar-event .label-chip i { width:6px; height:6px; }
@media(max-width:640px) {
  .label-catalog-row { grid-template-columns:1fr auto; gap:6px 12px; }
  .label-catalog-row > details { grid-column:1/-1; grid-row:2; }
  .patient-label-filters { flex-basis:100%; }
  .patient-label-filters label { flex:1; min-width:130px; }
  .labels-picker input[type=search], .label-editor input:not([type=color]) { font-size:16px; }
}
